Hi,

two week ago I had a similar problem (see Thread
"AutoCompleteTextfield---how to populate two input fields -
tf4592192.html#a13166291")

The solution was to have an autocomplete-list attached to the zipcode and
the city-field. The list shows the valid zipcode-city combinations for the
zipcode/city entered so far. When the user chooses an entry from the list,
both fields are filled accordingly.

To achieve this the AutoCompleteTextField's behavior was modified so that it
is able to update two fields at once from the user's selection (with
different values). In that way, entering the data occurs in the browser
only, the model remains untouched until the user submits the form. (Indeed,
a slightly different approach, but works great).

regards,
Oliver



Matej Knopp-2 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Refreshing-components-with-new-data-w-o-altering-the-backing-model-tf4675439.html#a13359783
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to