XSP.partialRefreshGet - Not sending values and not triggering events
-
12-06-2021 - |
سؤال
Spent a couple of hours on this now and I'm at my end of the rope here...
Could someone please tell why the below isn't working:
Just created a fresh database on a Domino 8.5.3 server all default settings.
What I expect to happen is that "$$xspsubmitvalue" should contain "whatYouWantToSendHere", but it's empty.
I'm using the URL to open the XPage: /fresh.nsf/test.xsp?Open&Login
This is the request URL after pushing the button:
/fresh.nsf/test.xsp?Open&Login&$$ajaxid=view%3A_id1%3ArefreshMe
and this is the form data:
$$viewid:!d6g1y5acmu!
$$xspsubmitid:view:_id1:_id2
$$xspexecid:
**$$xspsubmitvalue:**
$$xspsubmitscroll:0|0
view:_id1:view:_id1
Would highly appreciate some input!
Thanks!
/J
SourceCode
المحلول
Well, first, I believe you have an extra ",{}" in there at the end of the call to the partialRefreshGet function - partialRefreshGet only takes two parameters, the ID and the options object, but that isn't your issue.
The problem is that you have this is all happening inside a button that is also doing a partial refresh - since partial refreshes are asynchronous, and only one partial refresh can happen at a time, your code to execute the partial is conflicting with the button click's action to do a partial. Set submit="false" on your button and see if it works.
نصائح أخرى
The code of your button is "corrupt": It fires a partial refresh, and the CSJS code will never be executed.
Change this
<xp:eventHandler
event="onclick"
submit="true"
refreshMode="partial"
refreshId="refreshMe">
to this
<xp:eventHandler event="onclick" submit="false">
then it will work as required.
EDIT
Normal CSJS code will be executed, but not the CSJS based partial refresh because of an internal blocking ( a timestamp stored in XSP.lastSubmit ).