Enable Tab from another Tab in javafx

0

I need your help:

I have an application where I want to enable Tab when selecting a row from a table, this is a simple thing, but a complication has arisen, since each Tab has its FXML and controller independently.

I have a% main% co with its FXML in which I include the other FXML with TabPane and each has its controller (subcontroller).

The Tab selected by default has a table in which clients are listed, and when selecting one, I want to enable the other Tab that are disabled by default (They have customer data that is displayed when I select a client, but they are deactivated).

I control the change of Tab's from the main controller where the TabPane is and pass values between them without problems, but I am not able to enable and disable Tab .

TabPane where I include the Tab's

<TabPane fx:id="tabPaneClientes" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" tabClosingPolicy="UNAVAILABLE">
        <tabs>
            <Tab fx:id="tabClientesEdicion" closable="false" text="Edicion">
                <content>
                    <fx:include fx:id="tabEdicion" source="TabClientesEdicionVista.fxml" />
                </content>
            </Tab>
            <Tab fx:id="tabClientesFactura" closable="false" text="Facturas">
                <content>
                    <fx:include fx:id="tabFactura" source="TabClientesFacturaVista.fxml" />
                </content>
            </Tab>
            <Tab fx:id="tabClientesDevolucion" closable="false" text="Devoluciones">
                <content>
                    <fx:include fx:id="tabDevolucion" source="TabClientesDevolucionVista.fxml" />
                </content>
            </Tab>
        </tabs>
    </TabPane>

How could I solve it?

    
asked by Maurikius 19.02.2017 в 02:50
source

1 answer

0

I have already found the solution, I have communicated the drivers of the fxml included with the main one (quite obvious, but I had not thought about it), I passed a link where I obtained the solution. link

    
answered by 19.02.2017 в 09:48