How do I use the ? operator in JSF tag attributes?

I want to do something like this:
<h:inputText styleClass="${myBean.valid ? 'styleA' : styleB'}" ...>
What do I have to do to use this Expression language?
With the #{...} expression the ? operator doesnt seem to be available.
When I use the ${...} expression I am getting this error:
javax.servlet.ServletException: ServletException in '/WEB-INF/body/Test.jsp': /WEB-INF/body/Test.jsp(12,5) According to TLD or attribute directive in tag file, attribute styleClass does not accept any expressions
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
Can anybody please help?
Thanks!

Personally, i'd do:
<h:inputText styleClass="styleA" rendered="#{myBean.valid}"/>
<h:inputText styleClass="styleB" rendered="#{!myBean.valid}"/>

Similar Messages

  • How do I use the value of a table attribute outside the table?

    I have two tables that are master detail. But it might not be so obvious to the user before he knows how the page works that they are master detail. The tables are in separate showDetailItems in a panelAccordion and what I was thinking of was to show the value of one coloum in the selected row in the master in the text in the showdetail item that contains the detail table. But I can´t find the right expression to put into the accordion. How should the expression look like to get the value of an attribute in a table for use outside the table?

    Thanks for the suggestion but it doesn´t work. The first problem is that the page turns blank when I use that expression for the text in the showDetailItem and the second problem is that I don´t seem to be able to use the master table as a partial trigger. When I click edit in the partial trigger property I can´t shuttle the master table over to be a partial trigger to the showDetailItem even if the table has an id.
    Edited by: Atlantic Viking on Apr 2, 2009 6:24 AM
    Well I figured out how to come half way. I did the following things:
    1) Created an attribute value binding to the attribute I wanted to be shown in the showDetailItem
    2) Set the text property in the showDetailItem to this attribute value like this #{binding.attributeValue}
    To solve the problem I had with the partial triggers I continued like this
    3) Gave other components on the path from the showDetailItem to the master table id´s
    4) Clicked edit on the partial trigger property on the showDetailItem and was now able to shuttle the master table over to be a partial trigger.
    But I now got an other problem which looks like a bug. At first when I enter the page it looks fine but when I change focus in the master table to another row part of the showDetailItem containing the detail table disapears. The detail table still remains and works as it should but the part containing the text I tried to set above disapears and the text in the showDetailItem containing the master gets replaced by the text that was supposed to be in the showDetailItem containing the detail table. Any suggestions how to correct this are very welcome.
    Edited by: Atlantic Viking on Apr 2, 2009 6:59 AM

  • HT1338 Purchased a used macbook pro with Mountain Lion. My old Mac runs Snow Leopard is backed up to Time machine. How do I register the operating system to me and how do I use Time Machine to move my files to the new used computer?

    Purchased a used macbook pro with Mountain Lion. My old Mac runs Snow Leopard is backed up to Time machine. How do I register the operating system to me and how do I use Time Machine to move my files to the new used computer?

    If you look at the User Tips tab, you will find a write up on just this subject:
    https://discussions.apple.com/docs/DOC-4053
    The subject of buying/selling a Mac is quite complicated.  Here is a guide to the steps involved. It is from the Seller's point of view, but easily read the other way too:
    SELLING A MAC A
    Internet Recovery, and Transferability of OS & iLife Apps
    Selling an Old Mac:
    • When selling an old Mac, the only OS that is legally transferable is the one that came preinstalled when the Mac was new. Selling a Mac with an upgraded OS isn't doing the new owner any favors. Attempting to do so will only result in headaches since the upgraded OS can't be registered by the new owner. If a clean install becomes necessary, they won't be able to do so and will be forced to install the original OS via Internet Recovery. Best to simply erase the drive and revert back to the original OS prior to selling any Mac.
    • Additionally, upgrading the OS on a Mac you intend to sell means that you are leaving personally identifiable information on the Mac since the only way to upgrade the OS involves using your own AppleID to download the upgrade from the App Store. So there will be traces of your info and user account left behind. Again, best to erase the drive and revert to the original OS via Internet Recovery.
    Internet Recovery:
    • In the event that the OS has been upgraded to a newer version (i.e. Lion to Mountain Lion), Internet Recovery will offer the version of the OS that originally came with the Mac. So while booting to the Recovery Disk will show Mountain Lion as available for reinstall since that is the current version running, Internet Recovery, on the other hand, will only show Lion available since that was the OS shipped with that particular Mac.
    • Though the Mac came with a particular version of Mac OS X, it appears that, when Internet Recovery is invoked, the most recent update of that version may be applied. (i.e. if the Mac originally came with 10.7.3, Internet Recovery may install a more recent update like 10.7.5)
    iLife Apps:
    • When the App Store is launched for the first time it will report that the iLife apps are available for the user to Accept under the Purchases section. The user will be required to enter their AppleID during the Acceptance process. From that point on the iLife apps will be tied to the AppleID used to Accept them. The user will be allowed to download the apps to other Macs they own if they wish using the same AppleID used to Accept them.
    • Once Accepted on the new Mac, the iLife apps can not be transferred to any future owner when the Mac is sold. Attempting to use an AppleID after the apps have already been accepted using a different AppleID will result in the App Store reporting "These apps were already assigned to another Apple ID".
    • It appears, however, that the iLife Apps do not automatically go to the first owner of the Mac. It's quite possible that the original owner, either by choice or neglect, never Accepted the iLife apps in the App Store. As a result, a future owner of the Mac may be able to successfully Accept the apps and retain them for themselves using their own AppleID. Bottom Line: Whoever Accepts the iLife apps first gets to keep them.
    SELLING A MAC B
    Follow these instructions step by step to prepare a Mac for sale:
    Step One - Back up your data:
    A. If you have any Virtual PCs shut them down. They cannot be in their "fast saved" state. They must be shut down from inside Windows.
    B. Clone to an external drive using using Carbon Copy Cloner.
    1. Open Carbon Copy Cloner.
    2. Select the Source volume from the Select a source drop down menu on the left side.
    3. Select the Destination volume from the Select a destination drop down menu on the right
    side.
    4. Click on the Clone button. If you are prompted about creating a clone of the Recovery HD be
    sure to opt for that.
    Destination means a freshly erased external backup drive. Source means the internal
    startup drive. 
    Step Two - Prepare the machine for the new buyer:
    1. De-authorize the computer in iTunes! De-authorize both iTunes and Audible accounts.
    2, Remove any Open Firmware passwords or Firmware passwords.
    3. Turn the brightness full up and volume nearly so.
    4. Turn off File Vault, if enabled.
    5. Disable iCloud, if enabled: See.What to do with iCloud before selling your computer
    Step Three - Install a fresh OS:
    A. Snow Leopard and earlier versions of OS X
    1. Insert the original OS X install CD/DVD that came with your computer.
    2. Restart the computer while holding down the C key to boot from the CD/DVD.
    3. Select Disk Utility from the Utilities menu; repartition and reformat the internal hard drive.
    Optionally, click on the Security button and set the Zero Data option to one-pass.
    4. Install OS X.
    5. Upon completion DO NOT restart the computer.
    6. Shutdown the computer.
    B. Lion and Mountain Lion (if pre-installed on the computer at purchase*)
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because
    it is three times faster than wireless.
    1. Restart the computer while holding down the COMMAND and R keys until the Mac OS X
    Utilities window appears.
    2. Select Disk Utility from the Mac OS X Utilities window and click on the Continue button. 
    3. After DU loads select your startup volume (usually Macintosh HD) from the left side list. Click
    on the Erase tab in the DU main window.
    4. Set the format type to Mac OS Extended (Journaled.) Optionally, click on the Security button
    and set the Zero Data option to one-pass.
    5. Click on the Erase button and wait until the process has completed.
    6. Quit DU and return to the Mac OS X Utilities window.
    7. Select Reinstall Lion/Mountain Lion and click on the Install button.
    8. Upon completion shutdown the computer.
    *If your computer came with Lion or Mountain Lion pre-installed then you are entitled to transfer your license once. If you purchased Lion or Mountain Lion from the App Store then you cannot transfer your license to another party. In the case of the latter you should install the original version of OS X that came with your computer. You need to repartition the hard drive as well as reformat it; this will assure that the Recovery HD partition is removed. See Step Three above. You may verify these requirements by reviewing your OS X Software License.

  • How to use ternary operator in JSF using EL expression

    how to use ternary operator in JSF using EL expression

    I want to use ternary operator for h:datatable columnclasses attribute like as below
    <h:datatable
    columnClasses="#{booleanExpression ? style1,style2 : style3,style4}"
    />
    But it's not working.Is there any other alternative to do this?

  • HT5278 How do I download the operating system ios 5 to my iphone 4s?  The ios 6 will not let me use my bluetooth in my car.

    How do I download the operating system ios 5 to my iphone 4s.  The ios 6 will not let me use my bluetooth in my car.

    The only iOS currently available is iOS 6.0.1 (6.0.2 for iPhone 5). Once you upgrade you cannot downgrade. Contact your car maker for help.

  • I have an iMAC using OS X Version 10.5.8, how do I upgrade the operating system?

    I have an iMAC using OS X Version 10.5.8, how do I upgrade the operating system?

    Your first step will be to upgrade to Snow Leopard (10.6). Check the link below for requirements and purchasing info.
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard

  • How do I use the following code in such a way that it will display what is indicated by the word "echo"?

    if(exist chrome.exe $true) 
    echo internet is ready 
    else 
    echo get chrome!!
    I want to use the above script to cause the shell to display either "internet is ready" or "get chrome!!" depending on whether or not a user has Chrome but the shell keeps giving the following error message.
    Missing statement block after if ( condition ).
    At line:2 char:1
    What is a statement block, and how do I use it to display the text?

    This might work okay in .BAT but I don't think so much in Powershell. You are trying to do an IF ( ) statement, but you have no parameters after that.
    A pancake of how an IF statement works in Powershell:
    If (statement -like "True") { Script info if condition is true } else { script info if condition is false }
    In your case, you need to test the path of Chrome to see if it exsists. I don't have Chrome installed, but I do have IE. You just need to change the path to where the Chrome.exe is installed.
    ps - the Echo equiv in Powershell is Write-Host
    $TestBrowser = Test-Path "C:\Program Files (x86)\Internet Explorer\iexplore.exe"
        if ($TestBrowser -like "True")
            Write-Host the internets is ready!
        else
            Write-Host the internets is not ready
    Similiarly, you don't need to use $TestBrowser in your If ( ) statement, you can just use the operational param $?, which should return true or false depending on the last error message.

  • How can we manage the operations subcontracted in B1 ?

    Good morning
    How can we manage the operations subcontracted in B1?
    For example.
    I have a purchased item (a box A0001)
    I must paint (Service Item  P0001)
    I have a finished product that I sell (The box painted A0002)
    I have a BOM  for this item  which contains
    A0001 + P00001
    Can we have a floating price for article P0001?
    Can we have a purchase order for the Item P0001 from a production order of item A0002 ?
    etc. ...
    I am a new French partner. My apologies if this issue already exists and then for my English .....

    Can we have a floating price for article P0001?
    P0001 being a service item would be defined as a standard cost item with Issue method backflush.  In this case using a floating price might not be possible. 
    You could actually consider the quantity to be the price and define the price as 0.1 / any lowest mutiple and in the Production Order change the quantity to equal the total cost of painting.
    Can we have a purchase order for the Item P0001 from a production order of item A0002 ?
    P0001 if defined as a labor / service item cannot be purchased.

  • How do I use the Japanese fonts in Font Book in a Pages document?

    How does one use the Japanese fonts in Font Book in a Pages document. Pages has its own fonts but I cannot get the Japanese fonts into it.

    To type japanese on a computer you change the keyboard, not the font.  Go to system prefs/keyboard/input sources and add Japanese/Kotoeri to the list, then select Hiragana in the "flag" menu at the top right of the screen, then type.  The font will take care of itself.
    http://redcocoon.org/cab/mysoft.html
    If you have any further questions, just ask.

  • How do I use the web cam on my pc? Hp w2007 I have windows vista

    How do I use the web cam on my pc?  Hp w2007 I have windows vista

    Hp w2007 is a HP monitor without webcam ...
    Where is the webcam?
    V.
    *** Say 'Thanks' with Kudos ***

  • How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    unless i'm missing something, i think you got mixed up, this is easy google for walk throughs
    i'm assuming this is the new 3tb tc AC or 'tower' shape, if so, its wifi will run circles around your at&t device
    unplug the at&t box for a minute and plug it back in
    factory reset your tc - unplug it, hold down reset and keep holding while you plug it back in - only release reset when amber light flashes in 10-20s
    connect the tc to your at&t box via eth in the wan port, wait 1 minute, open airport utility look in 'other wifi devices' to setup the tc
    create a new wifi network (give it a different name than your at&t one) and put the tc in bridge mode (it may do this automatically for you, but you should double check) under the 'network' tab
    login to your at&t router and disable wifi on it
    add new clients to the new wifi network, and point your Macs to the time machine for backups

  • How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    How can I use the old Apple TV with new iTunes?  It tells me to input a code in iTunes but iTunes no longer has a spot to input this code to allow sync.  I can access the iTunes Store fine, just none of my Library

    read this
    https://discussions.apple.com/message/20429789#20429789

  • How do I use the adjustment brush to mask and not turn my item green?

    I have shot some products for my web site.  I need completely white backgrounds. I have tried to mask the product and lighten the whites, but when I click done, my product has turned very green.
    Why?  How do you use the brush?  Also, where is the invert to make this easier on me?
    Kind of urgent, I need to get these items on my site already.
    I know the answer is simple... I just don't know what it is.
    Thanks

    Have you tried without the adjustment brush, by simply adjusting white balance from the basic tab in develop?
    Click on the eye dropper tool and then click on a neutral gray color. Use the background if it is neutral rather than white. You may need to keep selecting the eye dropper to click in a few different places for best results.
    If you decide to use the adjustment brush you can show or hide the mask. Uncheck the mask when you have finished painting; then use the sliders, starting with tint and temperature.

  • HT4241 How do I use the mini deplayport to hdmi

    How do I use the mini displayport to hdmi on my tv?

    You use something like this:
    http://www.amazon.com/Mini-DisplayPort-HDMI-Adapter-Cable/dp/B003OC6LWM/ref=sr_1 _1?ie=UTF8&qid=1365115124&sr=8-1&keywords=minidisplay+port+hdmi
    Ciao.

  • HT201178 How do I use the wireless keyboard to edit my iPhone contacts?

    How do I use the wireless keyboard to edit my iPhone contacts?

    Type in the field for first name, last name etc. When you're ready to go to the next field, hit enter/return.

Maybe you are looking for