File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes JSF expression language Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "JSF expression language" Watch "JSF expression language" New topic
Author

JSF expression language

Jhonnathan Emilio Cardona Saineda
Greenhorn

Joined: Jan 24, 2012
Posts: 11

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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

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.

One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
Ramana Panku
Greenhorn

Joined: Feb 01, 2012
Posts: 1


i am facing same problem please help on it as soon as possible.
 
 
subject: JSF expression language
 
Threads others viewed
how to add a row dynamically in panel grid by clicking on command button using jsf
h:inputtext validator attribute styling
How To Get OS Version
Problem with h:panelGroup
DHTML drop down menu - Cross Browser
MyEclipse, The Clear Choice