-
1. Re: How link by clicking in a row in a dataTable?
mars1412 Mar 3, 2008 2:14 PM (in response to pericles)I think you will need to use the onRowClick event and then submit the form from java-script...
-
2. Re: How link by clicking in a row in a dataTable?
pericles Mar 3, 2008 3:55 PM (in response to pericles)Can you say an little exemple please?
Thanks.
-
3. Re: How link by clicking in a row in a dataTable?
mars1412 Mar 3, 2008 4:50 PM (in response to pericles)I haven't done that myself yet, but I would try the following:
- check the source code produced by your original s:link e.g.
<input type="button" value="ändern" id="j_id40" onclick="location.href='/xxx.seam?tipologiesId=1'; return false;"/>
- then do the same in your onRowClick() event
onRowClick="location.href='/Tipologies.seam?tipologiesId=#{tipologies.id}';"
if you are in a long-running conversation, you will also have to append the cid as URL parameter
-
4. Re: How link by clicking in a row in a dataTable?
pdpantages Mar 4, 2008 8:33 AM (in response to pericles)Hello Javi, I have had good luck using a4j:jsFunction for this sort of thing. Something like this:
<!-- ondbClick edit --> <a4j:region> <a4j:jsFunction name="fedit" eventsQueue="feditQ" timeout="5000" action="#{neEditor.edit}" > <f:param name="neId"/> <f:param name="ctx" value="nodetable" /> <f:param name="cid" value="#{conversation.id}" /> </a4j:jsFunction> </a4j:region> <rich:dataTable rowClasses="alarmRowOdd, alarmRowEven" onRowDblClick="fedit('#{networkElement.id}')" value="#{nodeList}" var="networkElement" rendered="true" >
The parameters to fedit() are just assigned, in order, to the f:params. So the parameter netwrokrElement.id will be assigned to f:param neId. If you passed a second parameter, it would override the
ctx
. Otherwise,ctx
assumes the default value specified in the f:param.I found (through trial and error) that the single quotes are needed around the parameter or it doesn't work.
Note that I am using an action method here; You should be able to set the action to the view from your s:link...
PdP
-
5. Re: How link by clicking in a row in a dataTable?
pericles Mar 4, 2008 9:01 AM (in response to pericles)Hello again,
I'll prove both proposals today, thank you very much Martin and Paul for help me ;).
I will inform.
Bye
-
6. Re: How link by clicking in a row in a dataTable?
pericles Mar 13, 2008 11:35 AM (in response to pericles)...
Note that I am using an action method here; You should be able to set the action to the view from your s:link...
PdPHi again Paul,
I prove it but doesn't work. I think I'm following badly your indications. I do this:
<a:region> <a:jsFunction id="fedit" name="fedit" eventsQueue="feditQ" timeout="5000" action="#{neEditor.edit}" > <f:param name="neId"/> <f:param name="ctx" value="nodetable" /> <f:param name="cid" value="#{conversation.id}" /> </a:jsFunction> </a:region> <rich:dataTable id="permisosTipologiaList" rowClasses="alarmRowOdd, alarmRowEven" onRowMouseOver="this.style.backgroundColor='#E9F0F8'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" onRowClick="fedit('#{permisosTipologia.id}')" var="permisosTipologia" value="#{permisosTipologiaList.resultList}" rendered="#{not empty permisosTipologiaList.resultList}"> <h:column> <f:facet name="header"> <s:link name="header" id="permisosTipologies" value="#{messages['documentTypeId']} #{permisosTipologiaList.order=='tipologies.id asc' ? messages.down : (permisosTipologiaList.order=='tipologies.id desc' ? messages.up : '' )}" action=""> <f:param name="order" value="#{permisosTipologiaList.order=='tipologies.id asc' ? 'tipologies.id desc' : 'tipologies.id asc'}"/> </s:link> </f:facet> #{permisosTipologia.tipologies.descripcio} </h:column>
Now, without the function, the s:link do this.
<s:link view="/#{empty from ? 'Tipologies' : from}.xhtml" id="tipologia"> <f:param name="tipologiesId" value="#{tipologies.id}"/> #{tipologies.descripcio} </s:link>
How can I do to set the action link correctly?
Thank you very much.
-
7. Re: How link by clicking in a row in a dataTable?
pericles Mar 13, 2008 4:25 PM (in response to pericles)I do it with Martin's solution, it works:
<rich:dataTable id="permisosTipologiaList" onRowMouseOver="this.style.backgroundColor='#E9F0F8'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'" onRowClick="location.href='/gucudo/PermisosTipologia.seam?permisosTipologiaIdUsuari=#{permisosTipologia.id.idUsuari}&permisosTipologiaIdTipologia=#{permisosTipologia.id.idTipologia}&permisosTipologiaIdTipus=#{permisosTipologia.id.idTipus}&cid=#{conversation.id}'" var="permisosTipologia" value="#{permisosTipologiaList.resultList}" rendered="#{not empty permisosTipologiaList.resultList}">
But put the url like this... it's a badly ingeniering aplication with Seam, I think Paul solution is better (thinking in Seam) but I don't know how use it, can anybody help me to do it?
Thanks a lot.
-
8. Re: How link by clicking in a row in a dataTable?
pdpantages Mar 21, 2008 7:23 AM (in response to pericles)Hello Javi, looking at your s:link,
Try setting the
action
to the view
Then add your parameters (id in this case)
Then add the cid (s:link normally adds this)It might be easier to harcode the action initially,
to get it working.<a:region> <a:jsFunction id="fedit" name="fedit" eventsQueue="feditQ" timeout="5000" action="/Tipologies.xhtml" <f:param name="tipologiesId"/> <f:param name="cid" value="#{conversation.id}" /> </a:jsFunction> </a:region> ... ... onRowClick="fedit('#{permisosTipologia.id}')"
-
9. Re: How link by clicking in a row in a dataTable?
pericles Mar 26, 2008 11:44 AM (in response to pericles)Hi Pau Pantages,
Thank you for the help, I can't prove it now but in a few days I will test it and say here the results.
Thank you very much.