Managed Bean in Task Form

Hi!Oracle Fusion Middleware 11.1.1.5.0, Oracle JDeveloper 11g.
I post this thread in this section because of the type of project I am working in (SOA Application).
I am trying to customize a BPEL Task Form.
After I made a project using Fusion Web Application, I could confirm that the managed beans for some ADF Faces components were working and the form (an .jspx page that I would run on Integrated Web Logic Server) was functional.
I made a project using SOA Application.
I made a BPEL Process with a Human Tak and using the Launch Task Form Wizard I made a form.
Then I started adding ADF Faces components that are using managed beans, just like in the other project.
When I deploy the project, all the components using the beans just dont show up. If I dont use the components with the managed beans the form appears normally.
Is there some additional requirement to make the bindings with the managed beans in the Task Form?
To clarify the question below I have some printscreens:
1. SelectOneChoice "Rubrica" component with value binding from the ActionListenerOK java class;
http://i43.tinypic.com/x4j0ol.jpg
2. Showing the Expression Builder for the above value binding;
http://i42.tinypic.com/14mdxqq.jpg
3. Method Expression Builder for a Button Component;
http://i41.tinypic.com/2r38tw2.jpg
4. The managed beans list for the form page;
http://i41.tinypic.com/rbjqt2.jpg
5. How the form appears when using the components with java bean bindings;
http://i39.tinypic.com/34pghh0.jpg
6. How the form appears when delete the components with tha java bindings;
http://i41.tinypic.com/2mwwkuo.jpg

<af:outputText value="Authenticated User: #{securityContext.userName}" id="ot2"/>
or via standard j2se apis (Subject.getSubject(..))
hth clemens (http://blogs.oracle.com/soabpm)

Similar Messages

  • JSF 2: A NullPointerException hits an unexpected managed bean at submission

    Hello,
    What a strange trouble I am facing today (I am still a newbie with JSF).
    I have this web page:
    <ui:composition template="/web/authentification/login/cnam/layout_cnam.xhtml">
          <ui:define name="content">
           <devoir:formulaireDeRemise sujetExamen="${devoirRemis.sujetExamen}" idAuditeur="${devoirRemis.auditeurId}" locale="${devoirRemis.requestLocale}" />
          </ui:define>
       </ui:composition>it uses composites, and composites that use composites, and the whole page and its composites rely on a Managed Bean, DevoirRemisBean:
    @ManagedBean(name="devoirRemis") @RequestScoped
    public class DevoirRemisBean extends BaseManagedBean
    private static Logger log = Logger.getLogger(DevoirRemisBean.class);
    private AuditeurId m_idAuditeur;
    private SujetExamen m_sujetExamen;
    private CorrecteurFacade m_correcteurService = CorrecteurFacade.getInstance(getRequestLocale());
    private EnseignantFacade m_enseignementService = EnseignantFacade.getInstance(getRequestLocale());
       public DevoirRemisBean()
          log.debug("DevoirRemisBean {0} créé.", this);
       public String doPréparerRemise(AuditeurId idAuditeur, UVId idUV, SujetId idSujet)
          assert(idAuditeur != null) : "L'identifiant de l'auditeur remettant un devoir ne peut pas valoir null.";
          assert(idUV != null) : "L'identifiant de l'UE du devoir à remettre ne peut pas valoir null.";
          assert(idSujet != null) : "L'identifiant du sujet d'examen pour le devoir à remettre ne peut pas valoir null.";
          m_idAuditeur = idAuditeur;
          m_sujetExamen = getSujetExamen(idUV, idSujet);
          log.debug("DevoirRemisBean {0} associé au casier ({1},{2},{3}).", this, idAuditeur, idUV, idSujet);
          return(destination(REMISE_DEVOIR_CNAM));
      // others getters and setters...
      // Eventually each getter always call this check() method to ensure being in a good state.
       public void check()
          assert(m_idAuditeur != null) : format("L''identifiant de l''auditeur devrait être connu à l''issue de la préparation de la remise de devoir, bean: {0}.", this);
          assert(m_sujetExamen != null)  : format("Le sujet d''examen devrait être connu à l''issue de la préparation de la remise de devoir, bean: {0}.", this);
       }When the interesting composite is called,
    <devoir:formulaireDeRemise sujetExamen="${devoirRemis.sujetExamen}" idAuditeur="${devoirRemis.auditeurId}" locale="${devoirRemis.requestLocale}" />
    it produces the expected result on the web page,
    I can see in my logs these lines, that makes me happy:
    DevoirRemisBean tag.uv.DevoirRemisBean@1133ead créé.
    DevoirRemisBean tag.uv.DevoirRemisBean@1133ead associé au casier (I023895,X1,TP03).
    meaning that the expected values are at the place I want them to be.
    In the web page displayed, a new submit button now exists.
    <h:inputHidden name="idAuditeur" value="${devoirRemis.auditeurId}" />
    <h:inputHidden name="idUV" value="${devoirRemis.sujetExamen.UV.id}" />
    <h:inputHidden name="idSujet" value="${devoirRemis.sujetExamen.id}" />
    <h:commandButton action="#{correction.doCorrection(idAuditeur, idUV, idSujet)}"
       styleClass="BtnVertNonPresse" value="${lblFormRemise.btn_envoyer}"
       onmousedown="if (this.className != 'BtnVertPresse') this.className='BtnVertPresse';"
       onmouseout="if (this.className != 'BtnVertNonPresse') this.className='BtnVertNonPresse';"
       onmouseup="if (this.className != 'BtnVertNonPresse') this.className='BtnVertNonPresse';" />(I have added <h:inputHidden> fields, for debugging.)
    This button is linked to an action that shall use another managed bean, correction, starting the same way than the other.
    @ManagedBean(name="correction") @RequestScoped
    public class DevoirCorrigéBean extends BaseManagedBean
    private static Logger log = Logger.getLogger(DevoirCorrigéBean.class);
    private AuditeurId m_idAuditeur;
    private SujetExamen m_sujetExamen;
       public DevoirCorrigéBean()
          log.debug("DevoirCorrigéBean {0} créé.", this);
       public String doCorrection(AuditeurId idAuditeur, UVId idUV, SujetId idSujet)
          assert(idAuditeur != null) : "L'identifiant de l'auditeur remettant un devoir ne peut pas valoir null.";
          assert(idUV != null) : "L'identifiant de l'UE du devoir à remettre ne peut pas valoir null.";
          assert(idSujet != null) : "L'identifiant du sujet d'examen pour le devoir à remettre ne peut pas valoir null.";
          m_idAuditeur = idAuditeur;
          m_sujetExamen = getSujetExamen(idUV, idSujet);
          log.debug("Demande de correction du casier ({1},{2},{3}) associé au devoirCorrigé {0}.", this, m_idAuditeur, m_sujetExamen.getUV().getId(), m_sujetExamen.getId());
          return(destination(ACCUEIL_CNAM));
    }Just before clicking on this button, I check the HTML source code produced by my browser.
    And I am still happy.
    <input type="hidden" name="j_idt12:remettreDevoir_X1_TP03:j_idt53" value="I023895" />
    <input type="hidden" name="j_idt12:remettreDevoir_X1_TP03:j_idt54" value="X1" />
    <input type="hidden" name="j_idt12:remettreDevoir_X1_TP03:j_idt55" value="TP03" />
    <input type="submit" name="j_idt12:remettreDevoir_X1_TP03:j_idt56" value="Envoyer" onmousedown="if (this.className != 'BtnVertPresse') this.className='BtnVertPresse';" onmouseout="if (this.className != 'BtnVertNonPresse') this.className='BtnVertNonPresse';" onmouseup="if (this.className != 'BtnVertNonPresse') this.className='BtnVertNonPresse';" class="BtnVertNonPresse" />
               </p><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="642372395068906580:4775162548067970543" autocomplete="off" />I then click on it.
    Failure:
    First, this debug log message:
    DevoirRemisBean tag.uv.DevoirRemisBean@9373f7 créé.
    Then,
    java.lang.AssertionError: L'identifiant de l'auditeur devrait être connu à l'issue de la préparation de la remise de devoir, bean: tag.uv.DevoirRemisBean@9373f7.
         at tag.uv.DevoirRemisBean.check(DevoirRemisBean.java:184)
         at tag.uv.DevoirRemisBean.getSujetExamen(DevoirRemisBean.java:127)
         at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at javax.el.BeanELResolver.getValue(BeanELResolver.java:302)Submitting my page, I was expecting
    #{correction.doCorrection(idAuditeur, idUV, idSujet)}
    to be called. From the DevoirCorrigéBean class.
    But instead, another instance of DevoirRemisBean is created, empty... for what internal goal?
    And my DevoirCorrigéBean:doCorrection(...) method is not even called.
    What can explain what is happening?
    Regards,
    Grunt.

    I removed all my assertions to see how far the submission could go when going unsane.
    I discovered that JSF attempts to redisplay my web page, and not to follow on the next one...
    ... so I have one explanation.
    Except that:
    There is no fields in the form that require a validation.
    (three hidden text fields, and a <h;inputTextarea> but that is not checked or mandatory).
    The form is not supposed to fail,
    and even if it had too, why the validation step doesn't carry the current managed bean at redisplay time, but instead re-create an empty managed bean?
    My form starts with a:
    <h:form id="${someId}"> where ${someId} is a scoped variable.
    Can it causes a problem during submission? Shall I use only a constant id for my form?
    What can you suggest me to do?
    Do I have a way to discover what JSF is about to complain against, before it tries to redisplay the page? I see nothing in my logs, but may be I shall redefine a log level somewhere, add one handler or something else?
    Regards,
    Grunt.

  • Validation, Task Flow, Servlet, Pop-up, and a Managed Bean

    Hi,
    We're trying to display a PDF in a pop-up by calling a Servlet within a JSF page by using a task flow in JDeveloper 11g R2.
    The relevant JSF snippet:
    <af:inlineFrame id="if1" shortDesc="Report" source="/pdfservlet" styleClass="AFStretchWidth"></af:inlineFrame>The /pdfservlet points to a Servlet with a doGet method as follows:
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      response.reset();
      OutputStream out = response.getOutputStream();
      FacesContext context = this.getFacesContext(request, response);
      OracleReportBean bean =
        context.getApplication().evaluateExpressionGet(context, "#{reportBean}", OracleReportBean.class);
      bean.run(context, out);
      removeFacesContext();
      out.close();
    }The Servlet attempts to get the FacesContext, but we've encountered the following exception:
    Caused By: javax.faces.FacesException: Cant instantiate class: oracle.adfinternal.view.faces.component.AdfViewRoot.We removed the following lines from the getFacesContext() method:
    UIViewRoot view = facesContext.getApplication().getViewHandler().createView(facesContext, "");
    facesContext.setViewRoot(view);This avoids the exception above, however... We're trying to get the parameters from the form that was submitted. Here is an example element from the form:
    <h:inputHidden value="MyMedicationList_Report" id="system_REPORT_RESOURCE"/>When the Servlet calls the Managed Bean to retrieve the value, it uses:
    Map<String, String[]> requestParameters = getRequestParameters();
    Parameters p = getParameters();
    for( String key : requestParameters.keySet() ) {
      for( String value : requestParameters.get( key ) ) {
        int i = key.indexOf( ':' );
        if( i >= 0 ) {
          key = key.substring( i + 1 );
        p.put( key, value );
    }Where getRequestParameters() attempts to get the external context to retrieve the request parameter values map:
    return getExternalContext().getRequestParameterValuesMap();The map comes up empty.
    I've tried following http://www.oracle.com/technetwork/developer-tools/adf/learnmore/oct2010-otn-harvest-183714.pdf by setting the web.xml to:
      <!-- JspFilter must be configured before adfBindings. -->
      <filter-mapping>
        <filter-name>JpsFilter</filter-name>
        <servlet-name>PDFServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>
      <filter-mapping>
        <filter-name>adfBindings</filter-name>
        <servlet-name>PDFServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
      </filter-mapping>And set the data bindings to:
      <pageMap>
        <page path="/pdfservlet" usageId="ca_bcpra_promis_reporting_view_PDFServletPageDef"/>
      </pageMap>
      <pageDefinitionUsages>
        <page id="ca_bcpra_promis_reporting_view_PDFServletPageDef" path="ca.bcpra.promis.reporting.view.PDFServletPageDef"/>
      </pageDefinitionUsages>The Servlet executes, calls the instantiated managed bean, but cannot read the request parameters.
    The button used to launch the task flow in a dialog is:
    <af:commandButton text="Run Report" id="submitReport" useWindow="true"
                      windowEmbedStyle="inlineDocument" windowModalityType="applicationModal" windowHeight="500"
                      windowWidth="700" action="runReport"/>By using a task flow, the user inputs are validated before the pop-up is opened. We want to keep that behaviour. The PDF opens and then returns with a NullPointerException:
    http://pastebin.com/raw.php?i=PaM64jL4
    The Servlet, through the managed bean, makes a request to the report server to pass parameters and generate a PDF. The PDF is streamed back to the browser via the Servlet.
    What other approaches can we take to:
    1. Send user and system parameters.
    2. Generate a PDF on a remote server.
    3. Stream the PDF back to the user in a pop-up.
    Thank you.

    It is not a static PDF. The PDF is generated, dynamically, on the report server using the parameters from multiple forms on the page.
    We've leveraged the HttpSession getSessionMap() object for now. When combined with a Method Task Flow, we can transfer the data (and FacesContext) to the report Servlet. For example, the following code exposes objects that the Servlet needs through the session:
      public void initReport(String reportName) {
        FacesContext context = FacesContext.getCurrentInstance();
        ExternalContext ec = context.getExternalContext();
        OracleReportBean bean =
          context.getApplication().evaluateExpressionGet(context, "#{reportBean}", OracleReportBean.class);
        bean.setFacesContext(context);
        ec.getSessionMap().put("reportBean", bean);
        ec.getSessionMap().put(Parameters.PARAM_REPORT_RESOURCE, reportName);
      }This means the Servlet can use the object:
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.reset();
        // Find the bean from the session.
        OracleReportBean bean = (OracleReportBean)request.getSession().getAttribute("reportBean");
        OutputStream out = response.getOutputStream();
        bean.run(out);
        out.close();
      }This allows the bean to generate reports.

  • Urgent - can't set managed bean value using a form, getting null

    I have a form with a bean -- unbelievably, I can't get the values entered into the form by the user to get stored into the bean. Everything is null... I've looked at a zillion examples, posts and compared etc...yet still can't see what is missing.
    Here's part of a trace :
    [cc]Dec-31 01:25:02 ApplicationImpl - Created bean resourceBean successfully
    [cc]Dec-31 01:25:02 ApplicationImpl - Storing resourceBean in scope request
    [cc]Dec-31 01:25:02 VariableResolverImpl - resolveVariable: Resolved variable:id=null name=null
    [cc]Dec-31 01:25:02 ValueBindingImpl - getValue Result:id=null name=null
    [cc]Dec-31 01:25:02 ValueBindingImpl - -->Returning id=null name=null
    If you have any ideas, please let me know--it seems just as I solve one JSF issue, I run into another on unexpectedly simple things.
    Here's the ResourceBean.java, the bean-config.xml and my jsp.
    package com.intalio.qa.tcm.view.beans;
    import java.util.Map;
    import javax.faces.context.FacesContext;
    import javax.faces.model.SelectItem;
    import org.apache.log4j.Logger;
    import com.intalio.qa.exceptions.DuplicateIdException;
    import com.intalio.qa.tcm.model.Resource;
    import com.intalio.qa.tcm.view.builders.ResourceBuilder;
    import com.intalio.qa.tcm.view.util.FacesUtils;
    * Resource backing bean.
    public class ResourceBean extends RootBean {
         * Class logger
         public static final Logger LOG =
              Logger.getLogger(ResourceBean.class);
    * The Resource id
         private String id = null;
         * The Resource name
         private String name = null;
    * Description
    private String description= null;
         * the resource type id associated with the Resource
         private String resourceTypeId= null;
         private static SelectItem[] resourceTypeIds = new SelectItem[] {
              new SelectItem("External Software"),
              new SelectItem("Hardware"),
              new SelectItem("Intalio Product Software"),
              new SelectItem("Machine - Dual CPU"),
              new SelectItem("Machine - CPU Single"),
              new SelectItem("Memory - UNIX"),
              new SelectItem("Memory - Windows") };
    * @return Returns the resourceTypeIds.
    public SelectItem[] getResourceTypeIds() {
    return resourceTypeIds;
    * @param resourceTypeIds The resourceTypeIds to set.
    public void setResourceTypeIds(SelectItem[] typeIds) {
    resourceTypeIds = typeIds;
         * Default constructor.
         public ResourceBean() {
    super();
    init();
         * Initializes ResourceBean.
         * @see RootBean#init()
         protected void init() {
         /*True, but I'd strongly recommend instead using:
    FacesContext fContext = FacesContext.getCurrentInstance();
    Map requestParams = fContext.getExternalContext().getRequestParameterMap();
    String companyId = (String) requestParams.get("companyID");
    The getRequest(), getSession(), and getContext() methods of ExternalContext should only be used as a last resort.*/
         * Backing bean action to update Resource.
         * @return the navigation result
         public String updateAction() {
              LOG.info("updateAction is invoked");
              try {
                   Resource Resource = ResourceBuilder.createResource(this);
                   LOG.info("ResourceId = " + Resource.getId());
              //     viewServicesManager.getResourceService().updateResource(Resource);
              } catch (Exception e) {
                   String msg = "Could not update Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error.");
                   return ActionResult.FAILURE;
              LOG.info("Resource with id of " + id + " was updated successfully.");
              return ActionResult.SUCCESS;
         * Backing bean action to create a new Resource.
         * @return the navigation result
         public String addAction() {
              try {
                   Resource resource = ResourceBuilder.createResource(this);
    LOG.info("resource created: " + resource.getName() + " with typeId = " + resource.getResourceTypeId());
                   viewServicesManager.getResourceService().saveResource(resource);
              } catch (DuplicateIdException de) {
                   String msg = "This id already exists";
                   LOG.info(msg);
                   FacesUtils.addErrorMessage(msg);
                   return ActionResult.RETRY;
              } catch (Exception e) {
                   String msg = "Could not save Resource";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(msg + ": Internal Error");
                   return ActionResult.FAILURE;
              String msg = "Resource with id of " + id + " was created successfully.";
              LOG.info(msg);
              return ActionResult.SUCCESS;
         * Backing bean action to delete Resource.
         * @return the navigation result
         public String deleteAction() {
              LOG.info("deleteAction is invoked");
              try {
         //          Resource Resource = ResourceBuilder.createResource(this);
         //          viewServicesManager.getResourceService().deleteResource(Resource);
                   //remove the ResourceList inside the cache
    //               FacesUtils.resetManagedBean(BeanNames.RESOURCE_LIST_BEAN);
              } catch (Exception e) {
                   String msg = "Could not delete Resource. ";
                   LOG.error(msg, e);
                   FacesUtils.addErrorMessage(null, msg + "Internal Error.");
                   return ActionResult.FAILURE;
              String msg = "Resource with id of " + id + " was deleted successfully.";
              LOG.info(msg);
              FacesUtils.addInfoMessage(msg);
              return ActionResult.SUCCESS;
         public String getId() {
              return id;
         * Invoked by the JSF managed bean facility.
         * <p>
         * The id is from the request parameter.
         * If the id is not null, by using the id as the key,
         * the Resource bean is initialized.
         * @param newQueryId the query id from request parameter
         public void setId(String newId) {
              LOG.info("setId " + newId);
              id = newId;
         public String getName() {
              return name;
         public void setName(String newName) {
              name = newName;
         public String getDescription() {
              return description;
         public void setDescription(String newDescription) {
              description = newDescription;
         public String getResourceTypeId() {
              return resourceTypeId;
         public void setResourceTypeId(String newResourceTypeId) {
              resourceTypeId = newResourceTypeId;
         public String toString() {
              return "id=" + id + " name=" + name;
         <!-- view -->
         <managed-bean>
              <description>
                   Managed bean
              </description>
              <managed-bean-name>applicationBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ApplicationBean
              </managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
              </managed-bean>
         <managed-bean>
              <description>
                   View service manager impl for business services
              </description>
              <managed-bean-name>viewServicesManagerBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ViewServicesManagerBean</managed-bean-class>
              <managed-bean-scope>application</managed-bean-scope>
         </managed-bean>
         <managed-bean>
              <description>
                   Backing bean that contains product information.
              </description>
              <managed-bean-name>resourceBean</managed-bean-name>
              <managed-bean-class>
                   com.intalio.qa.tcm.view.beans.ResourceBean
              </managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>viewServicesManager</property-name>
                   <value>#{viewServicesManagerBean}</value>
              </managed-property>
         </managed-bean>
    </faces-config>
    <f:view>
         <h:form id="createResourceForm" target="dataFrame">
              <h:outputText value="#{applicationBean.dummyVariable}" rendered="true" />
              <div align="center">
              <head>
              <link href="../../css/stylesheet.css" rel="stylesheet" type="text/css">
              <FONT color="#191970" size="4" face="Arial">Resources View</FONT>
              </head>
              <table style="margin-top: 2%" width="35%" cellpadding="10">
                   <div align="left">
                   <FONT color="#191970" size="3" face="Arial">Update Resources </FONT>
                   </div>
                   <tr>
                        <td align="center" valign="top" align="center" style="" bgcolor="white" />
                        <table>
                             <tbody>
                                  <tr>
                                       <td align="left" styleClass="header" width="100" />
                                       <td align="left" width="450" />
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Id" /></td>
                                       <td align="left" width="450"><h:inputText value="#{resourceBean.id}" id="id"/> <h:message for="id" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100"><h:outputText value="Name" /></td>
                                       <td align="left" width="450"><h:inputText value="#{resourceBean.name}" id="name" /> <h:message for="name" styleClass="errorMessage" /></td>
                                  </tr>
                                  <tr>
                                       <!--td align="right" width="100" valign="bottom"><h:outputText value="Type" /></td>
                                       <td align="left" width="550"><h:selectOneMenu>
                                            <f:selectItems value="#{resourceBean.resourceTypeIds}" />
                                       </h:selectOneMenu> <h:outputText value="#{resourceBean.resourceTypeId}" id="dresourceTypeId" /> <h:message for="resourceTypeId" styleClass="errorMessage" />
                                       </td>
                                  </tr>
                                  <tr>
                                       <td align="right" width="100" valign="bottom"><h:outputText value="Description" /></td>
                                       <td align="left" width="450"><h:inputText value="#{resourceBean.description}" id="description" size="96" /> <h:message for="description" styleClass="errorMessage" /></td>
                                  </tr>
                             </tbody>
                        </table>
         </h:form>
         </td>
         <!-- END DATA FORM -->
         <!-- BEGIN COMMANDS -->
         <td width="30%" align="left" valign="top"><h:form id="buttonCommandsForm">
              <h:panelGroup id="buttons">
                   <h:panelGrid columns="1" cellspacing="1" cellpadding="2" border="0" bgcolor="white">
                        <h:commandButton value="Add" style="height:21px; width:51px;font-size:8pt; font-color: black;" action="#{resourceBean.addAction}">
                        </h:commandButton>
                        <h:commandButton id="deleteCB" value="Delete" style="height:21px; width:51px;font-size:8pt" action="#{resourceBean.deleteAction}">
                        </h:commandButton>
                        <h:commandButton id="spaceFillerButton" style="height:21px; width:51px;font-size:8pt;background-color: #ffffff;color: #ffffff;border: 0px;">
                        </h:commandButton>
                        <h:commandButton id="saveCB" value="Save" style="height:21px; width:51px;font-size:8pt" action="#{resourceBean.saveAction}">
                        </h:commandButton>
                        <h:commandButton id="updateCB" value="Update" style="height:21px; width:51px;font-size:8pt" action="#{resourceBean.updateAction}">
                        </h:commandButton>
                   </h:panelGrid>
              </h:panelGroup>
         </h:form> <!-- end buttons --></td>
         </tr>
         </table>
         <HR align="center" size="2" width="60%" />
         <!-- data table -->
         </div>
    </f:view>
    THANKS.
    -L

    I solved this.
    Since I was testing the action code only, I didn't define a navigation entry corresponding to the action string returned for this button:
    <h:commandButton value="Add" style="height:21px; width:51px;font-size:8pt; font-color: black;" action="#{resourceBean.addAction}">
    </h:commandButton>After I added a nav definition, it worked. I don't know why at this point. I suspect a key step in the lifecycle was pre-empted...someone else can probably explain why. If I get a chance to research it after I'm done with my project, I'll update this post.
    Thanks.
    -L

  • How to use a managed bean in a bounded task flow without definig it in adfc-config

    Dear all
    I create a bounded task flow without page fragments (the pages are jspx), i created a jspx page with a button that its action has bounded to a managed bean function.
    i defined the managed bean on the corresponding bounded task flow, but it does not work.
    But there is no problem when i define the managed bean in adfc-config.xml.
    can anybody help me with this problem.
    is it possible to use jspx page with backing bean in bounded task flows, without defining the beans on adfc-config?
    Thank you very much

    Dear Timo
    I use jDev 11.1.1.6 and the scope is Request.Although when i use task flow page fragment and create jsff pages, there is no problem.

  • Call bounded task flow from managed bean

    Hi experts,
    can we call a bounded task flow from a managed bean?
    if yes , please explain.....
    Thankz in advance
    PMS

    Hi john,
    Thankz for ur reply........sorry if im asking stupid questions.
    this is my tree selection handler
    public void treeSelectionHandler(SelectionEvent selectionEvent) {
    RichTree tree1 = (RichTree) selectionEvent.getSource();
    RowKeySet rks2 = selectionEvent.getAddedSet();
    Iterator rksIterator = rks2.iterator();
    if (rksIterator.hasNext())
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeBinding = null;
    treeBinding = (JUCtrlHierBinding) ((CollectionModel)tree1.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = nodeBinding = treeBinding.findNodeByKeyPath(key);
    DCIteratorBinding _treeIteratorBinding = null;
    _treeIteratorBinding = treeBinding.getDCIteratorBinding();
    JUIteratorBinding iterator = nodeBinding.getIteratorBinding();
    String keyStr = nodeBinding.getRowKey().toStringFormat(true);
    iterator.setCurrentRowWithKey(keyStr);
    JUCtrlHierTypeBinding typeBinding = nodeBinding.getHierTypeBinding();
    String targetIteratorSpelString = typeBinding.getTargetIterator();
    if (targetIteratorSpelString.equals("${bindings.Iascat1View1Iterator}"))
    System.out.println("Tree Selected*************"+targetIteratorSpelString);*
    else
    if(targetIteratorSpelString.equals("${bindings.Iascat2View1Iterator}"))
    *System.out.println("Tree Selected**************"+targetIteratorSpelString);*
    else
    *System.out.println("Tree Selected**************"+targetIteratorSpelString);*
    I hav bounded task flow for each iterator for creating new record......i hav to replace code for calling bounded task flow instead of printing statement
    PMS

  • How can we contrrol the focus of an form Object  from the Managed bean??

    I am getting the following script error...
    Can't move the focus to the control because it is invisible or not enabled or of the type that does not accept the focus...
    I have a button whose action is mapped to a function in the Managed bean.
    In the managed bean
    I am making the button Invisible along with some other components.
    Can any one help me out....

    @BalusC
    You were proposing the following solution in other thread..
    <html>
    <head>
    </head>
    <body>
    <f:verbatim>
    <script>
    setFocus('</f:verbatim><h:outputText value="#{myBean.focusId}" /><f:verbatim>');
    </script>
    </f:verbatim>
    </body>
    </html>
    But it is giving the following error
    javax.faces.FacesException: org.apache.jasper.JasperException: /EducationDetails.jsp(97,29) The element type "script" must be terminated by the matching end-tag "</script>".

  • Custom bean on Approve in Human Task Form

    Hi,
    I have a complex requirement, The Approver has to validate the employee number manually.Approver will look in some system.
    There is a check box in  Human Task Form  " Validated Employee Number".
    The approver has to check mark this check box before approve. If this check box is not checked, we have to stop them with a pop up " Please verify employee number"
    Please advise.
    Thanks in advance.

    for the approve button, add action listener method and check your reqired fileds if any required filed is not entered you can throw an error as below.
    FacesContext.getCurrentInstance().addMessage(null,
                                                                           new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                                                           "Your Error Message",
                                                                            null));

  • Session scope managed bean is not instantiating?

    We have the need to use a session bean (rather than pageFlowScope) in our application.  But it looks like the session beans are not being instantiated at run time like other beans are.  I created a simple test case to verify.  One bean, named "MySessionBean", defined in the task flow as Session scope, then referenced in a view with an input text box, value:  #{sessionScope.MySessionBean.value1}. When I run the application,  I just get PropertyNotFoundException, Target Unreachable, 'MySessionBean' returned null.
    If I simply change the bean to use pageFlowScope, everything works fine.   I have debug code in the bean constructor, and it never gets called.   Is there some other step I am missing to have ADF instantiate the session bean?

    No luck, I tried it in both adfc-config.xml, and faces-config.xml.  I also tried moving the call to my view, from my bounded taskflow, into the adfc-config unbounded task flow, and then I ran that instead.  Still got the same error.    Here is my code from the the last round of tests with the view called in the main adfc-config.xml unbounded taskflow:
    adfc-config.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
          <view id="testView">
                <page>/testView.jspx</page>
          </view>
          <managed-bean id="__2">
          <managed-bean-name id="__5">MySessionBean</managed-bean-name>
          <managed-bean-class id="__4">test.MySessionBean</managed-bean-class>
          <managed-bean-scope id="__3">session</managed-bean-scope>
        </managed-bean>
    </adfc-config>
    testView.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:inputText label="Label 1" id="it1"
                          value="#{sessionScope.MySessionBean.value1}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    MySessionBean.java:
    package test;
    public class MySessionBean {
        private String value1="Hello World";
        public MySessionBean() {
            super();
        public void setValue1(String value1) {
            this.value1 = value1;
        public String getValue1() {
            return value1;

  • [ADF custom task form] How to get logged user in Worklist app?

    Hi!
    How to get the user id, logged in Worklist application in a managed bean? I'm creating ADF task form for human task and i have to know which user is logged in.
    Thx!

    &lt;af:outputText value="Authenticated User: #{securityContext.userName}" id="ot2"/>
    or via standard j2se apis (Subject.getSubject(..))
    hth clemens (http://blogs.oracle.com/soabpm)

  • Use ADF Managed Bean to get the username in BPM Workspace

    Hi all,
    I used JSF and ADF to build the UI of human task. And I want to get the username of the user who is manipulate on BPM Workspace. For example, an ADF form can display the username of current user in BPM Workspace. I also try this approach: use Manage Bean, and bind this bean to a output text in ADF form. The code fragment I use to get the current username is:
    ADFContext.getCurrent().getSecurityContext().getUserPrincipal().getName();
    But it does not work. The value I get is Anonymous.
    So, plz help me solve this problem

    Hi, please try this function as below:
    public String getUserLogin() throws WorkflowException,
    BPMIdentityException,
    BPMUnsupportedAttributeException {
    String userId = "";
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService;
    IWorkflowContext wfContext;
    // Get username of User Login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
    wfSvcClient = WorkflowService.getWorkflowServiceClient();
    queryService = wfSvcClient.getTaskQueryService();
    wfContext = queryService.getWorkflowContext(contextStr);
    userId = wfContext.getUser();
    return userId;
    Regards.

  • Binding ADF Components in Task Form

    Hi!
    I am using: Oracle Fusion Middleware 11.1.1.5.0, Oracle JDeveloper 11g.
    I posted this thread in the SOA section because of the type of project I am working in (SOA Application). But until now my question remained unanswered so I now I post in this section because I am using also ADF components.
    I am trying to customize a BPEL Task Form.
    After I made a project using Fusion Web Application, I could confirm that the managed beans for some ADF Faces components were working and the form (an .jspx page that I would run on Integrated Web Logic Server) was functional.
    I made a project using SOA Application.
    I made a BPEL Process with a Human Tak and using the Launch Task Form Wizard I made a form.
    Then I started adding ADF Faces components that are using managed beans, just like in the other project.
    When I deploy the project, all the components using the beans just dont show up. If I dont use the components with the managed beans the form appears normally.
    Is there some additional requirement to make the bindings with the managed beans in the Task Form?
    To clarify the question below I have some printscreens:
    1. SelectOneChoice "Rubrica" component with value binding from the ActionListenerOK java class;
    http://i43.tinypic.com/x4j0ol.jpg
    2. Showing the Expression Builder for the above value binding;
    http://i42.tinypic.com/14mdxqq.jpg
    3. Method Expression Builder for a Button Component;
    http://i41.tinypic.com/2r38tw2.jpg
    4. The managed beans list for the form page;
    http://i41.tinypic.com/rbjqt2.jpg
    5. How the form appears when using the components with java bean bindings;
    http://i39.tinypic.com/34pghh0.jpg
    6. How the form appears when delete the components with tha java bindings;
    http://i41.tinypic.com/2mwwkuo.jpg

    Answering your questions:
    Where: I created the class in the oracle package, than I tried using oracle.adf and oracle.bpel.services.workflow.worklist.adf, where I have seen that the form had automatically created some of the beans for some actions. I defined the bean inside the task flow.xml that was automatically created when I created the form.
    http://i39.tinypic.com/16gx6ic.jpg
    What scope: request. The bean is a class that changes the tabs upon an user selection from a SelectOneChoice component. But I also created bean for populating a table and I will need to create several other beans for different methods. The tabs are all hidden and only can be displayed upon selection and clicking the ok button.
    As the bean is functional when used in a Fusion Web Application (ADF), I believe that the code is correct:
    http://i43.tinypic.com/r8fg46.jpg
    Showing the bindings for the respective components:
    http://i43.tinypic.com/sxymue.jpg
    http://i40.tinypic.com/ek3tjk.jpg

  • Re:How to get the vo from managed bean

    Hi all,
    I am using Jdev11.1.2.3.0
    My requirement is : I have one jspx page.In that page i have created one form,so i need to get the values from managed bean.here i wont create by using data control view instance.so finally i have to get the table values from managed bean.so how can i get it.can anyone help me please.
    Thanks,
    G.Shilpa

    So you're not using ADF BC at all, right ?
    From JSF point of view, it does not matter how you provide UI control values.
    What you can do, for example, is to use pure JDBC in order to get and display the database values.
    What you need in your backing bean, is appropriate properties (setter/getter method pairs).
    In the getter, you can obtain DB values by using JDBC
    Take a look at:
    JSF 2.0 + JDBC integration example
    JSF JDBC Integration
    JDBC in JSF - YouTube

  • Initialize managed bean from request parameters

    Hi:
    I thought this topic would be on the FAQ, but I couldn't find it. I am looking for a mean to initialize my managed bean from the query string. There must be something like:
    <h:form initializeBean=""true"" requestParameter=""id_author"" beanProperty=""#{author.id_author}"" action=""#{author.getFromDB}"" >
    </form>
    The url would be something like http://localhost:8080/protoJSF/showAuthor.jsf?id_author=5334
    And the getFromDB method would be something like
      Public void getFromDB()
         Statement stmt = cn.createStatement( ?SELECT * from author where id_author=? + getId_author() );
         ResultSet rs = stmt.executeQuery();
      }The only way I've found to perform something like this is to present a blank author form with a ''load data'' button: after pressing the button the user can see author's data and edit the data if she wants to. This two-step data screening is annoying, to say the least.
    There must be a better way.
    I beg for a pointer on how can I achieve the initializing of a managed bean with dynamic data.
    Regards
    Alberto Gaona

    You just have to read carefully the very fun 289 pages
    specification :-)Or, if 289 pages of JavaServer Faces is too much, you can get almost all of the same information from the JavaServer Pages 2.0 specification, or even the JSP Standard Tag Libraries specification :-).
    More seriously, the standard set of "magic" variable names that JavaServer Faces recognizes is the same as that reognized by the EL implementations in JSP and JSTL. Specifically:
    * applicationScope - Map of servlet context attributes
    * cooke - Map of cookies in this request
    * facesContext - The FacesContext instance for this request
    * header - Map of HTTP headers (max one value per header name)
    * headerValues - Map of HTTP headers (String array of values per header name)
    * initParam - Map of context initialization parameters for this webapp
    * param - Map of request parameters (max one value per parameter name)
    * paramMap - Map of request parameters (String array of values per parameter name)
    * requestScope - Map of request attributes for this request
    * sessionScope - Map of session attributes for this request
    * view - The UIViewRoot component at the base of the component tree for this view
    If you use a simple name other than the ones on this list, JavaServer Faces will search through request attributes, session attributes, and servlet context (application) attributes. If not found, it will then try to use the managed bean facility to create and configure an appropriate bean, and give it back to you.
    For extra fun, you can even create your own VariableResolver that can define additional "magic" variable names known to your application, and delegate to the standard VariableResolver for anything else.
    Craig McClanahan

  • Generate PDF using Managed Bean with custom HTTP headers

    Background
    Generate a report in various formats (e.g., PDF, delimited, Excel, HTML, etc.) using JDeveloper 11g Release 2 (11.1.2.3.0) upon clicking an af:commandButton. See also the StackOverflow version of this question:
    http://stackoverflow.com/q/13654625/59087
    Problem
    HTTP headers are being sent twice: once by the framework and once by a bean.
    Source Code
    The source code includes:
    - Button Action
    - Managed Bean
    - Task Flow
    Button Action
    The button action:
    <af:commandButton text="Report" id="submitReport" action="Execute" />
    Managed Bean
    The Managed Bean is fairly complex. The code to `responseComplete` is getting called, however it does not seem to be called sufficiently early to prevent the application framework from writing the HTTP headers.
    HTTP Response Header Override
    * Sets the HTTP headers required to indicate to the browser that the
    * report is to be downloaded (rather than displayed in the current
    * window).
    protected void setDownloadHeaders() {
    HttpServletResponse response = getServletResponse();
    response.setHeader( "Content-Description", getContentDescription() );
    response.setHeader( "Content-Disposition", "attachment, filename="
    + getFilename() );
    response.setHeader( "Content-Type", getContentType() );
    response.setHeader( "Content-Transfer-Encoding",
    getContentTransferEncoding() );
    Issue Response Complete
    The bean indirectly tells the framework that the response is handled (by the bean):
    getFacesContext().responseComplete();
    Bean Run and Configure
    public void run() {
    try {
    Report report = getReport();
    configure(report.getParameters());
    report.run();
    } catch (Exception e) {
    e.printStackTrace();
    private void configure(Parameters p) {
    p.put(ReportImpl.SYSTEM_REPORT_PROTOCOL, "http");
    p.put(ReportImpl.SYSTEM_REPORT_HOST, "localhost");
    p.put(ReportImpl.SYSTEM_REPORT_PORT, "7002");
    p.put(ReportImpl.SYSTEM_REPORT_PATH, "/reports/rwservlet");
    p.put(Parameters.PARAM_REPORT_FORMAT, "pdf");
    p.put("report_cmdkey", getReportName());
    p.put("report_ORACLE_1", getReportDestinationType());
    p.put("report_ORACLE_2", getReportDestinationFormat());
    Task Flow
    The Task Flow calls Execute, which refers to the bean's `run()` method:
    entry -> main -> Execute -> ReportBeanRun
    Where:
    <method-call id="ReportBeanRun">
    <description>Executes a report</description>
    <display-name>Execute Report</display-name>
    <method>#{reportBean.run}</method>
    <outcome>
    <fixed-outcome>success</fixed-outcome>
    </outcome>
    </method-call>
    The bean is assigned to the `request` scope, with a few managed properties:
    <control-flow-rule id="__3">
    <from-activity-id>main</from-activity-id>
    <control-flow-case id="ExecuteReport">
    <from-outcome>Execute</from-outcome>
    <to-activity-id>ReportBeanRun</to-activity-id>
    </control-flow-case>
    </control-flow-rule>
    <managed-bean id="ReportBean">
    <description>Executes a report</description>
    <display-name>ReportBean</display-name>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    The `<fixed-outcome>success</fixed-outcome>` strikes me as incorrect -- I don't want the method call to return to another task.
    Restrictions
    The report server receives requests from the web server exclusively. The report server URL cannot be used by browsers to download directly, for security reasons.
    Error Messages
    The error message that is generated:
    Duplicate headers received from server
    Error 349 (net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION): Multiple distinct Content-Disposition headers received. This is disallowed to protect against HTTP response splitting attacks.Nevertheless, the report is being generated. Preventing the framework from writing the HTTP headers would resolve this issue.
    Question
    How can you set the HTTP headers in ADF while using a Task Flow to generate a PDF by calling a managed bean?
    Ideas
    Some additional ideas:
    - Override the Page Lifecycle Phase Listener (`ADFPhaseListener` + `PageLifecycle`)
    - Develop a custom Servlet on the web server
    Related Links
    - http://www.oracle.com/technetwork/middleware/bi-publisher/adf-bip-ucm-integration-179699.pdf
    - http://www.slideshare.net/lucbors/reports-no-notes#btnNext
    - http://www.techartifact.com/blogs/2012/03/calling-oracle-report-from-adf-applications.html?goback=%2Egde_4212375_member_102062735
    - http://docs.oracle.com/cd/E29049_01/web.1112/e16182/adf_lifecycle.htm#CIABEJFB
    Thank you!

    The problem was that the HTTP headers were in fact being written twice:
    1. The report server was returning HTTP response headers.
    2. The bean was including its own HTTP response headers (as shown in the question).
    3. The bean was copying the entire contents of the report server response, including the headers, into the output stream.
    Firefox ignored the duplicate header errors, but Google Chrome did not.

Maybe you are looking for