-
Bug
-
Resolution: Won't Fix
-
Normal
-
None
-
5.0.6, 5.0.7
-
None
When i have a form with multiple input fields with a constraint (e.g. "no empty") and databinding is active for these input fields, the following behavior can be produced:
1. Enter a value into the first field and lose focus
2. Delete the value again so the field is empty and lose focus -> the constraint triggers correctly
3. Enter a value into the second field and lose focus -> the first input field resets itself to the last validated value and is no longer marked as invalid
This can be reproduced on the demo page http://www.zkoss.org/zksandbox/#d1 with the following changes to the demo code:
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./mywin"?>
<window id="mywin" border="none">
ZK name check list :
<zscript>
//init example data beans
import org.zkoss.zksandbox.Person;
List persons = new ArrayList();
persons.add(new Person("Balu", "Haben"));
persons.add(new Person("Sadira", "Jobs"));
persons.add(new Person("Dacey", "Obert"));
persons.add(new Person("Gabby", "Taffy"));
Person selected = persons.get(0);
</zscript>
<listbox model="@
{persons}" selectedItem="@
{selected}" rows="5">
<listhead >
<listheader label="Name"/>
</listhead>
<listitem self="@
" label="@
{person.fullName}" />
</listbox>
<grid>
<columns>
<column label="First Name" />
<column label="Last Name" />
<column label="Full Name" />
</columns>
<rows>
<row>
<textbox value="@
" constraint="no empty"/>
<textbox value="@
" constraint="no empty"/>
<label value="@
" />
</row>
</rows>
</grid>
</window>