You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2009/02/09 17:21:10 UTC

Re: Nested forms : don't process inner form when outer form is submitted

try letting your inner form implement IFormVisitorParticipant.

another way is to override isrequired() and check for the submitting component.

-igor

On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme <ma...@tvh.be> wrote:
>
> Hello,
>
> I've been reading a lot about nested forms and what should happen with the
> inner forms when the outer form gets submitted. But I didn't found out how
> you can implement what i'm trying:
>
> I have inner form with some RequiredTextFields on it. These are required
> when the inner form is processed with an AjaxButton, but not when the outer
> form is submitted.
>
> How can I do this? Thanks for any help !!! Marieke.
> --
> View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


RE: can not close the modal window any more.

Posted by "Jing Ge (Besitec IT DEHAM)" <JG...@besitec.com>.
Hello,

Has anyone any solution?

Best regards!
Jing

 
-----Original Message-----
From: Jing Ge (Besitec IT DEHAM) [mailto:JGe@besitec.com] 
Sent: Donnerstag, 6. August 2009 16:53
To: users@wicket.apache.org
Subject: can not close the modal window any more.

Hello all,

Maybe this is a known problem...

when user opens a modal window and the web browser's screen is smaller
than the modal window, than he get the problem: the modal window's head
and foot will be "cut off". After the user maximizes his browser, the
head of the modal window is still out of the screen. The result: user
can not close the modal window any more.

I have googled and found a workaround here (maybe work, I have not
tested it):

http://steve-on-sakai.blogspot.com/2009/05/repositioning-modalwindow-in-
wicket.html

My question is:

Could we do it in this way: before the modal window is opened, use
javascript checking the browser screen and set the right position to the
modal window. The Head, i.e. title with the "X" and right edge, should
be NEVER out of screen.

Do I miss some feature of wicket modal window? Any help will be
appreciated. :-)

Best Regards!
Jing


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




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


can not close the modal window any more.

Posted by "Jing Ge (Besitec IT DEHAM)" <JG...@besitec.com>.
Hello all,

Maybe this is a known problem...

when user opens a modal window and the web browser's screen is smaller
than the modal window, than he get the problem: the modal window's head
and foot will be "cut off". After the user maximizes his browser, the
head of the modal window is still out of the screen. The result: user
can not close the modal window any more.

I have googled and found a workaround here (maybe work, I have not
tested it):

http://steve-on-sakai.blogspot.com/2009/05/repositioning-modalwindow-in-
wicket.html

My question is:

Could we do it in this way: before the modal window is opened, use
javascript checking the browser screen and set the right position to the
modal window. The Head, i.e. title with the "X" and right edge, should
be NEVER out of screen.

Do I miss some feature of wicket modal window? Any help will be
appreciated. :-)

Best Regards!
Jing


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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by Igor Vaynberg <ig...@gmail.com>.
i dont think its that new, but maybe changed since youve written your wiki.

-igor

On Thu, Aug 6, 2009 at 8:24 AM, John Krasnay<jo...@krasnay.ca> wrote:
> Oh, is that new? Perhaps my example on the wiki is indeed fubar.
>
> jk
>
> On Thu, Aug 06, 2009 at 08:14:51AM -0700, Igor Vaynberg wrote:
>> no, when a form's isenabled() returns false then all of its
>> descendants are also disabled. when a formcomponent is disabled it
>> adds disabled="disabled" attribute, so you wont be able to use it in
>> the browser.
>>
>> -igor
>>
>> On Thu, Aug 6, 2009 at 7:32 AM, John Krasnay<jo...@krasnay.ca> wrote:
>> > On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote:
>> >>
>> >> John Krasnay wrote:
>> >> >
>> >> > The isEnabled method only controls form processing on the server. If you
>> >> > can't even type characters in your text field you have something else
>> >> > going on at the browser level.
>> >> >
>> >>
>> >> Well usually in a disabled box you cannot type, no matter what browser you
>> >> are using.
>> >
>> > I guess I wasn't clear enough. Returning false from the form's isEnabled
>> > method should *not* disable the text field in the browser. It simply
>> > disables the default processing for the form. You should still be able
>> > to enter a value in the text field, but it won't be validated and the
>> > backing model will not be updated.
>> >
>> > Perhaps you are mistakenly overriding the text field's isEnabled method
>> > instead. Note that the text field's isEnabled is queried at render time,
>> > well before you know which button was pressed.
>> >
>> >> Anyway I think we can let the fields enabled but override the isRequired():
>> >> if the submitting is the rootform just return false. In this way component
>> >> is correctly displayed but validated when submitting the inner form (the one
>> >> to which it belongs).
>> >
>> > This might work for you, but be aware it can trip you up too, e.g. other
>> > validators on the components will still be invoked and the models for
>> > components in the nested form will still be updated.
>> >
>> > jk
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by John Krasnay <jo...@krasnay.ca>.
Oh, is that new? Perhaps my example on the wiki is indeed fubar.

jk

On Thu, Aug 06, 2009 at 08:14:51AM -0700, Igor Vaynberg wrote:
> no, when a form's isenabled() returns false then all of its
> descendants are also disabled. when a formcomponent is disabled it
> adds disabled="disabled" attribute, so you wont be able to use it in
> the browser.
> 
> -igor
> 
> On Thu, Aug 6, 2009 at 7:32 AM, John Krasnay<jo...@krasnay.ca> wrote:
> > On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote:
> >>
> >> John Krasnay wrote:
> >> >
> >> > The isEnabled method only controls form processing on the server. If you
> >> > can't even type characters in your text field you have something else
> >> > going on at the browser level.
> >> >
> >>
> >> Well usually in a disabled box you cannot type, no matter what browser you
> >> are using.
> >
> > I guess I wasn't clear enough. Returning false from the form's isEnabled
> > method should *not* disable the text field in the browser. It simply
> > disables the default processing for the form. You should still be able
> > to enter a value in the text field, but it won't be validated and the
> > backing model will not be updated.
> >
> > Perhaps you are mistakenly overriding the text field's isEnabled method
> > instead. Note that the text field's isEnabled is queried at render time,
> > well before you know which button was pressed.
> >
> >> Anyway I think we can let the fields enabled but override the isRequired():
> >> if the submitting is the rootform just return false. In this way component
> >> is correctly displayed but validated when submitting the inner form (the one
> >> to which it belongs).
> >
> > This might work for you, but be aware it can trip you up too, e.g. other
> > validators on the components will still be invoked and the models for
> > components in the nested form will still be updated.
> >
> > jk
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by Igor Vaynberg <ig...@gmail.com>.
no, when a form's isenabled() returns false then all of its
descendants are also disabled. when a formcomponent is disabled it
adds disabled="disabled" attribute, so you wont be able to use it in
the browser.

-igor

On Thu, Aug 6, 2009 at 7:32 AM, John Krasnay<jo...@krasnay.ca> wrote:
> On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote:
>>
>> John Krasnay wrote:
>> >
>> > The isEnabled method only controls form processing on the server. If you
>> > can't even type characters in your text field you have something else
>> > going on at the browser level.
>> >
>>
>> Well usually in a disabled box you cannot type, no matter what browser you
>> are using.
>
> I guess I wasn't clear enough. Returning false from the form's isEnabled
> method should *not* disable the text field in the browser. It simply
> disables the default processing for the form. You should still be able
> to enter a value in the text field, but it won't be validated and the
> backing model will not be updated.
>
> Perhaps you are mistakenly overriding the text field's isEnabled method
> instead. Note that the text field's isEnabled is queried at render time,
> well before you know which button was pressed.
>
>> Anyway I think we can let the fields enabled but override the isRequired():
>> if the submitting is the rootform just return false. In this way component
>> is correctly displayed but validated when submitting the inner form (the one
>> to which it belongs).
>
> This might work for you, but be aware it can trip you up too, e.g. other
> validators on the components will still be invoked and the models for
> components in the nested form will still be updated.
>
> jk
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by John Krasnay <jo...@krasnay.ca>.
On Thu, Aug 06, 2009 at 07:09:20AM -0700, nytrus wrote:
> 
> John Krasnay wrote:
> > 
> > The isEnabled method only controls form processing on the server. If you
> > can't even type characters in your text field you have something else
> > going on at the browser level.
> > 
> 
> Well usually in a disabled box you cannot type, no matter what browser you
> are using.

I guess I wasn't clear enough. Returning false from the form's isEnabled
method should *not* disable the text field in the browser. It simply
disables the default processing for the form. You should still be able
to enter a value in the text field, but it won't be validated and the
backing model will not be updated.

Perhaps you are mistakenly overriding the text field's isEnabled method
instead. Note that the text field's isEnabled is queried at render time,
well before you know which button was pressed.

> Anyway I think we can let the fields enabled but override the isRequired():
> if the submitting is the rootform just return false. In this way component
> is correctly displayed but validated when submitting the inner form (the one
> to which it belongs).

This might work for you, but be aware it can trip you up too, e.g. other
validators on the components will still be invoked and the models for
components in the nested form will still be updated.

jk

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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by nytrus <ny...@gmail.com>.


John Krasnay wrote:
> 
> The isEnabled method only controls form processing on the server. If you
> can't even type characters in your text field you have something else
> going on at the browser level.
> 

Well usually in a disabled box you cannot type, no matter what browser you
are using.
Anyway I think we can let the fields enabled but override the isRequired():
if the submitting is the rootform just return false. In this way component
is correctly displayed but validated when submitting the inner form (the one
to which it belongs).
-- 
View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p24847306.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by John Krasnay <jo...@krasnay.ca>.
On Thu, Aug 06, 2009 at 02:40:13AM -0700, nytrus wrote:
> 
> In the example, the inner form is enabled only when the submitter button is
> that of itself (i.e. I'm submitting the inner form). In all other cases the
> form is always disabled:

Yes, that is the point.

> I've tried the example and in factthe form is
> totally disabled, I can't fill my textfield and I can't even submit the
> form. Something is wrong with the example?

The isEnabled method only controls form processing on the server. If you
can't even type characters in your text field you have something else
going on at the browser level.

jk

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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by nytrus <ny...@gmail.com>.
In the example, the inner form is enabled only when the submitter button is
that of itself (i.e. I'm submitting the inner form). In all other cases the
form is always disabled: I've tried the example and in factthe form is
totally disabled, I can't fill my textfield and I can't even submit the
form. Something is wrong with the example?


John Krasnay wrote:
> 
> Have a look at the bottom of this page:
> 
> http://cwiki.apache.org/WICKET/conditional-validation.html
> 
> The example shown disables the whole inner form when the outer form is
> submitted, meaning the inner form won't even be submitted. If you want
> the inner form to be submitted but just not required, remove the
> isEnabled override and implement isRequired on your text fields with
> similar code.
> 
> jk
> 
> On Tue, Feb 10, 2009 at 12:33:00AM -0800, Marieke Vandamme wrote:
>> 
>> Thanks for the suggestions, but I'm still not sure how to implement it.
>> My innerform implements IFormVisitorParticipant. I override
>> processChildren(), but how do I know which form is getting submitted???
>> Because when innerform is submitted, i want to return true, otherwise
>> false. 
>> Thanks for any help!! Marieke.
>> 
>> 
>> igor.vaynberg wrote:
>> > 
>> > try letting your inner form implement IFormVisitorParticipant.
>> > 
>> > another way is to override isrequired() and check for the submitting
>> > component.
>> > 
>> > -igor
>> > 
>> > On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme <ma...@tvh.be> wrote:
>> >>
>> >> Hello,
>> >>
>> >> I've been reading a lot about nested forms and what should happen with
>> >> the
>> >> inner forms when the outer form gets submitted. But I didn't found out
>> >> how
>> >> you can implement what i'm trying:
>> >>
>> >> I have inner form with some RequiredTextFields on it. These are
>> required
>> >> when the inner form is processed with an AjaxButton, but not when the
>> >> outer
>> >> form is submitted.
>> >>
>> >> How can I do this? Thanks for any help !!! Marieke.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html
>> >> Sent from the Wicket - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> >> For additional commands, e-mail: users-help@wicket.apache.org
>> >>
>> >>
>> > 
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> > For additional commands, e-mail: users-help@wicket.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21929547.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p24841072.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by John Krasnay <jo...@krasnay.ca>.
Have a look at the bottom of this page:

http://cwiki.apache.org/WICKET/conditional-validation.html

The example shown disables the whole inner form when the outer form is
submitted, meaning the inner form won't even be submitted. If you want
the inner form to be submitted but just not required, remove the
isEnabled override and implement isRequired on your text fields with
similar code.

jk

On Tue, Feb 10, 2009 at 12:33:00AM -0800, Marieke Vandamme wrote:
> 
> Thanks for the suggestions, but I'm still not sure how to implement it.
> My innerform implements IFormVisitorParticipant. I override
> processChildren(), but how do I know which form is getting submitted???
> Because when innerform is submitted, i want to return true, otherwise false. 
> Thanks for any help!! Marieke.
> 
> 
> igor.vaynberg wrote:
> > 
> > try letting your inner form implement IFormVisitorParticipant.
> > 
> > another way is to override isrequired() and check for the submitting
> > component.
> > 
> > -igor
> > 
> > On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme <ma...@tvh.be> wrote:
> >>
> >> Hello,
> >>
> >> I've been reading a lot about nested forms and what should happen with
> >> the
> >> inner forms when the outer form gets submitted. But I didn't found out
> >> how
> >> you can implement what i'm trying:
> >>
> >> I have inner form with some RequiredTextFields on it. These are required
> >> when the inner form is processed with an AjaxButton, but not when the
> >> outer
> >> form is submitted.
> >>
> >> How can I do this? Thanks for any help !!! Marieke.
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21929547.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 

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


Re: Nested forms : don't process inner form when outer form is submitted

Posted by Marieke Vandamme <ma...@tvh.be>.
Thanks for the suggestions, but I'm still not sure how to implement it.
My innerform implements IFormVisitorParticipant. I override
processChildren(), but how do I know which form is getting submitted???
Because when innerform is submitted, i want to return true, otherwise false. 
Thanks for any help!! Marieke.


igor.vaynberg wrote:
> 
> try letting your inner form implement IFormVisitorParticipant.
> 
> another way is to override isrequired() and check for the submitting
> component.
> 
> -igor
> 
> On Mon, Feb 9, 2009 at 3:17 AM, Marieke Vandamme <ma...@tvh.be> wrote:
>>
>> Hello,
>>
>> I've been reading a lot about nested forms and what should happen with
>> the
>> inner forms when the outer form gets submitted. But I didn't found out
>> how
>> you can implement what i'm trying:
>>
>> I have inner form with some RequiredTextFields on it. These are required
>> when the inner form is processed with an AjaxButton, but not when the
>> outer
>> form is submitted.
>>
>> How can I do this? Thanks for any help !!! Marieke.
>> --
>> View this message in context:
>> http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21910941.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Nested-forms-%3A-don%27t-process-inner-form-when-outer-form-is-submitted-tp21910941p21929547.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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