Announcement

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

    ComboBoxItem Intermittently Throws Exception

    I have a fairly simple use case that is causing an exception to occur when selecting a ComboBoxItem in a panel to display the drop-down. It only seems to happen when running the Java code, the deployed JavaScript code works correctly. The following exception is being thrown and the code sample is the source code that creates the ComboBoxItem. If anyone has encountered this or has any idea of what might be causing it, I'd appreciate the input.

    Exception:

    Initializing AppEngine server
    The server is running at http://localhost:8888/
    Uncaught JavaScript exception [_4.body is undefined] in http://127.0.0.1:8888/imod/sc/modules/ISC_Forms.js, line 1844

    Code:
            HLayout mainLayout = new HLayout();
            mainLayout.setWidth("100%");
            mainLayout.setHeight("*");
            mainLayout.setPadding(new Integer(0));  
            mainLayout.setMargin(new Integer(0));  
            mainLayout.setMembersMargin(new Integer(5));
    
            VLayout rightLayout = new VLayout(5);
            rightLayout.setWidth("*");
            rightLayout.setHeight100();
            rightLayout.setPadding(new Integer(10));  
            rightLayout.setOverflow(Overflow.HIDDEN);
            rightLayout.setGroupTitle("Production Results");
            rightLayout.setIsGroup(Boolean.TRUE);
    
            mainLayout.addMember(rightLayout);
    
            viewCB = new ComboBoxItem(); 
            viewCB.setWidth("100%");
            viewCB.setTitle("View Set");
            viewCB.setHint("Choose from different sets of views");
            viewCB.setType("comboBox");  
            viewCB.setValueMap("Campaign Preview", "Campaign Fulfillment", "Campaign Schedules");  
            viewCB.setDefaultValue("Campaign Preview");
            viewCB.setTitleAlign(Alignment.LEFT);
            viewCB.setTextAlign(Alignment.LEFT);
            viewCB.setDisabled(Boolean.TRUE);
            
            viewTypeCB = new ComboBoxItem(); 
            viewTypeCB.setWidth("100%");
            viewTypeCB.setTitle("View");
            viewTypeCB.setHint("Choose view within the current set");
            viewTypeCB.setType("comboBox");  
            viewTypeCB.setValueMap("HTML", "Text", "XML");  
            viewTypeCB.setDefaultValue("HTML");
            viewTypeCB.setTitleAlign(Alignment.LEFT);
            viewTypeCB.setTextAlign(Alignment.LEFT);
            viewTypeCB.setDisabled(Boolean.TRUE);
    
            viewForm = new DynamicForm();  
            viewForm.setWidth100();
            viewForm.setCellSpacing(new Integer(5));
            viewForm.setCellPadding(new Integer(0));
            viewForm.setHeight(65);
            viewForm.setMargin(new Integer(0));
            viewForm.setPadding(new Integer(0));  
            viewForm.setOverflow(Overflow.HIDDEN);
            viewForm.setNumCols(2);
            viewForm.setAlign(Alignment.LEFT);
            viewForm.setTitleOrientation(TitleOrientation.LEFT);
            viewForm.setFields(viewCB, viewTypeCB);
    
            rightLayout.addMember(viewForm);

    #2
    There is a problem with
    viewCB.setWidth("100%");

    Try:
    // viewCB.setWidth("100%");

    and you'll see the javascript error goes away

    Comment


      #3
      this works better:

      .setWidth(500);

      that is, an int instead of a String argument.

      Comment


        #4
        Compiler issue?

        I guess i am missing something but shouldn't the compiler pick up this issue?

        Comment


          #5
          The correct setting is "*" rather than 100%. FormItems do not support percent sizing - we'll make this clearer in the docs and most likely add a failed assertion to catch this case clearly.

          Comment


            #6
            Compiler Error

            It'd be great if you added an assertion. One of the big reasons to use GWT over your javascript lib is for the compiler checking of syntax.

            Comment


              #7
              Added asset check to disallow setting percent size height / width for FormItem's.

              Sanjiv

              Comment

              Working...
              X