instead of
getComponent().getModelObject()).getUserName();
try String username=getComponent().getModelObject();
the textfield is associated with the username property of your form bean
because you are using compound model.
-igor
On 5/2/07, wicket0123 <[EMAIL PROTECTED]> wrote:
I have a fo
I have a form which extends wicket form:
MyForm extends Form
In the constructor, I have this line:
super(formId, new CompoundPropertyModel(new SignUpFormModel()));
SignUpFormModel is a Java class that contains my form fields. After the
super call, i add the components:
fc =
igor.vaynberg wrote:
>
> if you use wicket validators and the component is invalid the onerror()
> will
> be called instead of onupdate()
>
> the value is available via getformcomponent().getmodelobject() inside
> onupdate()
>
> -igor
>
> On 4/27/07, wicket0123 <[EMAIL PROTECTED]> wrote:
>> I
you most likely did not give the formcomponent a model.
paste the relevant code
-igor
On 4/28/07, wicket0123 <[EMAIL PROTECTED]> wrote:
when i use getformcomponent.getmodleobject inside the onupdate, it throws
nullpointer exeption. see code below,
((SignUpFormModel) getFormComponent().ge
when i use getformcomponent.getmodleobject inside the onupdate, it throws
nullpointer exeption. see code below,
((SignUpFormModel) getFormComponent().getModelObject()).getUserName()
If I use this, i have no problem:
((SignUpFormModel)
getComponent().getParent().getModelObject()).getUserName()
Also, attach the formcomponentupdate behavior to the field that needs
to be updated, not to a button.
Martijn
On 4/28/07, wicket0123 <[EMAIL PROTECTED]> wrote:
>
> I want to use ajax to check if a field value is valid w/o submitting the
> entire form. I add AjaxFormComponentUpdatingBehavior to m
if you use wicket validators and the component is invalid the onerror() will
be called instead of onupdate()
the value is available via getformcomponent().getmodelobject() inside
onupdate()
-igor
On 4/27/07, wicket0123 <[EMAIL PROTECTED]> wrote:
I want to use ajax to check if a field value
I want to use ajax to check if a field value is valid w/o submitting the
entire form. I add AjaxFormComponentUpdatingBehavior to my ajax object
(link/button/etc). But, I don't know how to retrieve the edit field's value
inside the onUpdate method. See the code I have:
fc = new