Announcement

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

    sectionStackSection event does not work when there is a child on it!

    Hi folk,

    I have a label added as a child on SectionStackSection, when the user clicks on the label the sectionStackSection does not change its state from collapse to expand or vice versa. It seems to me that the event does not propagate from the label to the sectionStackSection, Does any one have an idea about this issue?

    #2
    Here is a sample code of the problem

    Code:
    public void onModuleLoad() {
    		
    		SectionStack mainSectionStack = new SectionStack();
    		SectionStackSection sectionStacksection1 = new SectionStackSection();
    		SectionStackSection sectionStacksection2 = new SectionStackSection();
    		
    		//Add SectionStackSections to the main SectionStack
    		mainSectionStack.addSection(sectionStacksection1);
    		mainSectionStack.addSection(sectionStacksection2);
    		
    		//Define HLayout to put it inside the SectionStackSections
    		HLayout layout = new HLayout();layout.setHeight("50%");
    		layout.setBackgroundColor("#FF0000");
    		
    		//Add HLayout to the SectionStackSections
    		sectionStacksection1.addItem(layout);
    		
    		layout = new HLayout();layout.setHeight("50%");
    		layout.setBackgroundColor("#00FF00");
    		sectionStacksection2.addItem(layout);
    		
    		//Define HeaderLabel
    		Label sectionHeaderLabel=new Label();
    		sectionHeaderLabel.setHeight(15);
    		sectionHeaderLabel.setWidth(90);
    		sectionHeaderLabel.setLeft(25);
    		sectionHeaderLabel.setTop(3);
    		sectionHeaderLabel.setContents("Test");
    		
    		SectionHeader sectionHeader2 = mainSectionStack.getSection(1).getSectionHeader();
    		sectionHeader2.addChild(sectionHeaderLabel);
    		
    		//Draw the sectionStackSection
    		mainSectionStack.draw();
    		
    }
    Now if you tried to click on the "Test" that is located on the seconde sectionStackSection Header, the SectionStackSection will not receive the event in other word it does not expand or collapse when clicking on the label.

    Is there a way to make the label to pass the click handler to the sectionStackSection?

    Note: the above issue is appear on IE, FF and chrome on all versions

    Comment


      #3
      Your label is occluding the other controls. It's not clear what it's for, but you could use sendToBack() to move it behind other controls, or just call expandSection()/collapseSection when its clicked.

      Comment


        #4
        Thanks Isomorphice for your reply.

        I put the headerLabel in order to control the style and the position of it.

        Comment

        Working...
        X