Announcement

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

    force 2 fetch on same DataSource

    Smartclient - v8.3p_2013-02-19/LGPL Deployment

    I'm trying to fetch more than one time on a same DataSource, each one from a different button because I need 2 different callbacks depending on what button is pressed for this fetch. both fetch apply a filter, and the result is what I need to be able to export it. So I would like to know how can I force that the Fetch is done, as the second time it interpretates that is allready done and doesn't do it.

    My code

    Code:
    isc.SDPListGrid.create({
        ID: "empList_$$",
        width:"100%",
        autoDraw:false,
        hidden:true,
        hiddenParent: this,
        dataSource: ELDSID
    });
    
    isc.SDPToolButton.create({
           ID:"buttonexport_$$",
           icon: "fileimages/export_text-icon.png",
           title: "system.exportList@$",
           action:function (){
                empList_$$.fetchData(null,
                function(response){
                    response.data  =empListDS_$$.applyFilter(response.data,advancedFilter_$$.getCriteria());
                    serverCallList(response.data);
                });
           }
        });
    
     isc.SDPToolButton.create({
           ID:"navExport_$$",
           icon: "fileimages/export_text-icon.png",
           title: "system.exportDetail@$",
           action:function (){
                empList_$$.fetchData(null,
                function(response){
                    response.data  =empListDS_$$.applyFilter(response.data,advancedFilter_$$.getCriteria());
                    serverCall(response.data);
                });
           }
        });
        
        function serverCall(responseData){
             isc.RPCManager.sendRequest({
                params:{
                    data:responseData
                   },
                callback: function c(response) {
                    return true;  
                },
                actionURL: "WebDesktop.jsf?method=Employee.exportdetail"
            })
            
        }
        
        function serverCallList(responseData){
             isc.RPCManager.sendRequest({
                params:{
                    data:responseData
                   },
                callback: function c(response) {
                    return true;  
                },
                actionURL: "WebDesktop.jsf?method=Empcontract.export"
            })
            
        }
        
    isc.SDPFilterDynamicForm.create({
        ID:"filterUpdater_$$",
        dataSource: EMPLISTSELDS,
        recordSelector:filterSelector_$$,
        advancedFilter:advancedFilter_$$
    }),

    #2
    If you are trying to fetch data that will not be displayed in the grid, use DataSource.fetchData().

    Comment


      #3
      Hi again,

      I found now in another issue where yes I need to fetch and show everytime the button is clicked.. how can I handle this now?

      Comment


        #4
        ?

        The same way.

        If there's something different about this other circumstance, please explain why the solution already provided does not apply.

        Comment


          #5
          well, before I didn't have to show the result of the new fetch(it was for server use only). In this case the result of the Fetch must be shown on a new window. It works the first time, but when I try to apply the fetch for a second time(after clicking on a button) the window that was closed, doesn't get the data. The fetch is done, but it's not being shown on the new window.

          Comment


            #6
            Sorry, that's way to vague for us to help. Try adding *much* more details; some basics would include:

            1. the API you are calling

            2. why you think a fetch is performed

            3. what do you mean by window - browser window or SmartClient Window widget?

            4. what specific widget is supposed to be populated with data?

            Also, do not just answer the above questions, try to provide all the details we might need to answer your question.

            Comment

            Working...
            X