Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-20 Thread Charlie Dobbie
Hi Igor, Thanks, that's very reassuring! I'm having a bit of fun with Button.onSubmit being called before Form.onSubmit and I'm still not entirely sure what to do about the lack of an onError method, but I'm on the right track now. Charlie. On 2/15/07, Igor Vaynberg [EMAIL PROTECTED] wrote:

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-20 Thread Igor Vaynberg
yes, that is also something i do not like. i think form.submit() should be called before the button.onsubmit() what i tend to do is to leave form.submit() unused and put all the logic into button.onsubmit() what do you mean no onerror method? ajaxsubmitbutton should have one afaik. -igor On

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-20 Thread Charlie Dobbie
Hi Nathan, Yes, I've seen you using that structure in various places in Databinder! Using methods of that form, I've now managed to completely dispose of the boolean ajax flag I was passing around, and the code is much cleaner now than it was before. Many thanks! Charlie On 2/15/07, Nathan

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-20 Thread Charlie Dobbie
Hi Igor, Yes, I saw your post on wicket-dev*. It would certainly make more sense that way around in the code I'm currently playing with! Ah, yes - I can disable default form processing on the button and call the form's onSubmit logic directly - I'll give that a try. (Although that would mean I

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-20 Thread Igor Vaynberg
i wouldnt disable default form processing. just leave form.onsubmit() empty and put all that logic into buttons -igor On 2/20/07, Charlie Dobbie [EMAIL PROTECTED] wrote: Hi Igor, Yes, I saw your post on wicket-dev*. It would certainly make more sense that way around in the code I'm

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-15 Thread Charlie Dobbie
Hi Igor, The processing of the submitted data is handled in the same way, but the following page navigation must be different. If in a standard request, I'll need to setResponsePage() to the next page, but an AJAX request will just want to ModalWindow.close(). Error handling is also going to

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-15 Thread Igor Vaynberg
yes there is a better way. you should handle it inside the button's onsubmit not inside the form's onsubmit. that way: add(new Button() { onsubmit() { setresponsepage(..) isvisible(){...}}); add(new AjaxSubmitButton(onsubmit(target) { window.close(target); } onerror(){...} isvisible() {..} }

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-15 Thread Nathan Hamblen
You don't need to use the same object to factor out that code. Instead of passing the same form object between pages, you could have a base form class that adds the components you want, with a subclass for the modal window. Sometimes it's handy to have methods like protected Component

[Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-14 Thread Charlie Dobbie
Hi all, In my Databinder-using application I have the requirement to create/edit entities both within a standard request cycle, and via AJAX inside a Modal Window. In the interests of not duplicating code, I would like to drive both these processes from the same Form object, passing a boolean

Re: [Wicket-user] Form submitted normally and via AJAX? (Wicket 1.2.5)

2007-02-14 Thread Igor Vaynberg
i thought you wanted to handle it the same way so why do you need to know if the processing is ajax or regular request? -igor On 2/14/07, Charlie Dobbie [EMAIL PROTECTED] wrote: Hi all, In my Databinder-using application I have the requirement to create/edit entities both within a standard