Announcement

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

    TabSelected event fires on creation of tabSet

    Hello Isomorphic ,

    in the code below the tabSelected event fires just after the creation. Although no tab was selected. I need the event to fire only when the user actually selects a tab.

    How can it be avoided that the tabSelected event fires just after creating the tabSet?

    Using SmartClient_v82p_2012-07-09

    Greetings Thomas
    Code:
     
    isc.TabSet.create(
     {
      "ID":"tabSet_3",
      "tabSelected":function (p1, p2, p3, p4) {alert("Tab selected")},
      "width":800,
      "height":400,
      "tabs":
      [
       {
        "title":"First Tab",
        pane:isc.Canvas.create(
         {
          "contents":"Contents of first Tab"
         }
         )
       },
       {
        "title":"Second Tab",
        pane:isc.Canvas.create(
         {
          "contents":"Contents of second Tab"
         }
         )
       }
      ]
     }
     );

    #2
    This happens at draw, because a tab does indeed become selected at draw.

    To avoid drawing, set autoDraw:false.

    Comment


      #3
      thank you for the prompt response.

      with autoDraw:false the whole tabSet will be not drawn.

      But in this case I´m actually adding the tabSet to a layout as a member. The parent layout has autoDraw set to true, and the tabSet has autoDraw set to false.

      How can in this case the fireing of the tabSelected event be avoided?

      Comment


        #4
        Ultimately on your application, if you want the user to see the tabset it will of course be drawn. In the scenario you describe this is happening when it gets added as a member to a layout.

        When the tabset is drawn, one of its tabs becomes selected, and the tabSelected handler fires. It is not currently possible to disable this behavior.

        Comment

        Working...
        X