Announcement

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

    SelectItem with MultipleAppearance.PICKLIST: "Select all checkbox" not working

    The "select all" checkbox on the top left is not working for me.

    I am using

    SmartClient Version: SC_SNAPSHOT-2010-11-10/PowerEdition Deployment (built 2010-11-10) with GWT 2.0.4 on Firefox 3.6.12

    Java code:

    Code:
    package test.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.MultipleAppearance;
    import com.smartgwt.client.widgets.form.DynamicForm;
    import com.smartgwt.client.widgets.form.fields.SelectItem;
    import com.smartgwt.client.widgets.grid.ListGridField;
    
    public class SelectMultipleSample implements EntryPoint {
    
        public void onModuleLoad() {
    
            DynamicForm selectComboForm = new DynamicForm();
            selectComboForm.setWidth(450);
            
            final SelectItem selectItem = new SelectItem();
            selectItem.setMultipleAppearance(MultipleAppearance.PICKLIST);  
    		selectItem.setMultiple(true);  
    		
            selectItem.setTitle("Select");
            selectItem.setOptionDataSource(DataSource.get("contents"));
            ListGridField cntnId = new ListGridField("cntn_id", "Content id");
            ListGridField cntnBarCode = new ListGridField("cntn_barCode", "Content Barcode");
            selectItem.setPickListFields(cntnId, cntnBarCode);
            
            selectComboForm.setItems(selectItem);
            selectComboForm.draw();
        }
    
    }
    Datasource

    Code:
    <DataSource ID="contents" serverType="sql" tableName="content">
    	<fields>
    		<field primaryKey="true" type="sequence" name="cntn_pk" hidden="true" export="false"></field>
    		<field type="datetime" name="cntn_createdOn" canEdit="false" canFilter="true" title="" detail="true" showInGrid="true" export="true"></field>
    		<field type="text" length="45" name="cntn_id" required="true" exportable="true" export="true"></field>
    		<field title="bar" type="text" length="45" name="cntn_barCode" showInGrid="true" canEdit="false" export="true"></field>
    		<field type="integer" name="cntn_fk_location" hidden="false"></field>
    		<field title="quantity" type="float" name="cntn_quantity" export="true"></field>
    		<field title="unit" type="text" length="45" name="cntn_unit" export="true" ></field>
    	</fields>
    </DataSource>

    #2
    The select all checkbox appears only when the dataset is completely loaded - hover over it when it's disabled and it will tell you this.

    Comment


      #3
      I am sorry, I wasn't completely clear.

      My dataset is completely loaded, and the checkbox is enabled, but the value of the SelectItem does not seem to change when you click select all.

      Comment


        #4
        By "click select all", what do you mean? Are you talking about the header that appears for the picklist?

        Comment


          #5
          Yes, indeed

          Comment


            #6
            Ok - we've made a change to get this working. Check the next nightly build and let us know if you still have problems with this.

            Thanks
            Isomorphic Software

            Comment


              #7
              Ok, this works fine now. Thanks for the support :)

              Comment


                #8
                PasswordTextField

                SelectAll contents in PasswordTextField on click is disabled in smarGWT.

                Comment


                  #9
                  Is this an old feature that is no longer available or is there a way to "select all" in a selectitem picklist with multiple:true?

                  Comment


                    #10
                    See first post from Isomorphic - the checkbox appears only if the dataset is completely loaded.

                    Comment


                      #11
                      Well that post says that I can hover over it when it is disabled but I dont see any disabled "Select All" checkbox.

                      How do I set the FetchMode of the selectitem? I am using a custom datasource to fetch the picklist and I am setting totalRows on the DSResponse to the ammount of options I am returning, so I am not sure why it would think the dataset is not completely loaded.

                      Comment


                        #12
                        The "Select All" checkbox appears only if the header is showing, so you would need to set pickListFields or simply force showHeader:true via pickListProperties.

                        It's sufficient to simply return all rows (even if the SelectItem only requests some, you can return all). However, one way to force the SelectItem to ask for all rows is to set filterLocally:true.

                        Comment


                          #13
                          Ohh, I see. Thank you. That works perfectly!

                          Comment

                          Working...
                          X