How to set a value in a managed bean when click on a button

Dear all
I have a managed bean that contains an attribute of type string as follow:
the attribute name is taskFlowId
package dhamanADM.view.beans;
import oracle.adf.controller.TaskFlowId;
public class dynamicTaskFlowManager {
   private String taskFlowId = "/WEB-INF/flows/procedureMaster.xml#procedureMaster";   
    public dynamicTaskFlowManager() {
        super();
  public TaskFlowId getDynamicTaskFlowId() {
   return TaskFlowId.parse(taskFlowId);
}I want to change the value of this attribute when clicking on a commandMenuItem as follow
   <af:commandMenuItem text="Mission Persons" id="pt_cmi1"
                                            action="missionPers">
   <af:setActionListener from="/WEB-INF/flows/editPersionMission.xml#editPersionMission"
                                  to="#{pageFlowScope.dmDynamicTaskFlowManager.dynamicTaskFlowId}"/>
   </af:commandMenuItem>at run time when clicking on the menu this error appears
java.lang.IllegalArgumentException: Cannot convert /WEB-INF/flows/editPersionMission.xml#editPersionMission of type class java.lang.String to class oracle.adf.controller.TaskFlowId
My target is just to change the value of the attribute "taskFlowId" when clicking on the commandMenuItem
how can i do this?
Thanks in advance
Edited by: ta**** on Mar 29, 2011 1:24 PM

You are setting to set a String value where a type of TaskFlowId is required.
Looks like, you are trying to set the taskFlowId for the dynamic region. Modify the code as follows:
public class dynamicTaskFlowManager {
private String taskFlowId = "/WEB-INF/flows/procedureMaster.xml#procedureMaster";
public dynamicTaskFlowManager() {
super();
*public TaskFlowId getDynamicTaskFlowId() {*
AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
String currentTaskFlowId =
*(String)adfFacesContext.getPageFlowScope().get("CurrentTaskFlowId");*
if (currentTaskFlowId == null ||
*currentTaskFlowId.trim().equals("") == true) {*
currentTaskFlowId = taskFlowId;
return TaskFlowId.parse(currentTaskFlowId);
In the MenuItem, modify it as follows:
<af:commandMenuItem text="Mission Persons" id="pt_cmi1"
action="missionPers">
*<af:setActionListener from="/WEB-INF/flows/editPersionMission.xml#editPersionMission"*
*to="#{pageFlowScope.CurrentTaskFlowId}"/>*
</af:commandMenuItem>
Thanks,
Navaneeth

Similar Messages

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • How to set default value of session management alert

    Dear Sir,
    Our server is EP7 , I would like to set the default value of session management alert to be "OFF". Because now the default value of session management alert to be "ON".  And I must manual set when the server start every time.
    Please kindly advise.
    Thank you and best regards,
    Vimol

    Hi,
    There is also a SAP note which explains this:
    SAP Note Number: [868477 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_ep_pin/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d383638343737%7d]
    Regards,
    Praveen Gudapati

  • How do you make a movieclip display and play when click on a button

    I'm looking to have a movie clip pop up, play itself after a user clicks on a flash navigation button.
    (something like this???)
    message_btn.addEventListener(MouseEvent.CLICK, goMessage1);
    function goMessage1(evt:MouseEvent):void
        ???(play message movie clip here)???;

    How you code that depends a bit on how you design the movieclip.  You could make the movieclip have an empty first frame that it is stop()-ed at, and tell it to play() in the event handler function.  Or you could have the movie's visible property  initially set to false and stop()-ed at frame 1 and have the event handler set the visible property to true and tell the movieclip to play();
    The key is to have a plan where the movieclip is waiting to play and has an instance name assigned to it that you can use to command it to play when you want it to.

  • How to set a value when right click on af:commandlink ?

    Hi All,
    JDev Ver : 11.1.1.4.0
    How to set a value to property listener on right click of a commandLink ?
    I am having values that are hyper linked using af:commandlink, when i right click on hyperlink, that value i need to get in the managed bean ?
    (While right click i am populating on menu item)
    how to get the value ?
    Give some solutions ?
    thanks
    Gopinath

    Hi,
    Try this code:
    <af:clientListener method="rightClick"
    type="contextMenu"/>
    <af:serverListener type="setValue"
    method="#{beanName.setValueMethodName}"/>
    <trh:script xmlns:trh="http://myfaces.apache.org/trinidad/html"
    id="s13">rightClick = function(event) {
    var source = event.getSource();
    AdfCustomEvent.queue( source, "setValue"
    , {}, false); }
    </trh:script>

  • How to set a value to the TextField on keyPress Event?

    Hai,
    I am using Jdev 11g.
    In my jspx page,i have an Input Text...I want to set a value to that input text when i press any button (say F2) inside that text field .I tried with clientListener and server Listener..But it is not set.
    In jspx page
    *========*
    <f:facet name="metaContainer">
    <trh:script>
    function onKeypressClientListner(evt) {
    var _txtField; var valueStr;
    _txtField = evt.getSource();        
    if (evt.getKeyCode() == AdfKeyStroke.F2_KEY) {
    valueStr = _txtField.getSubmittedValue()
    AdfCustomEvent.queue(_txtField,"onKeyPressServerListner",{payload:valueStr}, true); evt.cancel();
    </trh:script>
    </f:facet>
    <af:inputText label="Label 1" id="it1"
    binding="#{backing_CheckKeyPress.itxtInputText}">
    <af:clientListener method="onKeypressClientListner" type="keyUp"/>
    <af:serverListener type="onKeyPressServerListner"
    method="#{backing_CheckKeyPress.serverKeyListner}"/>
    </af:inputText>
    In CheckKeyPress.java
    *======*
    public void serverKeyListner(ClientEvent clientEvent)
    System.out.println("Inside Server Listener");
    itxtInputText.setValue("Hai");
    AdfFacesContext.getCurrentInstance().addPartialTarget(itxtInputText);
    After executing this,program will give output as Inside Server Listener . But the TextField value is not setting..

    I got it..Just set immediate property to true

  • Set default value on field KNA1-AUFSD when creating Customer

    Hi,
    How to set default value on field KNA1-AUFSD when creating customer master using XD01/VD01?
    I have tried user exit SAPMF02D, but all KNA1 values are read only.
    Thx

    Hi
    Try to implement an enhancement option in include MF02DFEX. (at the beginning before call to FM CALL CUSTOMER-FUNCTION '001'.).
    and Initialize the value for KNA1-AUFSD.
    In this Include you can see that there is a call for CALL CUSTOMER-FUNCTION '001'.
    So even you test/check the initialized value for field KNA1-AUFSD is updated by putting a break point in this function module after implementation of your enhancement SAPMF02D.
    Regards,
    Dwaraka.S

  • How to set the value of process variables/payload using a managed bean?

    Hello,
    Someone can give me an example about how to set the values of a process payload in a managed bean?
    thank you!

    Try this:
    jsf page:
    <af:selectOneChoice label="Select Suburb"
    requiredMessageDetail="Select a suburb"
    valueChangeListener="#{selectOneChoiceBean.onValueChanged}"
    validator="#{selectOneChoiceBean.validate}"
    unselectedLabel="None" autoSubmit="true"
    binding="#{selectOneChoiceBean.selectOneChoice}"
    value="#{selectOneChoiceBean.value}">
    <f:selectItems value="#{selectOneChoiceBean.selectionList}"/>
    </af:selectOneChoice>
    backing bean:
    public class SelectChoiceBean {
    private List<SelectItem> selectionList;
    private String value = "B";
    private RichSelectOneChoice selectOneChoice;
    public SelectChoiceBean() {
    initSelectionList();
    public void setSelectionList(List<SelectItem> selectionList) {
    this.selectionList = selectionList;
    public List<SelectItem> getSelectionList() {
    return selectionList;
    public void onValueChanged(ValueChangeEvent valueChangeEvent) {
    System.out.println(valueChangeEvent.getNewValue());
    // Add event code here...
    public void validate(FacesContext facesContext, UIComponent uIComponent,
    Object object) {
    // Add event code here...
    private void initSelectionList() {
    selectionList = new ArrayList<SelectItem>();
    selectionList.add(new SelectItem("A", "A label"));
    selectionList.add(new SelectItem("B", "B label"));
    selectionList.add(new SelectItem("C", "C label"));
    public void setValue(String value) {
    this.value = value;
    public String getValue() {
    return value;
    public void setSelectOneChoice(RichSelectOneChoice selectOneChoice) {
    this.selectOneChoice = selectOneChoice;
    public RichSelectOneChoice getSelectOneChoice() {
    return selectOneChoice;
    }

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to set cookie value in one page and retrieve in another page using setA

    How to set cookie value in one page and retrieve in another page using setActionListener?
    I have tried with following code srcpage.jspx->destpage.jspx
    srcpage.jspx
    <af:table value="#{bindings.DepartmentsView1.collectionModel}"
    var="emp" rows="#{bindings.EMPView1.rangeSize}"
    first="#{bindings.EMPView1.rangeStart}"
    emptyText="#{bindings.DepartmentsView1.viewable ? 'No rows yet.' : 'Access Denied.'}">
    <af:column sortProperty="EmployeeName" sortable="false"
    headerText="Cookie Testing">
    <af:commandLink text="#{emp.EmployeeName}" action="success">
    <af:setActionListener from="#{emp.EmployeeName}"
    to="#{cookie}"/>
    </af:commandLink>
    </af:column>
    </af:table>
    espage.jspx
    <af:outputText value="Test Cookie Value: #{cookie}"/>
    ,Here Test Cookie Value prints the following instead of its original String value
    {JSESSIONID=javax.servlet.http.Cookie@7da288, oracle.uix=javax.servlet.http.Cookie@399f62}
    I have passed employee name "Robert" to cookie in srcpage.jspx,but it prints "JSESSIONID....." instead of "Robert" in destpage.jspx
    Thanks in advance
    Kalee

    Hi,
    "cookie" is a reserved name. If you want to write to a session scope attribute called "cookie" then you have to call #{sessionScope.cookie}. If you want to use EL to set and read from cookies then you will have to use
    #{cookie.cookieName}
    Note that #{cookie} writes to and returns a map
    check this: http://www.informit.com/articles/article.aspx?p=30946&seqNum=7
    Frank

  • How to set variable value in an XML array

    Hi,
    Please let me know how to set the value for a xml array element using assign activity inside a for-each block in BPEL 11g
    I tried to set the variable value for result element using the below condition but i encountered selection failure message
    $outputVariable.payload/ns1:Student['i']/ns1:result or
    $outputVariable.payload/ns1:Student[$i]/ns1:result
    And the xsd used is as below
    <xsd:complexType name="StudentCollection">
    <xsd:sequence>
    <xsd:element name="Student" type="Student" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Student">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="location" type="xsd:string"/>
    <xsd:element name="mark" type="xsd:string"/>
    <xsd:element name="result" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    Thanks,
    Dhana

    Hi,
    At the back of button specify the following parameter:-
    CMD    1        Execute_planning_function
    Planning_function_name  1   xyz
    Var_name     1    variable_name
    var_value      1    blank
    Can also refer to link below:-
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0a89464-f697-2910-2ba6-9877e3088954?quicklink=index&overridelayout=true(can refer to page 20)
    http://www.sdn.sap.com/ddc5564a-337d-4cf9-a34e-2dab64df09be/finaldownload/downloadid-a61a6724ba8e7b7fbd9c5df9590ab50d/ddc5564a-337d-4cf9-a34e-2dab64df09be/irj/scn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be?quicklink=index&overridelayout=true
    Hope it may help

  • In flex, How to set a value to one parameter, the parameter defined in a cffunction in a cfc file

    In flex, How to set a value to one parameter, the parameter
    defined in a cffunction in a cfc file, In the cffunction there are
    much cfargument, I want set a value to one of them, such as the
    cfc:
    <cffunction access="remote" name="myShow" output="false"
    returntype="struct">
    <cfargument name="ID" type="numeric" default=0>
    <cfargument name="GoodsID" type="string" default="">
    <cfargument name="DestTime" type="string" default="">
    <cfargument name="DestCount" type="numeric" default=1>
    How I set a value to only parameter one of them , such as set
    GoodsID when use mx:remoteObject.
    Thanks for your help

    Got maybe a solution for you, I have just tested it.
    So, the idea is to use intermediate variables. Imagine Var1 and Var2 variables that you refresh with your more or less complicated queries. Then what you can do is to refresh your final variable Var3 with a query using your intermediate variables. Here is an example for Oracle:
    select #Var1+#Var2 from dual
    This way you can make a chain of dependent variables: Var3 is using Var2 and Var2 is using Var1.
    Hope it helps.
    Shamil

  • How to set the value of something in a component from the main application?

    Hi,
    Maybe I've been working on this too long, but I can't figure
    out how to set the value of the text property of a text input field
    in a component from my main application in an mx:Script block. I
    have a component called Login in the components folder, and I need
    to set the text value of empNum. In my mxml declaration at that the
    top, I've declared these components as xmlns:c="components.*" So
    logically, the property I'm trying to set is c.Login.empNum.text. I
    can't figure out the correct syntax to get this to work, and I've
    tried everything I can think of. Does anyone have any suggestions?
    I'm thinking this should be an easy one, and I'm just missing
    something.
    Thanks!
    Holli

    Did you try giving it an id ?
    <c:MyLogin id="loginScreen" /c>
    So later you can do loginScreen .empNum.text = "my text"
    Laurent,

  • How to set the Value in Dropdownbyindex

    Hi Experts,
    I am New to Webdynpro-ABAP.
    I have one Dropdownbyindex field. I need to set the value from BAPI. how to set that values in Dropdown..
             I need Basic step-by-step procedure.
    Regards,
    P.Manivannan

    Hi,
    1. First import the BAPI in to WD component using create->service call.
    2.The BAPI import, export and Table parameters will be set in to the Component Controller context.Then drag this BAPI node to your view.
    3.In the 'texts' property of DDbyindex bind the BAPI output node which will be the Table parameter of the BAPI.It could be under CHANGING node.
    4.In WDDOINIT method just click the code wizard and enter the method name which you will give when importing the BAPI.Automatically the values from the BAPI will be loaded into your Dropdown when you run the application.
    Regards,
    Dinesh

  • How to set the value in SelectOneChoice

    Hi,
    I need an help....
    can anyone please tell me how to set the value in SelectOneChoice.
    I want to set the value at index 3
    i am trying selectOneChoice1.setvalue(new Integer(3)); but it is throwing an NullPointerException.
    Thanks,
    Neha

    Hi,
    is it ADF bound? If so then you set the default value to the list binding in the PageDef file. The value of the component must be bound to a method expression, which is why you see an exception. However, I think we need more information
    Frank

Maybe you are looking for

  • How do I know if my mac is compatable for airport express?

    Stupid question I know but I have a minimac osx 10.3.9 when checking under system profile this is the info I get: hardware: airport card: no information found. I take it this means I cannot use airport express

  • Question on populating a field based on 2 other fields

    Hi, I am looking for a solution wherein I need to populate a field (say no of days) based on the other two fields selected by the user (say date from and date to). As soon as user selects the value on "date to" field, "no of days" field should be aut

  • [JS CS3] Grep difficulty

    Hi, I succeeded creating a grep pattern which is used for a string replacement. var myRegExp = new RegExp ("\..-.*.indd") if the string is like this, it runs very well : var x = "001296.01.A-ATELIER GLOTIN.indd"; but like this, it's not satisfying :

  • About Batch Loader and Multiload Journal files

    Hi, may someone help me in 2 questions/ Can I use Batch Loader to automate process FDM journals and load it to HFM? And second, is it possible to use multiload excel files for these journals? Thx Edited by: user10941958 on Jan 22, 2010 2:54 AM Edited

  • Need help with background removed in elements 10

    I have been watching and learning from tutorials online and have found one of the easiest to use for removing a background I have elements 10 and when I click on New under file it shows I should be able to open the image from clipboard window but it