myfaces-dev mailing list archives

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

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">
<h:column>
<hx:div>
<fx:dragSource action="move" param="#{team.id}" /> <!-- evaluates to empty
string -->
<h:outputText value="#{team.id}" />   <!-- renders the correct id -->
</hx:div>
</h:column>
</h:dataTable>

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 #{team.id} 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:
<h:form>
<hx:div>
 <fx:dragSource action="move" param="#{lakers.id}" />
</hx:div>
</h:form>

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?

Thanks,
Ali

-- 
My Blog: http://blog.aliok.com.tr
Twitter: http://twitter.com/aliok_tr

Mime
View raw message