on submitting form ModelObject of TextField is NULL after setEnabled(true)
--------------------------------------------------------------------------

                 Key: WICKET-1956
                 URL: https://issues.apache.org/jira/browse/WICKET-1956
             Project: Wicket
          Issue Type: Bug
    Affects Versions: 1.3.5
         Environment: Java 6 R10, Jetty Server, WinXP sp3, FF3
            Reporter: Henner Storch


This Ajax event handler ist attached to an AbstractAutocompleteTextField via 
AjaxFormComponentUpdateBehaviour("onchange"):

@Override
protected void onUpdate(AjaxRequestTarget target)
{

        ChildObj co = (ChildObj)AutoCompleteTextField.findChoice();
        if(null != co )
        {
                ((Obj)Form.getModelObject()).setChildObject(co);
                ((Obj)Form.getModelObject()).setPrice(co.getPrice());
                if(co.isBoolAttribute())
                {
                        ((Obj)Form.getModelObject()).setAmount(new Float(1));
                        TextInput.setEnabled(false);
                        target.addComponent(TextInput);
                }
                else
                {
                        ((Obj)Form.getModelObject()).setAmount(new Float(1));
                        obj.setAmount(new Float(1));
                        TextInput.setModelObject(new Float(1));
                        TextInput.setEnabled(true);
                        target.addComponent(TextInput);
                }
        }
} 

If the Form containing the AbstractAutocompleteTextField and the TextField 
after the else-block has been executed the ModelObject of TextField is NULL no 
matter what Value is filled in. All other fields ModelObjects of the form are 
filled correctly. 
Form submitting does not fail when else-block was not executed.
ModelObject of the form is a CompoundPropertyModel of "Obj".



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to