AnsweredAssumed Answered

Action context in dashlets

Question asked by martinbramley on Nov 26, 2007

I'm trying to write my first dashlet. The aim is to produce a new dashlet that simplifies the pooled tasks interface. So that it is it is possible to take ownership of a task from the dashboard.

To do this I've created an action-group which contains the action take_ownership_doc. See below:

         <action-group id="pindar_artist_pool_actions">
            <action idref="take_ownership_doc" />

Then I created the dashlet based on pooled-tasks-todo-dashlet.jsp. See below:

<%@ taglib uri="" prefix="h" %>
<%@ taglib uri="" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>

<a:richList id="tasks-list" viewMode="details" value="#{WorkflowBean.tasksToDo}" var="r"
   styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow"
   altRowStyleClass="recordSetRowAlt" width="100%" pageSize="10"
   initialSortColumn="created" initialSortDescending="true"
   rendered="#{not empty WorkflowBean.tasksToDo}" refreshOnBind="true">

   <%– Primary column for details view mode –%>
   <a:column id="col1" primary="true" width="200" style="padding:2px;text-align:left">
      <f:facet name="header">
      <a:sortLink id="col1-sort" label="#{msg.description}" value="bpm:description" mode="case-insensitive" styleClass="header"/>
      <f:facet name="small-icon">
      <a:actionLink id="col1-act1" value="#{r['bpm:description']}" image="/images/icons/workflow_task.gif" showLink="false"
      actionListener="#{WorkflowBean.setupTaskDialog}" action="dialog:manageTask">
      <f:param name="id" value="#{}" />
      <f:param name="type" value="#{r.type}" />
      <a:actionLink id="col1-act2" value="#{r['bpm:description']}" actionListener="#{WorkflowBean.setupTaskDialog}" action="dialog:manageTask">
      <f:param name="id" value="#{}" />
      <f:param name="type" value="#{r.type}" />

   <%– Created Date column –%>
   <a:column id="col4" style="padding:2px;text-align:left">
      <f:facet name="header">
      <a:sortLink id="col4-sort" label="#{msg.created}" value="created" styleClass="header"/>
      <h:outputText id="col4-txt" value="#{r.created}">
      <a:convertXMLDate type="both" pattern="#{msg.date_time_pattern}" />

   <%– Status column –%>
   <a:column id="col6" style="padding:2px;text-align:left">
      <f:facet name="header">
      <a:sortLink id="col6-sort" label="#{msg.status}" value="bpm:status" styleClass="header"/>
      <h:outputText id="col6-txt" value="#{r['bpm:status']}" />

   <%– Actions column –%>
   <a:column id="col8" actions="true" style="padding:2px;text-align:left">
      <f:facet name="header">
      <h:outputText id="col8-txt" value="#{msg.actions}"/>

      <r:actions id="col8-actions" value="pindar_artist_pool_actions" context="#{r}" showLink="false" styleClass="inlineAction" />


The problem I have is that although the actions are listed correctly in my dashlet. I get a NULLPointerException when I click on the button. Am I correct in assuming that I have the action context incorrect?

If it is incorrect what should it be? Or have I made a made a mistake else where?

Many thanks in anticipation.