You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by brasmouk <br...@yahoo.fr> on 2013/09/24 14:00:37 UTC

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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Dynamic generation of HMI components

Posted by Martin Grigorov <mg...@apache.org>.
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 <br...@yahoo.fr> 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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Dynamic generation of HMI components

Posted by Sebastien <se...@gmail.com>.
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 <mg...@apache.org>wrote:

> On Tue, Sep 24, 2013 at 4:37 PM, brasmouk <br...@yahoo.fr> wrote:
>
> > I want to do something like that :
> >
> >
> > //-- JAVA
> >
> > ArrayList<IHMElement> 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
> >
> > <div wicket:id="listview">
> >    ?????
> > </div>
> >
>
> 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;
>
> <div wicket:id="listview">
>    <wicket:container wicket:id="sameId"/>
> </div>
>
>
> <wicket:fragment wicket:id="textField">
>   <input wicket:id="field"/>
> </wicket:fragment>
>
> <wicket:fragment wicket:id="label">
>   <span wicket:id="label"></span>
>
> </wicket:fragment>
>
>
> >
> >
> > --
> > 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-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: Dynamic generation of HMI components

Posted by Martin Grigorov <mg...@apache.org>.
On Tue, Sep 24, 2013 at 4:37 PM, brasmouk <br...@yahoo.fr> wrote:

> I want to do something like that :
>
>
> //-- JAVA
>
> ArrayList<IHMElement> 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
>
> <div wicket:id="listview">
>    ?????
> </div>
>

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;

<div wicket:id="listview">
   <wicket:container wicket:id="sameId"/>
</div>


<wicket:fragment wicket:id="textField">
  <input wicket:id="field"/>
</wicket:fragment>

<wicket:fragment wicket:id="label">
  <span wicket:id="label"></span>

</wicket:fragment>


>
>
> --
> 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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Dynamic generation of HMI components

Posted by brasmouk <br...@yahoo.fr>.
I want to do something like that :


//-- JAVA

ArrayList<IHMElement> 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

<div wicket:id="listview">
   ????? 
</div>	



--
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Dynamic generation of HMI components

Posted by "Richard W. Adams" <RW...@UP.COM>.
Short answer: You must write *some* HTML. 

Not-so-short-answer: The minimum required HTML is pretty small.




From:   brasmouk <br...@yahoo.fr>
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@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.
**