FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Dec 7, 2011, 8:12 AM
37 Posts

After click Button that generate PDF..other button don't work

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: pdf,xpages,itext,button
  • Replies: 1
 This is my scenario:
 
I have a Xpages with 2 button 
 
1) Button that go in Edit Mode the Datasouce 
2) Button that create with Itext in fly the PDF (I have used this example Enkory code )
 
After that I press the 2nd button (PDF Create) the other button doesn't work... 
 
Have you any suggest? 
Dec 8, 2011, 10:05 AM
57 Posts
Re: After click Button that generate PDF..other button don't work
A working example NSF for download here:
http://www.lotususergroup.org/glug.nsf/ef61d6610bf536f886256fcc006a0098/902de37200ef69b0862577840040e7a7?OpenDocument
 
the reason all buttons become invalid is that you are using server side function on the second button opening the export page. Once server side submit is made, current page is submitted to go through JSF lifecycle and render response is never invoked on the current page( If you have phase listener, you will see that ) without rendering response, the current page are destroyed.try this
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:button value="Label" id="button1">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="norefresh">
            <xp:this.action><![CDATA[#{javascript:facesContext.responseComplete();}]]></xp:this.action>
        </xp:eventHandler>
    </xp:button>
</xp:view>

 -----------------------------------
 Change your second button to something like this then it should work
<xp:button value="Export" id="button2">
        <xp:eventHandler event="onclick" submit="false">
            <xp:this.script><![CDATA[document.location = "ExportSomething.xsp"]]></xp:this.script>
         </xp:eventHandler>
</xp:button>
 
I have been trying to make a proxy servlet work instead of using an extra page as above
/Extlib/XPagesSBT.nsf/xsp/.proxy/ping 
 
but after reading Niklas Heidloff's Sample servlet and updateSite.nsf + the proxy API in extension library, I still can't pull things together, to create our own servlet and make it OSGI bundle being loaded when server is started is something new for me. So If anyone go through this, please give me a hand here to kick start
 
regards
wei

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.