Scratch that, the Form has an add() method that accepts a Component and a Panel 
is a component, netbeans is just being weird...

Thanks




----- Original Message ----
From: Steven Haines <lyg...@yahoo.com>
To: users@wicket.apache.org
Sent: Tue, April 27, 2010 12:17:04 PM
Subject: Re: Forms across multiple panels

Okay, I'm working on it, here is a followup question: how do I add a panel to a 
form?

Here's where I'm stuck. Here is my HTML with my panels embedded inside my form:

               <form wicket:id="myForm" id="myForm">
                    <div id="panelOne" wicket:id="panelOne">Panel One</div>
                    <div id="panelTwo" wicket:id="panelTwo">Panel Two</div>
                    <div id="panelThree" wicket:id="panelThree">Panel 
Three</div>
                    <div id="panelFour" wicket:id="panelFour">Panel Four</div>
                </form>

But how do I build the object hierarchy? The following fails because obviously 
the hierarchy is wrong (the panels are children of the form), but the Form 
class does not have an add() method to accept Panels..

                final MyForm myForm = new MyForm();
                final Form<MyForm> form = new Form<MyForm>( "myForm", new 
CompoundPropertyModel<MyForm>( myForm ) );
                add( new PanelOne( "panelOne" ), form );
                add( new PanelTwo( "panelTwo" ), form );
                add( new PanelThree( "panelThree" ), form );
                add( new PanelFour( "panelFour" ), form );
                add( form );

Should I make all of the panels implement IFormValidator so that I can make 
them match the page hierarchy? Or do you have any other more elegant 
suggestions?

Thanks
Steve



----- Original Message ----
From: Martin Makundi <martin.maku...@koodaripalvelut.com>
To: users@wicket.apache.org; Steven Haines <lyg...@yahoo.com>
Sent: Tue, April 27, 2010 10:18:13 AM
Subject: Re: Forms across multiple panels

Hi!

Yes.. you could have:

<form>
   <panel 1/>
   <panel 2/>
   <submit-button/>
</form>

**
Martin

2010/4/27 Steven Haines <lyg...@yahoo.com>:
> Sorry, yes, I have a "MasterPage" HTML and Java combination that hosts the 
> divs, so something like this:
>
> Java:
> public class MasterPage extends WebPage ...
>
> MyObject myobject = new MyObject();
> add( new Panel1( "panel1", myobject ) );
> add( new Pane2( "panel2", myobject ) );
>
> ...
>
> HTML:
> ...
> <div wicket:id="panel1"></div>
> <div wicket:id="panel2"></div>
> ...
>
> So conceivably I could create a form object on the MasterPage...
>
>
>
>
> ----- Original Message ----
> From: Martin Makundi <martin.maku...@koodaripalvelut.com>
> To: users@wicket.apache.org; Steven Haines <lyg...@yahoo.com>
> Sent: Tue, April 27, 2010 10:08:06 AM
> Subject: Re: Forms across multiple panels
>
> Panels are on same web-page?
>
> **
> Martin
>
> 2010/4/27 Steven Haines <lyg...@yahoo.com>:
>> Hi,
>>
>> The application I'm building is composed of several panels, each contained 
>> in its own <div>. The panels are logical groupings of data, handle different 
>> Ajax requests, and so forth.
>>
>> My challenge is that when a user completes the process by entering data into 
>> all of the panels, I want to submit the form data from all of the panels 
>> into a single form submit. Or written a different way, I do not want to have 
>> to submit each panel individually, I want a single submission.
>>
>> What is the best way to do this?
>>
>> Thanks
>> Steve
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

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

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

Reply via email to