-
1. Re: <a4j:actionparam> question
sergeysmirnov Jul 12, 2007 9:05 PM (in response to roykachouh)a4j:actionparam has a noEscape attribute. if it is set to true, the value will be evaluated as a javascript code.
For example,
....<script> ... var foo = "bar"; ... </script> ... ... <a4j:actionParam noEscape="true" name="param1" value="foo" assignTo="#{bean.prop1}" /> ...
it might be any javascript function there. Like:<a4j:actionParam noEscape="true" name="param1" value="getMyTableRowIndex()" assignTo="#{bean.prop1}" /> ...
if you have this function, the result of it will be taken.
So, clicking the row, set some javascript var that is referenced by no escaped value like it shown above.
P.S. NOTE: a4j:param extends f:param, so the "name" attribute is mandatory. Otherwise, the value will be missing due missing the request parameter name for it. The doc (#1) is not pretty much accurate about this issue.
P.P.S. noEscape has no effect along with non-ajax action component such as h:commandLink. The doc is right there.
#1 http://labs.jboss.com/file-access/default/members/jbossajax4jsf/freezone/docs/tlddoc/index.html -
2. Re: <a4j:actionparam> question
roykachouh Jul 13, 2007 4:15 PM (in response to roykachouh)Thanks! It worked like a charm.
-
3. Re: <a4j:actionparam> question
klonikar Mar 28, 2008 3:40 AM (in response to roykachouh)How can pass value of "var" for the selected row(s) to the backing bean java code?
-
4. Re: <a4j:actionparam> question
ilya_shaikovsky Apr 1, 2008 6:14 AM (in response to roykachouh)<rich:column> <a4j:command* ...> <a4j:actionParam name="..." value="#{cap.name}"> </a4j:command> </rich:column>
there, cap is variable defined in var attribute. or you mean something else? -
5. Re: <a4j:actionparam> question
klonikar Apr 2, 2008 5:52 AM (in response to roykachouh)I meant something similar, but wanted to pass the whole "var" object in one shot. Something like passing domain object for the selected row.
Currently, the org.richfaces.model.selection.Selection class allows accessing the selected row indices when dealing with ScrollableDataTable. But the row indices in the data list are not the same as displayed when you sort on some columns. Also, the rows indices are relative to one page scrolled in a page scroller.
Instead of row indices, it would be better to access the domain object ("var") associated with the selected row. -
6. Re: <a4j:actionparam> question
ramakrishnan Apr 13, 2010 6:11 AM (in response to ilya_shaikovsky)We use a datatable like the below and need to send the entire 'var' attribute to the beacking bean thru actionparam..
<h:dataTable id="dtResults" value="#{SearchBean.lstSrchResults}" var="result" columnClasses="col15,col85"> <h:column> .... .... <a4j:support event="onclick" ajaxSingle="true" immediate="true" requestDelay="1" disableDefault="true"> <a4j:actionparam name="checkedFile" value="#{result}" assignTo="#{SearchBean.selFile}" actionListener="#{SearchBean.addToCart}" /> </a4j:support> .... </h:column> </h:dataTable>
By doing so, we encounter a 'javax.el.ELException' on the actionListener and a null pointer in the bean, where the 'assignTo' attribute is accessed.
Pls clarifiy whether is this the right way to acheive this.
Thanks,
Ram
-
7. Re: <a4j:actionparam> question
harut Apr 30, 2010 8:25 AM (in response to ramakrishnan)It is imosspible to send your bean object by a4j:actionparam... it is request parameter so it can be any String but not a bean object...