0

I am using JSF and I have the following code:

<h:form id="agendaData" style="margin-left:1em" enctype="multipart/form-data" prependId="false">  
    [...]  
    <div class="form-group">
        <div style="float:left">
            <h:commandButton type="submit" class="btn btn-primary" value="Hinzufügen" actionListener="#{eventController.createAgendaEntry}">
                <f:ajax execute="@form" render="agendaData :agendaTable"/>
            </h:commandButton>
        </div>
        <div style="float:left">
            <h:commandButton type="submit" class="btn btn-primary" value="Aktualisieren" disabled="#{!eventController.agendaEntryUpdatePossible}" action="#{eventController.updateAgendaEntry}" style="margin-left:1em">
                <f:ajax execute="@form" render="agendaData :agendaTable"/>   
            </h:commandButton>
        </div>
    </div>
</h:form>

<h:form id="agendaTable" style="margin-left:1em">
    [...]
</h:form>

When I click on the commandButton with the value "Hinzufügen" the action "createAgendaEntry" won't be called. Only when I click the second time, it happens. I tried many solutions with panelGroups etc. But nothing worked. Adding this js-Code didn't work either. Is there any solution for it?

Community
  • 1
  • 1
chocolate cake
  • 1,376
  • 5
  • 19
  • 39

0 Answers0