Best way to do a choose without having to repeat the data?
This is probably an easy one that I am just missing.
Very rusty.
I am trying to figure out how to code this with JSTL so that I don't repeat the TD contents. CSS styling has nothing to do with this. <table:tr> alternates rows of shaded and white. I want to override the <table:tr> and use a particular bgcolor instead of the regular shaded and white background (that the <table:tr> produces) when that condition is met.
I want to do this WITHOUT having to repeat the same code twice.
I probably need to do some sort of c:set using a variable but i'm not sure how.
<c:choose>
<c:when test="${Form.formFieldId == "xyx"}">
<tr bgcolor="#344543" >
TD1
TD2
TD3
</tr>
</c:when>
<c:otherwise>
<table:tr>
SAME TD1 as above
SAME TD2 as above
SAME TD3 as above
</table:tr>
</c:otherwise>
</c:choose>
Thanks for any help.
Here is one way:
<c:set var="tdContent">
TD1
TD2
TD3
</c:set>
<c:choose>
<c:when test="${Form.formFieldId == "xyx"}">
<tr bgcolor="#344543" >
${tdContent}
</tr>
</c:when>
<c:otherwise>
<table:tr>
${tdContent}
</table:tr>
</c:otherwise>
</c:choose>You could also potentially do the following
<c:set var="bgColorAttribute" value="${Form.formFieldId == 'xyx' ? '' : ' bgcolor="#344543"'} "/>
<tr ${bgColorAttribute}>
TD1
TD2
TD3
</tr>Its not exactly what you were after, as it uses the <tr> tag both times, whereas you had one <tr> tag, and one <table:tr> tag in your example.
What is the <table:tr> tag? Its not one I am familiar with. Is it a standard tag library? Or a custom one you are using?
Can you share that taglib import with us so we can see what tag library you are using?
eg for the JSTL core library the line is: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
For the table taglib it should be something like: <%@ taglib prefix="table" uri="??????" %>
You say CSS styling has nothing to do with this. It probably should
What you would really want is something like
<tr class="oddLine">
<tr class="evenLine">and then define the oddLine/evenLine style classes in an imported css stylesheet.
Then if you wanted to change one of the line colours, you only have to change that css import, and you're done :-)
cheers,
evnafets
Similar Messages
-
Is there a way to exit a window without having to click the red x button?
I'm always looking for shortcuts and was wondering if for the MacBooks there was a way to exit out of a window without actually having to click the red x. For example, on a PC, I would click Alt+F4.
Shift CMD w
Regards,
Captfred -
I have GarageBand on my iMac, but would like the program on my iPad now. Since I have already pad for it once is there any way to put GarageBand on my iPad without having to pay for it again? Thanks
So after i purchase garageband for my ipad, is there any way to transfer unfinished work from my iMac to the iPad or from the iPad to the iMac?
-
What is the best way to edit array elements (without making copies of the array)?
Hello all
I am new to Labview so I apologise for the newbie question.
I am using Labview to check off parts in an assembly as a precursor to a test. For my "checklist" I create an array of clusters, with the cluster containing a string for the part number and a boolean to show if it has been scanned. I read in my parts list and then I would like to add in the part name to each cluster in the array. I do not want to make multiple copies of the array if possible. The code shown below does not work - I previously had the "Array" (my checklist) on the outside of the while loop, as I assumed the inplace elements box would not need an output. The cluster created in the inplace elements is correct, but the "Array" does not change.
Any help woud be appreciated, I would prefer a simpler solution to the inplace elements if possible (again without making multiple copies).
Regards
Ray
Solved!
Go to Solution.You don't show the rest of the code, but I'm guessing that your "Array" is never actually initialized with any values. Thus, the "replace" cannot work since you cannot replace an element that doesn't exist. If the case you are showing is intended to be the actual initialization of the array (and based on what you are saying it seems as if that's the case), then ditch the inplace element structure. All you need to do is to autoindex from your string array and just do this:
Attachments:
Example_VI_BD.png 13 KB -
The definitions of "delete cookies always" ,"don't remember history" and "delete temporary files" are not remembered when the internet is closed and opened again.
Are you using the method as shown in the [[clear recent history]] article to clear your data automatically?
If you are and the settings are not being remembered, see the [[preferences are not saved]] article. -
After updating to iTunes 11.0.4.,
iTunes 11.0.4. can't locate thousands of files (they are still on the harddisk though).
is there a way to simply relocate them (without having to do it manually for each individual song which would take forever)?Are these "thousands of files" in an iTunes library that simply cannot be found?
If so, assuming you know exactly where they are, hold the "Option" key while opening iTunes from your dock. You will then be given a "Choose Library" option. Choose it and point to your library. -
I'm trying to "un"disable an iPhone 4s. Any way to do this without having to reset the phone?
Hi mark,
Follow the instructions that best apply to your situation in this support article:
http://support.apple.com/kb/HT1212
Best of luck!
Cheers,
GB -
I have just updated my software on my iPhone 4S to IOS7.0.4 now I have lost many of my contacts. Can anyone suggest an easy way to reinstate them. (Without having to add them all again as I don't know what I have lost until I need it).
Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.
-
What is the best way of accessing application module without page binding?
Hi All
I am using Jdeveloper 11g R2 (11.1.2.3) & Weblogic 10.3.5.0
What is the best way of accessing application module without page binding?
In my application after user authenticated from LDAP
I need to read some information from database and set my menues.
Thanks
MohsenHi,
if you don't have a binding the I am not sure the binding context is created. Anyway, try
BindingContext.getCurrent().findDataControl("name here as ID in DataBindings.cpx") and see if it returns a valid instance
Frank -
Hi All
Was wondering if there is an easy way to switch between ethernet and wifi connection on Apple TV without having to disconnect the ethernet cable. The reason I ask is that I find it quicker to use my ethernet connection via a Netgear Powerline Home Theatre Set-up to stream Trailers and Movies on the Apple TV, however this is no good when connecting directly to my Mac to stream music or TV shows in iTunes, so revert to the wifi connection that I created on my Time Capsule to do this.
Would be handy if Apple TV had a menu option where you could manually change the connection type depending on what you were doing, as per above scenario.
Cheers
Brettbrettfromseabrook wrote:
Hi All
Was wondering if there is an easy way to switch between ethernet and wifi connection on Apple TV without having to disconnect the ethernet cable.
Unfortunately not. -
Question
After a few minutes, the page down won't work without clicking the mouse pointer on the page I am reading to activate page down again. Is there a way to go back to page down working every time without having to click the page first?Today, two other users reported issues with the back-forward history list dropping down if they hovered the mouse pointer over the back or forward button -- without clicking -- and then moved the pointer downwards. One user was on a touchpad, I don't know about the other user. Are you experiencing anything like that?
-
Is there a way to access my voicemail without having to enter my password every time?
Is there a way to access my voicemail without having to enter my password every time? Or is the only way to check emails is to click on the voicemail icon and enter password?
For that, you would probably have to create a contact and place it on your homescreen. I don't know if there are any settings where you can have the voicemail icon automatically call, although there may be. You can name the contact you place on your homescreen "call voicemail" or "voicemail", though.
Edit: keep in mind by setting up your voicemail number like I had previously described, anyone with access to your phone will now have access to your voicemails. If you are like me, though, that won't bother you. -
Is there a way to get to a certain measure without having to scroll the line thing all the way there if our file is hours long?
CNWSMT wrote:
Is there a way to get to a certain measure without having to scroll the line thing all the way there if our file is hours long?
double click the measures display (the LCD) and type in the measure -
I recently got a MacBook Pro and was interested in downloading Lightroom that I had previously purchased however there is no disk drive on my pro so was wondering if it is possible to download a different way without having to purchase the program again?
Lightroom - all versions
Windows
http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Windows
Mac
http://www.adobe.com/support/downloads/product.jsp?product=113&platform=Macintosh -
Is there a way to dismiss the alarm clock without having to unlock the phone?
This has been annoying and, quite honestly, I don't remember it being a problem before the iOS 5 update.
When an alarm goes off using the default clock / alarm app and the phone is locked, all I get is the option to Snooze. The only way to actually dismiss the alarm so that it does not go off again is to unlock the phone while the alarm is going off.
Is there a way - either by pressing a button on the phone or getting a dismiss button next to the snooze button - to dismiss an alarm in the lock screen without having to unlock the phone? I know if the phone is unlocked, the alert will give me the option of either "Snooze" or "Ok," but I don't get that same option in lock mode.
Any help with this would be appreiciated.The unlock slider at the bottom of the lock screen should turn off the alarm.
Maybe you are looking for
-
IMovie 8.0.5 doesn't recognize Firewire Camcorder
...but iMovie 6.0.3 does. I'm using both versions of iMovie because of my 3rd party plugins which stopped working in newer iMovie versions. SystemProfiler shows camera, I tried different accounts with same results.
-
Can anyone please tell me how to extract text from postscript
-
How to make script depended on specific network???
I hope that someone can help me with this. I do not yet have much experience with scripting, but I made a script which connects my macbook to a folder on my NAS. However, if my local network is not available the script will hang itself waiting until
-
I'm attempting to Export using Export > Quicktime Movie... It only gives me the option to Include Audio & Video, Audio or Video Only, Markers and whether or not to create a Self-Contained Movie... Whenever I hit Save, it creates a Final Cut Express M
-
Ipod Touch (2g) Transfer Issues
I'm on Windows 7 RTM, when it comes to moving content from my PC to my IPod I have no issues, everything transfers just fine. When transferring content from my ipod to my pc however, there are constant issues with the transfer freezing and what appea