Validate RefreshingView

2009-09-23 Thread Hakan . Steisjo
Hi,

I've got a problem that I hope someone can help me with and point me in 
the right direction. Is there a way in the validation phase to validate 
that a refreshingview contain items?

My scenario:

I've got a page that holds a form, an ajaxsubmitlink and a panel. The 
panel in turn has some input controls plus two other panels. The first 
nested panel holds a refreshingview where the user can add items using a 
textfield (in the same panel). I need to validate that the user has added 
atleast one item to the refreshingview, is there a way I can do that? I 
could use the ajaxsubmitlink's onSubmit function in the page, but that 
will cause problems in the second nested panel if the validation fails 
since no database activity will then take place and as I've read somewhere 
because Wicket clones the modelobject in submits. So that would mean 
anything entered in the second nested panel will be lost.

-Håkan

Validate refreshingview

2009-09-22 Thread Hakan . Steisjo

Hi,

I've a problem where I hope someone can point me in the right direction. I
have a page which holds a form, an ajaxsubmitlink, and a panel containing
formcomponents. The panel also holds two other panels, where one of the
panels holds a refreshingview to which the user can add items, using a
textfield in the same panel. Is there a way to add a validator to the panel
or refreshingview that in the validate phase can check that the user has
added atleast one item to the refreshingview?

I can make this check in the onSubmit function of the ajaxsubmitlink in the
page, but that causes problems in the second nested panel when the user has
failed to add an item. The submit then won't result in any database
activity and I've read somewhere that Wicket clones the modelobject on a
submit. This causes values entered in the second nested panel to disappear.

I hope someone can provide me with some help, thanks.

-Håkan


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



Re: Validate refreshingview

2009-09-22 Thread Igor Vaynberg
you can use embedded forms, afair onsubmit of an inner form is called
before onsubmit of outer.

-igor

On Tue, Sep 22, 2009 at 1:12 PM,  hakan.stei...@foxt.com wrote:

 Hi,

 I've a problem where I hope someone can point me in the right direction. I
 have a page which holds a form, an ajaxsubmitlink, and a panel containing
 formcomponents. The panel also holds two other panels, where one of the
 panels holds a refreshingview to which the user can add items, using a
 textfield in the same panel. Is there a way to add a validator to the panel
 or refreshingview that in the validate phase can check that the user has
 added atleast one item to the refreshingview?

 I can make this check in the onSubmit function of the ajaxsubmitlink in the
 page, but that causes problems in the second nested panel when the user has
 failed to add an item. The submit then won't result in any database
 activity and I've read somewhere that Wicket clones the modelobject on a
 submit. This causes values entered in the second nested panel to disappear.

 I hope someone can provide me with some help, thanks.

 -Håkan


 -
 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