[opencms-dev] programatically determine which locale is currently being edited

a.westermann at alkacon.com a.westermann at alkacon.com
Wed Jul 22 10:15:18 CEST 2009


Hi Marc,

I think it is this dirty and hidden (the cast!) trick:

     protected List parseSelectOptions(CmsObject cms, I_CmsWidgetDialog 
widgetDialog, I_CmsWidgetParameter param)
     throws CmsIllegalArgumentException {

         Locale dialogContentLocale = 
((I_CmsXmlContentValue)param).getLocale();
...
}


Use it wherever you need it and have an I_CmsWidgetParameter argument.


Kind Regards,
Achim.

-------------------
Achim Westermann

Alkacon Software GmbH  - The OpenCms Experts
http://www.alkacon.com - http://www.opencms.org




Marc.Schlegel wrote:
> Hello Everyone
> 
> After solving my problem with the CustomSelectWidget (the one from the
> OpenCms 7 book), there is one more tiny (but important) detail that I
> need to solve.
> 
> First I have to thank Paul for helping me previously and he whas
> actually also the one phrasing this question.
> 
> The point is, how can we get the correct Locale that is currently being
> edited in a structured content editor. As some of you might remember,
> the CustomWidget in the book is reading the possible values from another
> structured content. This one of course can have several languages as
> well. So when I switch the language in the editor that uses this
> CustomWidget, the widget should change its contents to the corresponding
> language as well.
> 
> So, as the subject says: how to programatically determine which locale
> is currently being edited? And how to refresh the widget when the editor
> changes the language?
> 
> Thanks in advance
> Marc
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev



More information about the opencms-dev mailing list