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> 

Reply via email to