I have an Xpage with a djTabContainer and the tab container holds several Custom Controls. One of the Custom Controls only has the contents rendered upon meeting a certain condition as shown here;
<xp:this.rendered><![CDATA[#{javascript:getComponent("conCapRev").getValue()
== "External”}]]></xp:this.rendered>
I want to have the Custom Controls contents rendered now upon meeting one of two conditions, where basically the rendering tag has an or in the Javascript. If this is not possible can there be two rendering tags?
I should mention that the rendering (or not rendering) of the tabbed Custom Control should occur when the document is being created and not just after it has been created and saved.
The code above works for this scenario. When I change getComponent for document1 as shown in the next XML tag it also works with no errors.
<xp:this.rendered><![CDATA[#{javascript:document1.getValue("conCapRev")
== "External"}]]></xp:this.rendered>
But when I add in the second condition as shown below it does not work and the Custom Control is always rendered. How can I solve this please?
<xp:this.rendered><![CDATA[#{javascript:document1.getValue("conCapRev") == "External"
|| document1.getValue("conTenderType") != "Extension"}]]></xp:this.rendered>
To perhaps add more information to make the issue clearer - during the initiation of a "Contract" document the user decides if the conCapRev field will be "Internal" or "External", then continuing with the Contracts general information the user selects a value for Tender Type (the ConTenderType field) from a possible list one of which is "Extension". The user then completes at least the Workflow tab with many fields and at this point the Contract can be saved or exit (discard without saving). Before or after the Contract is saved the user can go to another tab named Baseline which will NOT be rendered if the conCapRev field is "External" OR the conTenderType field is "Extension".
===
and!==
for comparison in JavaScript to avoid unexpected type conversions. That is not the issue here though... – Knut Herrmanndocument1.getValue("conTenderType") != "Extension"
returns always true. Test only this condition. First, show "conTenderType" item in a computed field. Contains it really "Extension"? Next, if so, add the render condition to the computed field. Is it still visible? Maybe you use an alias for "Extension" internally... – Knut Herrmann