myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ali Ok <>
Subject Trouble getting the value of a value expression in a datatable
Date Sun, 20 Jun 2010 23:36:05 GMT

I am having problems with getting the value of an expression within a
datatable with my custom component.

Let me write the code:
<h:dataTable value="#{dndBean.teams}" var="team">
<fx:dragSource action="move" param="#{}" /> <!-- evaluates to empty
string -->
<h:outputText value="#{}" />   <!-- renders the correct id -->

dndBean: managed bean
dndBean.teams: List<SportsTeam>, where SportsTeam has a public String
getId() method
team: var of datatable

I am getting a value of empty string for #{} in the facelet handler
of fx:dragSource, if I put the fx:dragSource in a h:dataTable.
In the apply method of handler, I am trying to get the value as
_param.getValue(faceletContext)  //use this method since deferredValueType
of _param is String

where _param is
@JSFFaceletAttribute(name = "param", className = "javax.el.ValueExpression",
deferredValueType = "java.lang.String")
private final TagAttribute _param;

If I put the fx:dragSource somewhere else, I am getting the correct value at
the handler:
 <fx:dragSource action="move" param="#{}" />

Why can this be happening?

One more hint, for the first case if I try to get the value at the handler,
I get empty string.
If I pass the value expression to behavior, and try to get the value at
renderer using the value expression, I am getting the correct value.

In theory, if the second case works, so does first one; right? Or am I
missing something?


My Blog:

View raw message