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



Apr 6, 2012, 8:56 PM
4 Posts
topic has been resolvedResolved

Can't get value of computed field in repeat control to put in scope variable via ssjs

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: SSJS repeat control computed field
  • Replies: 5
How do you access the value of a computed field (that is in a repeat control) with SSJS?
 
Apr 7, 2012, 12:31 PM
17 Posts
Re: Can't get value of computed field in repeat control put in scope variable via ssjs
Hi Jeff,
I have set up a small demo that you can just copy & paste - Page1 linking to Page2, passing a value in sessionScope and displaying it in a label:
 
Page1 source:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:link escape="true" text="Link" id="link1" value="/Page2.xsp">
        <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
            <xp:this.action><![CDATA[#{javascript:sessionScope.test = "Test value"}]]></xp:this.action>
</xp:eventHandler></xp:link>
</xp:view>

 
Page2 source:
 <?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:label value="#{javascript:sessionScope.test}" id="label1">
    </xp:label>
</xp:view>
 
HTH
Apr 7, 2012, 12:44 PM
4 Posts
Re: Can't get value of computed field in repeat control to put in scope variable via ssjs
Thanks Rick, you answered my question precisely as I stated in my goal.  Unfortunately, I didn't  state what I am really struggling with very clearly.
The value I want to pass is in a computed field within a repeat control.  So I need to capture what that computed field turned out to be in an on click event.
I am also having some trouble getting my button to work within the repeat control.  I have successfully built a link via SSJS when the page renders within the repeat but it's capturing information after the page renders and I get a user event that I cannot seem to get working.
 
Apr 7, 2012, 1:08 PM
17 Posts
Re: Can't get value of computed field in repeat control to put in scope variable via ssjs
Jeff,
then I would rather use request parameters passed in an URL (as the parameters in a GET request).
But I have tried the same - setting a sessionScope variable in a button placed in a repeat row - and it works, too.
No tricks should be required ... What is the error? Can you share your code?
Apr 9, 2012, 1:57 PM
4 Posts
Re: Can't get value of computed field in repeat control to put in scope variable via ssjs
I took things back a few steps and got a button in the repeat control to work in a very basic test.
 
I still can't figure out to access the value of a computed field in a repeat control via SSJS.
Apr 9, 2012, 4:25 PM
4 Posts
Re: Can't get value of computed field in repeat control to put in scope variable via ssjs
The answer is in this post.
http://www-10.lotus.com/ldd/xpagesforum.nsf/topicThread.xsp?action=openDocument&documentId=371BEF2BAE0FC93D852578B2006A3ACD#1617587F8CC6EA1B852578B70065D9A2

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