0 Replies Latest reply on Nov 27, 2008 2:16 AM by aldray.kianping.scs.com.sg

    How to get the TaskInstance after rendering element from taskInstancePriorityList on jsf?

    aldray.kianping.scs.com.sg
      Hi, how can i pass the task instance of the element selected back to the java code ? I need the task instance to do a reassigning of actor (basically transfering of task to another user)

      The line that trigger the java code is #{appealList.reassign}


      Code
      ----------
      <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <ui:composition xmlns="http://www.w3.org/1999/xhtml"
          xmlns:s="http://jboss.com/products/seam/taglib"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:rich="http://richfaces.org/rich"
          template="layout/template.xhtml">

      <ui:define name="body">
      <h1>Appeal List</h1>
      <f:view>
         <h:form id="list">
            <div>
               <h:outputText value="There are no appeal items." rendered="#{empty taskInstancePriorityList}"/>
               <h:dataTable value="#{taskInstancePriorityList}" var="task" rendered="#{not empty taskInstancePriorityList}">
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Process Id"/>
                      </f:facet>
                      <h:outputText value="#{task.taskMgmtInstance.processInstance.id}" style="width: 400"/>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Stage"/>
                      </f:facet>
                      <h:inputText value="#{task.name}" style="width: 400"/>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Description"/>
                      </f:facet>
                      <h:inputText value="#{task.description}" style="width: 400"/>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Created"/>
                      </f:facet>
                      <h:outputText value="#{task.taskMgmtInstance.processInstance.start}">
                          <s:convertDateTime type="date"/>
                      </h:outputText>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Priority"/>
                      </f:facet>
                      <h:inputText value="#{task.priority}" style="width: 30"/>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Due Date"/>
                      </f:facet>
                      <h:inputText value="#{task.dueDate}" style="width: 100">
                          <s:convertDateTime type="date" dateStyle="short"/>
                      </h:inputText>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Assigned To"/>
                      </f:facet>
                      <h:outputText value="#{task.actorId}" style="width: 400"/>
                  </h:column>
                  <h:column>
                      <f:facet name="header">
                          <h:outputText value="Reassigned"/>
                      </f:facet>
                      <h:selectOneListbox valueChangeListener="#{appealList.reassignActor}" size="1" style="width: 400">
                              <f:selectItem itemValue="" itemLabel=""/>
                              <f:selectItem itemValue="admin" itemLabel="admin"/>
                                              <f:selectItem itemValue="manager" itemLabel="manager"/>
                      </h:selectOneListbox>
                  </h:column>
                  <h:column>
                      <s:button action="#{appealList.reassign}" taskInstance="#{task}" value="reassign"/>
                  </h:column>           
               </h:dataTable>
            </div>
            <div>
            <h:messages/>
            </div>
           
         </h:form> 
      </f:view>
      </ui:define>
      </ui:composition>
      --------------------