Igor,

Regarding the stated problem:

As we know ,the formcomponent's getValue method returns value from the model
for the component when rendering if raw input is equal to no raw input
constant. So basically the problem is that component's model should
not be updated until the user submits the form containing the zip field
here.
So  looks like holding on to the raw input until the form is actually
submitted
should do the trick. Do you think its a good idea to hold on to the raw
input
by not calling clearInput in ajaxformcomponentupdatingbehavior.
It may be cleared in process() call of form if valid.

The only problem seems to be distinguishing incorrect input
from correct input. May be in this case, it will be upto user
to render any error label or feedback in that case.

I understand this may go against fundamental way wicket works..
i.e to pull only from models if data is correct. But the scenario
described above means that user doesnt want to update any transient
data (- as user may keep changing zip field many times for example) ,
in models - so therefore pick up from component instead of model
when rendering EXCEPT after submit when rendering the same page
again.

-swaroop




On 10/23/07, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
>
> dont know if you need that, just add javascript to the ajax target to
> set the values on the fields..
>
> -igor
>
>
> On 10/23/07, Matej Knopp <[EMAIL PROTECTED]> wrote:
> > I think what you could try (though it would be a nasty hack :) ) is to
> > set rawInput property on FormComponent. However, you'll need some
> > introspection to do that, as it is private and we don't plan to
> > provide an accessor for it :)
> >
> > -Matej
> >
> > On 10/23/07, karthik Guru <[EMAIL PROTECTED]> wrote:
> > > I have a form like this -
> > >
> > > Name:  [.....]
> > > Zip:      [.....]
> > > City:     [.....]
> > > State:   [.....]
> > >
> > > [Save]
> > >
> > > On filling the zip i want to auto populate the city and state. I can
> attach
> > > a AjaxFormComponentUpdatingBehavior to the zip field and do this. But
> I
> > > don't want to update the zip model, so i plan to have my version of
> > > AjaxFormComponentUpdatingBehavior and 'not' update the model. I can
> possibly
> > > get the user entered value from the convertedInput.
> > >
> > > But I don't want to want to update the city and the state model either
> to
> > > auto-populate the fields.
> > >
> > > Basically I want to hold off on the model updates until somebody
> clicks the
> > > save button.
> > >
> > > Can i set the converted input on a component and get it to refresh
> through
> > > Ajax?
> > > I know that I can do this through javascript ($(fieldId).value =
> ''blah
> > > blah')and add it to AjaxTarget. But i was wondering if i can just work
> with
> > > components (do setConvertedInput / something) and then add it to
> Ajaxtarget
> > > and make it work?
> > >
> > > -- karthik --
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to