Hey Daniel,
I have a few thoughts about this. I think maybe the best solution is to create a few convenience classes in Errai UI that handle wrapping Panels for use in other objects, but yes, I did find something that I think will help.
Could you just do something like this?
@DataField
private HTMLPanel list = new HTMLPanel("ul", "");
...
list.add(new ListItem());
Hey Lincoln,How was JavaOne? Hope you had a great time and some nice talks.Did you find any solution for my problem?Regards,DanielAm 17.09.2012 um 18:07 schrieb "Lincoln Baxter, III" <lincolnbaxter@gmail.com>:Yes, I see your point. Let me think about that.On Mon, Sep 17, 2012 at 8:35 AM, Daniel Sachse <sachsedaniel@gmail.com> wrote:
Hey Lincoln,don´t worry about that! I think we are all busy and such a response timeframe is absolutely normal ;)Unfortunatly your example is not 100% solving my problem. The solution assumes, that the UL is a subcomponent of the template.What I want to is the following:-----------------------------------------UL.html:<ul class="super special"><li class="class">1</li><li>2</li></ul>----------------------------------------UL.java:@Templatedpublic class UL extends Composite {…public void addLI(LI li) {SOME_MAGIC_TO_ADD_LI_TO_UL(li);}…}I could solve the problem by surrounding the UL with a div as a temp. workaround. But If I then try to template an LI element, then I would run into:<ul><div><li>…</li></div><div><li>…</li></div>….</ul>
I think that this is not a solution we all want for these kind of scenarios. I hope this example made it a little bit more clear what I am trying to do.Regards,DanielAm 17.09.2012 um 06:47 schrieb "Lincoln Baxter, III" <lincolnbaxter@gmail.com>:Hey Daniel!
Sorry for the late reply - busy weekend :) I think this example shows how to do what you want to do.
https://github.com/ocpsoft/socialpm/blob/master/gwt/src/main/java/com/ocpsoft/socialpm/gwt/client/local/view/component/ProjectList.java
Let me know if it doesn't!
~LincolnOn Sat, Sep 15, 2012 at 1:16 PM, Daniel Sachse <sachsedaniel@gmail.com> wrote:
Hey Lincoln,I hope you are up well and had a nice time while I was off because of my holiday.I started playing around with Errai-UI and one question came up to my mind:I am building a Component with the @Templated mechanism. This all works fine so far(GREAT WORK!).What I am now trying to do is to dynamically add Children to this template. Is this somehow possible? I saw that I can access the template widget by casting getWidget() to TemplateWidget, but I couldn´t find an appropriate add(..) method :( .Would be cool if this could be done somehow.Hope I was clear enough :)Regards,Daniel
--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."
--
Lincoln Baxter, III
http://ocpsoft.org
"Simpler is better."