Taken that you want them to turn up as real components, being able to
receive their own inputs and stuff, you'd need an interpretation.

Roughly

public class MyDynamicPanel extends Panel {

 public MyDynamicPanel(URL xmlDefinition, IModel model) {
   // read and interpret definition
   // create a ListView or Repeater or something similar and
   // for each element you find, you add a panel with the actual
component in it

 }

 protected Panel newTextComponent(String id, ...) { ...

 protected Panel newComboBoxComponent(String id, ... { ...
}

etc.

MyDynamicPanel.html
...
 <ul>
   <li wicket:id="components"> <!-- generated for every component,
e.g. backed by a ListView -->
     <span wicket:id="component">[actual component will be placed here]</span>
   </li>
 </ul>

Then e.g. a text component could be as simple as:

public class TextFieldPanel extends Panel {

 public TextFieldPanel(String id, IModel model) {
   add(new TextField("field", model);
 }
}

TextFieldPanel.html
<wicket:panel>
 <input type="text" wicket:id="field" />
</wicket:panel>

That may seem like more work than needed, but it is very flexible to
work with panels like that.

Hope that helps,

Eelco

On 12/13/06, edward durai <[EMAIL PROTECTED]> wrote:

Hello Experts,

I am concentrating to do Wicket sample application.
I have xml like

<DYNAMIC>
<FIELDS LABELNAME="USERNAME" FIELDTYPE="TEXT"/>
<FIELDS LABELNAME="PASSWORD" FIELDTYPE="TEXT"/>
<FIELDS LABELNAME="COUNTRY" FIELDTYPE="COMBO"/>
</DYNAMIC>

Using the above xml, I want to draw

lable name and texboxes/combo(given above) display.

Is it possible in Wicket?
Kindly send me your suggestion.

Thanks for resposing.

Edward


--
View this message in context: 
http://www.nabble.com/Dynamic-field-drawing-using-Wicket--tf2818746.html#a7867403
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Reply via email to