0
votes

I am having tableview at my .fxml file like below,

<TableView fx:id="tblViewer" prefHeight="340.0"  prefWidth="800.0" 
                             styleClass="tableview" stylesheets="@ClsMain.css" />

I have select box of tables. When I am selecting any table all the data with columns populated into tableview. If columns are more, than tableview automatically render the horizontal scroll bar to it same for vertical scroll bar.

Problem is when I scroll to right end and if I am changing the dropdown selection it is not let me go to the left side. And some of the columns are truncated from the left. Like showing in the image.

enter image description here

If you have the solution then help me out please.

Kind Regards.

Updated:

Here I am binding the tableview and the data

private void initClsTable() {       
        System.out.println("in inintClsTable");
        Bindings.bindContentBidirectional(tblViewer.getColumns(), getViewModel().getColumnList());
        Bindings.bindContentBidirectional(tblViewer.getItems(), getViewModel().getDataList());
    }

Here my selection taken place: (When user changes the selection)

private void subscribechoosenTableDataConfig() {
        this.columnsList.clear();
        this.dataList.clear();
        System.out.println("subscribechoosenTableDataConfig");      
        if (choosenTableDataConfig.get() != null && choosenTableDataConfig.getValue().getTableName() != null
                && choosenTableDataConfig.getValue().getTableNumber() != 0) {
            clsManager.tell(new ClsManager.ClsTableDataRequest(eventHandler, choosenTableDataConfig.getValue()
                    .getTableName(), choosenTableDataConfig.getValue().getTableNumber()), ActorRef.noSender());
        }
    }
1
Can you add more information about the select box to your question? - ItachiUchiha
Question updated please check - php83
This is most probably because you are removing and adding columns dynamically. Can you please add a MCVE to duplicate the issue? - ItachiUchiha
Great dude, I remove those two lines and it is working fine. How can I thanq dude. Really great solution. Bravo - php83
I am not sure weather I can provide MCVE due to so many complexity involved in that, but I will try whenever I get free time. - php83

1 Answers

0
votes

By removing these two lines I have what I wanted.

this.columnsList.clear();
this.dataList.clear();

Many thanks to ItachiUchiha