On an XPage I have a dojo.dijitree module which uses a Notes View as the datastore.
I have the universal ID of the referring document available for each item in my tree widget.
What I would like to do know is when some clicks on an item that a part of the content on the XPage gets refreshed with a part (data field) of the referring document. But I am not sure how to do this.
The only thing I have is an onclick event on my tree-item.
When I have have a button with the partical refresh enabled it says:
<xp:eventHandler event=”onclick” submit=”true” refreshMode=”partial” refreshId=”PaneToRefresh”>
Then I can place an server side action like:
<xp:this.action>
<xp:executeScript>
<xp:this.script><![CDATA[#{javascript:alert(“hi”);}]]></xp:this.script>
</xp:executeScript>
</xp:this.action>
If I place this action under my script I get the problem indication:
The markup tag script can only contain controls and markup tags.
So if you have a clue how to place a partial refresh under a ‘normal’ script that collects data from a document somewhere else then I would be greatful to hear it from you…
Cheers
What I do is have a button (for example named “refreshnow_button”) set up to do the partial refresh i want, with the following CSS to hide the button from the user:
z-index:99;left:0;top:0;position:absolute;display:none;
then, when I want to do the partial refresh from a client side script, i enter the following in the “client” event:
dojo.byId(“#{javascript:getClientId(‘refreshnow_button’)}”).click() … wallah …
depending on what (else) is going on around it in the script, you might find it helpful to put it in a setTimeout() as well, which will execute the script in X milliseconds, like this:
setTimeout(“dojo.byId(\”#{javascript:getClientId(‘refreshnow_button’)}\”).click()”, 1000)
Hope that Helps!
… hmm … obviously the “… wallah …” is not part of the code π
hej Jeremy, thanks for the tip but it does not seem to work for me (yet).
I just have added a simple alert() command under the button. pushing the button straight causes the alert to occur, but trying to call the alert by invoking the button via a script does not seem to work π
probably i am doing something wrong here…
Patrick, I’ll give you a hint:
XSP._firePartialRefreshEvent(“axfull”,””, “”,targetId,””,””,targetId,””,true,true,true);
I’m not sure why the ID to be refreshed has to be passed twice, but it does.
Tim … I don’t believe that the _firePartialRefreshEvent(…) is _forward_ compatible…