i have a dataTble cotaining object of type Action , the user can choose ana action to modify it so i want to retrieve the old action before modifying it so i tried the onStart attribute to do it but i get this error:
oct. 15, 2012 11:42:12 AM
com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback visit
Grave: javax.el.PropertyNotFoundException: /manageProjectTestsPage.xhtml @342,417
onstart="#{projectTestManagementMB.initOldAction}": Property 'initOldAction' not found
on type tn.talan.testFramework.managedBean.ProjectTestManagementMB
here’s the code :
public String initOldAction(){
String index=(String)
FacesContext.getCurrentInstance().getExternalContext().
getRequestParameterMap().get("index");
System.out.println("index "+index);
oldSelectedAction =testActionList.get(Integer.parseInt(index));
return null;
}
xhtml:
<p:column headerText="Options">
<p:commandLink id="modifyManualActionBtn" style="margin-right:5px" onstart="#
{projectTestManagementMB.initOldAction}" actionListener="#
{projectTestManagementMB.verifyTestDisponibilityActionModifying}"
title="modify" update=":form:growl :form:testTabView:confirmModifyActionDialog
:form:testTabView:addModifyActionDlg" disabled="#
{projectTestManagementMB.modifyBtnFlag}">
<h:graphicImage value="../images/cssImg/modify_icon.png" heigth="13"width="17"/>
<f:param name="index" value="#{rowIndex}" />
</p:commandLink>
....
So how to use the onstart attribute to retrieve the old action value before executing the actionListener actionListener="#
{projectTestManagementMB.verifyTestDisponibilityActionModifying}"
And if i can not use it ,Is there another solution ?
You are retrieving this error because the
onstartattribute is a value attribute that should be set to a Javascript expression to execute before the ajax request begins. You can use an EL expression here, however it is not likeactionListenerwhich expects a method expression.By not having the parenthesis in the EL expression for
onstart, JSF assumes this a call to a Managed Property rather than a method. Try this instead:This isn’t your actual problem however as your method
initOldAction()doesn’t return a String containing a Javascript expression. I don’t think this attribute does what you think it does, it is just a client side callback.