Announcement

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

    sending additional params with fetchData request

    I have the follwing code that gets fired when I want to fetch for a particular listgrid. How do I modify it so that the request that comes into the server has custom parameters? I've tried adding params:{'tset':'test'} but I dont receive it as part of the Request object and it is not part of the actionUrl either.

    Code:
          list.fetchData(null, null,{showPrompt:false});

    #2
    "params" is the correct way to do this, there may have simply been something wrong with your syntax.

    However, as a reminder, it's very very rare that it would be valid to do this. If you are adding something that affects the data that is returned, it *must* be part of the criteria or the operationId or you will interfere with the ability to do correct caching.

    Comment


      #3
      Nothing to do with data processing - we are trying to implement multi-session support in our product and we would like to pass in the session id as part of the action request before we actually process the request. Could you provide a sample code on how to do this please?

      Comment


        #4
        Code:
              list.fetchData(null, null,{
                     showPrompt:false,
                     params : { paramName : "paramValue" }
              });

        Comment


          #5
          Ok - I tried that exact script and I don't see the params as part of the ds request - here's what I see in the jsconsole:

          Code:
          {
              "dataSource":"page$applicationGroup$2$$content$appGroupIterator$2$appGroupFrame$selectAppTable$ds", 
              "operationType":"fetch", 
              "componentId":"page$applicationGroup$2$$content$appGroupIterator$2$appGroupFrame$selectAppTable", 
              "data":{
              }, 
              "startRow":0, 
              "endRow":75, 
              "textMatchStyle":"exact", 
              "resultSet":[ResultSet ID:isc_ResultSet_2 (created by: page$applicationGroup$2$$content$appGroupIterator$2$appGroupFrame$selectAppTable)], 
              "callback":{
                  "caller":[ResultSet ID:isc_ResultSet_2 (created by: page$applicationGroup$2$$content$appGroupIterator$2$appGroupFrame$selectAppTable)], 
                  "methodName":"fetchRemoteDataReply"
              }, 
              "willHandleError":true, 
              "showPrompt":false, 
              "prompt":"Finding records that match your criteria...", 
              "oldValues":{
              }, 
              "clientContext":{
                  "requestIndex":1
              }, 
              "requestId":"page$applicationGroup$2$$content$appGroupIterator$2$appGroupFrame$selectAppTable$ds$6272"
          }
          Here's the properties of the listgrid

          Code:
          Evaluator: result of 'page$applicationGroup$0$$content$appGroupIterator$0$appGroupFrame$selectAppTable' (1ms):
          TileGrid{tileSize: 120,
          tilesPerLine: 4,
          showEdges: false,
          wrapValues: true,
          tileValueAlign: "left",
          overflow: "visible",
          tileValueStyle: "cwAppPageLabel",
          fastCellUpdates: false,
          cwFirstFocusableFilterField: "getApplicationLabel",
          groupStartOpen: "first",
          wrapCells: true,
          fixedRecordHeights: false,
          dataSource: "page$applicationGroup$0$$content$appGrou..."[83],
          validateOnChange: true,
          dataProperties: Obj,
          ID: "page$applicationGroup$0$$content$appGrou..."[80],
          cwID: "appGroupTopLayout$layoutWrapper$Horizont..."[63],
          autoFitData: "vertical",
          autoFitMaxHeight: 900,
          autoFitMaxRecords: 500,
          hoverStyle: "CwHoverStyle",
          recordBaseStyleProperty: "velocityRowStyle",
          cwSelMethod: "onApplicationClick",
          neverValidate: true,
          modalEditing: true,
          canSelectText: true,
          selectOnEdit: true,
          willHandleErrors: true,
          autoFetchData: false,
          canSort: true,
          selectionProperty: "$isCwSelected",
          headerButtonProperties: Obj,
          width: 560,
          height: 100,
          fields: Array[1],
          canEdit: false,
          position: "absolute",
          left: 108,
          tiles: Array[2],
          detailViewer: [DetailViewer ID:page$applicationGroup$0$$content$appGroupIterator$0$appGroupFrame$selectAppTable_detailViewer],
          originalFields: Array[0],
          completeFields: Array[1],
          membersMargin: 10,
          parentElement: [HStack ID:page$applicationGroup$0$$content$appGroupIterator$0$appGroupFrame$HorizontalLayout],
          topElement: [VStack ID:page$$vLayout],
          tabIndex: 2292,
          cacheOffsetCoords: true,
          zIndex: 200558,
          data: [ResultSet ID:isc_ResultSet_0 (created by: page$applicationGroup$0$$content$appGroupIterator$0$appGroupFrame$selectAppTable)],
          selection: [Selection ID:page$applicationGroup$0$$content$appGroupIterator$0$appGroupFrame$selectAppTable_selection],
          children: Array[3],
          }

          Comment


            #6
            You're doing list.fetchData(). If "list" is a ListGrid, whether params work or not depends on whether the ResultSet has already been created. If it has, you can't change the params on the fly.

            This again is related to caching. We would strongly recommend moving the information you need into criteria or the operationId.

            Comment


              #7
              ah, ok I see - params works as long as the properties are there the first time this listgrid is loaded. thanks

              Comment

              Working...
              X