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



May 9, 2012, 3:13 PM
31 Posts
topic has been resolvedResolved

Set computed field from combobox

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: scoped variable
  • Replies: 5
I have a combobox in which a user can select a year. Then a button that will do a lookup of information based on that year. The data will then be dropped into computed fields on the page. This example is just a start.
 
Here is the button code - execute script onclick event -
var combo = getComponent("comboBox1").getSubmittedValue();
viewScope.put("thisYear", combo );
 
Then the value for the computed field is a viewScope variable set to thisYear.
 
I am not getting a value in the computedField. What am I missing? I also tried using requestScope but no result, but I don't see errors either for either types of scoped variable type.
 
Thanks,
 
 
May 9, 2012, 4:11 PM
17 Posts
Re: Set computed field from combobox
 Are you refreshing the computed field?. You need to do partial refresh on computed field. 
May 10, 2012, 7:13 AM
126 Posts
Re: Set computed field from combobox
getSubmittedValue() is used to get the value that has been posted back to the server after a refresh (before any converter etc. is applied)
 
getvalue() is used to get the value that is currently held in the control (in this case the selected element).
 
Depending on how your refreshing there may not be a submitted value. Try getValue() and see does that work
May 11, 2012, 2:02 PM
31 Posts
Re: Set computed field from combobox
Before my initial post I had started with getValue() but wasn't getting results - however, that was probably in the midst of other issues too. getValue() worked this time.
 
Thanks!

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