yeah, i really preferred setSubmitForm. that's the one that made sense to me since it determines if the button winds up calling onSubmit() versus just getting called itself.
i've really never used tapestry or jsf, so maybe that's the problem.

Phil Kulak wrote:

I would just like to say that setDefaultFormProcessing() makes no
sense to me. Immediate did. It's what is used by Tapestry, JSF, and
probably everyone else that introduces this kind of functionality. I
have to view the source just about every time I use it just to
remember if I want set it to true or false to make my button bypass
vallidation and binding (immediate). Oh well, I'll get over it, just
wanted to throw that up there.

On 8/10/05, Jonathan Locke <[EMAIL PROTECTED]> wrote:
more like:

   public final void onFormSubmitted()
   {
       if (handleMultiPart())
       {
           // First, see if the processing was triggered by a Wicket button
           final Button submittingButton = findSubmittingButton();

           // When processing was triggered by a Wicket button and that
button
           // indicates it wants to be called immediately (without
processing),
           // call Button.onSubmit() right away.
           if (submittingButton != null &&
!submittingButton.getDefaultFormProcessing())
           {
               submittingButton.onSubmit();
           }
           else
           {
               // process the form for this request
               process(submittingButton);
           }
       }
   }

?

Johan Compagner wrote:

So now the multipart handling is after the submittingButton.onSubmit()
that doesn't look good to me...


Jonathan Locke wrote:

so the refactor is a bunch easier to read and work with.  i can test
and commit.
looks like this:

  public final void onFormSubmitted()
  {
      // First, see if the processing was triggered by a Wicket button
      final Button submittingButton = findSubmittingButton();

      // When processing was triggered by a Wicket button and that
button
      // indicates it wants to be called immediately (without
processing),
      // call Button.onSubmit() right away.
      if (submittingButton != null &&
!submittingButton.getDefaultFormProcessing())
      {
          submittingButton.onSubmit();
      }
      else
      {
          // process the form for this request
          process(submittingButton);
      }
  }

  protected void process(final Button submittingButton)
  {
      if (handleMultiPart())
      {
          // Execute validation now before anything else
          validate();
            // If a validation error occurred
          if (hasError())
          {
              // mark all children as invalid
              markFormComponentsInvalid();
                // let subclass handle error
              onError();
          }
          else
          {
              // before updating, call the interception method for
clients
              beforeUpdateFormComponentModels();
                // Update model using form data
              updateFormComponentModels();
                // Persist FormComponents if requested
              persistFormComponentData();
                // let clients handle further processing
              delegateSubmit(submittingButton);
          }
      }
  }

Igor Vaynberg wrote:

That works for me.
-Igor




-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jonathan Locke
Sent: Wednesday, August 10, 2005 1:39 PM
To: [email protected]
Subject: Re: [Wicket-user] Problem with CompoundPropertyModel and
multiple Submit Buttons


setDefaultFormProcessing?

Igor Vaynberg wrote:



Lets not forget that this is not just for cancel buttons. To me
setProcessForm(false) says that the form will not be
processed, when in

fact I can do form processing in Button.onSubmit() - Im still
processing the form, just not in Form.onSubmit().
-Igor






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Jonathan

Locke
Sent: Wednesday, August 10, 2005 1:10 PM
To: [email protected]
Subject: Re: [Wicket-user] Problem with CompoundPropertyModel and
multiple Submit Buttons


more to the point... Form.process() is not called.   which
makes even

/more/ sense!  ;-)

Johan Compagner wrote:




onSubmit of what? if you do setProcessForm(false) then

Form.onSubmit()



is not called only the onSubmit() of the Button. So

setProcessForm()



makes sense to me.


Igor Vaynberg wrote:



I don't think its still there. You might do your own processing in
onSubmit() so setFormProcess(false) might be confusing.

How about: setBypassDefaultFormProcessing() :) ?

-Igor






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jonathan Locke
Sent: Tuesday, August 09, 2005 5:15 PM
To: [email protected]
Subject: Re: [Wicket-user] Problem with
CompoundPropertyModel and

multiple Submit Buttons


ok.  i see your point.  but setImmediate still means

nothing to me.

how about something more like setProcessForm?

Igor Vaynberg wrote:





setSubmitForm() is not precise enough since the form is

submitted anyways.




All setImmediate(true) really does is bypass the
default
form processing.




-Igor






-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On

Behalf

Of Jonathan

Locke
Sent: Tuesday, August 09, 2005 3:01 PM
To: [email protected]
Subject: Re: [Wicket-user] Problem with

CompoundPropertyModel and



multiple Submit Buttons


you would only ever call the method to turn form

submitting

off on a

button like you're trying to do.

Button cancelButton = new Button("...")
cancelButton.setSubmitForm(false);

this makes a lot of sense to me.  and you could even

make a

class to

deal with it...

public class CancelButton extends Button {
public CancelButton(...)
{
   setSubmitForm(false);
}
}

if you'd prefer it could be just setSubmit().  the

difference though

really is whether the button submits or not.

Jonathan Locke wrote:




still makes no sense to me.  bypass changes to what?
Button.setSubmitForm is exactly right.  it determines

if

the button

should submit the form or not.  right?

David Liebeherr wrote:



Okay, this fix isn't good since it can be only used with

javascript.



So i changed it so the setImmediate(true) solution

Jonathan mentioned.



I got a new idea for a rename of this method:
setBypassChanges(). What about that?

Cu,
Dave

David Liebeherr wrote:



Hi Johnatan,

i think immediate is realy  bit confusing.
So what about setDisableEffect or setNoEffect? is

that better?



Well, anyway, i have implementet a fix for my situation

this way now:



I got a normal Submit-Button and a special cancel Button:

        add(new Link("cancel") {
            public void onClick() {
                setResponsePage(new PageAfterNoChange());
            }
        });

I think this is the must clear solution under the current
circumstances.
Any commest to that fix?

Thanks,
Dave

Jonathan Locke wrote:



try setting the isImmediate value on the cancel button

to true.

this will cause the button to call onSubmit without


validating the



form or updating the model.

this is a new feature, and while the functionality makes


sense, i'm



not so sure about the name.  maybe something more like

a boolean

property Button.submitForm where the default is true....


that would



make more sense to me.  isImmediate is kindof

nonsensical to



my ear... how can a button be "immediate"?

David Liebeherr wrote:




Hi!

I have a Form wich has two Submit Buttons ("Update" and


"Cancel").



The form uses a CompundPropertyModel to get the

changes of

the form automaticly represented in the Model. But when i


click the

Cancel Button i have to discard the changes to the


Model Object.




How can i do this?

I was searching for something like
CompoundPropertyModel.discardChanges(), but i have


found nothing.



Thanx,
Dave


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software


Conference & EXPO



September 19-22, 2005 * San Francisco, CA * Development


Lifecycle



Practices Agile & Plan-Driven Development *

Managing Projects



& Teams * Testing & QA Security * Process Improvement &


Measurement *



http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference
& EXPO September 19-22, 2005 * San Francisco, CA *
Development Lifecycle Practices Agile & Plan-Driven
Development * Managing

Projects & Teams



* Testing & QA Security * Process Improvement & Measurement
* http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software

Conference & EXPO



September 19-22, 2005 * San Francisco, CA * Development

Lifecycle



Practices Agile & Plan-Driven Development * Managing

Projects & Teams

* Testing & QA Security * Process Improvement & Measurement
* http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software

Conference & EXPO



September 19-22, 2005 * San Francisco, CA * Development

Lifecycle


Practices Agile & Plan-Driven Development * Managing

Projects & Teams *

Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software

Conference & EXPO



September 19-22, 2005 * San Francisco, CA * Development

Lifecycle

Practices Agile & Plan-Driven Development * Managing Projects
& Teams * Testing & QA Security * Process Improvement &

Measurement *



http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software
Conference & EXPO

September 19-22, 2005 * San Francisco, CA * Development
Lifecycle Practices Agile & Plan-Driven Development * Managing

Projects & Teams



* Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference &
EXPO September 19-22, 2005 * San Francisco, CA * Development
Lifecycle Practices Agile & Plan-Driven Development * Managing

Projects & Teams



* Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference &
EXPO September 19-22, 2005 * San Francisco, CA * Development
Lifecycle Practices Agile & Plan-Driven Development * Managing
Projects & Teams

* Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user






-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices Agile & Plan-Driven Development * Managing
Projects & Teams *

Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices Agile & Plan-Driven Development * Managing Projects &
Teams * Testing & QA Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user







-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams *
Testing & QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing
& QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing
& QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to