it looks like only one input component (the one indicated by the child attribute) get its value bound to the model inside an enclosure tag, the documentation (WIA and http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html) could give some more information on this constraint. Is there a way to get around this by overloading methods or so, or should I proceed with grouping them on panels, fragments or something else?

regards,
Jeroen.
On Feb 2, 2010, at 9:58 PM, Jeroen Dijkmeijer wrote:

Hi,

I'm struggling my way into wicket, I've a sort of wizard like page, after the user submits the form, new input fields become visible. I also want a textinput field to become visible together with a dropdownbox. In the constructor I fill the choices and set the initial (selected) value. After the user submits, I set the textinputfield to be visible, which will cause all the components in the surrounded enclosure to become visible. So far so good however the selected value is not recognised and the "choose one" thing is shown. Code snippets are below
Any help is appreciated.
Jeroen
constructor:
..
               String pollType = "Wanneer";
               lijst = new ArrayList<String>();
               lijst.add("Wanneer");
               lijst.add("Wie");
               lijst.add("Waar");
               lijst.add("Wat");
               lijst.add("Welk bedrag");
               lijst.add("Weet nog niet");
form.add(new ListChoice<String>("poll_type", new Model(pollType), lijst));
               add(form);


inner class:
       class SaveButton extends Button {
               /**
                *
                */
private static final long serialVersionUID = 109611211318049267L;

               private SaveButton() {
                       super("save", new ResourceModel("save"));
               }

               @Override
               public void onSubmit() {
                       try {
getParent().get("poll_part_header").setVisible(true);

My html code:
<wicket:enclosure child="poll_part_header">
<div class="input-line"><wicket:message key="lbl.poll.part.header">[header]</wicket:message>
               <select wicket:id="poll_type" size="1"/>
<input wicket:id="poll_part_header" type="text" size="50"/>
       </div>
</wicket:enclosure>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to