File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes EL fails to work in data table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "EL fails to work in data table" Watch "EL fails to work in data table" New topic

EL fails to work in data table

vikram s

Joined: Dec 30, 2004
Posts: 9

I am trying to check for a condition as shown below. But the expression used in <c:when >fails to work. Note that the RCollect bean has been intialized and the result is var attribute of datatable.



<jsp:useBean id="RCollect" class="org.freebxml.omar.client.ui.thin.RegistryObjectCollectionBean"
scope="session" />

<h:dataTable id="ColDataTable"
<c:when test="${ ==}">
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

"vikram s",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
vikram s

Joined: Dec 30, 2004
Posts: 9
Hi Bear Bibeault,

If you havent a heard a name that doesnt make it fictious. Did i say
can that be a name? no i didnt, cause i aint heard all the names in the world.

As Far as expanding Last name is concerned. I dont have one, surprised well in our part of the world many people dont. I wouldnt want to expand my middle name many would not like it? Hence just the intial to differentiate it from other Vikrams if you have any, and i am sure you have plenty.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

Touche'. But check the naming rules anyway, since we did allow for single-name-only people. What we're striving for is to be professional (don't let the moth-eaten moose head fool you), and so we have a certain set of rules which have to take into account that it's a very big world. And it could be worse - so many people in China have the surname "Wang" that they've been forced to go to 3 names!

But in answer to your question: mix JSTL and JSF at your peril. That's especially true of iterative operations, but it's risky in any case. There are efforts to make the two play better together, but much remains to be done.

You may be attempting to use the wrong approach. For example, instead of a JSTL conditional wrapping of a set of buttons, here's how I handle context-sensitve button display:

JSF is more abstract than JSTL. In most cases, JSF pages should be display-oriented and logic should be handled at the backing bean level.

An IDE is no substitute for an Intelligent Developer.
vikram s

Joined: Dec 30, 2004
Posts: 9
Hi Tim,

Thanks that helped. I made some changes to the backing bean and used the rendered attribute.

Vikram S
I agree. Here's the link:
subject: EL fails to work in data table
It's not a secret anymore!