• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSF expression language

  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have this:
this work:
<h:inputText style="#{(vendedorBB.tipoAccion=='ver')?'FONT-WEIGHT: bold;':''}" />

This too work
<h:inputText style="#{initParam.styleLabel}" />

but how do i do for use both???
<h:inputText style="#{(vendedorBB.tipoAccion=='ver')?'initParam.styleLabel':' '}" /> //this don't work

<h:inputText style="#{(vendedorBB.tipoAccion=='ver')?initParam.styleLabel:' '}" /> //this don't work and the output is error

<h:inputText style="#{(vendedorBB.tipoAccion=='ver')?#{initParam.EstiloLabel}:''}" /> //this don't work and the output is error
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not just:


???

I don't recommend coding complex expressions in EL. Even if you have vast quantities of experience and know how the EL process works from the inside out (I do), debugging EL is a major pair in the sit-down-place. Plus, people routinely abuse it to break the separation between Model and View in MVC.

What my little XML snippet is intended to portray is a situation where the backing bean has to determine which styles to apply to the control. It's a lot easier to code and debug Java String expressions in a backing bean than it is in EL.

Also note that I used a style class instead of a brute-force style. That allows fine-tuning (and skinning!) the styling without requiring application code modifications, since only the CSS needs to be updated if you design the right set of style classes.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


i am facing same problem please help on it as soon as possible.
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic