Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2552

Tabbox model NotifyChange problem

    Details

      Description

      run the attached example:
      removing a tab (other than the currently selected), will cause incorrect rendering of the last tab

      the example also contains a commented out (more efficient) usage - which does not cause the problem

      as well as a workaround in case the @NotifyChange is required (for some reason), by really replacing the ListModel instance (maybe that's a hint for a fix)

      1. remove-tab-model.zul
        0.7 kB
        cor3000
      2. TabboxRemoveViewModel.java
        1.0 kB
        cor3000

        Activity

        Hide
        jumperchen jumperchen added a comment -

        Bug fixed since 2/4/2015

        Show
        jumperchen jumperchen added a comment - Bug fixed since 2/4/2015
        Hide
        jumperchen jumperchen added a comment -

        conflict with ZK-2013

        Show
        jumperchen jumperchen added a comment - conflict with ZK-2013
        Hide
        jumperchen jumperchen added a comment -

        refixed since 2/13/2015

        Show
        jumperchen jumperchen added a comment - refixed since 2/13/2015
        Hide
        jumperchen jumperchen added a comment -

        Bug fixed in ZK 8.0 since 2/17/2015

        Show
        jumperchen jumperchen added a comment - Bug fixed in ZK 8.0 since 2/17/2015
        Hide
        WilliamB WilliamB added a comment -

        Hello,

        Since 8 is not a release yet, any plan to fix that for 7?
        It's a deal breaker for me atm ....

        Thanks

        Show
        WilliamB WilliamB added a comment - Hello, Since 8 is not a release yet, any plan to fix that for 7? It's a deal breaker for me atm .... Thanks
        Hide
        cor3000 cor3000 added a comment -

        since this issue required a low level fix and has possible greater impact on other components this issue is only fixed in the next major version.

        The above example includes (commented out) workarounds to avoid the issue by either choosing a more efficient implementation or a one line change to fix it in the VM when really in the need to replace the whole model

        Show
        cor3000 cor3000 added a comment - since this issue required a low level fix and has possible greater impact on other components this issue is only fixed in the next major version. The above example includes (commented out) workarounds to avoid the issue by either choosing a more efficient implementation or a one line change to fix it in the VM when really in the need to replace the whole model
        Hide
        WilliamB WilliamB added a comment - - edited

        So I guess the issue I've is something else.
        Because even without notify I get the bug :

        Get a zul with 3 closable tabs using model on tabbox.
        And a VM with a closetab method with a tab parameter which just does model.remove(tab).

        Click on Tab3
        Close Tab2
        => console log "Tab to Close : Tab2" & "Index of Tab to Close : 1"
        Close Tab3
        => Expected : console log "Tab to Close : Tab3" & "Index of Tab to Close : 1"
        => Current : console log "Tab to Close : null" & console log "Index of Tab to Close : 2"

        So when I remove Tab2, the Tab3 index still is 3.
        And if I add a new tab, Tab4, its index will also be 3 : now it's impossible to select tab3 as even with a click on it, it's Tab4 that is selected ....

        If you have a work around please help.

        Show
        WilliamB WilliamB added a comment - - edited So I guess the issue I've is something else. Because even without notify I get the bug : Get a zul with 3 closable tabs using model on tabbox. And a VM with a closetab method with a tab parameter which just does model.remove(tab). Click on Tab3 Close Tab2 => console log "Tab to Close : Tab2" & "Index of Tab to Close : 1" Close Tab3 => Expected : console log "Tab to Close : Tab3" & "Index of Tab to Close : 1" => Current : console log "Tab to Close : null" & console log "Index of Tab to Close : 2" So when I remove Tab2, the Tab3 index still is 3. And if I add a new tab, Tab4, its index will also be 3 : now it's impossible to select tab3 as even with a click on it, it's Tab4 that is selected .... If you have a work around please help.
        Hide
        cor3000 cor3000 added a comment - - edited

        this is a working example http://zkfiddle.org/sample/8kvoib/1-zk2552-workaround
        if you encounter something else, then it might be a separate problem or bug

        Show
        cor3000 cor3000 added a comment - - edited this is a working example http://zkfiddle.org/sample/8kvoib/1-zk2552-workaround if you encounter something else, then it might be a separate problem or bug

          People

          • Assignee:
            hanhsu hanhsu
            Reporter:
            cor3000 cor3000
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours
              2h