user2215700
user2215700

Reputation: 13

XSP.partialRefresh

ENVIRONMENT: client + server = 8.5.3 with extension library.

I have a button when clicked runs a SSJS and partially refreshes a div (div1)

Now I have to update few more divs (div2,div3,....) on same form. I have tried the following code as CSJS with onclick() of the same button but it does nothing.

XSP.partialRefreshGet("#{id:div1}", {
   onComplete: function() {
      XSP.partialRefreshGet("#{id:div2}", {
        onComplete: function() {}
      });
   }
});

would appreciate any response to help solve this issue.

Upvotes: 1

Views: 1642

Answers (1)

Paul Stephen Withers
Paul Stephen Withers

Reputation: 15729

Putting the XSP.partialRefreshGet on the onclick of the button means it runs before the SSJS. Is that what you want? I suspect you probably want it to run after the SSJS, so in the source pane select the eventHandler and put your code on the onComplete event of the eventHandler. That will run after the SSJS completes.

I can't confirm whether or not there are problems in your XSP.partialRefreshGet, but I believe any CSJS on a button needs to return true, or the SSJS doesn't run. If you move it to the onComplete you will not need to worry about that though.

Upvotes: 7

Related Questions