Hi, i'm trying to create a dinamically primefaces menubar, but, i got a problem.
I need to use ValueExpression in property Value or ValueExpression (I'm not sure what's the correct option to use) to do this:
#{LanguageBean.getText('TXT_EXAMPLE')}
The return of this expression will be my Value, but, when i started the application, the value of MenuItem stay null, then, nothing is displayed.
Someone here know what i have to do? I'm having a headache with this problem.
Sorry for my bad english guys.
Thanks for you help.
Menubar using ValueExpression
Not enough info about the context in which you're doing this. Where is the element in the page?
What happens if you put a debug point in your LanguageBean's getText() method and then open the page, is it called?
What happens if you put a debug point in your LanguageBean's getText() method and then open the page, is it called?
-------
PrimeFaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6
PrimeFaces 3.4, Glassfish 3.1.2, Mojarra 2.1.6
-
- Posts: 3
- Joined: 31 Oct 2010, 16:43
The problem is not in getText(), if i create the <p:menubar /> manually, it works perfectly.
My problem is here:
The ValueExpression doesn't work, if i replace #{IdiomaController.getTexto('TXT_PORFAVOR')} for "anyone string", doesn't works too. The problem is in ValueExpression, but i don't know how to fix it.
I have tested replace Object.class for String.class, but still doesn't work.
My problem is here:
Code: Select all
ValueExpression value = FacesContext
.getCurrentInstance()
.getApplication()
.getExpressionFactory()
.createValueExpression(
FacesContext.getCurrentInstance().getELContext(),
"#{IdiomaController.getTexto('TXT_PORFAVOR')}",
Object.class);
mi.setValueExpression("value", value);
//mi.setValue(value);
I have tested replace Object.class for String.class, but still doesn't work.
Hi,
Are you sure your beans are configured with first upper case letters LanguageBean / IdiomaController?
Are you sure your beans are configured with first upper case letters LanguageBean / IdiomaController?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
-
- Information
-
Who is online
Users browsing this forum: No registered users and 31 guests