Announcement

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

    #16
    We made some attempts to reproduce this but no luck. Below is one example that seems to follow the pattern you describe, but works correctly. You can turn on the "draws" log in the Developer Console to verify that the drawing order is as you describe.

    The only thing we can suggest is that maybe you are using Canvas containers in some places instead of Layouts. Because a Canvas does not impose a visual order on it's children, it also does not manage their tab order - it is undefined.

    Code:
    isc.VLayout.create({
        ID:"main",
        autoDraw:true,
        members: [
            isc.Button.create({
                title:"First"
            }),
            isc.Button.create({
                title:"Second"
            })
        ]
    })
    
    main.addMember(isc.VLayout.create({
        autoDraw:false,
        ID:"inner"
    }), 1);
    
    isc.logWarn("adding form");
    inner.addMember(
    isc.DynamicForm.create({
        autoDraw:false,
        items : [
            { name:"textField" }
        ]
    }));
    isc.logWarn("added form");

    Comment


      #17
      No, we don't use Canvases as containers, only Layouts.

      The important thing here is that there 3 different Layouts:

      Code:
      Top layout (drawn)
        - LayoutA (drawn)
        - LayoutB (drawn)
        - LayoutC (drawn)
          -- childrens (drawn)
      So approximate sequence is the following:

      - first adding children to the "LayoutB":
      ----- add new "LayoutBChild"
      ---------- add new "DynamicFormB"

      - then adding children to the "LayoutA" above:
      ----- add new "LayoutAChild"
      ---------- add new "DynamicFormA"

      After that, "LayoutBChild" gets chance to be drawn and starts calculating indexes. It gets previous tab widget - "DynamicFormA" (just added and still has default tab index) and allocating indexes starting from some global index.

      Note, there is no problem with LayoutA or LayoutC after that - only LayoutB has broken index.
      Result tabbing: LayoutA - LayoutC - LayoutB

      Comment


        #18
        Like this? Still works perfectly.

        Code:
        isc.VLayout.create({
            ID:"main",
            autoDraw:true,
            members: [
                isc.VLayout.create({
                    ID:"layoutA",
                    autoDraw:false
                }),
                isc.VLayout.create({
                    ID:"layoutB",
                    autoDraw:false
                }),
                isc.VLayout.create({
                    ID:"layoutC",
                    members:[
                        isc.Button.create({
                            title:"First",
                            autoDraw:false
                        })
                    ]
                })
            ]
        })
        
        isc.logWarn("adding children");
        
        layoutB.addMember(isc.VLayout.create({
            autoDraw:false,
            ID:"layoutBChild"
        }));
        
        layoutBChild.addMember(
        isc.DynamicForm.create({
            autoDraw:false,
            items : [
                { name:"textFieldB1" },
                { name:"textFieldB2" }
            ]
        }));
        
        layoutA.addMember(isc.VLayout.create({
            autoDraw:false,
            ID:"layoutAChild"
        }));
        
        layoutAChild.addMember(
        isc.DynamicForm.create({
            autoDraw:false,
            items : [
                { name:"textFieldA1" },
                { name:"textFieldA2" }
            ]
        }));
        
        isc.logWarn("added all children");

        Comment


          #19
          Of course it works perfectly. I tried different scenarios, more complicated then that.
          As I said I could not reproduce it as a standalone example, because it's a sort of timing issue.
          Maybe what is also makes a difference is what are you inserting in the layout and how big is it, maybe because it adds children on timers. Who knows.

          But the fact is IT HAPPENS.

          Comment


            #20
            OK.. at this point we still don't know if you're getting the results you're getting because of some kind of usage error, but even if it is a real bug, it's beginning to sound as though it's unlikely anyone will ever hit it again, so we need to stop spending time on it. Luckily, you have an approach that works for you.

            Comment

            Working...
            X