1
votes

I using some Dojo radio buttons in an XPages application and would like to display the label, not the selected value, when the XPage is in read mode. Is this possible? Here is an example of my code:

<xe:djRadioButton id="C1B1_R1" groupName="FKRadio1" value="#{document1.C1B1_RValue}">
<xe:this.label><![CDATA[#{javascript:sessionScope.get("C1B1_R1")}]]></xe:this.label>
<xe:this.selectedValue><![CDATA[#{javascript:sessionScope.get("SV_C1B1_R1")}]]>
</xe:this.selectedValue>
<xe:this.rendered><![CDATA[#{javascript:var r3 = sessionScope.get("C1B1TextVisibility");
@If(currentDocument.isEditable(),@If(r3 != null && r3[0]!=0,true,false), 
@Trim(@GetField("C1B1_RValue")) == sessionScope.get("SV_C1B1_R1"), true, false)}]]>
</xe:this.rendered>
</xe:djRadioButton>

In edit mode, the labels are displayed. However in read mode, the value of the field is displayed rather than the corresponding label for the field value. In this case, the values are all numeric while the labels are text.

2

2 Answers

1
votes

Tony,

Three things that you should try, these are written in order you should try:

1) I think it is rendering as just plain text when in read mode, so it just shows the values. Try setting the "Show disabled control for read only" and see if it renders it as something other than plain text.

2) Change the code to be the same for read or edit mode, in other words make it like edit mode. Then use the styleClass to use jQuery or CSS to restrict editing.

3) Use a hidden input/display:none to load the field on the page, then set the label to a field that is shown

1
votes

You can hidde the djRadioButton in read mode, and show a xp:text with the label instead.

Or, maybe with the property "Show disabled control for read-only" (in general properties of the Dojo Radio Button)