You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by itayh <it...@attractv.net> on 2008/11/09 10:27:53 UTC

Re: problem with PropertyModel and setDefaultFormProcessing(false) for button

Hi Timo,

Changing it to link solve the problem, but created a new one. It changes the
look and feel of my page (since I am using buttons for save and cancel in my
site).

Thank in advance,
  Itay


Timo Rantalaiho wrote:
> 
> On Tue, 28 Oct 2008, itayh wrote:
>> I have a page that contain a hidden form. When the user press on "Add
>> Item"
>> or "Edit Item" then I set the visability of the form to true and the user
>> can add details and the OK button save the data and set the visability of
>> the form to false.
>> The problem is if the user press on cancel. I need to set
>> setDefaultFormProcessing(false) for the cancel button (since I don't want
>> to
>> do validation checks) but It cause the next problem:
>> After the cancel press next time I press the "Add Item" or "Edit Item"
>> the
>> data that I see is the old data (The one I press cancel on)
>> Changing setDefaultFormProcessing(true) for the cancel fix that problem.
> 
> Maybe you could change the cancel button
> 
>> addItemForm.add(new Button("cancel", new Model("Cancel")) {
>>     public void onSubmit() {
>> 	onCanceItem();
>>     }
>> }.setDefaultFormProcessing(false));
> 
> to be a Link in Wicket? That way it would definitely not
> submit any form data to the server, so nothing should be
> stored in between requests.
> 
> Best wishes,
> Timo
> 
> -- 
> Timo Rantalaiho           
> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
> 
> ---------------------------------------------------------------------
> 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/problem-with-PropertyModel-and-setDefaultFormProcessing%28false%29-for-button-tp20209348p20404643.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: problem with PropertyModel and setDefaultFormProcessing(false) for button

Posted by Christopher Lyth <ch...@gmail.com>.
Have you tried to setDefaultFormProcessing to false and in the onSubmit of
the button reset the form model. Alternatively the add button could set the
model of the form to a new object every time.

On Sun, Nov 9, 2008 at 4:27 AM, itayh <it...@attractv.net> wrote:

>
> Hi Timo,
>
> Changing it to link solve the problem, but created a new one. It changes
> the
> look and feel of my page (since I am using buttons for save and cancel in
> my
> site).
>
> Thank in advance,
>  Itay
>
>
> Timo Rantalaiho wrote:
> >
> > On Tue, 28 Oct 2008, itayh wrote:
> >> I have a page that contain a hidden form. When the user press on "Add
> >> Item"
> >> or "Edit Item" then I set the visability of the form to true and the
> user
> >> can add details and the OK button save the data and set the visability
> of
> >> the form to false.
> >> The problem is if the user press on cancel. I need to set
> >> setDefaultFormProcessing(false) for the cancel button (since I don't
> want
> >> to
> >> do validation checks) but It cause the next problem:
> >> After the cancel press next time I press the "Add Item" or "Edit Item"
> >> the
> >> data that I see is the old data (The one I press cancel on)
> >> Changing setDefaultFormProcessing(true) for the cancel fix that problem.
> >
> > Maybe you could change the cancel button
> >
> >> addItemForm.add(new Button("cancel", new Model("Cancel")) {
> >>     public void onSubmit() {
> >>      onCanceItem();
> >>     }
> >> }.setDefaultFormProcessing(false));
> >
> > to be a Link in Wicket? That way it would definitely not
> > submit any form data to the server, so nothing should be
> > stored in between requests.
> >
> > Best wishes,
> > Timo
> >
> > --
> > Timo Rantalaiho
> > Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
> >
> > ---------------------------------------------------------------------
> > 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/problem-with-PropertyModel-and-setDefaultFormProcessing%28false%29-for-button-tp20209348p20404643.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
>
>


-- 
Christopher J Lyth
christopher.lyth@gmail.com

Re: problem with PropertyModel and setDefaultFormProcessing(false) for button

Posted by jWeekend <jw...@cabouge.com>.
Itay,

Link can be used with an anchor or a button (in fact, it can be used with
"any element that supports the onclick javascript event handler").

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



itayh wrote:
> 
> Hi Timo,
> 
> Changing it to link solve the problem, but created a new one. It changes
> the look and feel of my page (since I am using buttons for save and cancel
> in my site).
> 
> Thank in advance,
>   Itay
> 
> 
> Timo Rantalaiho wrote:
>> 
>> On Tue, 28 Oct 2008, itayh wrote:
>>> I have a page that contain a hidden form. When the user press on "Add
>>> Item"
>>> or "Edit Item" then I set the visability of the form to true and the
>>> user
>>> can add details and the OK button save the data and set the visability
>>> of
>>> the form to false.
>>> The problem is if the user press on cancel. I need to set
>>> setDefaultFormProcessing(false) for the cancel button (since I don't
>>> want to
>>> do validation checks) but It cause the next problem:
>>> After the cancel press next time I press the "Add Item" or "Edit Item"
>>> the
>>> data that I see is the old data (The one I press cancel on)
>>> Changing setDefaultFormProcessing(true) for the cancel fix that problem.
>> 
>> Maybe you could change the cancel button
>> 
>>> addItemForm.add(new Button("cancel", new Model("Cancel")) {
>>>     public void onSubmit() {
>>> 	onCanceItem();
>>>     }
>>> }.setDefaultFormProcessing(false));
>> 
>> to be a Link in Wicket? That way it would definitely not
>> submit any form data to the server, so nothing should be
>> stored in between requests.
>> 
>> Best wishes,
>> Timo
>> 
>> -- 
>> Timo Rantalaiho           
>> Reaktor Innovations Oy    <URL: http://www.ri.fi/ >
>> 
>> ---------------------------------------------------------------------
>> 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/problem-with-PropertyModel-and-setDefaultFormProcessing%28false%29-for-button-tp20209348p20405449.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