0

Hi guys <h:commandbutton> with <f:ajax> doesn't work in <h:datatable>. It works when it is out of <h:panelgroup> and <h:datatable>. But in this case, it doesn't work.

<h:panelGroup  id="output4">
    <h:dataTable border="1" class="data_table" value="#{admin.list}" var="o">
        <h:column>
            <f:facet name="header">Id</f:facet>
                #{o.id}
        </h:column>
        <h:column>
            <f:facet  name="header">İsim</f:facet>
                #{o.isim}
        </h:column>
        <h:column>
            <f:facet name="header">Yazar/Yönetmen/Yapımcı/Sanatçı</f:facet>
                #{o.yazar}
        </h:column>
        <h:column>
            <f:facet name="header">Yayınevi</f:facet>
                #{o.yayinevi}
        </h:column>
        <h:column>
            <f:facet name="header">Fiyat</f:facet>
            #{o.fiyat} &#8378;
        </h:column>
        <h:column >
            <f:facet  name="header">İşlem</f:facet>
            <h:panelGroup id="userPanel">
                <h:panelGroup>
                    <h:form>
                        <h:commandButton value="Sil" >
                            <f:param name="islem" value="2" />
                            <f:param name="id" value="#{o.id}" />
                            <f:ajax execute="@this" event="action" id="5" 
                                    listener="#{test.deleteRecord()}" />
                        </h:commandButton>
                    </h:form>
                </h:column>
            </h:dataTable>
        </h:panelGroup>
4
  • Do you have a <h:form> that wraps your <h:dataTable>? May 23, 2014 at 23:49
  • Any warning in console when click button? Also no need to define event="action" Remove the id=5 also. It comes repetitive.
    – Ranjith
    May 24, 2014 at 10:14
  • 1
    That's your problem them. Remove the inner <h:form> that you added inside <h:column>. Basic HTML doesn't allow having nested forms. May 24, 2014 at 12:05
  • possible duplicate of h:commandLink / h:commandButton is not being invoked May 24, 2014 at 12:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.