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



Aug 25, 2012, 11:00 PM
16 Posts

XSP PartialRefresh

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: partial refresh
  • Replies: 2
 Hi,
 I am using the code listed here http://www.eknori.de/2011-04-05/xpages-categorized-view-and-multiple-partial-refresh/ to have a categorized view using repeat controls.  This is working great and will expand and collapse the columns using Partial Refresh and on-complete events.  The issue is I would like to have a link in the secondrepeat control to either partial refresh and third panel (where I have a form) or open a new page using the documentid of the entry in the repeat.  The problem is as the partial refresh is using CSJS is doesn't fire the SSJS on the link.  
 
 
Any ideas?
 
Below is the page source 
 
 <?xml version="1.0" encoding="UTF-8"?>
<xp:view
xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xp:this.data>
<xp:dominoDocument
var="document3"
formName="Contract"
action="openDocument"
documentId="#{javascript:viewScope.UNID}">
</xp:dominoDocument>
</xp:this.data>
<xp:panel id="View">
<xp:this.rendered><![CDATA[#{javascript:if (viewScope.mode==null){
true }
else {
false }}]]></xp:this.rendered>
<xp:table style="width:100.0%">
<xp:tr>
<xp:td style="width:5%"></xp:td>
<xp:td style="width:10%">
<xp:label
value="Region"
id="label1"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
<xp:td style="width:10%">
<xp:label
value="Country"
id="label2"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
<xp:td style="width:10%">
<xp:label
value="Next Activity Resp."
id="label3"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
<xp:td style="width:10%">
<xp:label
value="Vendor"
id="label4"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
<xp:td style="width:10%">
<xp:label
value="No of Subs."
id="label5"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
<xp:td style="width:10%">
<xp:label
value="Spend KEUR/Yr"
id="label6"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
<xp:td style="width:25%">
<xp:label
value="Next Activity Description"
id="label7"
style="font-weight:bold;text-decoration:underline">
</xp:label>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td></xp:td>
<xp:td>
<xp:br></xp:br>
</xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
</xp:tr>
</xp:table>
<xp:repeat
id="repeat1"
rows="30"
var="RowData">
<xp:this.value>
<![CDATA[#{javascript:@DbColumn(@DbName(),"(AllContractsbyNextActivity)",1)}]]>
</xp:this.value>
<xp:panel id="mainpanel">
<xp:image
id="image1"
url="/plus.jpg"
style="height:16.0px;width:16.0px"
rendered="#{javascript:
context.getSubmittedValue()=='hide' || 
context.getSubmittedValue()== null;}">
<xp:eventHandler
event="onclick"
submit="false">
<xp:this.script><![CDATA[var visibility = 'show';
XSP.partialRefreshGet("#{id:mainpanel}", {
  params: {'$$xspsubmitvalue': visibility}, 
  onComplete: function () {
  XSP.partialRefreshGet("#{id:secondpanel}", {
   params: {'$$xspsubmitvalue': visibility}});}
});]]></xp:this.script>
</xp:eventHandler>
</xp:image>
<xp:image
url="/minus.jpg"
id="image2"
style="height:16.0px;width:16.0px"
rendered="#{javascript:context.getSubmittedValue()=='show'}">
<xp:eventHandler
event="onclick"
submit="false">
<xp:this.script><![CDATA[var visibility = 'hide';
XSP.partialRefreshGet("#{id:mainpanel}", {
params: {'$$xspsubmitvalue': visibility}, 
onComplete: function () {
XSP.partialRefreshGet("#{id:secondpanel}", {
  params: {'$$xspsubmitvalue': visibility}});}
});]]></xp:this.script>
</xp:eventHandler>
</xp:image>
<xp:text
escape="true"
id="computedField2"
style="margin-left:5.0px;font-weight:bold">
<xp:this.value><![CDATA[#{javascript:if (RowData) {
RowData }
else {
'- not categorized -'}}]]>
</xp:this.value>
</xp:text>
<xp:br></xp:br>
</xp:panel>
<xp:panel id="secondpanel">
<xp:repeat
rows="30"
var="character"
rendered="#{javascript:context.getSubmittedValue()== 'show'}">
<xp:this.value>
<![CDATA[#{javascript:var tempview:NotesView=database.getView("(AllContractsbyNextActivity)");
return tempview.getAllEntriesByKey(RowData, true);}]]>
</xp:this.value>
<xp:table style="width:100.0%">
<xp:tr>
<xp:td style="width:5%"></xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="region">
<xp:this.value>
<![CDATA[#{javascript:character.getDocument().getItemValueString("Region")}]]>
</xp:this.value>
</xp:text>
</xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="country">
<xp:this.value>
<![CDATA[#{javascript:character.getDocument().getItemValueString("Country")}]]>
</xp:this.value>
</xp:text>
</xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="nextresp">
<xp:this.value><![CDATA[#{javascript:var name:NotesName = session.createName(
character.getDocument().getItemValueString("NextResp"));
return name.getCommon()
}]]></xp:this.value>
</xp:text>
</xp:td>
<xp:td style="width:10%">
<xp:link
escape="true"
id="vendorlink">
<xp:this.text><![CDATA[#{javascript:character.getDocument().getItemValueString("Supplier")}]]></xp:this.text><xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:openPage name="/Contracts_Edit.xsp">
<xp:this.documentId><![CDATA[#{javascript:character.getDocument().getUniversalID()
}]]></xp:this.documentId>
</xp:openPage>
</xp:this.action></xp:eventHandler></xp:link></xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="number">
<xp:this.value><![CDATA[#{javascript:character.getDocument().getItemValueDouble("number")}]]></xp:this.value>
<xp:this.converter>
<xp:convertNumber
type="number"
integerOnly="true">
</xp:convertNumber>
</xp:this.converter>
</xp:text>
</xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="spend">
<xp:this.value><![CDATA[#{javascript:character.getDocument().getItemValueDouble("spend")}]]></xp:this.value>
<xp:this.converter>
<xp:convertNumber
type="number"
integerOnly="true">
</xp:convertNumber>
</xp:this.converter>
</xp:text>
</xp:td>
<xp:td style="width:25%">
<xp:text
escape="false"
id="nextdesc">
<xp:this.value><![CDATA[#{javascript:var contract = character.getDocument().getMIMEEntity("NextDesc")
if (contract!==null){
contract.getContentAsText()} 

}]]></xp:this.value>
</xp:text>
</xp:td>
</xp:tr>
<xp:tr>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td></xp:td>
<xp:td>
<xp:span style="font-weight:bold;text-decoration:underline"></xp:span>
</xp:td>
<xp:td></xp:td>
</xp:tr>
</xp:table>
</xp:repeat>
<xp:table
style="width:100%"
rendered="#{javascript:context.getSubmittedValue()== 'show'}">
<xp:tr>
<xp:td style="width:5%"></xp:td>
<xp:td style="width:10%"></xp:td>
<xp:td style="width:10%"></xp:td>
<xp:td style="width:10%"></xp:td>
<xp:td style="width:10%"></xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="computedField1"
style="font-weight:bold;text-decoration:underline">
<xp:this.value><![CDATA[#{javascript:try {
var View:NotesView = database.getView("(AllContractsbyBusiness)")
var nav:NotesViewNavigator = View.createViewNav();
var entry:NotesViewEntry = View.getEntryByKey(RowData);
entry = nav.getPrev(entry);
if (entry == null) {
}
else {
return entry.getColumnValues()[6]
}
}
catch (e){
}
}]]></xp:this.value>
</xp:text>
</xp:td>
<xp:td style="width:10%">
<xp:text
escape="true"
id="computedField3"
style="font-weight:bold;text-decoration:underline">
<xp:this.value><![CDATA[#{javascript:try {
var View:NotesView = database.getView("(AllContractsbyBusiness)")
var nav:NotesViewNavigator = View.createViewNav();
var entry:NotesViewEntry = View.getEntryByKey(RowData);
entry = nav.getPrev(entry);
if (entry == null) {
}
else {
return entry.getColumnValues()[7]
}
}
catch (e){
}
}]]></xp:this.value>
</xp:text>
<xp:span style="font-weight:bold;text-decoration:underline">€</xp:span>
</xp:td>
<xp:td style="width:25%"></xp:td>
</xp:tr>
</xp:table>
</xp:panel>
</xp:repeat>
</xp:panel>
<xp:text
escape="true"
id="computedField20"
value="#{viewScope.UNID}">
</xp:text>
</xp:view>

Aug 27, 2012, 8:50 PM
586 Posts
Re: XSP PartialRefresh
Not sure I get what the issue is.  You can do a partial Refresh from CSJS using the XSP object.  Is that what you're looking for?
 
 
Sep 10, 2012, 2:32 PM
26 Posts
Re: XSP PartialRefresh
Do you mean that you need to run the SSJS code from Client side ? Please clarify.
 
If that is the question then the below URL would be useful.
 
http://xpagetips.blogspot.in/2011/11/running-ssjs-from-csjs-sometimes-its.html
 
Regards,
Pranesh

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