BootsFaces-OSP icon indicating copy to clipboard operation
BootsFaces-OSP copied to clipboard

Datatable selected-items and selectionMode dont work

Open gen0v opened this issue 6 years ago • 5 comments

Hello, i have the problem that if i add these options to my datatable nothing changes. Even if i delete the option select="true" i can still select multiple rows.

I wanted to be able to select one cell, but like i said no of this options work and i dont seem to find a solution.

gen0v avatar Mar 06 '19 21:03 gen0v

                      <b:dataTable id="dtable" row-group="1" select="true" selected-items='cell' selectionMode='single' value="#{adminWorkerManagementView.worker}" var="worker">

                            <b:dataTableColumn value="#{worker.name}" label="Worker" orderable="false"/>
                            <b:dataTableColumn value="#{worker.job}" label="Job" orderable="false" header-style-class="hidden" content-style-class="hidden"/>

                            <c:forEach var="day" items="#{scheduleView.day_array}">
                              <b:dataTableColumn value="#{worker.schedule[day]}" label="#{day.dayOfMonth}" orderable="false"/>
                            </c:forEach>

                            <b:dataTableColumn label="Option">
                              <b:commandButton value="Delete" iconAwesome="trash"
                                               action="#{adminWorkerManagementView.delete(worker)}">
                                <f:ajax execute="@this" render="@form" />
                              </b:commandButton>
                          </b:dataTableColumn>


                      </b:dataTable>

gen0v avatar Mar 06 '19 21:03 gen0v

Same error in https://github.com/TheCoder4eu/BootsFaces-OSP/issues/1063

gen0v avatar Mar 06 '19 21:03 gen0v

Hello, further i have an error where i try to call a method from onselect="bean.methoder(worker,indexes)" but both values are always null. And trying with "ajax:...." only resets the page but method wont be called.

Maybe i am overseeing something.

Thanks in advance!

gen0v avatar Mar 07 '19 22:03 gen0v

Well i have the same problem. It seems to be that error is caused by the orderable attribute on the column. Such an attribute need a creation of the column defs in json. At the end of the function there will be add the select option. It seems to be a bug. https://github.com/TheCoder4eu/BootsFaces-OSP/blob/ed9d37df613b4ac40b53bc9ffd265cd55fd98df5/src/main/java/net/bootsfaces/component/dataTable/DataTableRenderer.java#L801

PS: Well in the short term you can fix this by using 1.4.0. A new feature of issue #1038 causes the bug which was introduced in 1.4.1.

ElectroStar avatar Mar 26 '19 14:03 ElectroStar

Are there any plans to fix this?

vsvetoslavov avatar Jul 05 '19 11:07 vsvetoslavov

I'm afraid development of BootsFaces has slowed down considerably. We'll never manage to address this issue. Let's close it.

stephanrauh avatar Aug 12 '24 15:08 stephanrauh