Jeremy,
It was getValue() that I was looking for! I guess I didn't realize the
difference between the Model object and the Component's value. For some
reason I thought the Model was the necessary glue between the Component and
my Java code.
Thanks for the help man!
Jamie
Jeremy Thomerson-5 wrote:
>
> Sorry, yes. Since you are skipping default form processing, it is also
> skipping pushing things onto the models.... So, you have a couple of
> options...
>
> Option one - get the value directly from the text field, i.e.
>
> System.*out*.println("USERNAME WAS: " + tfUsername.getValue());
> Option two - don't use setDefaultFormProcessing(false) - only put the
> logic
> for the username check in the checkAvail button, and put all other form
> logic in the main submit button. Then make sure that the main submit
> button
> is the primary button. This is probably the better option.
>
> Hope this helps.
>
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
> On Fri, Nov 7, 2008 at 1:00 AM, jpswain <[EMAIL PROTECTED]> wrote:
>
>>
>> Jeremy,
>>
>> Thanks for checking it out!
>> Everything you said is true, except you missed one thing, the button
>> won't
>> get anything out of the field except what was last (if yet) submitted by
>> the
>> entire form to update its model. So, in this case
>> setDefaultFormProcessing(false) definitely does Not work. Sorry, it's
>> really my fault for not putting a println in the right spot.
>>
>> To check it out with the "stock" components, then in your
>> checkAvailButton's
>> onSubmit() add this as the last line:
>> System.out.println(">>> username=" + username);
>>
>> You'll see that it's not getting the text out of the field. Try playing
>> around with it while watching the output there, and it'll make sense what
>> I'm talking about, I hope.
>>
>> Thanks again :),
>> Jamie
>>
>> P.S.
>> I have updated the quickstart, at the same location:
>> http://cosmiao.com/jps/wicket-quickstart.zip
>>
>>
>> Jeremy Thomerson-5 wrote:
>> >
>> > I'm not sure I understand your problem. I quickly got it working (I
>> > think)
>> > the way you wanted using Wicket's built in classes. Maybe I
>> misunderstood
>> > you. Here were the steps I took:
>> >
>> > 1. Took your quickstart and got it in Eclipse
>> > 2. Changed FormCustom to Form
>> > 3. Changed AjaxFallbackButtonCustom to AjaxFallbackButton
>> > 4. added .setDefaultFormProcessing(false) on the checkAvailButton
>> > 5. PROFIT!
>> >
>> > Below, I have pasted the updated HomePage class. Please let me know if
>> I
>> > didn't understand - but when I run it, it only calls the onSubmit of
>> the
>> > checkAvailButton. Then, when I click the submitButton, it does both
>> > submit
>> > button and form onSubmit.
>> >
>> >
>> > --
>> > Jeremy Thomerson
>> > http://www.wickettraining.com
>> >
>> >
>> --
>> View this message in context:
>> http://www.nabble.com/Wicket---Ajax%28Fallback%29Button-and-Form---possible-solution-to-problem-tp20373644p20375622.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
--
View this message in context:
http://www.nabble.com/Wicket---Ajax%28Fallback%29Button-and-Form---possible-solution-to-problem-tp20373644p20388569.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]