Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b:command button does not work in datatable. #486

Closed
jwsj opened this issue Aug 12, 2016 · 4 comments
Closed

b:command button does not work in datatable. #486

jwsj opened this issue Aug 12, 2016 · 4 comments
Assignees
Milestone

Comments

@jwsj
Copy link

jwsj commented Aug 12, 2016

When click the button in datatable, refresh the page and not execute method action.
Below my code :

<h:form id="frm">
        <f:metadata>
            <f:event type="preRenderView"
                listener="#{CboController.getListarCbo}" />
        </f:metadata>

        <b:dataTable id="tabela" value="#{CboController.listaCbo}" var="tab"
            lang="es">

            <b:dataTableColumn label="Código">
                <h:outputText value="#{tab.codCbo}" />
            </b:dataTableColumn>

            <b:dataTableColumn label="Descrição">
                <h:outputText value="#{tab.descCbo}" />
            </b:dataTableColumn>

            <b:dataTableColumn label="Ação">
                <b:commandButton value="alt" icon="alterar-dados" ajax="true"
                    action="#{CboController.redirectEdit()}">
                </b:commandButton>

            </b:dataTableColumn>
        </b:dataTable>

    </h:form>
@stephanrauh
Copy link
Collaborator

stephanrauh commented Aug 13, 2016

For some reason, every button has the same name and id. Little wonder nothing works.

@stephanrauh
Copy link
Collaborator

Turns out, it's a weird caching problem.

@stephanrauh stephanrauh changed the title b:command button is not work in datatable. b:command button does not work in datatable. Aug 13, 2016
@stephanrauh
Copy link
Collaborator

I've uploaded a developer snapshot fixing the bug to Maven Central. See #369 on how to get it. Note that I didn't fix every bug yet. If you use input fields in your dataTable, you'll want to replace b:dataTableColumn by the standard h:column. If you're using NetBeans or IntelliJ, your IDE probably will complain about the label attribute, but apart from that, thing should work better than before.

To dos left before we can close the issue:

  • There seems to be a special treatment of the submittedValue attribute in h:column. We should find it and make the special treatment available to b:dataTableColumn.
  • Talking of which: why do we need a b:dataTableColumn in the first place? Let's try to find a way to get rid of it. Every JSF component in the table is considered a column.

@stephanrauh
Copy link
Collaborator

Finished the last remaining bugs, added a demo to the sneak preview showcase (http://www3.bootsfaces.net/Showcase/forms/DataTable.jsf) and uploaded a new developer preview version of BootsFaces to Maven Central.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants