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



Dec 17, 2012, 8:03 PM
37 Posts

Struggling with multiple partial refresh from a radio button

  • Category: Dojo and Client Side JavaScript
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 3
 Hello!
 
   I've searched for an example and tried many things, but, alas, I'm stuck.  It should be something simple, but I think I'm missing something.  I should mention that I'm experienced in web development in Notes, but have only done XPages for a few months.  All I want to do is, when a radio button is changed, refresh multiple panels.  I'm using a viewScope variable (with the value in the radio button) to determine whether something should be hidden or not.
 
   I know CSJS is triggered before SSJS, and I saw Tim Tripcony's article about refreshing multiple partial refreshes, and it works fine in CSJS.  In SSJS, doing a full update to the XPage while setting the viewScope to the radio button works, also.  I'd just prefer to update the panels that need to be updated.
   And no, I won't be able to change the field order to have all the panels put together.
 
   In traditional Domino development, simple javascript would hide or show various div's, based on a radio button's value.  Any ideas on what I can be missing here?
 
Thanks, in advance! 
 
Steve in NYC 
Dec 18, 2012, 2:36 PM
37 Posts
Almost there?
 Hello!
 
   I've tried to change the viewScope in the CSJS, and this is the code I have in the radio button group: 
 
var v_id="#{id:radioPresType}";
var v_result = getRadioVal(v_id);
"#{javascript:viewScope.presType='" + v_result + "'}";
XSP.partialRefreshGet('#{id:presTypePanel1}', {
onComplete: function() {
XSP.partialRefreshGet('#{id:presTypePanel2}', {
onComplete: function() {
XSP.partialRefreshGet('#{id:presTypePanel3}', {
onComplete: function() {
XSP.partialRefreshGet('#{id:presTypePanel4}');
}
});
}
});
}
});
 
   I can confirm that the "v_result" does evaluate to the proper value, but the viewScope presType comes out as "+ v_result +", instead of reading the value.  I've tried many different syntaxes, but haven't been able to get it to work.
   The partial refreshes, on their own, work.  But, I'm using the viewScope variable to show or hide elements within the several panels.
 
Any ideas?  Am I on the right track, or am I completely off base for what I want to do? 
 
Any assistance would be greatly appreciated. 
 
Thanks, in advance! 
 
Steve in NYC 
Dec 19, 2012, 2:52 AM
8 Posts
Re: Struggling with multiple partial refresh from a radio button
have you tried putting this part in sessionScope?
 
var v_id="#{id:radioPresType}";
var v_result = getRadioVal(v_id);
"#{javascript:viewScope.presType='" + v_result + "'}";
 
then on the event of the field, the partial refresh part is on the onComplete
 
Dec 19, 2012, 2:27 PM
37 Posts
Re: Struggling with multiple partial refresh from a radio button
Hello!
 
   I think the real problem is the syntax to get the "v_result" in the viewScope line.  I'm using the debug toolbar, and when I check the viewScope.presType variables, it'll say " + v_result +", "} + v_result + {", or any other variation I've tried.  If I can find the proper syntax to get that line, then I'm done with it!
 
 Any suggestions?
 
Thanks! 
 
Steve in NYC 

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