1
votes

I am using Primefaces 4.0. Problem i am facing is CommandLink not Getting updated on change event of SelectOnemenu.Code as Follows:-

<p:selectOneMenu id="List"
    value="#{Bean.selectedId}" style="width:230px">
    <f:selectItem itemLabel="--Select--" />
    <f:selectItems value="#{Bean.SelectItemList}" />
    <p:ajax event="change" update="enableGo,disableGo"></p:ajax>
</p:selectOneMenu>


<p:commandLink id="enableGo" value="GO" styleClass="blueButton"
     rendered="#{Bean.selectedId != null}"
     action="#{note.load}">
</p:commandLink>

<p:commandLink id="disableGo" value="GO"
     styleClass="disabledButton"
     rendered="#{Bean.selectedId == null}">
</p:commandLink>

I also tried updating with the formid eg: ":formid:enableGo,:formid:disableGo" but it didnt work!.

1

1 Answers

1
votes

The client side javascript won't be able to find either of the components to update. You'll need to wrap them (the <p:commandLink>s) in a wrapper and then update the wrappers. See BalusC's answer for more details and an example.