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

dataTable not rendered properly when included in dynamic tabView #885

Closed
parysto opened this issue Oct 21, 2017 · 3 comments
Closed

dataTable not rendered properly when included in dynamic tabView #885

parysto opened this issue Oct 21, 2017 · 3 comments
Assignees
Labels
dataTable Issues with the main Topic dataTable
Milestone

Comments

@parysto
Copy link

parysto commented Oct 21, 2017

Hi,

I'm using BootsFaces 1.2.0-SNAPSHOT to add tabs dynamically to a tabView (Issue #807). However, I observed two issues when I include a dataTable in each dynamically created tab:

1

The dataTable's search and pagination row is rendered more than once (one time for each tab):

bootsfacetabviewissue1

<b:tabView>
    <b:tab title="Tab" value="#{list}" var="entry">
        <b:dataTable value="#{entry.list}" var="row">
            <b:dataTableColumn>td1</b:dataTableColumn>
            <b:dataTableColumn>td2</b:dataTableColumn>
            <b:dataTableColumn>td3</b:dataTableColumn>
        </b:dataTable>
    </b:tab>
</b:tabView>

2

When the dataTable is used together with a header-facet and a selectMultiMenu is added to the same tab, the content of all tabs is shown on the first tab and switching between tabs isn't possible anymore.

bootsfacetabviewissue2

<b:form>
    <b:tabView>
        <b:tab title="Tab" value="#{list}" var="entry">
            <b:selectMultiMenu>
                <f:selectItems value="#{entry.list}" var="s" itemLabel="#{s.name}"/>
            </b:selectMultiMenu>

            <b:dataTable value="#{entry.list}" var="row">
                <f:facet name="header">
                    <tr>
                        <th>th1</th>
                        <th>th2</th>
                        <th>th3</th>
                    </tr>
                </f:facet>
                <b:dataTableColumn>td1</b:dataTableColumn>
                <b:dataTableColumn>td2</b:dataTableColumn>
                <b:dataTableColumn>td3</b:dataTableColumn>
            </b:dataTable>
        </b:tab>
    </b:tabView>
</b:form>

The second issue seems to be caused by a missing </div> tag in the generated html after the dataTable. This causes each tab to be nested in its preceding tab.

@vsvetoslavov
Copy link
Contributor

Hi parysto!
One thing you may want to consider when using tabs is that the content of invisible tabs may have visual flaws, related to being rendered but hidden and thus rendering javascript-based calculations wrong. In my project I use some javascript code to beautify some things a bit, and I neded to call that code on show of tabs.
However I have not had any problems putting data tables in tabs - especially when they're on the first (the one displayed by default) tab.

@parysto
Copy link
Author

parysto commented Nov 12, 2017

Hi vsvetoslavov,

thanks for your hint.

When I use static tabs, the data tables are rendered without any flaws:

<b:tabView>
    <b:tab title="Tab1">
        <b:dataTable value="#{entry.list}" var="row">
            <b:dataTableColumn>td1</b:dataTableColumn>
            <b:dataTableColumn>td2</b:dataTableColumn>
            <b:dataTableColumn>td3</b:dataTableColumn>
        </b:dataTable>
    </b:tab>
    <b:tab title="Tab2">
        <b:dataTable value="#{entry.list}" var="row">
            <b:dataTableColumn>td1</b:dataTableColumn>
            <b:dataTableColumn>td2</b:dataTableColumn>
            <b:dataTableColumn>td3</b:dataTableColumn>
        </b:dataTable>
    </b:tab>
    <b:tab title="Tab3">
        <b:dataTable value="#{entry.list}" var="row">
            <b:dataTableColumn>td1</b:dataTableColumn>
            <b:dataTableColumn>td2</b:dataTableColumn>
            <b:dataTableColumn>td3</b:dataTableColumn>
        </b:dataTable>
    </b:tab>            
</b:tabView>

It just happens when I'm using dynamic tabs. I guess that the JS required to render the tables' decorations/input fields is not called properly by the logic that renders the dynamic tabs, or there is an error with the tabs' ID. (So that the JS is called more than once for each table, i.e. called one time for each dynamic tab on each table.)

@geopossachs geopossachs added the dataTable Issues with the main Topic dataTable label Nov 24, 2019
@geopossachs geopossachs self-assigned this Nov 24, 2019
@geopossachs geopossachs added this to the v1.6.0 milestone May 17, 2020
@stephanrauh
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dataTable Issues with the main Topic dataTable
Projects
None yet
Development

No branches or pull requests

4 participants