Announcement

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

    SmartGWT: SelectBox/ComboBox Autofilter to showing values

    I created a ds.xml file to define my datasource with an enum field. I then call ListGrid.setShowFilterEditor(true) to show filter editors in my ListGrid.

    Now, the select box shows up above the enum field but it doesn't have any values (i.e. it's blank). When I type the first letter of one of the enum options, the select box displays that enum value.

    Is there a way so that if the user clicked the drop-down arrow of the select box, it displays all the possible enum options? Thanks!

    #2
    That's what both a ComboBoxItem or SelectItem do by default (see the many samples). Something is wrong in your definition - can you show both the .ds.xml and the grid? And can you indicate the version of GWT, SmartGWT, browser(s) tried and version(s)?

    Comment


      #3
      I'm using SmartGWT EE 2.3 trial version. Thanks for the tip with trying different browsers. In Google Chrome, it doesn't work, but in Internet Explorer, it does. However, when I press the drop-down button, it clears out the whole screen except for the options shown. It's weird because the showcase works fine for me in Chrome. I couldn't test my app in Firefox because of another issue (I'll make a new post about it later).

      Here's the grid code (I changed to use a TreeGrid now):
      Code:
      grid = new TreeGrid();
      grid.setHeight100();
      grid.setDataSource(DataSource.get("allDMI"));
      grid.setFields(
          new TreeGridField("name","Name"),
          new TreeGridField("type","Type"),
          new TreeGridField("description","Description"));
      grid.setAutoFetchData(true);
      grid.setShowFilterEditor(true);
      Here is the ds.xml file:
      Code:
      <DataSource ID="allDMI" serverType="generic">
          <fields>
              <field name="id"        type="sequence" hidden="true" primaryKey="true"/>
              <field name="parentId"  type="sequence" hidden="true" foreignKey="allDMI.id"/>
              <field name="name"      type="text"     title="Name" hidden="true" length="128" required="true" canFilter="true"/>        
              <field name="type"      type="enum"     title="Type" length="3" 
                     editorType="SelectItem" defaultToFirstOption="true" showAllOptions="true">  
                  <valueMap>  
                      <value>AA</value>  
                      <value>BB</value>  
                      <value>CC</value>  
                      <value>DD</value>
                  </valueMap>  
              </field>
              <field name="description" type="text" title="Description" length="2000"
                     titleOrientation="top" rowSpan="4" colSpan="2" height="100%" canFilter="true"/>
          </fields>
      
          <serverObject lookupStyle="new" className="path.to.AllDMI"/>
      </DataSource>

      Comment


        #4
        Most likely you have external CSS - see the FAQ about this and where it may be coming from.

        If that's not it, try posting a screenshot of exactly what you're seeing.

        Comment


          #5
          I disabled the css file I was using and I get the same thing. I attached the images after clicking in Chrome (nothing happens) and IE (clears the background and shows only the filter options). Thanks!
          Attached Files

          Comment


            #6
            Both strongly suggest there is still external CSS around or perhaps a third-party library interfering. Sorry, not sure what to suggest - clearly this all works with a clean install.

            Comment


              #7
              After reading the FAQ, I realized I had the default GWT themes enabled in my gwt.xml so I deleted that and then deleted my war directory then rebuilt it. Didn't help. I also tried the SmartGwtEENoTheme module to no avail.

              Not sure if this would help but I got my app running in Firefox and the filter select box does work as expected so I'm puzzled now.

              Comment


                #8
                Found the solution to this while working on a different problem. See these threads:
                http://forums.smartclient.com/showthread.php?p=57367
                http://forums.smartclient.com/showthread.php?p=57369

                Turns out we called RootLayoutPanel.get().add(initialCanvas) instead of intialCanvas.draw()

                Comment

                Working...
                X