Announcement

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

    DynamicForm group border - is this a bug?

    I am trying to create a dynamicform as a group but without group title. And when I do that, the default border is created without group title as expected. However, there is a little hold on the upper left hand near the corner, I think this is where the title would be, if specified. And I can not find a way to remove that gap. I have tried all the possible combination of the below. Please see the attached screen capture for reference.

    Here is what I had tried..combination of all these.
    --
    final String nullString = "";

    final DynamicForm form = new DynamicForm() {{
    setAttribute("groupTitle", nullString , false);
    setAttribute("titleSuffix", nullString, false);
    setAttribute("titlePrefix", nullString, false);
    setAttribute("titleWidth", 0, false);
    //setAttribute("numCols", 1, false);
    setAttribute("requiredTitlePrefix", nullString, false);
    setAttribute("requiredTitleSuffix", nullString, false);
    //setAttribute("groupLabelPadding", "", false);
    setAttribute("showEdges", 0, true);
    //setAttribute("extraSpace", 0, false);
    }};

    form.setExtraSpace(0);
    form.setIsGroup(true);
    form.setShowEdges(false);
    form.setGroupTitle(nullString);
    //form.setBorder("1px solid gray");
    -------

    And none of them worked.
    If you could please take a look at the attached screen capture or try to create a simple group without group title, you will see what I mean.

    I really need to figure this out, so please please help!~
    Attached Files

    #2
    hi

    I have done a dynamic form with border ,am attaching screenshot,is this ur need pls tell ???
    Attached Files

    Comment


      #3
      Hey vinuriyer,
      I'm also interested doing this. can you please provide the code through which you've achieved this?

      Comment


        #4
        Originally posted by RAS
        I'm also interested doing this. can you please provide the code through which you've achieved this?
        hi ras ,

        Please wait on ,i'll provide the code

        Comment


          #5
          hi test(hop this is not ur name.still ur reference is as) and RAS,

          Here is the small sample to show the border for a dynamic form.as i suggested in same topic with test in another thread,i used setborder(String) for dynamicform.Please check it out

          Comment


            #6
            Originally posted by vinuriyer
            hi test(hop this is not ur name.still ur reference is as) and RAS,

            Here is the small sample to show the border for a dynamic form.as i suggested in same topic with test in another thread,i used setborder(String) for dynamicform.Please check it out

            package org.yournamehere.client;




            import com.google.gwt.core.client.EntryPoint;
            import com.smartgwt.client.types.Alignment;
            import com.smartgwt.client.widgets.form.DynamicForm;

            import com.smartgwt.client.widgets.form.fields.ButtonItem;
            import com.smartgwt.client.widgets.form.fields.PasswordItem;
            import com.smartgwt.client.widgets.form.fields.TextItem;
            import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
            import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
            import com.smartgwt.client.widgets.layout.VLayout;




            /**
            * Login Panel Operations
            * @author Vinu Iyer (GTL ,Emp-id: 05726)
            */
            public class LoginPanel implements EntryPoint{

            private DynamicForm dynamicForm = new DynamicForm();
            private VLayout layout = new VLayout();
            /**
            * Constructor
            * @param mainEntryPoint -reference of mainentrypoint
            */
            public LoginPanel() {

            layout.setLayoutTopMargin(200);
            layout.setLayoutLeftMargin(300);
            layout.setPixelSize(300, 200);
            initComponents();
            layout.draw();
            }

            /**
            * Initailizing the components
            */
            public void initComponents(){

            TextItem usField = new TextItem("usname","Username");
            usField.setRequired(true);
            PasswordItem paField = new PasswordItem("pass","Password");
            paField.setRequired(true);
            ButtonItem loginButton = new ButtonItem(" Login > ");

            dynamicForm.setBorder("1px solid #e8eef7");
            dynamicForm.setPixelSize(290, 190);
            dynamicForm.setFields(usField,paField,loginButton);
            dynamicForm.setAlign(Alignment.CENTER);

            layout.addMember(dynamicForm);


            //Adding Listeners
            loginButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
            if(dynamicForm.validate(false)){
            checkLogin();
            }
            }
            });

            }

            /**
            * This method is to check login,by passing username and password to server
            * @param username
            * @param password
            */
            private void checkLogin() {

            // Enter the logic to check it
            }

            /**
            * To clear the fields
            */
            public void clearValues() {
            dynamicForm.setValue("usname","");
            dynamicForm.setValue("pass","");
            }

            public void onModuleLoad() {
            new LoginPanel();
            }


            }

            Comment


              #7
              Also for more spacial and neat way

              package org.yournamehere.client;




              import com.google.gwt.core.client.EntryPoint;
              import com.smartgwt.client.widgets.form.DynamicForm;
              import com.smartgwt.client.widgets.events.ClickEvent;
              import com.smartgwt.client.widgets.events.ClickHandler;

              import com.smartgwt.client.widgets.IButton;
              import com.smartgwt.client.widgets.form.fields.PasswordItem;
              import com.smartgwt.client.widgets.form.fields.TextItem;
              import com.smartgwt.client.widgets.layout.VLayout;




              /**
              * Login Panel Operations
              * @author Vinu Iyer (GTL ,Emp-id: 05726)
              */
              public class LoginPanel implements EntryPoint{


              private IButton loginButton = new IButton("Login >") ;
              private DynamicForm dynamicForm = new DynamicForm();
              private VLayout layout = new VLayout();
              /**
              * Constructor
              * @param mainEntryPoint -reference of mainentrypoint
              */
              public LoginPanel() {

              layout.setLayoutTopMargin(300);
              layout.setLayoutLeftMargin(200);
              layout.setPixelSize(300, 200);
              layout.setBorder("1px solid #e8eef7");

              layout.setMembersMargin(10);
              layout.setLayoutMargin(35);
              initComponents();
              layout.draw();
              }

              /**
              * Initailizing the components
              */
              public void initComponents(){

              TextItem usField = new TextItem("usname","Username");
              usField.setRequired(true);
              PasswordItem paField = new PasswordItem("pass","Password");
              paField.setRequired(true);

              loginButton.setPixelSize(80, 25);
              dynamicForm.setPixelSize(200, 50);
              dynamicForm.setFields(usField,paField);

              layout.addMember(dynamicForm);
              layout.addMember(loginButton);

              //Adding Listeners
              loginButton.addClickHandler(new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
              if(dynamicForm.validate(false)){
              checkLogin();
              }
              }
              });

              }

              /**
              * This method is to check login,by passing username and password to server
              * @param username
              * @param password
              */
              private void checkLogin() {

              // Enter the logic to check it
              }

              /**
              * To clear the fields
              */
              public void clearValues() {
              dynamicForm.setValue("usname","");
              dynamicForm.setValue("pass","");
              }

              public void onModuleLoad() {
              new LoginPanel();
              }


              }

              This code setting border for a layout container containing the dynamic form

              Comment


                #8
                Thank you for providing the code and I do really appreciate the help.

                I believe you have a dynamicform(not a group) and set the border manually.
                But, I wanted to form a dynamicform group without grouptitle by setting;
                dynamicForm.setIsGroup(true);
                dynamicForm.setGroupTitle("");

                And when I do that I expect the default border around the formitems without grouptitle. The problem I am facing is that it creates default border around formItems and no grouptitle as I expected. However, it leaves this little hole uppoer left near corder that I CAN NOT seem to remove it.

                Could please help how I can form a dynamicform group without group title?
                Last edited by test; 29 Mar 2011, 04:50.

                Comment


                  #9
                  Hmm

                  I understand ur problem,a gap is coming because the function setGrouptitle()
                  is

                  <CODE>
                  /**
                  * Set the groupTitle.
                  *
                  * @param groupTitle the groupTitle
                  */
                  public void setGroupTitle(String groupTitle) {
                  setAttribute("groupTitle", groupTitle, true);
                  }
                  </CODE>
                  So even u put the group title null or "" ,the third parameter is true ,so it will display the title.if or if not the attribute will display..so its not a bug

                  Comment


                    #10
                    Thank you again for looking into this problem.

                    I did try to set that third value to false, as you can see from my post;
                    --
                    setAttribute("groupTitle", nullString , false);
                    ---
                    BUT, that did not work. And you mentioned it is not a bug..does that you mean you know the workaround to resolve this? or There is NO WAY TO REMOVE THAT GAP?

                    Comment


                      #11
                      I still don't see why a border on the form is a lesser solution. A group has a title but a border does not.

                      Comment

                      Working...
                      X