My commandlink is calling to action only in the second click. I added a debug point and tried. first click it doesn't come to method. Only second click it hit the action. I tried by adding the script as mentioned in here but it didn't help. Any other solution to resolve this? instead h:commandlink ?
<h:form>
<h:panelGroup id="new-line-panel">
some code goes here....
<h:panelGroup id="numberSelectionPanel">
<ui:repeat var="newLineItem" value="#{SelectionBean.Cards}" >
<span class="new-line-item">
<h:commandLink id="no-#{newLineItem.serNo}"
styleClass="#{SelectionBean.serNo == newLineItem.serNo ? 'selected' : ''} btn"
action="#{SelectionBean.populateSelectedNum(newLineItem.serNo)}">
<f:ajax render=":form:numberSelectionPanel" execute="@form"/>
#{newLineItem.serNo}
</h:commandLink>
</span>
</ui:repeat>
</h:panelGroup>
some more code
</h:panelgroup>
</h:form>
in the SelectionBean method
public void populateSelectedNumber(String number) {
this.serNo = number; // I added debug point here
selectedMnpMessage = null;
}