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

Tabbox model binding (close tab issue)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.0
    • 7.0.0
    • Components
    • Security Level: Jimmy

      tabboxes using the model feature ZK-1845 / ZK-2002 get into an inconsitent state, when the <tab>s use closable="true"
      when the tab is closed the the tabbox component does not, and cannot remove it from the ListModel - as it is readonly.

      workaround:
      the ListModel item can be removed by the application during the onClose event of a <tab> component

      <tab label="@load(each)" closable="true" onClose="@command('closeTab', page=each)"/>
      
      @Command("closeTab")
      public void onCloseTab(@BindingParam("page") String page) {
      	tabsModel.remove(page);
      }
      

      the problem with this workaround is the fact, that the component is being removed 2 times once by the models onChange event, and by the <tab> component itself in its close() method calling detatch... however this works, but might lead to (unknown) side effects

      so in the usecase of model with closable, the default detach behaviour should be disabled (stopping the event) and indicating the developer that he should handle the onClose event by updating the model for the tabbox.

            jumperchen jumperchen
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: