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

Rerender of b:dataTable duplicates elements #335

Closed
jwgmeligmeyling opened this issue Mar 27, 2016 · 3 comments
Closed

Rerender of b:dataTable duplicates elements #335

jwgmeligmeyling opened this issue Mar 27, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@jwgmeligmeyling
Copy link

I try to update a <b:dataTable> using a <f:ajax execute="@form" render="data-table-basic"/>. While new entries are added to the data table correctly, its control elements appear twice. Not sure if this is actually a bug or the intented behaviour for dataTable, as I am very new to JSF and Bootsfaces. Little help would be appreciated a lot though 😄 I am on BootsFaces 0.8.1 / Chrome.

@stephanrauh
Copy link
Collaborator

No, it's not the way it should be :). But it's hard to avoid: the BootsFaces datatable is a client side widget, and every time you update the form, it is initialized again. BTW, I couldn't reproduce your error. Could you send us a reproducer?

In any case, in BootsFaces 0.8.2 you can use the widgetVar to destroy the datatable before updating the page:

<b:dataTable value="#{carPool.carPool}" var="car" id="bcarPool"
                      widgetVar="tblWidget">
...
</b:dataTable>
<b:commandButton onclick="tblWidget.DataTable().destroy();event.stopPropagation();ajax:carPool.initRandomCarPool();" 
    update="@form"/>

In BootsFaces 0.8.1 you have to find out a jQuery expression that finds your dataTable. For instance, you can use $('.dataTable').DataTable().destroy().

Be that as it may, that BootsFaces dataTable is a client-side widget, which means it doesn't play nicely with JSF AJAX.

@stephanrauh stephanrauh added this to the v0.8.2 milestone Mar 28, 2016
@stephanrauh stephanrauh self-assigned this Mar 28, 2016
@stephanrauh
Copy link
Collaborator

If you want to give the new version a try, I've uploaded a developer snapshot to Maven Central (see #151 on how to get it)

@jwgmeligmeyling
Copy link
Author

Thanks for your efforts, I will try the developer snapshot!

XaeroDegreaz added a commit to XaeroDegreaz/BootsFaces-OSP that referenced this issue Apr 1, 2016
… the clientId search for the multi column searching.
woutbr pushed a commit to woutbr/sosit18 that referenced this issue Nov 17, 2018
Oplossing is table ook vernietigen bij saven. 
TheCoder4eu/BootsFaces-OSP#335 (comment)
Reden is dat de update van commandButton de table opnieuw wilt aanmaken.
Mogelijks is dit een bug. Waarschijnlijker is dat ik een fout maak.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants