Edward,

You could try something like:

    class Step1 extends WizardStep {
        public Step1() {
            super("Step 1", "How many?");
            add(new TextField("numberOfThings"));
        }
    };

    class Step2 extends WizardStep {
        public Step2() {
            super("Things", "Now Enter As Many 'Things' As You Opted For");
            add(new Loop("things", new
ComponentPropertyModel("numberOfThings")) {
                @Override
                protected void populateItem(LoopItem item) {
                    IModel model = thingModel(item.getIteration()); //
create model or reuse existing
                    item.add(new TextField("thing", model));
                }
            });
        };
    }

... where some ancestor has a CompoundPropertyModel whose model object has a
"numberOfThings" property and this model object's setNumberOfThings method
may also manage a list of models backed by "thing"s. Does that make sense?

Hej core devs, I was wondering when I'd use the Loop class - is this a
decent abuse of it?!

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 



Edward Zarecor-2 wrote:
> 
> I'm relatively new to wicket and have question about the wizard
> implementation.
> 
> It seems all the steps added to the Wizard in its constructor are
> themselves
> constructed when init is called on the Wizard.  What I would like to do is
> have a mechanism for dynamically changing the second step in my wizard so
> that an arbitrarily sized editable list is displayed.
> 
> Say step one was "How many events would you like to create," step two
> would
> be a list that corresponded in size to the answer provided in step one.
> 
> What's the best way to approach this?
> 
> I'm using 1.3.3 and a panel style wizard.
> 
> Thanks.
> 
> Ed.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Wizard-question-tp19227685p19238822.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to