Re: Dynamic generation of HMI components
Hi, I think decebals did something that may interest you (or at least the approach) https://github.com/decebals/wicket-dashboard Best regards, Sebastien. On Tue, Sep 24, 2013 at 5:02 PM, Martin Grigorov wrote: > On Tue, Sep 24, 2013 at 4:37 PM, brasmouk wrote: > > > I want to do something like that : > > > > > > //-- JAVA > > > > ArrayList elements = getIHMElements(screenID); // from the > > database > > > > add(new ListView("listview", userList) { > > protected void populateItem(ListItem item) { > > > > for (IHMElement ihmElement : elements) { > > switch (ihmElement.getIHMType) > > { > > case CstElement.INPUT: item.add(new > TextField("")) > > break; > > case CstElement.LABEL: item.add(new Label("")) > > break; > > ... > > > > } > > } > > }); > > > > > > //-- HTML > > > > > >? > > > > > > You can use Fragment component. See > http://wicketguide.comsysto.com/guide/chapter5.html#chapter5_5 > > case CstElement.INPUT: > Fragment f = new Fragment("sameId", "textField", this) > f.add(new TextField("field", ...); > item.add(f) > break; > case CstElement.LABEL: > Fragment f = new Fragment("sameId", "label", this) > f.add(new Label("label", ...)); > item.add(f); > break; > > > > > > > > > > > > > > > > > > > > > > -- > > View this message in context: > > > http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-IHM-components-tp4661471p4661476.html > > Sent from the Users forum mailing list archive at Nabble.com. > > > > - > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > > For additional commands, e-mail: users-h...@wicket.apache.org > > > > >
Re: Dynamic generation of HMI components
On Tue, Sep 24, 2013 at 4:37 PM, brasmouk wrote: > I want to do something like that : > > > //-- JAVA > > ArrayList elements = getIHMElements(screenID); // from the > database > > add(new ListView("listview", userList) { > protected void populateItem(ListItem item) { > > for (IHMElement ihmElement : elements) { > switch (ihmElement.getIHMType) > { > case CstElement.INPUT: item.add(new TextField("")) > break; > case CstElement.LABEL: item.add(new Label("")) > break; > ... > > } > } > }); > > > //-- HTML > > >? > > You can use Fragment component. See http://wicketguide.comsysto.com/guide/chapter5.html#chapter5_5 case CstElement.INPUT: Fragment f = new Fragment("sameId", "textField", this) f.add(new TextField("field", ...); item.add(f) break; case CstElement.LABEL: Fragment f = new Fragment("sameId", "label", this) f.add(new Label("label", ...)); item.add(f); break; > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-IHM-components-tp4661471p4661476.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Dynamic generation of HMI components
I want to do something like that : //-- JAVA ArrayList elements = getIHMElements(screenID); // from the database add(new ListView("listview", userList) { protected void populateItem(ListItem item) { for (IHMElement ihmElement : elements) { switch (ihmElement.getIHMType) { case CstElement.INPUT: item.add(new TextField("")) break; case CstElement.LABEL: item.add(new Label("")) break; ... } } }); //-- HTML ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-IHM-components-tp4661471p4661476.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Dynamic generation of HMI components
Hi, You can generate your markup on the fly or load it from anywhere by using org.apache.wicket.markup.IMarkupResourceStreamProvider Make sure you read IMarkupCacheKeyProvider javadoc as well. On Tue, Sep 24, 2013 at 2:00 PM, brasmouk wrote: > Hello everyone, > > I am trying to study framewok wicket for the creation of a new JEE > application. > > The need is to generate dynamic pages as the representation of my pages is > stored in a database. > > My question: Is there a way to generate a page dynamically without having > to > add html tags in a static page. > > I do not want to create a html code to a StringBuffer and swing in a static > component because I also want to take bricks form / validation event > handler. > > > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-HMI-components-tp4661471.html > Sent from the Users forum mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
Re: Dynamic generation of HMI components
Short answer: You must write *some* HTML. Not-so-short-answer: The minimum required HTML is pretty small. From: brasmouk To: users@wicket.apache.org Date: 09/24/2013 08:14 AM Subject:Dynamic generation of HMI components Hello everyone, I am trying to study framewok wicket for the creation of a new JEE application. The need is to generate dynamic pages as the representation of my pages is stored in a database. My question: Is there a way to generate a page dynamically without having to add html tags in a static page. I do not want to create a html code to a StringBuffer and swing in a static component because I also want to take bricks form / validation event handler. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-HMI-components-tp4661471.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org ** This email and any attachments may contain information that is confidential and/or privileged for the sole use of the intended recipient. Any use, review, disclosure, copying, distribution or reliance by others, and any forwarding of this email or its contents, without the express permission of the sender is strictly prohibited by law. If you are not the intended recipient, please contact the sender immediately, delete the e-mail and destroy all copies. **
Dynamic generation of HMI components
Hello everyone, I am trying to study framewok wicket for the creation of a new JEE application. The need is to generate dynamic pages as the representation of my pages is stored in a database. My question: Is there a way to generate a page dynamically without having to add html tags in a static page. I do not want to create a html code to a StringBuffer and swing in a static component because I also want to take bricks form / validation event handler. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Dynamic-generation-of-HMI-components-tp4661471.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org