Announcement

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

    ListGrid normalized Field, ValueMap, filter as if ComboBox

    WANTING a ListGrid field with ValueMap to be FILTERED as if a ComboBox

    In this example, I've modified a showcase example (see below of which one). I have a continent field (integer) that is a foreign key into a Continent table. I use optionDataSource to display the continent name. When filtering as a SelectItem, an exact text match is performed on the display field.

    Instead, I would like to filter using the field as a comboBox. I.e, type in the filter field and see hints as to which are valid text values. The user then has a choice to use the exact text value that's suggested in the comboBox actions or just to use a partial match as if one was searching a textItem.

    However, when using the attribute:

    Code:
    filterEditorType="comboBox"
    for the continent field, I get no response from the filter.

    HOW would I filter the continent field as if it were a ComboBoxItem?


    ENVIRONMENT:
    1.smartgwtpower-3.0p downloaded on 09-18-2012

    2. MacOSX 10.8.1,
    Eclipse Indigo Service Release 2 Build id: 20120216-1857
    chrome and eclipse:runOnServer
    Tomcat 7.0.27

    3,4, and 5 not apropos


    MODIFICATIONS TO EXAMPLE in EE Showcase:

    Variation of SmartGWT EE Showcase->Java Data Integration -> SQL ->Basic Connector.

    1. I imported the world.data.xml into MySQL.
    2. I normalized the table by adding a Continent table.
    3. I added attribute sortField to the continent field.
    4. I added operationId to sort the filter pulldown.


    Code:
    <DataSource  
        ID="worldDS"  
        serverType="sql"  
        tableName="worldDS"  
    >  
        <fields>  
            <field name="pk"            type="sequence"   hidden="true"            primaryKey="true" />  
            <field name="countryCode"   type="text"       title="Code"             required="true"   />  
            <field name="countryName"   type="text"       title="Country"          required="true"   />  
            <field name="capital"       type="text"       title="Capital"          />  
            <field name="government"    type="text"       title="Government"       length="500"      />  
            <field name="continent"     type="integer"       title="Continent"
    			 filterEditorType="comboBox"
                 optionDataSource="Continent"
                 optionOperationId="byName"
                 valueField="pk"
                 displayField="name"
                 sortField="name"
                 />
            <field name="independence"  type="date"       title="Nationhood"          />  
            <field name="area"          type="float"      title="Area (km2)"		  />  
            <field name="population"    type="integer"    title="Population"          />  
            <field name="gdp"           type="float"      title="GDP ($M)"            />  
            <field name="member_g8"     type="boolean"    title="G8"                  />  
        </fields>  
    </DataSource>


    Code:
    <DataSource  
        ID="Continent"  
        serverType="sql"  
        tableName="Continent"  
    >  
        <fields>  
            <field name="pk"            type="sequence"   hidden="true"            primaryKey="true" />  
            <field name="name"   type="text"       title="Continent"             required="true" />  
        </fields>  
    
    <operationBindings>
    	<operationBinding operationId="byName" operationType="fetch">
    		<orderClause>
    			name asc
    		</orderClause>
    	</operationBinding>
    	<operationBinding operationId="byID" operationType="fetch">
    		<orderClause>
    			pk asc
    		</orderClause>
    	</operationBinding>
    </operationBindings>
    
    </DataSource>

    #2
    The correct setting would be filterEditorType="ComboBoxItem".

    For further help, we need to see the server-side log for the request (this is always required).

    Comment


      #3
      Thank you for the quick response, Isomorphic!

      I changed the attribute as suggested:

      Code:
      filterEditorType="ComboBoxItem"
      However, there is no response when I select a continent in the pulldown, let's say "Asia". The result in the grid is as if no filtering was applied. I had previously replied, but I hadn't backed out my changes to match this example. Here's the log for this example.

      SERVER LOGS for filtering on Continent
      === 2012-09-18 19:01:19,177 [c-10] INFO RequestContext - URL: '/Performances/performances/sc/IDACall', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_1) AppleWebKit/536.25 (KHTML, like Gecko) Safari/522.0': Safari with Accept-Encoding header
      === 2012-09-18 19:01:19,179 [c-10] DEBUG XML - Parsed XML from (in memory stream): 1ms
      === 2012-09-18 19:01:19,189 [c-10] DEBUG RPCManager - Processing 1 requests.
      === 2012-09-18 19:01:19,198 [c-10] DEBUG RPCManager - Request #1 (DSRequest) payload: {
      criteria:{
      name:"Asia"
      },
      operationConfig:{
      dataSource:"worldDS",
      operationType:"fetch",
      textMatchStyle:"substring"
      },
      startRow:0,
      endRow:75,
      componentId:"isc_ListGrid_0",
      appID:"builtinApplication",
      operation:"worldDS_fetch",
      oldValues:{
      name:"Asia"
      }
      }
      === 2012-09-18 19:01:19,198 [c-10] INFO IDACall - Performing 1 operation(s)
      === 2012-09-18 19:01:19,198 [c-10] DEBUG AppBase - [builtinApplication.worldDS_fetch] No userTypes defined, allowing anyone access to all operations for this application
      === 2012-09-18 19:01:19,199 [c-10] DEBUG AppBase - [builtinApplication.worldDS_fetch] No public zero-argument method named '_worldDS_fetch' found, performing generic datasource operation
      === 2012-09-18 19:01:19,199 [c-10] INFO SQLDataSource - [builtinApplication.worldDS_fetch] Performing fetch operation with
      criteria: {name:"Asia"} values: {name:"Asia"}
      === 2012-09-18 19:01:19,199 [c-10] INFO SQLDataSource - [builtinApplication.worldDS_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
      === 2012-09-18 19:01:19,199 [c-10] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
      === 2012-09-18 19:01:19,200 [c-10] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Eval'd row count query: SELECT COUNT(*) FROM worldDS WHERE ('1'='1')
      === 2012-09-18 19:01:19,200 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] DriverManager fetching connection for Mysql via jdbc url jdbc:mysql://localhost/fermat?user=fermatcapital&password=fermatwandq&zeroDateTimeBehavior=convertToNull
      === 2012-09-18 19:01:19,200 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Passing JDBC URL only to getConnection
      === 2012-09-18 19:01:19,207 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Returning pooled Connection
      === 2012-09-18 19:01:19,207 [c-10] INFO SQLDriver - [builtinApplication.worldDS_fetch] Executing SQL query on 'Mysql': SELECT COUNT(*) FROM worldDS WHERE ('1'='1')
      === 2012-09-18 19:01:19,208 [c-10] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Using SQL Limit query
      === 2012-09-18 19:01:19,208 [c-10] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT worldDS.area, worldDS.capital, worldDS.continent, worldDS.countryCode, worldDS.countryName, worldDS.gdp, worldDS.government, worldDS.independence, worldDS.member_g8, worldDS.pk, worldDS.population FROM worldDS WHERE ('1'='1') LIMIT 0, 75
      === 2012-09-18 19:01:19,208 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] DriverManager fetching connection for Mysql via jdbc url jdbc:mysql://localhost/fermat?user=fermatcapital&password=fermatwandq&zeroDateTimeBehavior=convertToNull
      === 2012-09-18 19:01:19,208 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Passing JDBC URL only to getConnection
      === 2012-09-18 19:01:19,215 [c-10] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Returning pooled Connection
      === 2012-09-18 19:01:19,225 [c-10] INFO DSResponse - [builtinApplication.worldDS_fetch] DSResponse: List with 75 items
      === 2012-09-18 19:01:19,225 [c-10] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
      === 2012-09-18 19:01:19,226 [c-10] DEBUG RPCManager - non-DMI response, dropExtraFields: false
      === 2012-09-18 19:01:19,233 [c-10] INFO Compression - /Performances/performances/sc/IDACall: 15602 -> 3775 bytes


      SERVER LOGS for Correct filtering on an another field
      === 2012-09-18 19:03:09,446 [ec-4] INFO RequestContext - URL: '/Performances/performances/sc/IDACall', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_1) AppleWebKit/536.25 (KHTML, like Gecko) Safari/522.0': Safari with Accept-Encoding header
      === 2012-09-18 19:03:09,448 [ec-4] DEBUG XML - Parsed XML from (in memory stream): 1ms
      === 2012-09-18 19:03:09,449 [ec-4] DEBUG RPCManager - Processing 1 requests.
      === 2012-09-18 19:03:09,449 [ec-4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
      criteria:{
      government:"rep"
      },
      operationConfig:{
      dataSource:"worldDS",
      operationType:"fetch",
      textMatchStyle:"substring"
      },
      startRow:0,
      endRow:75,
      componentId:"isc_ListGrid_0",
      appID:"builtinApplication",
      operation:"worldDS_fetch",
      oldValues:{
      government:"rep"
      }
      }
      === 2012-09-18 19:03:09,449 [ec-4] INFO IDACall - Performing 1 operation(s)
      === 2012-09-18 19:03:09,450 [ec-4] DEBUG AppBase - [builtinApplication.worldDS_fetch] No userTypes defined, allowing anyone access to all operations for this application
      === 2012-09-18 19:03:09,450 [ec-4] DEBUG AppBase - [builtinApplication.worldDS_fetch] No public zero-argument method named '_worldDS_fetch' found, performing generic datasource operation
      === 2012-09-18 19:03:09,450 [ec-4] INFO SQLDataSource - [builtinApplication.worldDS_fetch] Performing fetch operation with
      criteria: {government:"rep"} values: {government:"rep"}
      === 2012-09-18 19:03:09,451 [ec-4] INFO SQLDataSource - [builtinApplication.worldDS_fetch] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
      === 2012-09-18 19:03:09,451 [ec-4] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Executing row count query: SELECT COUNT(*) FROM $defaultTableClause WHERE $defaultWhereClause
      === 2012-09-18 19:03:09,451 [ec-4] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Eval'd row count query: SELECT COUNT(*) FROM worldDS WHERE (worldDS.government LIKE '%rep%')
      === 2012-09-18 19:03:09,451 [ec-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] DriverManager fetching connection for Mysql via jdbc url jdbc:mysql://localhost/fermat?user=fermatcapital&password=fermatwandq&zeroDateTimeBehavior=convertToNull
      === 2012-09-18 19:03:09,451 [ec-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Passing JDBC URL only to getConnection
      === 2012-09-18 19:03:09,458 [ec-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Returning pooled Connection
      === 2012-09-18 19:03:09,459 [ec-4] INFO SQLDriver - [builtinApplication.worldDS_fetch] Executing SQL query on 'Mysql': SELECT COUNT(*) FROM worldDS WHERE (worldDS.government LIKE '%rep%')
      === 2012-09-18 19:03:09,459 [ec-4] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] Using SQL Limit query
      === 2012-09-18 19:03:09,459 [ec-4] DEBUG SQLDataSource - [builtinApplication.worldDS_fetch] SQL windowed select rows 0->75, result size 75. Query: SELECT worldDS.area, worldDS.capital, worldDS.continent, worldDS.countryCode, worldDS.countryName, worldDS.gdp, worldDS.government, worldDS.independence, worldDS.member_g8, worldDS.pk, worldDS.population FROM worldDS WHERE (worldDS.government LIKE '%rep%') LIMIT 0, 75
      === 2012-09-18 19:03:09,459 [ec-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] DriverManager fetching connection for Mysql via jdbc url jdbc:mysql://localhost/fermat?user=fermatcapital&password=fermatwandq&zeroDateTimeBehavior=convertToNull
      === 2012-09-18 19:03:09,460 [ec-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Passing JDBC URL only to getConnection
      === 2012-09-18 19:03:09,466 [ec-4] DEBUG PoolableSQLConnectionFactory - [builtinApplication.worldDS_fetch] Returning pooled Connection
      === 2012-09-18 19:03:09,476 [ec-4] INFO DSResponse - [builtinApplication.worldDS_fetch] DSResponse: List with 75 items
      === 2012-09-18 19:03:09,476 [ec-4] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
      === 2012-09-18 19:03:09,477 [ec-4] DEBUG RPCManager - non-DMI response, dropExtraFields: false
      === 2012-09-18 19:03:09,484 [ec-4] INFO Compression - /Performances/performances/sc/IDACall: 15839 -> 3498 bytes
      Last edited by michaeljseo; 18 Sep 2012, 15:04.

      Comment


        #4
        The problem is, your ComboBoxItem is generating criteria that is supposed to be used against the continent name, but no such field exists in your "worldDS" DataSource.

        To introduce such a field, use dataSourceField.includeFrom on worldDS to introduce a field called "continentName". This will both introduce the server-side join needed for server-based filtering against this field *and* load values into the browser so that client-side filtering can work.

        The "Field Include" sample shows a complete working example of this.

        Comment


          #5
          Almost there! But how are you able to edit the Continent field via valueMap?

          Comment


            #6
            Not sure we follow the question.. basically you're going to declare a new field with includeFrom. Your optionDataSource and filterEditorType settings can remain the same.

            Comment


              #7
              I tried this, but I'm not able to edit the Continent field, which I don't understand how the field is showing up on the grid. Also, there are two fields named "Continent" (see attachment).

              In fact, I'm sure I'm still lost.

              Code:
              <DataSource  
                  ID="worldDS"  
                  serverType="sql"  
                  tableName="worldDS"  
              >  
                  <fields>  
                      <field name="pk"            type="sequence"   hidden="true"            primaryKey="true" />  
                      <field name="countryCode"   type="text"       title="Code"             required="true"   />  
                      <field name="countryName"   type="text"       title="Country"          required="true"   />  
                      <field name="capital"       type="text"       title="Capital"          />  
                      <field name="government"    type="text"       title="Government"       length="500"      />  
                      <field includeFrom="Continent.name" />  
                      <field name="cname" includeFrom="Continent.name" 
                      	 editorType="ComboBoxItem"
                           optionDataSource="Continent"
                           optionOperationId="byName"
                           valueField="name"
                           displayField="name"
                           sortField="name"
                           />
                      <field name="continent"     type="integer"    hidden="true"    foreignKey="Continent.pk"  />  
                      <field name="independence"  type="date"       title="Nationhood"          />  
                      <field name="area"          type="float"      title="Area (km2)"		  />  
                      <field name="population"    type="integer"    title="Population"          />  
                      <field name="gdp"           type="float"      title="GDP ($M)"            />  
                      <field name="member_g8"     type="boolean"    title="G8"                  />  
                  </fields>  
              
              Ma
              </DataSource>
              Attached Files
              Last edited by michaeljseo; 18 Sep 2012, 16:02. Reason: attachment doesn't seem to have been uploaded.

              Comment


                #8
                That's now a kind of nonsense mix. You just want this:

                Code:
                        <field name="continent" type="integer"
                             displayField="name"/>
                        <field name="continentName" includeFrom="Continent.name"
                             hidden="true"/>
                It's technically cheating to put optionDataSource and other settings in a .ds.xml file. They aren't documented for use there and will have different effects on different components. But when applying them, they apply to the field continent (the integer field), not the includeFrom field.

                Comment


                  #9
                  Hmmm? I tried, but I get a server-side error:

                  Code:
                  === 2012-09-18 20:19:07,134 [ec-5] DEBUG RPCManager - Processing 2 requests.
                  === 2012-09-18 20:19:07,149 [ec-5] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                      criteria:{
                      },
                      operationConfig:{
                          dataSource:"worldDS",
                          operationType:"fetch",
                          textMatchStyle:"substring"
                      },
                      startRow:0,
                      endRow:75,
                      componentId:"isc_ListGrid_0",
                      appID:"builtinApplication",
                      operation:"worldDS_fetch",
                      oldValues:{
                      }
                  }
                  === 2012-09-18 20:19:07,150 [ec-5] DEBUG RPCManager - Request #2 (DSRequest) payload: {
                      criteria:{
                      },
                      operationConfig:{
                          dataSource:"worldDS",
                          operationType:"fetch",
                          textMatchStyle:"startsWith"
                      },
                      componentId:"isc_PickListMenu_0",
                      appID:"builtinApplication",
                      operation:"worldDS_fetch",
                      oldValues:{
                      }
                  }
                  === 2012-09-18 20:19:07,152 [ec-5] INFO  IDACall - Performing 2 operation(s)
                  === 2012-09-18 20:19:07,161 [ec-5] DEBUG AppBase - [builtinApplication.worldDS_fetch] No userTypes defined, allowing anyone access to all operations for this application
                  === 2012-09-18 20:19:07,161 [ec-5] DEBUG AppBase - [builtinApplication.worldDS_fetch] No public zero-argument method named '_worldDS_fetch' found, performing generic datasource operation
                  === 2012-09-18 20:19:07,161 [ec-5] INFO  SQLDataSource - [builtinApplication.worldDS_fetch] Performing fetch operation with
                  	criteria: {}	values: {}
                  === 2012-09-18 20:19:07,169 [ec-5] INFO  SQLWhereClause - [builtinApplication.worldDS_fetch] empty condition
                  === 2012-09-18 20:19:07,171 [ec-5] WARN  RequestContext - dsRequest.execute() failed: 
                  java.lang.NullPointerException
                  	at com.isomorphic.sql.SQLJoinWhereClause.buildExpression(SQLJoinWhereClause.java:155)
                  	at com.isomorphic.sql.SQLJoinWhereClause.getSQLString(SQLJoinWhereClause.java:127)
                  	at com.isomorphic.sql.SQLDataSource.getClausesContext(SQLDataSource.java:2136)
                  	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1218)
                  	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:293)
                  	at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:237)
                  	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1289)
                  	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:725)
                  	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
                  	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
                  	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1954)
                  	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
                  	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
                  	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
                  	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
                  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
                  	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
                  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
                  	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
                  	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                  	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
                  	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                  	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                  	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
                  	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
                  	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
                  	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
                  	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
                  	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
                  	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
                  	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
                  	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
                  	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
                  	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
                  	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  	at java.lang.Thread.run(Thread.java:680)
                  === 2012-09-18 20:19:07,172 [ec-5] DEBUG AppBase - [builtinApplication.worldDS_fetch] No userTypes defined, allowing anyone access to all operations for this application
                  === 2012-09-18 20:19:07,172 [ec-5] DEBUG AppBase - [builtinApplication.worldDS_fetch] No public zero-argument method named '_worldDS_fetch' found, performing generic datasource operation
                  === 2012-09-18 20:19:07,172 [ec-5] INFO  SQLDataSource - [builtinApplication.worldDS_fetch] Performing fetch operation with
                  	criteria: {}	values: {}
                  === 2012-09-18 20:19:07,173 [ec-5] INFO  SQLWhereClause - [builtinApplication.worldDS_fetch] empty condition
                  === 2012-09-18 20:19:07,173 [ec-5] WARN  RequestContext - dsRequest.execute() failed: 
                  java.lang.NullPointerException
                  	at com.isomorphic.sql.SQLJoinWhereClause.buildExpression(SQLJoinWhereClause.java:155)
                  	at com.isomorphic.sql.SQLJoinWhereClause.getSQLString(SQLJoinWhereClause.java:127)
                  	at com.isomorphic.sql.SQLDataSource.getClausesContext(SQLDataSource.java:2136)
                  	at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1218)
                  	at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:293)
                  	at com.isomorphic.sql.SQLDataSource.executeFetch(SQLDataSource.java:237)
                  	at com.isomorphic.datasource.DataSource.execute(DataSource.java:1289)
                  	at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:725)
                  	at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658)
                  	at com.isomorphic.application.AppBase.execute(AppBase.java:491)
                  	at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1954)
                  	at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:199)
                  	at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:156)
                  	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:121)
                  	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
                  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
                  	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
                  	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
                  	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
                  	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                  	at com.isomorphic.servlet.CompressionFilter.doFilter(CompressionFilter.java:259)
                  	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
                  	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
                  	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
                  	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
                  	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
                  	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
                  	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
                  	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
                  	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
                  	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
                  	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
                  	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
                  	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
                  	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                  	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                  	at java.lang.Thread.run(Thread.java:680)
                  === 2012-09-18 20:19:07,174 [ec-5] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
                  === 2012-09-18 20:19:07,176 [ec-5] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                  === 2012-09-18 20:19:07,177 [ec-5] DEBUG RPCManager - non-DMI response, dropExtraFields: false
                  === 2012-09-18 20:19:07,178 [ec-5] INFO  Compression - /Performances/performances/sc/IDACall: 200 -> 116 bytes
                  === 2012-09-18 20:19:28,050 [ec-7] INFO  RequestContext - URL: '/Performances/performances/sc/skins/Enterprise/images/headerIcons/close_Over.png', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_1) AppleWebKit/536.25 (KHTML, like Gecko) Safari/522.0': Safari with Accept-Encoding header
                  === 2012-09-18 20:19:28,058 [ec-7] INFO  Download - done streaming: /Users/Shared/test/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Performances/performances/sc/skins/Enterprise/images/headerIcons/close_Over.png

                  Comment


                    #10
                    The code we showed will work if you still have a DataSource named "Continent" with a field "name", but if you've shuffled things around or perhaps aren't using SQL tables that match the DataSources any more, it won't.

                    Comment


                      #11
                      I've re-checked and re-started eclipse, but I still get the same error.

                      How does your modifications work without a foreignKey specifier?

                      Comment


                        #12
                        Ah, sorry, that actually should be in the DataSource on the field "continent", in the same way the samples show.

                        Comment


                          #13
                          No prob!

                          Well, I get nothing displayed in my Grid with this:

                          Code:
                                  <field name="continentName" includeFrom="Continent.name"
                                       hidden="true"/>
                                  <field name="continent" type="integer"
                                  	foreignKey="Continent.pk"
                                  	displayField="name"
                                       />
                          The Grid does show the values when I use:

                          Code:
                                  <field name="continentName" includeFrom="Continent.name"
                                       hidden="true"/>
                                  <field name="continent" type="integer"
                                  	foreignKey="Continent.pk"
                                  	displayField="continentName"
                                       />
                          However, the pulldown in the filter literally shows the grid column. I.e, press on the pulldown and you have "Europe" repeated many times (see attachment).
                          Attached Files

                          Comment


                            #14
                            Yes, that correction was needed as well - we renamed "name" to "continentName" for clarity but missed a spot...

                            Now, you just need to re-add your optionDataSource definitions. The correct way is programmatic calls on the ListGridField: setFilterEditorType() with an instance of ComboBoxItem where optionDataSource, and valueField and displayField have been set.

                            Comment


                              #15
                              I added to the end of the class the programmatic calls, but nothing changed.
                              Code:
                                  public void onModuleLoad() {  
                                      final ListGrid listGrid = new ListGrid();  
                                      listGrid.setWidth(700);  
                                      listGrid.setHeight(224);  
                                      listGrid.setAlternateRecordStyles(true);  
                                      DataSource ds = DataSource.get("worldDS");
                                      listGrid.setDataSource(ds);  
                                      listGrid.setAutoFetchData(true);  
                                      listGrid.setShowFilterEditor(true);  
                                      listGrid.setCanEdit(true);  
                                      listGrid.setEditEvent(ListGridEditEvent.CLICK);  
                                      listGrid.setCanRemoveRecords(true);  
                                      
                                      IButton newButton = new IButton("Add New");  
                                      newButton.addClickHandler(new ClickHandler() {  
                                          public void onClick(ClickEvent event) {  
                                              listGrid.startEditingNew();  
                                          }  
                                      });  
                                
                                      VLayout layout = new VLayout(15);  
                                      layout.addMember(listGrid);  
                                      layout.addMember(newButton);  
                                
                                      layout.draw();  
                              [B]
                                      ComboBoxItem cbi = new ComboBoxItem("continent");
                                      cbi.setOptionDataSource(DataSource.get("Continent"));
                                      cbi.setOptionOperationId("byName");
                                      cbi.setDisplayField("name");
                                      cbi.setValueField("pk");
                                      listGrid.getField("continent").setFilterEditorType(cbi);
                              [/B]
                                  }
                              I also tried to set

                              Code:
                                      cbi.setValueField("name");
                              which gave me the same result. I don't think the setting is taking. Perhaps I'm not setting the filterEditorType at the right moment?

                              Comment

                              Working...
                              X