Announcement

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

    Possible bug in ListGrid display when using Field with setPickListFields

    Hi Isomorphic,

    I found a weird bug when I tried to integrate you example http://www.smartclient.com/smartgwt/...bobox_category in my project.

    I use a bound ListGrid and want to display many columns of my optionDataSource, so I use "setPickListFields(...)".

    This is my code:

    Code:
    		boundList = new ListGrid();
    		boundList.setFields();
    
    		final ListGridField anredeIdLGF = boundList.getField("ANREDE_ID");
    
    		final DataSource anredeDS = DataSource.get("T_ANREDE");
    		anredeDS.setCacheAllData(true);
    
    		ComboBoxItem anredeIdCBI = new ComboBoxItem() {
    			{
    				setOptionDataSource(anredeDS);
    				setValueField("ID");
    				setDisplayField("NAME");
    				
    				ListGrid ddLG = new ListGrid() {
    					{
    						setDataSource(anredeDS);
    						setFields();
    					}
    				};
    				setPickListWidth(400);  
    				setPickListFields(ddLG.getField("SHORTNAME"), ddLG.getField("NAME"), ddLG.getField("DESCRIPTION"));
    			}
    		};
    		anredeIdLGF.setEditorType(anredeIdCBI);
    What happens is that the Dropdown changes its design as you can see in the attached pictures. Note on pictures 3,4 and 5 how the design of the Dropdown changes from no header to header to header with correct width (width given in ds.xml file).

    Code:
    <DataSource schema="mySchema" dbName="Oracle" tableName="T_ANREDE" ID="T_ANREDE" dataSourceVersion="1"
    
    	serverType="sql"
    >
    	<fields>
    		<field primaryKey="true" hidden="true" name="ID" type="sequence"></field>
    		<field name="SHORTNAME" title="Kurzform" length="20" type="text" width="50"></field>
    		<field name="NAME" title="Ausgeschrieben" length="50" type="text" width="100"></field>
    		<field name="DESCRIPTION" title="Beschreibung" length="100" type="text" width="250"></field>
    		<field name="MODIFIED_BY" hidden="true" type="int"></field>
    		<field name="MODIFIED_AT" hidden="true" type="datetime" title="Geändert"></field>
    	</fields>
    </DataSource>
    I'm on the 3.0 eval with FF 9.0.1 and tried both development mode out of Eclipse Indigo SR1 as well as deployed to Tomcat 7 (all on local Win7).


    Can you confirm the report?
    Do you need more code?

    Best regards,
    Blama
    Attached Files

    #2
    "width" is not a valid setting in a .ds.xml file - note how it is not documented there. Just because you see a property has *some* effect does not mean it is supported - use the docs.

    Comment


      #3
      Hi Isomorphic,

      I removed the "width" attributes, but the behaviour keeps the same.
      I also noticed I get warnings related to this like "IFCS6:WARN:PickListMenu:isc_PickListMenu_10:fields and completeFields are null and there is no DataSource", but the widgets work as expected.

      Best regards,
      Blama

      Comment


        #4
        Since there are samples showing this behavior working fine, you should work toward a minimal, standalone test case and fill out the other information in the FAQ.

        Comment


          #5
          Hi Isomorphic,

          I found the error. It was the way I got my ListGridField for setPickListFields(...)

          Correct:
          Code:
          				        ListGridField shortname = new ListGridField("SHORTNAME");
          				        ListGridField name = new ListGridField("NAME");
          					setPickListFields(shortname, name);
          I did:
          Code:
          				ListGrid ddLG = new ListGrid() {
          					{
          						setDataSource(titelDS);
          						setFields();
          					}
          				};
          				setPickListWidth(200);
          				setPickListFields(ddLG.getField("SHORTNAME"), ddLG.getField("NAME"));

          Thank you,
          Blama

          Comment

          Working...
          X