Announcement

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

    MenuBar and Vlayout

    Hi,

    i have the 2.4 version and want to add a menubar to a vlayout - but i only get a java script exception...

    This is my code:

    Code:
    MenuBar bar = new MenuBar();
    bar.setWidth100();
    bar.setHeight100();
    
    newmail = new MenuButton();
    newmail.setTitle("Create Mail");
    newmail.setAutoFit(true);
    
    bar.addMember(newmail);
    addMember(bar);
    After this i get this error message:

    Code:
    Uncaught JavaScript exception [this.menus is undefined] in http://127.0.0.1:8888/com.ctk.verwaltung.Index/sc/modules/ISC_Grids.js, line 3503
    What is my mistake? Thank you for help ;)
    Greets RBS2002

    #2
    That's not complete code obviously - try creating a standalone test case.

    Comment


      #3
      This is the complete code from a standalone ;) Here the complete code

      Code:
      public class MainSupport extends VLayout{
      	
      	private MenuButton newmail;
      	private MenuButton replymail;
      	private MenuButton removemail;
      	private MenuButton printmail;
      	
      	public MenuButton getReplymail() {
      		return replymail;
      	}
      	
      	public MainSupport() {
      		setSize("100%", "100%");
      		moveTo(0, 0);
      		setMembersMargin(5);
      		
      		MenuBar bar = new MenuBar();
      		bar.setWidth100();
      		bar.setHeight100();
      		
      		newmail = new MenuButton();
      		newmail.setTitle("Verfassen");
      		newmail.setAutoFit(true);
      		
      		replymail = new MenuButton();
      		replymail.setTitle("Antworten");
      		replymail.setAutoFit(true);
      		
      		removemail = new MenuButton();
      		removemail.setTitle("L\u00f6schen");
      		removemail.setAutoFit(true);
      		
      		printmail = new MenuButton();
      		printmail.setTitle("Drucken");
      		printmail.setAutoFit(true);
      		
      		bar.addMember(newmail);
      		
      		//addChild(bar);
      		//addMember(bar);
      		addMember(new MailWindow(this));

      Comment


        #4
        or is this not possible - i have a Root Panel and a TabSet with a tab - at this tab i add this vlayout - and at this vlayout i want to add a menue bar. I added a screenshot to show what i mean ;)

        Greets RBS2002
        Attached Files

        Comment


          #5
          You don't need to create explicit MenuButtons for each menu - simply call 'setTitle' on the menu instances and apply them directly to the MenuBar via addMenus()

          Comment

          Working...
          X