Hello,
My event action doesn't work in my portlet, I don't know why:
Xreg File :
<portlet-entry name="DisciplinePortlet" hidden="false"
type="instance" parent="JSP" application="false">
<meta-info>
<title>Disciplines</title>
<description> Affiche la liste des disciplines
</description>
</meta-info>
<classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
<parameter name="template" value="Discipline.jsp" hidden="true"
cachedOnName="true" cachedOnValue="true"/>
<parameter name="edit.template" value="EditDiscipline.jsp"
hidden="true" cachedOnName="true" cachedOnValue="true"/>
<parameter name="action" value="DisciplineAction" hidden="true"
cachedOnName="true" cachedOnValue="true"/>
<media-type ref="html"/>
<url cachedOnURL="true"/>
</portlet-entry>
Action Class :
public class DisciplineAction extends JspPortletAction implements
IAttributeRequest, IAttributeSession, IWebAction {
....
/**
* Static initialization of the logger for this class */
private static final JetspeedLogger logger =
JetspeedLogFactoryService.getLogger(DisciplineAction.class.getName());
// Gestion de la cache
protected CacheManager cache;
/**
* Build the normal state content for this portlet.
*
* @param portlet The jsp-based portlet that is being built.
* @param rundata The turbine rundata context for this request.
*/
protected void buildNormalContext(Portlet portlet, RunData rundata) {
try {
doList(rundata,portlet);
}
catch(Exception e) {
rundata.setMessage("Error : " + e);
}
}
public void doList(RunData rundata, Portlet portlet) throws
SigalAppException {
logger.info("Enter dans doList");
List parameters = transformToBeanList(getAllDiscipline(rundata,portlet),
transformer); Collections.sort(parameters);
rundata.getRequest().setAttribute(ATTRIBUT_PARAMETER_BEAN_LIST,
parameters); logger.info("Enter dans doList");
}
public void doGetBean(RunData rundata, Portlet portlet) throws Exception
{
System.out.println("Enter dans doGetBean"); int parameterId =
Integer.parseInt((String)
rundata.getRequest().getParameter(ATTRIBUT_PARAMETER_ID));
rundata.getRequest().setAttribute(ATTRIBUT_PARAMETER_BEAN,
transformer.transformToBean(getDiscipline(rundata, portlet,
parameterId)));
String editTemplate =
portlet.getPortletConfig().getInitParameter("edit.template",
"EditDiscipline.jsp");
setTemplate(rundata, editTemplate, true);
System.out.println("Sortie dans doGetBean");
}
JSP:
<form method="post" action="<jetspeed:dynamicUri/>">
<input type="hidden" name="js_peid" value="<%=jspeid%>"> <input
type="hidden" name="action" value="DisciplineAction">
<INPUT TYPE="hidden" NAME="<%= IAttributeRequest.ATTRIBUT_PARAMETER_ID
%>" VALUE="1">
<input type="submit" name="eventSubmit_doGetBean" value="Save"/>
<input type="submit" name="eventSubmit_doList" value="Liste"/> </form>
</TABLE>
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]