This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Nov 18, 2012, 6:35 PM
43 Posts

XSP Partial Refresh to call EventHandler

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 0
 Hi,
 
I need to run a client side script before handling my query to event handler(Basically I am using this in XPage Menu Custom Control) but here is a small example which is still not working..Any helps would be really appreciated.. 
 
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:button value="click me" id="button1">
        <xp:eventHandler event="onclick" submit="false">
        <xp:this.script><![CDATA[alert("Hi");

        var myParameter = "newsave";
XSP.partialRefreshGet("#{id:onfoobar}", {
      params: {
            '$$xspsubmitvalue': myParameter
      },onComplete: function () {
      alert("finished")
      }
        });]]></xp:this.script>

        </xp:eventHandler>
</xp:button>
    <xp:eventHandler event="onfubar" id="dostuff2" submit="true"
    refreshId="dostuff" refreshMode="complete">
    <xp:this.action><![CDATA[#{javascript:var m= context.getSubmittedValue();
if(m=="newsave"){
var link:XSPUrl=context.getUrl();
if(context.getUrlParameter("link"))
link.removeParameter("link");
view.postScript("window.open('" + "www.google.com" + "','_self','','')");}}]]></xp:this.action>
  </xp:eventHandler>
</xp:view>
 
Eager to hear some response..! 
 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal