Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL fails to work in data table

 
vikram s
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

TIA

Thanks,
Vikram

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

<h:dataTable id="ColDataTable"
value="#{RCollect.Beans}"
var="result">
..........
........
<c:choose>
<c:when test="${result.id == RCollect.newBean.id}">
.....
......
</c:when>
</h:dataTable>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64692
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.

Thanks!
bear
JavaRanch Sheriff
 
vikram s
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault,

If you havent a heard a name that doesnt make it fictious. Did i say
Bear
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.


Thanks,
Vikram
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vikram s
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

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

Regards,
Vikram S
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic