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



Sep 11, 2013, 4:03 PM
9 Posts

get combo box value for client side script?

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2

Hi-

I am creating a form using the extension library form layout controls--very cool by the way. I want to have certain questions in a panel appear when a combobox is changed to "yes" and disappear if changed to "no". (like a hide/when in the notes client). After days of experimentation, it seems to me that doing this client side will be best, if I can. I'm experimenting with the dojo wipe in and wipe out feature which works great but I've only been able to get it to work by calling it on the onclick event of a button. 

I want to call it on the onchange event of my combobox but how do I get it to fade in if "yes" is selected in my combobox and fade out if "no" is selected?

How can I get at that combobox value on the client side and have it control if the dojo event is fired or not?

Any help GREATLY appreciated. 

-Nate Greene

Sep 11, 2013, 8:50 PM
170 Posts
This might be the way

I don't know if you mean that you don't want to fire the backend SSJS event if so this is the way

To get the value from the combobox if the XPage name of it is Combo1

var obj = dojo.byId("#{id:Combo1}");
var combovalue = obj.options[obj.selectedIndex].text;

if(combovalue=="firedojo"){

return true

}else{

return false //will not fire any backend events

}

 

/Fredrik

www.xpagedeveloper.com

Sep 13, 2013, 6:59 PM
9 Posts
Thank you for your reply, but

Hi-

Thank you very much for your reply. The code you gave seems to be what I'm looking for but I don't know where to put it. My XSP is below. 

Where do I put the code so that the dojofxWipeIn is called only if "Yes" is selected in the combobox?

 
Show field below? 
<xp:comboBox id="comboBox1">
<xp:selectItem itemLabel=""></xp:selectItem>
<xp:selectItem itemLabel="Yes"></xp:selectItem>
<xp:selectItem itemLabel="No"></xp:selectItem>
<xp:eventHandler event="onchange" submit="false">
<xp:this.script>
<xe:dojofxWipeIn node="Lewiston"></xe:dojofxWipeIn>
</xp:this.script>
</xp:eventHandler>
</xp:comboBox>
<xp:br></xp:br>
<xp:panel
id="Lewiston"
style="display: none;"
>
Hello World!
</xp:panel>
 

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