0

Hi guys i tried make some feature for add data, i make row expasion on dataTable and inside row expansion i make button for show dialog for input data but whe i click the button, it's not working and dialog not showing

here the code

<p:dataTable var="projectMember" widgetVar="BATable"
                                    value="#{bANewProjectBean.lazyBAProjectMemberModel}"
                                    paginatorPosition="bottom" rows="10" paginator="true"
                                    rowsPerPageTemplate="10,15,25,50,100" rowIndexVar="rowIndex"
                                    lazy="true" id="baTable">
                                    <p:column headerText="Task" style="width:1.8%">
                                        <p:rowToggler />
                                    </p:column>
                                    <p:column headerText="No" style="font-weight:bold;" width="3%">
                                        <h:outputText value="#{rowIndex+1}" style="float:right;" />
                                    </p:column>
                                    <p:column headerText="Member Name"
                                        sortBy="#{projectMember.memberName}" filterStyle="width:200;"
                                        style="font-weight:bold;">
                                        <h:outputText value="#{projectMember.memberName}" />
                                    </p:column>
                                    <p:column headerText="Man Hour" width="15%">
                                        <h:outputText value="#{projectMember.memberManHour}" />
                                    </p:column>
                                    <p:column headerText="Sign Date">
                                        <h:outputText value="#{projectMember.memberSignDate}">
                                            <f:convertDateTime pattern="dd MMMM yyyy HH:mm:ss" />
                                        </h:outputText>
                                    </p:column>
                                    <p:column headerText="Due Date">
                                        <h:outputText value="#{projectMember.memberPlanDate}">
                                            <f:convertDateTime pattern="dd MMMM yyyy HH:mm:ss" />
                                        </h:outputText>
                                    </p:column>
                                    <p:column headerText="Finish Date">
                                        <h:outputText value="#{projectMember.memberRealDate}">
                                            <f:convertDateTime pattern="dd MMMM yyyy HH:mm:ss" />
                                        </h:outputText>
                                    </p:column>
                                    <p:rowExpansion>
                                    <p:commandButton value="Add Task" action="#{bANewProjectBean.asd}"/>
                                    </p:rowExpansion>
                                </p:dataTable>

maybe u guys have any idea for this issues ? Thank you

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
Steven a
  • 43
  • 4
  • Is the button part of a form? I only see the table as the top element. – Smutje Oct 08 '20 at 09:50
  • Please read https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value – Jasper de Vries Oct 08 '20 at 09:54
  • Does this answer your question? [commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated](https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) – Melloware Oct 10 '20 at 12:56
  • @Smutje yeah it's part of a form i put the dataTable inside a form, or maybe i must create a form inside rowExpansion and put the button inside that form ? because when i put the button outside dataTable, it's working – Steven a Oct 11 '20 at 03:41
  • Nesting forms isn't a good idea. Can you include the method that is responsible for showing the dialog? – fuggerjaki61 Oct 11 '20 at 13:57
  • I don't see an 'update' attribute on the 'Add Task' button. Ajax attribute defaults to 'true' so you need to update the component you want to make visible on the screen. Try adding 'update' along with the id of the popup dialog you are expecting to see. Or are you displaying the popup from within the 'asd' method? – MrChris Oct 26 '20 at 22:54

0 Answers0