1. #1
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default How to add Label or HTML to FormPanel?

    How to add Label or HTML to FormPanel?


    There doesn't seem to be a way to add a simple instructional Label or HTML to the FormPanel?? What is the best way to add some text that explains what this form is about?

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    bump.... anybody/Darrell got any thoughts about this?

  3. #3
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    baluba is on a distinguished road

      0  

    Default


    If you just need one instructional label you can always use the title text.... FormPanel.setTitle() ?

    Until now FormPanel can only host widgets that are subclasses of Field, which supports validation among other things. Although static elements like labels have no relevance in validation and posting of formdata I don't see why it shouldn't be possible to decorate our forms with such widgets.

  4. #4
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    setTitle seems to only set the tooltip text - perhaps you mean setHeading which is new for GXT 1.0 and sets what I would have called the container's title... I guess Darrell decided setHeading was more correct? don't know why he left setTitle in - change the name to setTooltip !!

    Either way, not really what I need... perhaps I should extend Field - but before I do, is this something that Beta3 (or more) may eventually have?

  5. #5
    Ext User
    Join Date
    Apr 2008
    Posts
    18
    Vote Rating
    0
    baluba is on a distinguished road

      0  

    Default


    oops, sorry. You must use FormPanel.setHeading()

  6. #6
    Ext User
    Join Date
    Dec 2007
    Posts
    42
    Vote Rating
    0
    mbenothmane is on a distinguished road

      0  

    Default


    I came across something called StaticField in the forums a while ago that can do what you are looking for.

  7. #7
    Ext User
    Join Date
    Apr 2008
    Location
    Munich, Germany
    Posts
    43
    Vote Rating
    0
    flow is on a distinguished road

      0  

    Lightbulb


    Right now, the FormPanel only supports widgets that derivate from Field. Thus, LabelField does the job.
    @Darrell: can you close this thread, plz?

  8. #8
    Sencha - GXT Dev Team darrellmeyer's Avatar
    Join Date
    May 2007
    Location
    Washington, DC
    Posts
    2,242
    Vote Rating
    2
    darrellmeyer is on a distinguished road

      0  

    Default


    setTitle seems to only set the tooltip text - perhaps you mean setHeading which is new for GXT 1.0 and sets what I would have called the container's title... I guess Darrell decided setHeading was more correct? don't know why he left setTitle in - change the name to setTooltip !!
    setTitle is a method from the GWT UIObject (sets the title attribute on the element), so I don't think we would want to override that one . A while back, setHeading used to be setText, which many complained about, so it was changed to setHeader.

  9. #9
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    3
    gslender is on a distinguished road

      0  

    Default


    best solution I've found is to put FormPanel into another container and set rowlayout vertical and add HTML to the top

  10. #10
    Ext User
    Join Date
    Apr 2008
    Location
    Austria
    Posts
    58
    Vote Rating
    0
    maku is on a distinguished road

      0  

    Default


    It would be really helpful to get a little bit more flexible FormPanel.

    It is normally to need more than the FormPanel provides.

    From my point of view it would be a good idea to provide a way to put components like labels, images and so on to a FormPanel.