-
1. Richface Context Menu problem
nbelaevski Mar 24, 2011 10:01 AM (in response to jobmathew)Hi,
For client-side templates parameters you should use {selectedRow} expression, not EL-expression.
-
2. Re: Richface Context Menu problem
jobmathew Mar 24, 2011 11:22 AM (in response to nbelaevski)I changed my code accordingly but still am having NP exception
my modified code is
<rich:contextMenu attached="false" id="ContextMenu" submitMode="ajax">
<rich:menuItem value="Edit Record" ajaxSingle="true"
oncomplete="#{rich:component('modeEditPanel')}.show()"
actionListener="#{manageUserBean.fetchCurrentRow}" >
<a4j:actionparam name="row" value="{selectedRowNumber}" />
<a4j:actionparam name="modeTableRowIndex" value="{modeTableIndex}" />
</rich:menuItem>
</rich:contextMenu>
<a4j:region>
<rich:dataTable width="100%" onRowMouseOver="this.style.backgroundColor='#{a4jSkin.tabBackgroundColor}'"
onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
value="#{manageTableBean.modeTable}" var="Step" rows="20" rowKeyVar="Row"
id="Table" onRowContextMenu=" Row=this;
#{rich:component('modeContextMenu')}.show(event,{selectedRowNumber:'#{Row}' ,modeTableIndex:'#{Step.id}'});
return false;">
and on debuging i see in the actionevent binding
[oncomplete=/Pages/ManageTable.xhtml @14,126 oncomplete="#{rich:component('modeEditPanel')}.show()": ValueExpression[#{rich:component('modeEditPanel')}.show()], null]
Exception
SCHWERWIEGEND: Received 'java.lang.NullPointerException' when invoking action listener '#{manageUserBean.fetchCurrentRow}' for component 'j_id42'
24.03.2011 16:13:47 javax.faces.event.MethodExpressionActionListener processAction
SCHWERWIEGEND: java.lang.NullPointerException
-
3. Re: Richface Context Menu problem
ilya_shaikovsky Mar 25, 2011 6:50 AM (in response to jobmathew)add noEscape="true" to parameters.
-
4. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 6:59 AM (in response to ilya_shaikovsky)on which node
actionparam or onRowContextMenu
-
5. Re: Richface Context Menu problem
ilya_shaikovsky Mar 25, 2011 7:13 AM (in response to jobmathew)sorry. to actionparam tag.
-
6. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 7:17 AM (in response to ilya_shaikovsky)NO probs....
But still have the same problem
<a4j:actionparam name="id" value="{userID}" noEscape="true" assignTo="#{TableBean.projectId}"/>
<a4j:actionparam name="row" value="{currentRow}" noEscape="true" assignTo="#{TableBean.row}" />
SCHWERWIEGEND: Received 'java.lang.NullPointerException' when invoking action listener '#{TableBean.fetchCurrentRow}' for component 'j_id41'
25.03.2011 12:14:53 javax.faces.event.MethodExpressionActionListener processAction
SCHWERWIEGEND: java.lang.NullPointerException
at net.rim.amalia.view.pages.ManageActionTableBean.fetchCurrentRow(TableBean.java:121)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
-
7. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 7:24 AM (in response to ilya_shaikovsky)What is the role of name in actionparm?
should it be the same name of like the private filed in the bean class ?
-
8. Re: Richface Context Menu problem
ilya_shaikovsky Mar 25, 2011 7:30 AM (in response to jobmathew)no name should be used if you want to get the param from request params map..
B.t.w. #{TableBean.row}.. shouldn't it be #{tableBean.row}?
-
9. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 7:32 AM (in response to ilya_shaikovsky)that was a typo.
in my code it was correct
it was #{tableBean.row}
-
10. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 7:43 AM (in response to ilya_shaikovsky)more question
<a4j:actionparam name="row" value="{currentRow}" noEscape="true" assignTo="#{tableBean.row}" />
tableBean.row should point to getter or setter of the bean property row ?
tableBean.projectId is pointing to setter and tableBean.row is pointing to getter of the private fields..
i dont know why...
does any one have an answer for this !!!!
-
11. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 7:48 AM (in response to jobmathew)ok i have figured out this rearding getter and setter.
the order of getter and setter in the bean class.
which one comes first. this is been pointed to
-
12. Re: Richface Context Menu problem
ilya_shaikovsky Mar 25, 2011 8:08 AM (in response to jobmathew)Doh.. finally I think get the problem
move actionListener="#{manageUserBean.fetchCurrentRow}" to the last param tag also. thats known JSF prblem that nested actionListeners are called after ones defined at tag. so the parameters getting set *after* your listener call.
-
13. Re: Richface Context Menu problem
jobmathew Mar 25, 2011 8:20 AM (in response to ilya_shaikovsky)Thank you so much..
Have update the code like this
<rich:menuItem value="Edit Record" ajaxSingle="true"
oncomplete="#{rich:component('editPanel')}.show()"
actionListener="#{manageUserBean.fetchCurrentRow}" >
<a4j:actionparam name="id" value="{userID}" assignTo="#{tableBean.projectId}"/>
<a4j:actionparam name="row" value="{currentRow}" assignTo="#{tableBean.row}" />
</rich:menuItem>
and its working without problem.
many many many thanks....... spend around 3 days on this