Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    rulescope regression ?

    Hello

    Since build 2024-08-15 from v13.0p, rulescopes are not functionning anymore for us, at least on ToolStripButton

    Code:
        final var firstButton = new ToolStripButton();
    
        firstButton.setID("MyToolStripButtonID");
    
        firstButton.setEnableWhen(new AdvancedCriteria("MyListGridID.anySelected", OperatorId.EQUALS, true));
    The button stay disabled when a record in the listgrid is selected

    2024-08-14 and previous are ok
    tried up to 2024-08-28

    Best regards

    #2
    Based on this limited information we are unable to reproduce the issue. Can you provide a standalone test case or modify a showcase sample to reproduce your issue?

    Regards
    Isomorphic Software

    Comment


      #3
      Here it is...
      tab_1 is working (ie when you select an item of the listgrid, the ToolStripButton become enabled) but tab_2 and tab_3 are not working because they are in a tabset which is member of another tabset, if you set BUG to false, they are working again but they are all at same level now which is not what I wanted. This was working on 13.0p up to build 2024-08-14...

      Code:
      package com.compodata.smartgwt_bug_1.client;
      
      import java.util.Map;
      import com.google.gwt.core.client.EntryPoint;
      import com.smartgwt.client.data.AdvancedCriteria;
      import com.smartgwt.client.types.OperatorId;
      import com.smartgwt.client.types.SelectionStyle;
      import com.smartgwt.client.types.Side;
      import com.smartgwt.client.util.SC;
      import com.smartgwt.client.widgets.grid.ListGrid;
      import com.smartgwt.client.widgets.grid.ListGridField;
      import com.smartgwt.client.widgets.layout.HLayout;
      import com.smartgwt.client.widgets.layout.SplitPane;
      import com.smartgwt.client.widgets.tab.Tab;
      import com.smartgwt.client.widgets.tab.TabSet;
      import com.smartgwt.client.widgets.toolbar.ToolStrip;
      import com.smartgwt.client.widgets.toolbar.ToolStripButton;
      
      
      /**
      * Entry point classes define <code>onModuleLoad()</code>.
      */
      public class SmartGWT_Bug_1 implements EntryPoint
      {
          private static final boolean BUG = true;
      
          /**
           * This is the entry point method.
           */
          public void onModuleLoad()
          {
              final TabSet mainTabSet = new TabSet();
              final Tab other = new Tab("Other");
              if(BUG)
              {
                  final TabSet otherTabSet = new TabSet();
                  final Tab tab1 = new MyTab(1);
      
                  otherTabSet.setTabs(new MyTab(2), new MyTab(3));
                  other.setPane(otherTabSet);
      
                  mainTabSet.setTabs(tab1, other);
              }
              else
              {
                  mainTabSet.setTabs(new MyTab(1), new MyTab(2), new MyTab(3));
              }
              mainTabSet.setTabBarPosition(Side.TOP);
              mainTabSet.setTabBarAlign(Side.LEFT);
              mainTabSet.setWidth100();
              mainTabSet.setHeight100();
              mainTabSet.draw();
          }
      
          class MyTab extends Tab
          {
              public MyTab(int i)
              {
                  super("tab_"+i);
      
                  final SplitPane pane = new SplitPane();
                  ListGrid navigationPane = new MyGrid(i);
                  pane.setNavigationPane(navigationPane);
                  pane.setDetailToolButtons(new MyToolStrip(i));
                  pane.setDetailPane(new HLayout());
      
                  setPane(pane);
      
              }
          }
      
          class MyToolStrip extends ToolStrip
          {
              public MyToolStrip(int i)
              {
                  super();
      
                  setWidth100();
      
                  final ToolStripButton acceptButton = new ToolStripButton();
                  acceptButton.setID("AcceptBtn_"+i);
                  acceptButton.setIcon("[SKIN]/actions/accept.png");
                  acceptButton.setShowFocused(false);
                  acceptButton.setPrompt("Accept "+i);
                  acceptButton.addClickHandler(e -> SC.warn("accept " + i));
                  acceptButton.setEnableWhen(new AdvancedCriteria("BaseList_" + i + ".anySelected", OperatorId.EQUALS, true));
      
                  addButton(acceptButton);
              }
          }
      
          class MyGrid extends ListGrid
          {
              public MyGrid(int i)
              {
                  super();
      
                  setID("BaseList_" + i);
                  setSelectionType(SelectionStyle.SINGLE);
                  setFields(new ListGridField("value"));
                  setData(new com.smartgwt.client.data.Record[] {new com.smartgwt.client.data.Record(Map.of("value", "test"))});
              }
          }
      }
      Last edited by opty; 3 Sep 2024, 03:53.

      Comment


        #4
        Thanks for the example. We are reproducing this issue and it is being looked at. We'll followup with more information when we have it.

        Regards,
        Isomorphic Software

        Comment


          #5
          Please try again with builds dated September 4 or later.

          Comment


            #6
            Ok, I will do as soon as it is available in builds folder

            Comment


              #7
              Good news, it's working again with 2024-09-04 build
              Thank you

              Comment

              Working...
              X