Announcement

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

    How to Joint multiple DynamicForms as one single logic form?

    I am new on SmartGWT and using firefox 3.6.10.
    I am pleased to know how to joint multiple DynamicForms as a logic form to submit all the data to server side?

    I know a class ValuesManager is involed but I dun know how it actually does.
    May I have a concret example?

    Here is my code
    Code:
    TextItem userName = new TextItem();
            userName.setName("userName");
            userName.setTitle("User Name");
            userName.setWrapTitle(false);
    
    PasswordItem password = new PasswordItem();
            password.setName("password");
            password.setTitle("Password");
    
    TextItem age = new TextItem();
            age.setName("age");
            age.setTitle("Age");
    
    TextItem sex = new TextItem();
            userName.setName("sex");
            userName.setTitle("Sex");
    
    final DynamicForm form0 = new DynamicForm();
            form0.setID("form0");
            form0.setAction("register.htm");
            form0.setMethod(FormMethod.POST);
            form0.setFields(userName,password);
    
    final DynamicForm form1 = new DynamicForm();
            form0.setID("form1");
            form0.setAction("register.htm");
            form0.setMethod(FormMethod.POST);
            form0.setFields(age,sex);
    
    Tab tab1 = new Tab("Tab1");
            tab1.setAttribute("height", 20);
            tab1.setPane(form0);
    Tab tab2 = new Tab("Tab2");
            tab2.setAttribute("height", 20);
            tab2.setPane(form1);
    
    IButton submit = new IButton();
            submit.setTitle("Submit");
            submit.addClickHandler(new ClickHandler() {
    			public void onClick(ClickEvent event) {
                            //I would like to joint two forms and submit to register.htm(it is a jsp actually)
    			}
            });
    
    TabSet tabset = new TabSet();
            tabset.setTabBarPosition(Side.LEFT);
            tabset.setWidth100();
            tabset.setHeight100();
            tabset.setTabBarThickness(70);
            tabset.addTab(tab1);
            tabset.addTab(tab2);
    
    VLayout vLayout = new VLayout();
            vLayout.setMembersMargin(10);
            vLayout.addMember(tabset);
            vLayout.addMember(submit);
            vLayout.draw();

    #2
    Have you consult the JavaDoc of SmartGWT yet?

    http://www.smartclient.com/smartgwt/...esManager.html

    Comment


      #3
      I did, I have spent the whole day for it, sorry for my stupid.
      > <

      Comment

      Working...
      X