Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    FormItem.getValue() broken in recent nightly builds?

    I picked up the 2010-10-01 nightly build from http://www.smartclient.com/builds/SmartGWT/2.x/LGPL

    I noticed that my forms are broken. It seems FormItem.getValue() returns a null even though values have been entered. But if I call DynamicForm.getValue() and pass the name of the FormItem, the entered value is returned.

    I've tried it with GWT 1.5.3 as well as GWT 2.0.4 - IE and Chrome browsers.

    I've confirmed this happens with TextItem's and PasswordItem's - haven't tried the other FormItem classes. Here is the onModuleLoad() sample program that illustrates the problem:

    Code:
    	public void onModuleLoad() 
    	{
    	    final DynamicForm form = new DynamicForm();
    	    
    	    final TextItem ti = new TextItem();
    	    ti.setTitle("Name");
    	    
    	    final PasswordItem pi = new PasswordItem();
    	    pi.setTitle("Password");
    	    
    	    form.setFields(ti, pi);
    	    form.setSaveOnEnter(true);
    	    
    	    form.addSubmitValuesHandler(new SubmitValuesHandler() {
    
                public void onSubmitValues(SubmitValuesEvent event)
                {
                    String name1 = (String)ti.getValue();
                    String password1 = (String)pi.getValue();
                    
                    String name2 = (String)form.getValue(ti.getName());
                    String password2 = (String)form.getValue(pi.getName());
                    SC.say("FormItem getValue()'s says name: " + name1 + ", password: " + password1 + "\nForm.getValue()'s says name: " + name2 + ", password: " + password2);
                }
    	        
    	    });
    	    
    	    form.draw();
    	}

    #2
    I'm seeing the same thing. In my case I have a SelectItem and the value is not getting updated when the selection is changed. Here is an example from the dev console showing the valueMap for the SelectItem and the fact that the value ("style") doesn't match the map entry for the selected display value ("Style/Color/Size"). In this case the value should be "item".
    Code:
    Evaluator: result of 'isc_SelectItem_74' (0ms):
    SelectItem{eventParent: [DynamicForm ID:isc_DynamicForm_21],
    containerWidget: [DynamicForm ID:isc_DynamicForm_21],
    form: [DynamicForm ID:isc_DynamicForm_21],
    type: "SelectItem",
    name: "groupLevel",
    title: "Group by",
    value: "style",
    valueMap: Obj,
    ID: "isc_SelectItem_74",
    pickerIconHeight: 22,
    hasFocus: false,
    pickList: [PickListMenu ID:isc_PickListMenu_0],
    }
    Evaluator: result of 'isc_SelectItem_74.getDisplayValue()' (0ms):
    "Style/Color/Size"
    Evaluator: result of 'isc_SelectItem_74.valueMap' (0ms):
    {style: "Style",
    color: "Style/Color",
    item: "Style/Color/Size"}

    Comment


      #3
      Form.getValue() has been fixed. Please pick up the next nightly build.

      Jay, I'm not sure your issue is directly related to this so if you're having an issue with the next nightly then please post a testcase.

      Thanks,
      Sanjiv

      Comment


        #4
        The 10/3 build fixed this issue. Thanks.

        Comment


          #5
          I have confirmed the fix works for me too.

          Thanks!

          Comment

          Working...
          X