1

Good afternoon,

I am trying to get the selected row in the "dataTable" of bootsfaces. However I can not implement a property of type "onSelect" to retrieve the selected item.

Can this property be implemented in any way?

I would only need to be able to work with the selected item in the table.

This is part of my code :

<b:dataTable id=”tableProductsDetailsVats” fixedHeader=”true” selectionMode=”single”
                       style=”width:100%;” border=”false” responsive=”true” lang=”es” select=”true” 
                       searching=”true” multiColumnSearch=”true” var=”product”
                       value=”#{Products.productos}” rendered=”#{Products.mostrarTabla}”
                       onselect=”console.log(#{product.nombre});” ondeselect=”console.log(‘deselect’);”>
                       <b:dataTableColumn value=”#{product.nombre}” contentStyleClass=”center”
                              header-style=”text-align:center;” content-style=”width:30%;”
                              label=”#{textMsg[‘container.detailsProduct.table.obj.name’]}” />

                </b:dataTable>

Thanks for all !

danysion
  • 45
  • 9

1 Answers1

0

Update Nov 27, 2016: There's also a bug ticket concerning this issue.

Update Dec 4, 2016: Starting with BootsFaces 1.0.1, onselect is implemented correctly, and the loop variable is passed to the bean method.

Until BootsFaces 1.0.0, it wasn't not supported out-of-the-box. If you have to use a version older than 1.0.1 for some reason, you can implement a command button in each row, as you can see in the last example at http://showcase.bootsfaces.net/forms/DataTable.jsf. So (until 1.0.0) I recommend to implement a hidden command button in each row, and to call it using the client-side API of the underlying widget, dataTables.net.

I'd also recommend to open an issue on our bugtracker. This way, we know it's an issue important to you, and we'll provide a more intuitive solution with the next version of BootsFaces.

Stephan Rauh
  • 3,069
  • 2
  • 18
  • 37
  • 1
    Currently the information that you offer me works correctly, if I select a row and pulse left button I can get the selected object. Now I have another problem related to this, we notice that bootsfaces does not have "contextMenu" so I can not get that element with right click (showing a menu) and select it at the same time. – danysion Nov 23 '16 at 12:38
  • Come to think of it, context menus have fallen out of grace when smartphones and tablet PCs got popular. I suppose that's the reason why BootsFaces doesn't support context menus yet. However, in my eyes, BootsFaces should embrace both the desktop and the mobile platforms. Would you mind to [open an issue on our bug tracker](https://github.com/TheCoder4eu/BootsFaces-OSP/issues) so we can schedule context menus soon? – Stephan Rauh Nov 25 '16 at 21:59
  • Perfect , i go to create a new task to do the context menu. Thanks so much for all ! – danysion Nov 29 '16 at 15:04