Announcement

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

    Add and Update problem working with Multiple binary fields in a single Datasource

    ISC_VERSION :
    "v11.0p_2016-09-07" / "v11.0p_2016-11-11"

    OS and Browser: Google Chrome Version 54.0.2840.99 m (64-bit)

    DATABASE VERSION:
    Oracle 11g

    I've tried to search into documentation if it was possible (or not) work with multiple binary fields in a single datasource, but i didn't found anything.

    So i tried and i failed. I've encountered two problems in both add and update operation.

    Problem 1: Upload binary fields error in add operation

    When i try to add a record, using the form, with 3 uploded File, only the first binary field (HOME_JERSEY) is saved correctly, the others not.
    Seeing the log, i noticed that in the create statement SmartClient try to save the others 2 file without related fields (_FILENAME, _FILESIZE, _DATE_CREATED)

    INSERT LOG:

    Code:
    INSERT
    INTO TEAMS
      (
        AWAY_JERSEY,
        AWAY_JERSEY_DATE_CREATED,
        HOME_JERSEY,
        HOME_JERSEY_DATE_CREATED,
        HOME_JERSEY_FILENAME,
        HOME_JERSEY_FILESIZE,
        NOME,
        THIRD_JERSEY,
        THIRD_JERSEY_DATE_CREATED,
        ID_REC
      )
      VALUES
      (
        ?,
        TO_DATE('2016-11-24 12:12:11','YYYY-MM-DD HH24:MI:SS'),
        ?,
        TO_DATE('2016-11-24 12:12:11','YYYY-MM-DD HH24:MI:SS'),
        'arrow.png',
        590,
        'Team_1',
        ?,
        TO_DATE('2016-11-24 12:12:11','YYYY-MM-DD HH24:MI:SS'),
        SQ_ID_REC.NextVal
      )
    Step to reproduce:

    1. Fill the "Nome" field (Ex. "Team_1")
    2. Choose a File for the "Home Jersey" field
    3. Choose a File for the "Away Jersey" field
    4. Choose a File for the "Third Jersey" field
    5. Click on "save" button.



    Problem 2: Upload binary fields error in update operation

    When i try to upload in an update operation a field that is differet from "AWAY_JERSEY", the update fails with a SQLException: Invalid column index.

    Step to reproduce:
    1. Select a record from the grid
    2. Choose a File for the "Home Jersey" field
    3. Click on "save" button.

    Update log:

    Code:
    2016-11-24 12:21:55,521 INFO  SQLDriver [builtinApplication.TEAMS_update] Executing SQL query on 'test' using connection '892375283':
    
    UPDATE TEAMS
    SET
      HOME_JERSEY            =?,
      HOME_JERSEY_FILENAME   ='arrow.png',
      HOME_JERSEY_FILESIZE   =590,
      NOME                   ='Team_1'
    WHERE (TEAMS.ID_REC=6)
    
    Nov 24, 2016 12:21:55 PM oracle.jdbc.driver.OraclePreparedStatement setStringInternal
    SEVERE: 2B12068 Throwing SQLException: 3
    2016-11-24 12:21:55,533 DEBUG SQLDriver [builtinApplication.TEAMS_update] FAILED to execute SQL update in 'test' using connection'892375283'
    2016-11-24 12:21:55,533 DEBUG DSRequest freeOnExecute is false for request of type update on DataSource TEAMS - not freeing resources!
    2016-11-24 12:21:55,533 WARN  RequestContext dsRequest.execute() failed:  
    java.sql.SQLException: Invalid column index
    java.sql.SQLException: Invalid column index
        at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:7829)
        at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:7783)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.setString(OraclePreparedStatementWrapper.java:914)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
        at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
        at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:934)
        at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:840)
        at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:1027)
        at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:598)
        at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:2116)
        at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:449)
        at com.isomorphic.sql.SQLDataSource.executeUpdate(SQLDataSource.java:398)
        at com.isomorphic.datasource.DataSource.execute(DataSource.java:2281)
        at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:735)
        at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:652)
        at com.isomorphic.application.AppBase.execute(AppBase.java:493)
        at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2723)
        at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:230)
        at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:187)
        at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
        at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
        at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:200)
        at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.test.utils.Log4jSessionFilter.doFilter(Log4jSessionFilter.java:65)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at com.isomorphic.js.JSSyntaxScannerFilter._doFilter(JSSyntaxScannerFilter.java:262)
        at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        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:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

    Code to reproduce:

    TABLE and SEQUENCE:
    Code:
    CREATE TABLE TEAMS
       (    
       "ID_REC" NUMBER(10,0),
        "NOME" VARCHAR2(100 BYTE) NOT NULL ENABLE,
        "HOME_JERSEY" BLOB,
        "HOME_JERSEY_FILENAME" VARCHAR2(255 BYTE),
        "HOME_JERSEY_FILESIZE" NUMBER(10,0),
        "AWAY_JERSEY" BLOB,
        "AWAY_JERSEY_FILENAME" VARCHAR2(255 BYTE),
        "AWAY_JERSEY_FILESIZE" NUMBER(10,0),
        "THIRD_JERSEY" BLOB,
        "THIRD_JERSEY_FILENAME" VARCHAR2(255 BYTE),
        "THIRD_JERSEY_FILESIZE" NUMBER(10,0),
        "HOME_JERSEY_DATE_CREATED" DATE,
        "AWAY_JERSEY_DATE_CREATED" DATE,
        "THIRD_JERSEY_DATE_CREATED" DATE,
         CONSTRAINT "PK_OSS_SQUADRE" PRIMARY KEY ("ID_REC")
       )
    
    CREATE SEQUENCE  SQ_ID_REC  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 2000 NOORDER  NOCYCLE ;
    DATASOURCE:

    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                ID="TEAMS"
                tableName="TEAMS"
                dbName="test"
                dataSourceVersion="1"
                serverType="sql"
                dropExtraFields="false"
    >
        <fmt:bundle basename="i18nMessages" encoding="utf-8"/>
        <fields>
            <field name="ID_REC" type="sequence" sequenceName="SQ_ID_REC" primaryKey="true"/>
            <field name="NOME" type="text"/>
    
            <field name="HOME_JERSEY" type="binary"/>
            <field name="HOME_JERSEY_FILENAME" type="text"/>
            <field name="HOME_JERSEY_FILESIZE" type="integer"/>
            <field name="HOME_JERSEY_DATE_CREATED" type="creatorTimestamp"/>
            <field name="AWAY_JERSEY" type="binary"/>
            <field name="AWAY_JERSEY_FILENAME" type="text"/>
            <field name="AWAY_JERSEY_FILESIZE" type="integer"/>
            <field name="AWAY_JERSEY_DATE_CREATED" type="creatorTimestamp"/>
            <field name="THIRD_JERSEY" type="binary"/>
            <field name="THIRD_JERSEY_FILENAME" type="text"/>
            <field name="THIRD_JERSEY_FILESIZE" type="integer"/>
            <field name="THIRD_JERSEY_DATE_CREATED" type="creatorTimestamp"/>
        </fields>
    </DataSource>

    JS:

    Code:
    isc.Window.create({
        ID:"windowTest",
        height:500,
        width:1000,
        items:[
            isc.ListGrid.create({
                ID:"gridTest",
                dataSource:"TEAMS",
                width:"100%",
                height:"50%",
                autoFetchData:true,
                recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue){
                    formTest.editRecord({ID_REC:record.ID_REC, NOME:record.NOME});
                },
                fields:[
                    {
                        name:"ID_REC",
                        type:"int"
                    },
                    {
                        name:"NOME",
                        type:"text"
                    },
                    {
                        name:"HOME_JERSEY",
                        type:"binary"
                    },
                    {
                        name:"AWAY_JERSEY",
                        type:"binary"
                    },
                    {
                        name:"THIRD_JERSEY",
                        type:"binary"
                    }
                ]
            }),
            isc.DynamicForm.create({
                ID:"formTest",
                width:"100%",
                heigth:"50%",
                dataSource:"TEAMS",
                colNums:4,
                fields:[
                    {
                        name:"NOME",
                        type:"text"
                    },
                    {
                        name:"HOME_JERSEY",
                        type:"binary",
                        editorType:"FileItem"
                    },
                    {
                        name:"AWAY_JERSEY",
                        type:"binary",
                        editorType:"FileItem"
                    },
                    {
                        name:"THIRD_JERSEY",
                        type:"binary",
                        editorType:"FileItem"
                    },
                    {
                        name:"savebutton",
                        type:"button",
                        title:"Save",
                        click: function(){
                            formTest.saveData (function(dsResponse,data){
                               if(dsResponse.status == 0){
                                   formTest.editNewRecord();
                                   gridTest.invalidateCache();
                               }
                            });
                        }
                    }
                ]
            })
        ]
    })

    so, you cannot have multiple binary fields in a single datasource? or are they bug?

    Thanks.
    Last edited by simokris; 28 Nov 2016, 05:48.

    #2
    You can have multiple binary fields in a DataSource, however, you can't save more than one file at a time using FileItem (see FileItem docs). You can either use MultiFileItem, or use multiple different forms in a VStack, which is generally a better UI anyway, since you minimize the chance of files being lost if an error or timeout occurs.

    It's unclear whether the SQL error also resulted from trying to submit this same form that has multiple FileItems. Let us know if you can reproduce that with valid usage.

    Comment


      #3
      I'm Sorry but in the FileItem docs i didn't read anywhere that I cannot have more than 1 FileItem in a singleForm. The docs says:

      Code:
      Binary data interface for use in DynamicForms. Allows users to select a single file for upload.
      I interpret this thing like i cannot Select more than 1 file for a single FileItem, but not that i cannot have more FileItem.

      By the way, for the Valid Usage, i removed 2 FileItem from the DynamicForm to save just a single BinaryField (different from AWAY_JERSEY) and i obtain the same error that i obtained in upload operation of the previous example.

      (Keep in mind that i wrote this test case just to make it simple to debug for you. In my project i'm actually facing this problem using yours RestHandler where i'm handling the upload process through DMI)

      LOG:

      Code:
      2016-11-29 10:42:00,659 DEBUG RPCManager Request #1 (DSRequest) payload: {
          values:{
              HOME_JERSEY:"C:\\fakepath\\arrow.png",
              NOME:"Team_2",
              HOME_JERSEY_FILESIZE:590,
              HOME_JERSEY_DATE_CREATED:new Date(1480412520659),
              HOME_JERSEY_FILENAME:"arrow.png"
          },
          operationConfig:{
              dataSource:"TEAMS",
              repo:null,
              operationType:"add",
              textMatchStyle:"exact"
          },
          componentId:"isc_DynamicForm_1",
          appID:"builtinApplication",
          operation:"TEAMS_add",
          oldValues:{
          },
          criteria:{
          }
      }
      2016-11-29 10:42:00,660 INFO  IDACall Performing 1 operation(s)
      2016-11-29 10:42:00,660 DEBUG DeclarativeSecurity Processing security checks for DataSource null, field null
      2016-11-29 10:42:00,660 DEBUG DeclarativeSecurity DataSource TEAMS is not in the pre-checked list, processing...
      2016-11-29 10:42:00,660 DEBUG AppBase [builtinApplication.TEAMS_add] No userTypes defined, allowing anyone access to all operations for this application
      2016-11-29 10:42:00,660 DEBUG AppBase [builtinApplication.TEAMS_add] No public zero-argument method named '_TEAMS_add' found, performing generic datasource operation
      2016-11-29 10:42:00,661 DEBUG BasicDataSource [builtinApplication.TEAMS_add] Validating 1 'TEAMS's at path ''
      2016-11-29 10:42:00,661 DEBUG BasicDataSource [builtinApplication.TEAMS_add] Validating a 'TEAMS' at path ''
      2016-11-29 10:42:00,662 DEBUG BasicDataSource [builtinApplication.TEAMS_add] Done validating 1 'TEAMS's at path '': 1ms (avg 1)
      2016-11-29 10:42:00,662 DEBUG DataSource [builtinApplication.TEAMS_add] post-validation valueSet: [
          {
              NOME:"Team_2",
              HOME_JERSEY_FILESIZE:590,
              HOME_JERSEY_DATE_CREATED:new Date(1480412520660),
              HOME_JERSEY_FILENAME:"arrow.png",
              AWAY_JERSEY_DATE_CREATED:new Date(1480412520660),
              THIRD_JERSEY_DATE_CREATED:new Date(1480412520660)
          }
      ]
      2016-11-29 10:42:00,662 INFO  SQLDataSource [builtinApplication.TEAMS_add] Performing add operation with
          criteria: {NOME:"Team_2",HOME_JERSEY_FILESIZE:590,HOME_JERSEY_DATE_CREATED:new Date(1480412520660),HOME_JERSEY_FILENAME:"arrow.png",AWAY_JERSEY_DATE_CREATED:new Date(1480412520660),THIRD_JERSEY_DATE_CREATED:new Date(1480412520660)}    values: {NOME:"Team_2",HOME_JERSEY_FILESIZE:590,HOME_JERSEY_DATE_CREATED:new Date(1480412520660),HOME_JERSEY_FILENAME:"arrow.png",AWAY_JERSEY_DATE_CREATED:new Date(1480412520660),THIRD_JERSEY_DATE_CREATED:new Date(1480412520660)}
      2016-11-29 10:42:00,668 DEBUG SQLValuesClause [builtinApplication.TEAMS_add] Sequences: {ID_REC=SEQ_JPO_TABELLE_DOMINIO}
      2016-11-29 10:42:00,729 DEBUG PoolableSQLConnectionFactory [builtinApplication.TEAMS_add] makeObject() created an unpooled Connection '2033542985'
      2016-11-29 10:42:00,729 DEBUG SQLConnectionManager [builtinApplication.TEAMS_add] Borrowed connection '2033542985'
      2016-11-29 10:42:00,729 DEBUG SQLTransaction [builtinApplication.TEAMS_add] Started new test transaction "2033542985"
      2016-11-29 10:42:00,729 DEBUG SQLDataSource [builtinApplication.TEAMS_add] Setting DSRequest as being part of a transaction
      2016-11-29 10:42:00,729 INFO  SQLDriver [builtinApplication.TEAMS_add] Executing SQL query on 'test' using connection '2033542985':
      
      INSERT INTO teams (
      away_jersey_date_created,
      home_jersey,
      home_jersey_date_created,
      home_jersey_filename,
      home_jersey_filesize,
      nome,
      third_jersey_date_created,
      id_rec
      ) VALUES (
      TO_DATE('2016-11-29 10:42:00','YYYY-MM-DD HH24:MI:SS'),
      ?,
      TO_DATE('2016-11-29 10:42:00','YYYY-MM-DD HH24:MI:SS'),
      'arrow.png',
      590,
      'Team_2',
      TO_DATE('2016-11-29 10:42:00','YYYY-MM-DD HH24:MI:SS'),
      seq_jpo_tabelle_dominio.NEXTVAL
      )
      
      Nov 29, 2016 10:42:01 AM oracle.jdbc.driver.OraclePreparedStatement setStringInternal
      SEVERE: 285788ED Throwing SQLException: 3
      2016-11-29 10:42:01,121 DEBUG SQLDriver [builtinApplication.TEAMS_add] SequenceMode is not JDBC_DRIVER, skipping search for generated values
      2016-11-29 10:42:01,122 DEBUG SQLDriver [builtinApplication.TEAMS_add] FAILED to execute SQL update in 'test' using connection'2033542985'
      2016-11-29 10:42:01,122 DEBUG DSRequest freeOnExecute is false for request of type add on DataSource TEAMS - not freeing resources!
      2016-11-29 10:42:01,123 WARN  RequestContext dsRequest.execute() failed:  
      java.sql.SQLException: Invalid column index
          at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:7829)
          at oracle.jdbc.driver.OraclePreparedStatement.setString(OraclePreparedStatement.java:7783)
          at oracle.jdbc.driver.OraclePreparedStatementWrapper.setString(OraclePreparedStatementWrapper.java:914)
          at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
          at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.setString(DelegatingPreparedStatement.java:135)
          at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:934)
          at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:840)
          at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:1027)
          at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:598)
          at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:2122)
          at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:449)
          at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:402)
          at com.isomorphic.datasource.DataSource.execute(DataSource.java:2264)
          at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:735)
          at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:652)
          at com.isomorphic.application.AppBase.execute(AppBase.java:493)
          at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2725)
          at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:230)
          at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:187)
          at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
          at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
          at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
          at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:200)
          at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:178)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at com.test.utils.Log4jSessionFilter.doFilter(Log4jSessionFilter.java:65)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
          at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
          at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:187)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:109)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:109)
          at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
          at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
          at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
          at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
          at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.jasig.cas.client.session.SingleSignOutFilter.doFilter(SingleSignOutFilter.java:76)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
          at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
          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:222)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721)
          at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
          at java.lang.Thread.run(Thread.java:745)

      As you can see in the Error log, the server receive as values this:

      Code:
      values:{
              HOME_JERSEY:"C:\\fakepath\\arrow.png",
              NOME:"Team_2",
              HOME_JERSEY_FILESIZE:590,
              HOME_JERSEY_DATE_CREATED:new Date(1480412520659),
              HOME_JERSEY_FILENAME:"arrow.png"
          },
      But in the post-validation SC add also AWAY_JERSEY_DATE_CREATED and THIRD_JERSEY_DATE_CREATED:

      Code:
      post-validation valueSet: [
      {
      NOME:"Team_2",
      HOME_JERSEY_FILESIZE:590,
      HOME_JERSEY_DATE_CREATED:new Date(1480412520660),
      HOME_JERSEY_FILENAME:"arrow.png",
      AWAY_JERSEY_DATE_CREATED:new Date(1480412520660),
      THIRD_JERSEY_DATE_CREATED:new Date(1480412520660)
      }
      And at the end i obtain always:
      Code:
      java.sql.SQLException: Invalid column index

      This problem occur if i use HOME_JERSEY or THIRD_JERSEY, but not if i use AWAY_JERSEY.


      Code JS to reproduce:

      Code:
      isc.Window.create({
          ID:"windowTest",
          height:500,
          width:1000,
          items:[
              isc.ListGrid.create({
                  ID:"gridTest",
                  dataSource:"TEAMS",
                  width:"100%",
                  height:"50%",
                  autoFetchData:true,
                  recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue){
                      formTest.editRecord({ID_REC:record.ID_REC, NOME:record.NOME});
                  },
                  fields:[
                      {
                          name:"ID_REC",
                          type:"int"
                      },
                      {
                          name:"NOME",
                          type:"text"
                      },
                      {
                          name:"HOME_JERSEY",
                          type:"binary"
                      },
                      {
                          name:"AWAY_JERSEY",
                          type:"binary"
                      },
                      {
                          name:"THIRD_JERSEY",
                          type:"binary"
                      }
                  ]
              }),
              isc.DynamicForm.create({
                  ID:"formTest",
                  width:"100%",
                  heigth:"50%",
                  dataSource:"TEAMS",
                  colNums:4,
                  fields:[
                      {
                          name:"NOME",
                          type:"text"
                      },
                      {
                          name:"HOME_JERSEY",
                          type:"binary",
                          editorType:"FileItem"
                      },
                      {
                          name:"savebutton",
                          type:"button",
                          title:"Save",
                          click: function(){
                              formTest.saveData (function(dsResponse,data){
                                  if(dsResponse.status == 0){
                                      formTest.editNewRecord();
                                      gridTest.invalidateCache();
                                  }
                              });
                          }
                      }
                  ]
              })
          ]
      })

      Last edited by simokris; 29 Nov 2016, 03:15.

      Comment


        #4
        We'll check on this server-side crash. Note that it looks somewhat likely to be Oracle-specific, so you may be able to get further in your development by using any other database.

        As far as allowing multiple FileItems, we agree the docs do not quite explicitly state that only a single FileItem will work. We'll revise how this is explained and expand on how to handle the upload UI for multiple binary fields where MultiFileItem is not the right UI.

        Comment


          #5
          Originally posted by Isomorphic View Post
          We'll check on this server-side crash. Note that it looks somewhat likely to be Oracle-specific, so you may be able to get further in your development by using any other database.
          i tried to make a testcase using MySQL Database and the problem is the same with just a different message:
          Code:
          java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1)
          Click image for larger version

Name:	photo_2016-12-01_16-17-39.jpg
Views:	239
Size:	34.0 KB
ID:	241637


          Log
          Code:
          === 2016-12-01 15:45:27,150 [ec-5] INFO  SQLDriver - [builtinApplication.TEAMS_add] Executing SQL query on 'test' using connection '1691812430':
          INSERT INTO TEAMS (
              AWAY_JERSEY_DATE_CREATED,
              HOME_JERSEY,
              HOME_JERSEY_DATE_CREATED,
              HOME_JERSEY_FILENAME,
              HOME_JERSEY_FILESIZE,
              NOME,
              THIRD_JERSEY_DATE_CREATED
          )
          VALUES
              (
                  '2016-12-01 15:45:27',
                  ?, '2016-12-01 15:45:27',
                  'arrow.png',
                  590,
                  'Team_1',
                  '2016-12-01 15:45:27'
              )
          === 2016-12-01 15:45:27,184 [ec-5] DEBUG SQLDriver - [builtinApplication.TEAMS_add] SequenceMode is not JDBC_DRIVER, skipping search for generated values
          === 2016-12-01 15:45:27,185 [ec-5] DEBUG SQLDriver - [builtinApplication.TEAMS_add] FAILED to execute SQL update in 'test' using connection'1691812430'
          === 2016-12-01 15:45:27,186 [ec-5] WARN  RequestContext - dsRequest.execute() failed:
          java.sql.SQLException: Parameter index out of range (2 > number of parameters, which is 1).
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
              at com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3391)
              at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3376)
              at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3413)
              at com.mysql.jdbc.PreparedStatement.setNull(PreparedStatement.java:3452)
              at com.mysql.jdbc.PreparedStatement.setString(PreparedStatement.java:3954)
              at com.isomorphic.sql.SQLDriver.doUpdate(SQLDriver.java:934)
              at com.isomorphic.sql.SQLDriver.update(SQLDriver.java:840)
              at com.isomorphic.sql.SQLDriver.executeUpdate(SQLDriver.java:1027)
              at com.isomorphic.sql.SQLDataSource.executeNativeUpdate(SQLDataSource.java:598)
              at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:2116)
              at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:449)
              at com.isomorphic.sql.SQLDataSource.executeAdd(SQLDataSource.java:402)
              at com.isomorphic.datasource.DataSource.execute(DataSource.java:2264)
              at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:735)
              at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:652)
              at com.isomorphic.application.AppBase.execute(AppBase.java:493)
              at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:2723)
              at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:230)
              at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:187)
              at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
              at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
              at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
              at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at com.isomorphic.servlet.CompressionFilter._doFilter(CompressionFilter.java:260)
              at com.isomorphic.servlet.BaseFilter.doFilter(BaseFilter.java:88)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
              at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
              at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
              at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
              at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
              at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
              at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
              at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
              at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
              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:222)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
              at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
              at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
              at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
              at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
              at java.lang.Thread.run(Thread.java:745)


          Code to Reproduce:

          SQL:
          Code:
          CREATE TABLE `TEAMS` (
          `ID_REC`  int(10) NOT NULL AUTO_INCREMENT ,
              `NOME` VARCHAR(100) NOT NULL,
              `HOME_JERSEY` LONGBLOB,
              `HOME_JERSEY_FILENAME` VARCHAR(255),
              `HOME_JERSEY_FILESIZE` int(10),
              `AWAY_JERSEY` LONGBLOB,
              `AWAY_JERSEY_FILENAME` VARCHAR(255),
              `AWAY_JERSEY_FILESIZE` int(10),
              `THIRD_JERSEY` LONGBLOB,
              `THIRD_JERSEY_FILENAME` VARCHAR(255),
              `THIRD_JERSEY_FILESIZE` int(10),
              `HOME_JERSEY_DATE_CREATED` DATE,
              `AWAY_JERSEY_DATE_CREATED` DATE,
              `THIRD_JERSEY_DATE_CREATED` DATE,
          PRIMARY KEY (`ID_REC`)
          );

          DataSource:
          Code:
          <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                      ID="TEAMS"
                      tableName="TEAMS"
                      dbName="test"
                      dataSourceVersion="1"
                      serverType="sql"
                      dropExtraFields="false"
          >
              <fmt:bundle basename="i18nMessages" encoding="utf-8"/>
              <fields>
                  <field name="ID_REC" type="sequence" primaryKey="true"/>
                  <field name="NOME" type="text"/>
          
                  <field name="HOME_JERSEY" type="binary"/>
                  <field name="HOME_JERSEY_FILENAME" type="text"/>
                  <field name="HOME_JERSEY_FILESIZE" type="integer"/>
                  <field name="HOME_JERSEY_DATE_CREATED" type="creatorTimestamp"/>
                  <field name="AWAY_JERSEY" type="binary"/>
                  <field name="AWAY_JERSEY_FILENAME" type="text"/>
                  <field name="AWAY_JERSEY_FILESIZE" type="integer"/>
                  <field name="AWAY_JERSEY_DATE_CREATED" type="creatorTimestamp"/>
                  <field name="THIRD_JERSEY" type="binary"/>
                  <field name="THIRD_JERSEY_FILENAME" type="text"/>
                  <field name="THIRD_JERSEY_FILESIZE" type="integer"/>
                  <field name="THIRD_JERSEY_DATE_CREATED" type="creatorTimestamp"/>
              </fields>
          </DataSource>
          JS:

          Code:
          isc.Window.create({
              ID:"windowTest",
              height:500,
              width:1000,
              items:[
                  isc.ListGrid.create({
                      ID:"gridTest",
                      dataSource:"TEAMS",
                      width:"100%",
                      height:"50%",
                      autoFetchData:true,
                      recordClick: function (viewer, record, recordNum, field, fieldNum, value, rawValue){
                          formTest.editRecord({ID_REC:record.ID_REC, NOME:record.NOME});
                      },
                      fields:[
                          {
                              name:"ID_REC",
                              type:"int"
                          },
                          {
                              name:"NOME",
                              type:"text"
                          },
                          {
                              name:"HOME_JERSEY",
                              type:"binary"
                          },
                          {
                              name:"AWAY_JERSEY",
                              type:"binary"
                          },
                          {
                              name:"THIRD_JERSEY",
                              type:"binary"
                          }
                      ]
                  }),
                  isc.DynamicForm.create({
                      ID:"formTest",
                      width:"100%",
                      heigth:"50%",
                      dataSource:"TEAMS",
                      colNums:4,
                      fields:[
                          {
                              name:"NOME",
                              type:"text"
                          },
                          {
                              name:"HOME_JERSEY",
                              type:"binary",
                              editorType:"FileItem"
                          },
                          {
                              name:"savebutton",
                              type:"button",
                              title:"Save",
                              click: function(){
                                  formTest.saveData (function(dsResponse,data){
                                      if(dsResponse.status == 0){
                                          formTest.editNewRecord();
                                          gridTest.invalidateCache();
                                      }
                                  });
                              }
                          }
                      ]
                  })
              ]
          })

          Comment


            #6
            Just to let you know, a developer is assigned to look at this and we will post back soon on this thread

            Comment


              #7
              We have made a change to correct the SQL problem. It will be in builds of SmartClient 10.0 / Smart GWT 5.0 and newer, as of tomorrow

              Comment

              Working...
              X