View Full Version : How to add Label or HTML to FormPanel?
gslender
04-26-2008, 03:21 AM
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
04-29-2008, 06:28 AM
bump.... anybody/Darrell got any thoughts about this?
baluba
04-29-2008, 07: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
04-29-2008, 07: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
04-29-2008, 12:20 PM
oops, sorry. You must use FormPanel.setHeading()
mbenothmane
04-29-2008, 01:49 PM
I came across something called StaticField in the forums a while ago that can do what you are looking for.
Right now, the FormPanel only supports widgets that derivate from Field. Thus, LabelField does the job.
@Darrell: can you close this thread, plz?
darrellmeyer
06-12-2008, 12:22 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 !!
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
06-13-2008, 09:05 PM
best solution I've found is to put FormPanel into another container and set rowlayout vertical and add HTML to the top
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
06-16-2008, 06:17 AM
You can use the LabelField to show some information on your FormPanel.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.