You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Chandra Sekhar <sv...@lasersoft.co.in> on 2006/10/30 06:59:26 UTC
Best way of getting a Form Name through JSF way
Hi Experts,
I need a solution regarding,the JSF way of getting a Form name and
display it on the header while loading a JSF page .
Thanks & Regards,
Chandra Sekhar.
Re: Best way of getting a Form Name through JSF way
Posted by Andrew Robinson <an...@gmail.com>.
The form name is the same as the form ID. From a control, simply surf
the parents until you get to the form control and then get the ID:
String formId = null;
for (UIComponent parent = comp.getParent(); parent != null; parent =
parent.getParent())
{
if (parent instanceof HtmlForm)
{
formId = parent.getId();
break;
}
}
On 10/29/06, Chandra Sekhar <sv...@lasersoft.co.in> wrote:
> Hi Experts,
>
> I need a solution regarding,the JSF way of getting a Form name and
> display it on the header while loading a JSF page .
>
> Thanks & Regards,
> Chandra Sekhar.
>