0
<p:fieldset styleClass="weightTextBox">
            <p:selectOneMenu id="detectionSelector" value="#{ngs.detectionMode}">
                <f:selectItem itemValue="SYBR" itemLabel="SYBR" />
                <f:selectItem itemValue="NONE" itemLabel="None" />
                <f:selectItem itemValue="SYBR_GREEN" itemLabel="Sequencing" />
                <f:selectItem itemValue="PROBE" itemLabel="Probe" />
                <p:ajax event="change" update="@form" render="@form"/>
            </p:selectOneMenu>
            </p:fieldset>

I do have multiple select items while the three values NONE, SYBR, SYBR_GREEN have same usage. what im trying to do is

<ui:fragment rendered="#{ngs.detectionMode ne 'SYBR_GREEN' or ngs.detectionMode ne 'NONE' or ngs.detectionMode ne 'SYBR'}">

While this way is working but i need it for all the 3 options.

<ui:fragment rendered="#{ngs.detectionMode ne 'SYBR_GREEN'}">

I tried multiple ways but none worked.

<ui:fragment rendered="#{(ngs.detectionMode ne 'SYBR_GREEN') or (ngs.detectionMode ne 'NONE') or (ngs.detectionMode ne 'SYBR')}">


<ui:fragment rendered="#{ngs.detectionMode ne 'SYBR_GREEN' or 'NONE' or 'SYBR'}">
john
  • 1
  • 3
  • I have a hard time understanding your issue. You post something that you state is working (and about all 3 options) then you post that you need it for all 3 and after it you post just 1 option in it and later on 2 more examples that do not work but seem (at least in attempt) do the same as the first one that you say IS working... And does it work if you just use a plain inputtext instead of a select? If not the issue is not select related – Kukeltje May 01 '18 at 07:30

1 Answers1

0

I suppose you are looking for criteria where ui:fragment will be rendered only when 'PROBE' option is selected.

In that case, you need to define exclusive conditions (AND) and not inclusive conditions (OR) like in your failed attempts.

So, for example, instead of

<ui:fragment rendered="#{(ngs.detectionMode ne 'SYBR_GREEN') or (ngs.detectionMode ne 'NONE') or (ngs.detectionMode ne 'SYBR')}">

you should use

<ui:fragment rendered="#{(ngs.detectionMode ne 'SYBR_GREEN') and (ngs.detectionMode ne 'NONE') and (ngs.detectionMode ne 'SYBR')}">

Also notice that p:ajax component does not have render attribute.

Dusan Kovacevic
  • 1,377
  • 1
  • 13
  • 19