B4J Question Tableview Anomaly when column resizing.

Discussion in 'B4J Questions' started by Jmu5667, Oct 5, 2018.

  1. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Hello

    I have a table view with 7 cols. The first 2 cols are text, and the remainder 5 cols have a checkbox in them.

    upload_2018-10-5_12-52-39.png

    When I resize any of the cols that have a checkbox using the double click on the col header when the mouse icon turns to resize the following occurs:

    upload_2018-10-5_12-54-21.png


    Is this a bug, or if there a redraw required, or can I just disable col resizing.

    Regards

    John.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    How are you creating the checkbox cells? Try to put the checkbox in a pane with a fixed size.
     
  3. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Code:
    Sub CreateItemCB (ci As CellIndex) As CheckBox
       
       
    Dim cb As CheckBox
       
    Dim ch As ChannelPTT
       
       ch.Initialize
       ch = Channels.Get(ci.Column-
    2)
       
       cb.Initialize(
    "cb")
       cb.Tag = ci
       cb.TooltipText = ch.name

       
    Return cb
       
       
    End Sub
    I will try the pane method
     
  4. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    I have just tried the following:


    Code:
    ' // create all the channels for this row
                   For x = 2 To tvAccounts.ColumnsCount-1
                       tvAccounts.SetColumnWidth(x,
    50)
                       
    ' // for each cell we create a cell index and checkbox for each channel and store the key
                       Dim ci As CellIndex
                       
    Dim p As Pane
                      
                       p.Initialize(
    "")
                      
                       ci.key = rs1.GetString(
    "device_id")
                       ci.Column = x
                       ci.Row = rowIndex
                       p.AddNode(CreateItemCB(ci),
    0,0,-1,-1)
                       row(x) = p
                   
    Next
    I still get the same result. Where I am adding the pane node using -1,-1 I also tried using 60,60 to see if there was a difference and there was not.

    Regards

    John.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Don't use -1.
    Set the pane size with Pane.SetLayout.
     
  6. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Did This, same result. There is only pane.SetLayoutAnimated.

    Code:
    ' // create all the channels for this row
                   For x = 2 To tv.ColumnsCount-1
                       tv.SetColumnWidth(x,
    50)
                       
    ' // for each cell we create a cell index and checkbox for each channel and store the key
                       Dim ci As CellIndex
                       
    Dim p As Pane

                       
                       p.Initialize(
    "")
                       ci.key = rs1.GetString(
    "device_id")
                       ci.Column = x
                       ci.Row = rowIndex
                       
                       p.AddNode(CreateItemCB(ci),
    0,0,60,60)
                       p.SetLayoutAnimated(
    0,0,0,60,60)
                       row(x) = p
                   
    Next
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    It is the same.

    Might be a bug in TableView. If you can reproduce it in a small project that I might be able to find a workaround.
     
  8. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Here you go.

    When you run this double click the col header to resize the col and you will see the effect. However when you scroll down past the cb's that have disappeared and then scroll back up they will reappear.

    Regards

    John.
     

    Attached Files:

  9. Erel

    Erel Administrator Staff Member Licensed User

  10. Jmu5667

    Jmu5667 Well-Known Member Licensed User

  11. Erel

    Erel Administrator Staff Member Licensed User

    Yes. The drawing happens in JavaFX layer.
     
    Jmu5667 likes this.
  12. Jmu5667

    Jmu5667 Well-Known Member Licensed User

    Thanks for help.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice