1. #1
    Sencha User abshnasko's Avatar
    Join Date
    Sep 2011
    Posts
    44
    Answers
    1
    Vote Rating
    0
    abshnasko is on a distinguished road

      0  

    Default Answered: Why does the GXT3 example app not use FormPanel for its forms example?

    Answered: Why does the GXT3 example app not use FormPanel for its forms example?


    http://www.sencha.com/examples/#Exam...mple(uibinder)

    The GXT3 examples uses a FramedPanel with a Vertical Layout instead of a FormPanel. Why?

  2. A FormPanel is only required if you want to do a real http post with the html form element. FormPanel is not required in that example.

  3. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    A FormPanel is only required if you want to do a real http post with the html form element. FormPanel is not required in that example.

  4. #3
    Sencha User abshnasko's Avatar
    Join Date
    Sep 2011
    Posts
    44
    Answers
    1
    Vote Rating
    0
    abshnasko is on a distinguished road

      0  

    Default


    The old 2.2.5 explorer examples used FormPanel. So it was making an HTTP post? Preposterous. It used a FormPanel with a FormLayout, which conveniently allowed me in UiBinder to define a Field with a fieldLablel attribute that would be rendered into a FormLayout. The UiBinder markup is much more complex now, and this seems like a step backward.

  5. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    The answer was fully correct and answered your question and even gave you input on when you should use FormPanel. There was no real reason why it used FormPanel. The GXT 2.2.5 example did not need to use FormPanel either. It could have used ContentPanel with a FormLayout also.


    GXT 3 does not have any FormLayout anymore, that is why VerticalLayoutContainer is used. GXT 2 was not supporting UiBinder. However GXT 3 does and you can define a FieldLabel aswell as a width for each field using UiBinder.

  6. #5
    Sencha User abshnasko's Avatar
    Join Date
    Sep 2011
    Posts
    44
    Answers
    1
    Vote Rating
    0
    abshnasko is on a distinguished road

      0  

    Default


    You did not change it because you suddenly realized a HTTP POST wasn't needed, you changed it because FormLayout is no longer there. So actually your answer was wrong.

    So, why in UiBinder is a field a child of a label? I guess the UiBinder complexity I referred to is a consequence of this strange design decision. Logically and semantically, this seems crazy. Why should a label have a widget as a child?

  7. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    So, why in UiBinder is a field a child of a label? I
    It is not like this only in UiBinder, the hole API is like this. A FieldLabel is a widget now. This means you can put a label in front of any widget (not only fields like in GXT 2).

  8. #7
    Sencha User abshnasko's Avatar
    Join Date
    Sep 2011
    Posts
    44
    Answers
    1
    Vote Rating
    0
    abshnasko is on a distinguished road

      0  

    Default


    Right I understand that it's a widget, I just don't see the sanity in having a parent-->child relationship between label-->field. They should be siblings.

  9. #8
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Answers
    60
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    You did not change it because you suddenly realized a HTTP POST wasn't needed, you changed it because FormLayout is no longer there.
    If that would be the reason, than we could still use FormPanel, because that is still there. You should only use FormPanel when you are really going to do a real form submit. Else you are adding unrequired markup to your application.

    The example does not need FormPanel, so it is not used. However, you can archieve the same with using FormPanel. It is the same than in GXT 2. You could have archieved the same without using FormPanel.

Thread Participants: 1