Announcement

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

    DataSourceField.setValueMap() is broken in 2.4

    Hi, I'm migrating our application from SmartGWT 2.3 to 2.4, and testing has revealed that DataSourceField.setValueMap() has broken. This is seen when I use the DataSourceField in a custom client side datasource used by a FilterBuilder. I'm running Firefox 3.6.13 on Ubuntu 10.06.

    I have created an example that uses the CustomDS sample that comes with the both 2.3 and 2.4. If you run the example code below in 2.3, the values set in setValueMap() are in the ComboBox. If you run it 2.4, they are not. It appears something has broken internally between the releases, but I'm not sure what.

    Here is CustomDS.java:
    Code:
    package com.smartgwt.sample.client;
    
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.util.KeyCallback;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.Label;
    import com.smartgwt.client.widgets.form.FilterBuilder;
    import com.smartgwt.client.widgets.layout.VStack;
    
    
    /**
     * Entry point classes define <code>onModuleLoad()</code>.
     */
    public class CustomDS implements EntryPoint
    {
    
    	/**
    	 * This is the entry point method.
    	 */
    	public void onModuleLoad()
    	{
    
    		KeyIdentifier debugKey = new KeyIdentifier();
    		debugKey.setCtrlKey( true );
    		debugKey.setKeyName( "D" );
    
    		Page.registerKey( debugKey, new KeyCallback()
    		{
    			public void execute(String keyName)
    			{
    				SC.showConsole();
    			}
    		} );
    
    		VStack vStack = new VStack();
    		vStack.setLeft( 175 );
    		vStack.setTop( 75 );
    		vStack.setWidth( "70%" );
    		vStack.setMembersMargin( 20 );
    
    		Label label = new Label();
    		label.setContents( "<ul>" + "<li>The Combo Boxes for Field 1 and 2 should have values in their picklists</li>"
    				+ "</ul>" );
    		vStack.addMember( label );
    
    		DataSource ds = new CustomFilterDataSource();
    
    		FilterBuilder filterBuilder = new FilterBuilder();
    		filterBuilder.setDataSource( ds );
    
    		vStack.setMembers( label, filterBuilder );
    
    		vStack.draw();
    
    	}
    
    }
    And CustomFilterDataSource.java
    Code:
    // Filename: NotamDataSource.java
    
    package com.smartgwt.sample.client;
    
    
    import java.util.TreeMap;
    
    
    public class CustomFilterDataSource extends DataSource
    {
    	final DataSourceField field1;
    
    	final DataSourceField field2;
    
    	public CustomFilterDataSource()
    	{
    		setShowPrompt( false );
    
    		ComboBoxItem comboBoxItem = new ComboBoxItem();
    		comboBoxItem.setType( "comboBox" );
    		comboBoxItem.setWidth( 300 );
    
    		field1 = new DataSourceTextField( "field1", "Field 1", 50 );
    		field1.setEditorType( comboBoxItem );
    		field1.setValueMap( new String[ ]
    		{
    			"AA", "AB"
    		} );
    		addField( field1 );
    
    		field2 = new DataSourceEnumField( "field2", "Field 2", 50 );
    		field2.setEditorType( comboBoxItem );
    		TreeMap<String, String> map = new TreeMap<String, String>();
    		map.put("v1", "value 1");
    		map.put("v2", "value 2");
    		field2.setValueMap( map );
    		addField( field2 );
    
    		setClientOnly( true );
    	}
    
    }
    Attached Files

    #2
    Any update on this? The example appears to show a clear regression from 2.3 to 2.4.

    Thanks,
    Chris

    Comment


      #3
      We see the issue and will have a fix soon
      Thanks

      Comment


        #4
        Excellent. If you could let me know when it has made it into the nightly build, I would really appreciate it.

        Thanks!

        Comment


          #5
          Ok this should be in the next nightly build (Jan 20) - let us know if it doesn't work for you

          Regards
          Isomorphic Software

          Comment


            #6
            i have same problem and it doesnt work for me with chrome in develop mode (use latest build of smartgwt LGPL API(3. 2. 2011 date of build)), but after compilation wokrs everything ok. Where is a problem ?
            Last edited by vergillio; 4 Feb 2011, 05:04.

            Comment

            Working...
            X