EL expression condition

UI Components for JSF
Post Reply
denisduval75
Posts: 109
Joined: 08 Nov 2016, 16:53

12 Nov 2018, 11:31

Hello
In an EL expression, I would like to use the following syntax :

Code: Select all

...oncomplete="#{admBean.codeMessage == 'messageModUtil' ? 'PF('widgetUtil').hide()' : 'PF('widgetNote').show()'}"/>
But I get the error :
javax.el.ELException: Not a Valid Method Expression
Thanks for your help.

Jan Eckert
Posts: 84
Joined: 11 Sep 2014, 10:13
Location: Brussels, Belgium

12 Nov 2018, 11:52

It is illegal indeed. you need to alterate ' and " in case of nesting. Try this (not tested):

Code: Select all

...oncomplete="#{admBean.codeMessage == 'messageModUtil' ? 'PF("widgetUtil").hide()' : 'PF("widgetNote").show()'}"/>
Primefaces 6.1+
Wildfly 11

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

12 Nov 2018, 14:03

Yes, see the 'duplicate' answer on your same question in stackoverflow

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 38 guests