Hi David
Thanks for quick response.
Here is my code snippet
<h:dataTable id="deviceDetailTable" styleClass="list" rowClasses="odd,even"
value="#{updateDeviceBean.tableRows}" var="vartableRow"
style="">
<h:column id="column1" style="">
<f:facet name="header"><h:outputText value="Id"/></f:facet>
<h:commandLink action="#{updateDeviceBean.loadDeviceInterfaceDetails}"
value="#{vartableRow.viewId}">
<f:param name="interfaceId" value="#{vartableRow.viewId}"/>
</h:commandLink>
</h:column>
....
....
</h:dataTable>
In getTableRows() method i am using pojo to render the content inside
<h:dataTable> as follows
public List doGetTableRows() {
tableRows.add(
new DeviceDetail(
devInterface.getId(), //devInterface.getId() - returns an Object & is
rendered as hyperlink
devInterface.getMac(),
devInterface.getIp(),devInterface.getHostName()
)
);
return tableRows;
}
I understand <f:param> is used only to pass Strings & not Objects. So
<t:updateActionListener ... /> is the solution to pass objects
Regards
Bansi
David Delbecq-2 wrote:
>
> Not sur what you want, trying to answere anyway.
>
> 1) If you wanna put information on an HyperLink and have it set to a
> bean property, one way is to use a lifeCycle listener. At the begin of
> life cycle, this listener would look for a series of hardcoded url
> parameters (like "deviceView") and map the to hardCoded value
> (#{sessionBean.deviceView}). Note that url parameter must be String, if
> you want to set complex objects like this, you will have to be able to
> write them to string and convert them from string.
>
> 2) If you wanna set an object as a parameter using f:param, be aware
> that f:param works only for h:commandLink, and not for h:commandButton
>
> Regards,
> David Delbecq
> bansi a écrit :
>> On click of hyperlink i wanna pass the object instance i.e. address of
>> the
>> object
>> FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("viewId")
>>
>> Please note viewId is instance of my object like DeviceView viewId;
>>
>> I am checking the value at every stage & it holds the address of an
>> object
>> until i click the link which goes to backing bean method where the value
>> is
>> null
>>
>> Any pointers/suggestion highly appreciated
>>
>
>
--
View this message in context:
http://www.nabble.com/Unable-to-pass-Object-using-FacesContext-tf4288541.html#a12242597
Sent from the MyFaces - Users mailing list archive at Nabble.com.