PDA

View Full Version : How to add Label or HTML to FormPanel?



gslender
25 Apr 2008, 11:21 PM
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?

gslender
29 Apr 2008, 2:28 AM
bump.... anybody/Darrell got any thoughts about this?

baluba
29 Apr 2008, 3:23 AM
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.

gslender
29 Apr 2008, 3:59 AM
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?

baluba
29 Apr 2008, 8:20 AM
oops, sorry. You must use FormPanel.setHeading()

mbenothmane
29 Apr 2008, 9:49 AM
I came across something called StaticField in the forums a while ago that can do what you are looking for.

flow
11 Jun 2008, 1:43 AM
Right now, the FormPanel only supports widgets that derivate from Field. Thus, LabelField does the job.
@Darrell: can you close this thread, plz?

darrellmeyer
11 Jun 2008, 8:22 PM
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.

gslender
13 Jun 2008, 5:05 PM
best solution I've found is to put FormPanel into another container and set rowlayout vertical and add HTML to the top

maku
14 Jun 2008, 12:40 AM
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.

assassin
16 Jun 2008, 2:17 AM
You can use the LabelField to show some information on your FormPanel.