-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have the following model:
Person - String name - Set<phone> phones
My ViewModel has following filds: - Person selected - Phone selectedPhone
My View will create a form like:
<groupbox form="@id('fx') @load(vm.selected) @save(vm.selected, before='save')">
and will expose the name in a textbox and the phones on a listbox. Everytime I selected a phone I set the property selectedPhone. The phone can be edited by using another textfields on my view.
When I change the name the dirty state of my form is updated, and this is good. When I select a Phone I can see that the property selectedPhone of my viewmodel is set. But when I change the phone using the editBox bounded to selectedPhone the dirty state of my form doesn't changed.
This is expected since I'm changing the ViewModel and not the form. But what would be the way to solve this problem, since when a phone is changed, means the Person is changed too, because there are things to save?
Asked: 2013-03-22 18:21:00 +0800
Seen: 16 times
Last updated: Mar 22 '13
Problem binding values to a composite component
How can i load a constant in .zul
[Ugent please] connect Web service .net view in grid group ZK
ZK drang and drop and databinding [closed]
Not able to bind Spring beans after zk upgrade
spring + zk @autowired problem
Editable interface to add users
Hi, I am not I fully understand your question, from your description, you bind person name to form, but phone to VM? instead of form? any reason? If you bind phone to form, you won't have this issue, right?
samchuang ( 2013-03-25 01:46:39 +0800 )editI'm trying to avoid the situation in which the form is marked as dirty just changing the selected phone. My goal is to have the form marked as dirty just if the user changes something within the phone object.
spaeth ( 2013-03-25 09:02:12 +0800 )edit