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



Jul 1, 2013, 11:55 PM
41 Posts
topic has been resolvedResolved

Problem with partial refresh

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 4

Hi,

 

Am having some trouble with partial refresh.  I have an XPage with has the ability to link to another document, the link section is hidden based on a radio button Yes/No, with the default option No and the section hidden. 

Once it's changed to Yes, the option's available and I use a Dialog to display a view for selection of the associated documents. 

On the OK button of the Dialog, it then sets the underlying data source field with the URL of the documents selected (document1.replaceItemValue('field',selected)), close the dialog, and have on the OnClick selected to Partial Refresh the panel that contains the links on the main form. 

The links are within a repeat control that displays the URL in computed text.  What I'm finding that, when there is no value initially in the field on the document, after selection, the partial refresh does not redisplay, so doesn't display the link I just selected.  If I change the Yes/No option back to no (hides the section) then to Yes the links are displayed - so the repeat control is refreshed.  If I select links again, the value doesn't change. If I have a text field that has it's data source as the field, it is refreshed on the partial refresh.

BUT, If I save the document, close, then re-open the section works as it should - selecting new links refreshes the links.

 

If anyone has any suggestions would be greatly appreciated as I cannot figure out what's going on.

 

Thanks again all.

 

Cameron

Jul 3, 2013, 7:52 PM
453 Posts
What is the Scope of the pnlAgreement

Is the pnlAgreement available to be refreshed or is it not rendered unless the button is selected. I have found that this is generally (at least for me) to be the issue. The object pnlAgreement must be in the current Stack, I have made a panel not visible (not rendered) then of course the refresh can't work because it can't find the object to refresh.

Jul 3, 2013, 10:13 PM
41 Posts
The panel should be visible

Hi Bill,

 

Thanks for the reply. You're right, it does have something to do with the panel.  Logically it is visible as the Select button is within the panel.  I have temporarily taken away the visible code so it's constantly available and now it works.  Might give a try hiding with CSS.

 

Thanks again

Jul 4, 2013, 10:37 PM
453 Posts
Resfresh a panel

If a panel is not rendered and you do a partial refresh of the panel then the not rendered panel is not in the stack so it can't be refreshed. A tip that I picked up from one of the TLCC courses is to create an outer level panel called say panelAll which has no rendered properties. Now if you do a partial refresh of that panel the rendered properties of the inner panels/tables etc are recomputed. So for example I have an XPage with two panels call then panelTop and panelBottom. these to panels have opposite rendered properties based on a value in a viewScope variable viewScope.get("vsAction") == "" ? true : false for the panelTop and viewScope.get("vsAction") == "" ? false : true for the panelBottom. A button in the panelTop sets teh vsAction to something and then does a partial refresh of panelAll. A button in the panelBottom sets vsAction = "". and a partial refresh of the panelAll. The two panels toggle between rendered = true and false. If the button in panelTop attempts to do a partial refresh on panelBottom it will fail because it is not there.

Part of the problem is that the property is misnamed (IMHO) visible on the Data Properties panel, In the All Properties it is labeled correctly as rendered. So coming from a traditional Notes/Domino background I assumed it was like the Hide-When formula, BUT not so. I understand if you set rendered = false and loaded = true that the control is not visible but is accessible. I personally don't like that because it must be maintained in two places. If you want a control to be hidden but accessible then I use the Style property = "display:none". If you set the property of a panel to display:none then a partial refresh of just that panel will work and if the formula for the style changes it to say "" then the panel will display. The down side of this is that the content of the panel is loaded in the XPage. I frequently want a bunch of controls to be accessible by the javascript so I can do a getComponent(), but they are hidden from the user. So I stick them all inside a <xp:panel id="hiddenControls" style="display:none"></xp:panel>

Not sure how much of this appliers to your situation but these two paragraphs represent a lot of hours of trial & error and frustration as I figured out how XPages deals with scope etc.

Jul 5, 2013, 12:00 AM
41 Posts
Thanks for the info

Thanks again Bill for sharing your findings. As mentioned in my reply am probably going to use display:none css to hide the panel as you suggested.  In my case, I don't need to access the contents of the panel via SSJS as it's just a list of URLs


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