Sven,
I have implemented your advise beforehand.. now i want to set style for A elements according to selected locale, that's why i use styleClass="#{locale.style}"
 
----- Original Message -----
Sent: Monday, May 29, 2006 8:58 PM
Subject: Re: Getting reference to caller UIComponent from managed bean setter/getter

I think the easiest option is to use an actionListener instead the action attribute. You then have a myActionlistener(ActionEvent e) Method in your backing bean and can call a method to retrieve the component that was clicked on. with that you can get the name of the id and change the locale accordingly.

I even give the id ("de", "en", etc.) directly to a new Locale(id) and assign that local to the UIViewRoot to change the language used.

Hope that helps,

Sven

On 5/29/06, Furer Alexander <[EMAIL PROTECTED]> wrote:
Hi
Is there any way to get reference to caller UIComponent from managed bean getter/setter function ?
For example , assume we have following jsp fragment:
 

<

h:commandLink id="en"  styleClass="#{locale.style}">

<h:outputText value="English" />

</

h:commandLink>

<

h:commandLink id="he" styleClass ="#{locale.style}">

<h:outputText value="Hebrew" />

</h:commandLink>

 

class Locale{

String     getStyle(){

    HERE I WANT TO GET reference to  UIComponent ( in one case - its command link with id=="en" , second case - with id=="he")

}

}

Any ideas ?

Thanks




--
Sven Haiges
[EMAIL PROTECTED]

TEL +49 89 420 958 993 | SIPgate 8008878 | Skype: hansamann
Personal Homepage, Wiki & Blog: http://www.svenhaiges.de

Reply via email to