Announcement

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

    MultiFileItem not uploading on newly created master record

    v9.1p_2014-03-11/Pro Deployment (built 2014-03-11)

    I have a form with a MultiFileItem and it works fine when I'm editing an existing master record, but not when I'm creating a new master record. When I call form.saveData() on a new record it creates an add operation on the form DS and then a fetch operation on the MultiFileItem DS.

    The master record id is being returned in the add operation response.

    In the docs it says the following, but I don't understand what the last part (bolded) means...:
    "If the master record is being newly created, files are not actually uploaded until after the master record is confirmed saved,and the list of fields shown in the main form reflects files which will be uploaded after the master record is saved. "



    MultiFileItem DS:
    Code:
    <DataSource  
        ID="scrum_backlog_userStoryFiles"
        serverConstructor="it.forecast.server.servlets.scrum.userStories.UserStoryFilesServlet">
        <fields>
             <field name="fileId" type="sequence" primaryKey="true" hidden="true"/>
             <field name="masterRecordId" type="number" foreignKey="scrum_backlog_userStoryDetails.id" hidden="true"/>
             <field name="file" type="binary" title="File"/>
             <field name="user" type="text" title="User" hidden="true"/>
          </fields>
    </DataSource>
    Form DS:
    Code:
    <DataSource  
    	ID="scrum_backlog_userStoryDetails"
    	serverConstructor="it.forecast.server.servlets.scrum.userStories.UserStoryDetailsServlet">
    	<fields>  
    		<field name="id"                      type="sequence"      hidden="true"                         primaryKey="true"       />
    		<field name="userStoryType"           type="integer"       title="Type"                          required="true"         />
    		<field name="userStoryId"             type="text"          title="Id"        	                                         />
    		<field name="title"                   type="text"          title="Title"	length="255"         required="true"         />
    		<field name="role"                    type="text"          title="As a"	    length="255"         required="false"        />
    		<field name="goal"                    type="text"          title="I want"   length="1000"        required="false"        />
    		<field name="benefit"                 type="text"          title="so that"  length="1000"        required="false"        />
    		<field name="acceptanceCriteria"      type="text"		   title="Acceptance Criteria" length="3000" required="false"    />
    		<field name="owners"                  type="enum"          title="Owners"                        required="true"         />
    		<field name="timeLeft"                type="integer"       title="Time Left"                     				         />
    		<field name="minutesWorked"           type="text"          title="Time Registered"                    			         />
    		<field name="minutesWorkedString"     type="text"          title="Time Registered"                    			         />
    		<field name="estimate"                type="integer"       title="Estimated Points"   length="9"      				         />
    		<field name="taskEstimate"            type="integer"       title="Task Estimate"    	      	   				         />
    		<field name="sprint"                  type="integer"       title="Sprint"                        					     />
    		<field name="epic"                    type="text"          title="Epic"     length="255"								 />
    		<field name="completionDate"          type="date"          title="Completion Date"     dateFormatter="toEuropeanShortDate"	 />
    		<field name="linkedEstimate"		  type="integer"       title="Linked Estimate"                    			         />
    	</fields>
    </DataSource>
    MultiFileItem:
    Code:
    MultiFileItem files = new MultiFileItem("files", "File Attachments");
    files.setWidth(fieldWidth);
    files.setAttribute("dataSource", "scrum_backlog_userStoryFiles");
    files.setTitleOrientation(TitleOrientation.TOP);
    files.setIconVAlign(VerticalAlignment.TOP);
    files.setColSpan(4);
    Do I need to do anything special for this to work?
    Like I said it works fine for existing master records.

    Let me know if you need any more information.

    /Tilds

    #2
    The docs are correct: first the new master record is saved, then related records for the uploaded files are saved.

    So first step is to look at the usual diagnostics (RPC tab of Developer Console, server logs) to see if the master record was indeed saved successfully.

    Comment


      #3
      The RPC tab shows Status: SUCCESS on the form's add operation, and a line is correctly added in the database...

      Comment


        #4
        Just to clarify, we're not seeing a general problem with this feature, so we need all the details usually required to be able to figure out what is going wrong specifically for you: server logs, RPC tab contents, Developer Console "Results" tab contents, browser(s) affected, etc.

        Comment


          #5
          Server Logs:
          Code:
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Host:127.0.0.1:8888
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Accept-Language:en-US,en;q=0.5
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Accept-Encoding:gzip, deflate
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Referer:http://127.0.0.1:8888/Application.html?gwt.codesvr=127.0.0.1:9997
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Cookie:GLog=%7B%0D%20%20%20%20left%3A242%2C%20%0D%20%20%20%20top%3A19%2C%20%0D%20%20%20%20width%3A1611%2C%20%0D%20%20%20%20height%3A848%2C%20%0D%20%20%20%20priorityDefaults%3A%7B%0D%20%20%20%20%20%20%20%20Log%3A4%2C%20%0D%20%20%20%20%20%20%20%20resize%3A3%2C%20%0D%20%20%20%20%20%20%20%20testReplay%3A3%0D%20%20%20%20%7D%2C%20%0D%20%20%20%20defaultPriority%3A3%2C%20%0D%20%20%20%20trackRPC%3Atrue%0D%7D; EMP_SESSION_ID=a08f5e28-2464-4163-aa3c-02a23ae45c13; JSESSIONID=e90zhrdxaafg; skin_name=Forecast
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Connection:keep-alive
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Cache-Control:no-cache
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Content-Type:application/x-www-form-urlencoded; charset=UTF-8
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Content-Length:1341
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - Header Name:Value pair: Pragma:no-cache
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - session exists: e90zhrdxaafg
          === 2014-04-11 10:22:12,492 [0-14] DEBUG IDACall - remote user: null
          === 2014-04-11 10:22:12,493 [0-14] INFO  RequestContext - URL: '/forecast/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0': Moz (Gecko) with Accept-Encoding header
          === 2014-04-11 10:22:12,493 [0-14] WARN  RPCManager - client/server version mismatch.  Client is version: v9.1p_2014-03-11, server is version: v9.0p_2013-08-16 - mixing different client/server versions is generally not supported.  If you've installed a more recent client version, try clearing the browser cache and reloading the page.
          === 2014-04-11 10:22:12,495 [0-14] DEBUG XML - Parsed XML from (in memory stream): 2ms
          === 2014-04-11 10:22:12,496 [0-14] DEBUG RPCManager - Processing 1 requests.
          === 2014-04-11 10:22:12,496 [0-14] DEBUG DSRequest - Caching instance 88 of DS scrum_backlog_userStoryDetails from DSRequest.getDataSource()
          === 2014-04-11 10:22:12,496 [0-14] DEBUG RPCManager - Request #1 (DSRequest) payload: {
              values:{
                  sessionId:"a08f5e28-2464-4163-aa3c-02a23ae45c13",
                  projectId:17,
                  sprint:269,
                  owners:[
                      19
                  ],
                  userStoryType:15,
                  title:"test"
              },
              operationConfig:{
                  dataSource:"scrum_backlog_userStoryDetails",
                  operationType:"add",
                  textMatchStyle:"exact"
              },
              componentId:"AddUserStoryForm",
              appID:"builtinApplication",
              operation:"scrum_backlog_userStoryDetails_add",
              oldValues:{
              },
              criteria:{
              }
          }
          === 2014-04-11 10:22:12,496 [0-14] INFO  IDACall - Performing 1 operation(s)
          === 2014-04-11 10:22:12,496 [0-14] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
          === 2014-04-11 10:22:12,496 [0-14] DEBUG DeclarativeSecurity - DataSource scrum_backlog_userStoryDetails is not in the pre-checked list, processing...
          === 2014-04-11 10:22:12,496 [0-14] DEBUG AppBase - [builtinApplication.scrum_backlog_userStoryDetails_add] No userTypes defined, allowing anyone access to all operations for this application
          === 2014-04-11 10:22:12,496 [0-14] DEBUG AppBase - [builtinApplication.scrum_backlog_userStoryDetails_add] No public zero-argument method named '_scrum_backlog_userStoryDetails_add' found, performing generic datasource operation
          === 2014-04-11 10:22:13,567 [0-14] INFO  DSResponse - [builtinApplication.scrum_backlog_userStoryDetails_add] DSResponse: Map with 27 keys
          === 2014-04-11 10:22:13,567 [0-14] ERROR DataSource - [builtinApplication.scrum_backlog_userStoryDetails_add] Autogenerated audit is available only for Enterprise licenses.
          === 2014-04-11 10:22:13,567 [0-14] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
          === 2014-04-11 10:22:13,567 [0-14] DEBUG RPCManager - non-DMI response, dropExtraFields: false
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Host:127.0.0.1:8888
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Accept-Language:en-US,en;q=0.5
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Accept-Encoding:gzip, deflate
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Referer:http://127.0.0.1:8888/Application.html?gwt.codesvr=127.0.0.1:9997
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Cookie:GLog=%7B%0D%20%20%20%20left%3A242%2C%20%0D%20%20%20%20top%3A19%2C%20%0D%20%20%20%20width%3A1611%2C%20%0D%20%20%20%20height%3A848%2C%20%0D%20%20%20%20priorityDefaults%3A%7B%0D%20%20%20%20%20%20%20%20Log%3A4%2C%20%0D%20%20%20%20%20%20%20%20resize%3A3%2C%20%0D%20%20%20%20%20%20%20%20testReplay%3A3%0D%20%20%20%20%7D%2C%20%0D%20%20%20%20defaultPriority%3A3%2C%20%0D%20%20%20%20trackRPC%3Atrue%0D%7D; EMP_SESSION_ID=a08f5e28-2464-4163-aa3c-02a23ae45c13; JSESSIONID=e90zhrdxaafg; skin_name=Forecast
          === 2014-04-11 10:22:15,117 [0-14] DEBUG IDACall - Header Name:Value pair: Connection:keep-alive
          === 2014-04-11 10:22:15,118 [0-14] DEBUG IDACall - Header Name:Value pair: Cache-Control:no-cache
          === 2014-04-11 10:22:15,118 [0-14] DEBUG IDACall - Header Name:Value pair: Content-Type:application/x-www-form-urlencoded; charset=UTF-8
          === 2014-04-11 10:22:15,118 [0-14] DEBUG IDACall - Header Name:Value pair: Content-Length:1470
          === 2014-04-11 10:22:15,118 [0-14] DEBUG IDACall - Header Name:Value pair: Pragma:no-cache
          === 2014-04-11 10:22:15,118 [0-14] DEBUG IDACall - session exists: e90zhrdxaafg
          === 2014-04-11 10:22:15,118 [0-14] DEBUG IDACall - remote user: null
          === 2014-04-11 10:22:15,118 [0-14] INFO  RequestContext - URL: '/forecast/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0': Moz (Gecko) with Accept-Encoding header
          === 2014-04-11 10:22:15,120 [0-14] DEBUG XML - Parsed XML from (in memory stream): 2ms
          === 2014-04-11 10:22:15,121 [0-14] DEBUG RPCManager - Processing 1 requests.
          === 2014-04-11 10:22:15,121 [0-14] DEBUG DSRequest - Caching instance 180 of DS scrum_backlog_userStoryFiles from DSRequest.getDataSource()
          === 2014-04-11 10:22:15,121 [0-14] DEBUG RPCManager - Request #1 (DSRequest) payload: {
              criteria:{
                  sessionId:"a08f5e28-2464-4163-aa3c-02a23ae45c13",
                  user:19,
                  masterRecordId:646
              },
              operationConfig:{
                  dataSource:"scrum_backlog_userStoryFiles",
                  operationType:"fetch",
                  textMatchStyle:"exact"
              },
              startRow:0,
              endRow:75,
              componentId:"isc_MultiFileItem_3_canvas",
              appID:"builtinApplication",
              operation:"scrum_backlog_userStoryFiles_fetch",
              oldValues:{
                  sessionId:"a08f5e28-2464-4163-aa3c-02a23ae45c13",
                  user:19,
                  masterRecordId:646
              }
          }
          === 2014-04-11 10:22:15,121 [0-14] INFO  IDACall - Performing 1 operation(s)
          === 2014-04-11 10:22:15,122 [0-14] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
          === 2014-04-11 10:22:15,122 [0-14] DEBUG DeclarativeSecurity - DataSource scrum_backlog_userStoryFiles is not in the pre-checked list, processing...
          === 2014-04-11 10:22:15,122 [0-14] DEBUG AppBase - [builtinApplication.scrum_backlog_userStoryFiles_fetch] No userTypes defined, allowing anyone access to all operations for this application
          === 2014-04-11 10:22:15,122 [0-14] DEBUG AppBase - [builtinApplication.scrum_backlog_userStoryFiles_fetch] No public zero-argument method named '_scrum_backlog_userStoryFiles_fetch' found, performing generic datasource operation
          === 2014-04-11 10:22:15,168 [0-15] INFO  Download - Returning 304: Not modified on conditional get of: D:\Workspaces\20130114\cloud_web\war\forecast\sc\skins\Forecast\images\loadingSmall.gif
          === 2014-04-11 10:22:15,168 [0-13] INFO  Download - Returning 304: Not modified on conditional get of: D:\Workspaces\20130114\cloud_web\war\forecast\sc\skins\Forecast\images\Scrollbar\vthumb_grip.png
          === 2014-04-11 10:22:15,238 [0-14] INFO  DSResponse - [builtinApplication.scrum_backlog_userStoryFiles_fetch] DSResponse: List with 0 items
          === 2014-04-11 10:22:15,238 [0-14] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
          === 2014-04-11 10:22:15,238 [0-14] DEBUG RPCManager - non-DMI response, dropExtraFields: false
          RPC Tab:
          Add Operation RPCRequest
          Code:
          {
              "actionURL":"http://127.0.0.1:8888/forecast/sc/IDACall", 
              "showPrompt":true, 
              "prompt":"Saving form...", 
              "transport":"xmlHttpRequest", 
              "promptStyle":"cursor", 
              "bypassCache":true, 
              "data":{
                  "values":{
                      "sessionId":"a08f5e28-2464-4163-aa3c-02a23ae45c13", 
                      "projectId":17, 
                      "sprint":269, 
                      "owners":[
                          19
                      ], 
                      "userStoryType":15, 
                      "title":"test"
                  }, 
                  "operationConfig":{
                      "dataSource":"scrum_backlog_userStoryDetails", 
                      "repo":null, 
                      "operationType":"add", 
                      "textMatchStyle":"exact"
                  }, 
                  "componentId":"AddUserStoryForm", 
                  "appID":"builtinApplication", 
                  "operation":"scrum_backlog_userStoryDetails_add", 
                  "oldValues":{
                  }
              }
          }
          Add Operation DSRequest:
          Code:
          {
              dataSource:"scrum_backlog_userStoryDetails", 
              operationType:"add", 
              componentId:"AddUserStoryForm", 
              data:{
                  sessionId:"a08f5e28-2464-4163-aa3c-02a23ae45c13", 
                  projectId:17, 
                  sprint:269, 
                  owners:[
                      19
                  ], 
                  userStoryType:15, 
                  title:"test"
              }, 
              textMatchStyle:"exact", 
              callback:{
                  target:[DynamicForm ID:AddUserStoryForm], 
                  methodName:"saveEditorReply"
              }, 
              showPrompt:true, 
              prompt:"Saving form...", 
              oldValues:{
              }, 
              requestId:"scrum_backlog_userStoryDetails$62737", 
              internalClientContext:{
              }, 
              fallbackToEval:false, 
              afterFlowCallback:"AddUserStoryForm.$49z(dsRequest, dsResponse, data)", 
              editor:[DynamicForm ID:AddUserStoryForm], 
              lastClientEventThreadCode:"MUP6", 
              bypassCache:true
          }
          Add Operation Raw Response:
          Code:
          [
              {
                  data:{
                      tags:[
                      ], 
                      userStoryTypeColor:"#231F20", 
                      statusName:"To Do", 
                      sprintName:"Sprint 21", 
                      userStoryType:15, 
                      estimate:0, 
                      oldSprintId:-1, 
                      userStoryId:400, 
                      id:646, 
                      statusId:17, 
                      epic:"", 
                      title:"test", 
                      minutesWorked:0, 
                      sprintId:269, 
                      taskEstimate:0, 
                      priority:25, 
                      owner:[
                          19
                      ], 
                      timeLeft:0, 
                      sprint:269, 
                      owners:[
                          19
                      ], 
                      minutesWorkedString:"0h 00m", 
                      completionDate:""
                  }, 
                  invalidateCache:false, 
                  isDSResponse:true, 
                  operationType:"add", 
                  queueStatus:0, 
                  status:0
              }
          ]
          Results Tab: (Logging Preferences are all set to Warn. Let me know if you need specific preferences.)
          Code:
          10:21:33.724:MUP1:WARN:MultiFileItem:isc_MultiFileItem_3[files]:CanvasItem: files defined with no canvas property - creating a default canvas for this item.
          10:21:35.263:XRP9:WARN:fetchMissingValues:isc_SelectItem_18[owners]:FetchMissingValues - filterLocally is false yet optionDataSource fetch included records that do not match our current data value. Ignoring these values.
          10:21:36.110:XRP0:WARN:fetchMissingValues:isc_SelectItem_17[sprint]:FetchMissingValues - filterLocally is false yet optionDataSource fetch included records that do not match our current data value. Ignoring these values.
          The problem doesn't seem to be browser specific. It appears in both Firefox 25 and Chrome 33.

          Let me know if you need more info.

          Comment


            #6
            One thing jumps out from these logs:
            === 2014-04-11 10:22:12,493 [0-14] WARN RPCManager - client/server version mismatch. Client is version: v9.1p_2014-03-11, server is version: v9.0p_2013-08-16 - mixing different client/server versions is generally not supported. If you've installed a more recent client version, try clearing the browser cache and reloading the page.
            This appears that you have got (severely) mismatched client and server jars. When you update, to a new SmartGWT version, you need to install all the jars under the "lib" dir, (cleaning out all the old versions). At a guess this indicates you updated just smartgwt.jar / smartgwtee.jar / smartgwt-skins.jar and left the other jars in place from an older install.

            If that doesn't resolve the problem for you, we'll probably need to see a little EntryPoint class that demonstrates the problem which we can run on our end.
            After all this is working in general (see the relevant showcase example: here)

            Thanks
            Isomorphic Software

            Comment


              #7
              Okay the version issue has now been resolved, but unfortunately it did not solve the problem.

              The only difference I see between my own MultiFileItem and the one in the showcase is that the showcase uses datasources with serverType="sql" and I'm using Custom Datasources with serverConstructor="className" could that have anything to do with it?

              I'll try to create a small example that you can run.

              Comment

              Working...
              X