0

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;        
}
Community
  • 1
  • 1
ever alian
  • 1,028
  • 3
  • 15
  • 45
  • Possible duplicate of [commandButton/commandLink/ajax action/listener method not invoked or input value not updated](http://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) – Emil Sierżęga Sep 16 '16 at 10:32
  • @EmilSierżęga I tried that. I have followed the guidelines there. But it didn't help. – ever alian Sep 16 '16 at 10:35
  • Every one of them? Also `ui:repeat` is almost always causing problems, if you can use `p:repeat`, `a4j:repeat` or any other. – Emil Sierżęga Sep 16 '16 at 10:42
  • @EmilSierżęga I will try your sugessions, But I want to say that when I use `c:forEach` this is working perfectly. But then as usual I face list size different issue. This is why I want to move to `ui:repeat`. But that leads to different issue. – ever alian Sep 16 '16 at 11:41

0 Answers0