Announcement

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

    Align SubmitItems in a Form

    Hi,
    I'm having one form and it has two submit items, submitItem and ResetItem. When i set these items to form, they are displaying in two different rows. But i want them in single row.

    I know one way to achieve this ie., instead of taking submit items, by taking HLayout with two IButtons and adding HLayout to the main panel after form.

    But i want to achieve this with SubmitItems only. I tried couple of options but no luck. Is there a way to display them in single row and align them to center?

    1) I've got solution to place them in single row in another post but unable to center them to form. I'm using like below:
    btnSubmit.setStartRow(true);
    btnSubmit.setEndRow(false);
    ....
    btnReset.setStartRow(false);
    btnReset.setEndRow(true);
    ....
    form.setItems(btnSubmit,btnReset);
    ....
    PFA screenshot attached.

    2) how to auto adjust label width in the form? In the screenshot, deploymentType displayed in two lines.
    Attached Files
    Last edited by skaluva; 19 Apr 2011, 05:46.

    #2
    See details on form layout in the docs. You can add setting to not allow wrapping of titles or define columns and widths, etc. to address your needs. You may find your layout is best achieved with the added HLayout for your buttons though.

    Comment


      #3
      Hi david,
      1) Thanks for your suggestion. But for HLayout we can only add IButtons but not SubmitItems. If we write IButtons, we need to add click handler for them and need to call form.submit() manually whereas for SubmitItems we dont need to all these things. Adding SubmitItem to Form is enough. Everything will be done automatically. Thats y i asked i there anyway to center align submit items to the form. If there is no option, i will go for HLayout implementation.

      2) Used form.setWrapItemTitles(false); It worked. Thanks.

      Comment


        #4
        1. True, but commonly you want to trigger something else during the click as well like closing the form for instance. You can still get the desired effect by using 4 columns with correct sizes and then colSpans on the actual form items. It will probably be clearer in the end to see the HLayout and extra call then to modify all the other fields. Although for a form this small it may not.

        2. Great.

        Comment

        Working...
        X