To access the bean viewScope in the method call

Hello

I use Jdev 11.1.1.6.0

I have a tf1 taskflow with a fragment of page say test.jsff and test.jsff has 2 regions TF2 and TF3.

TF2 has test1.jsff and then calling the method
TF3 has test2.jsff and then calling the method

My idea is to define a bean viewScope in tf1 and access since the call to the method of TF2 and TF3 to store specific data TF2 and TF3 beans viewScope...

My problem is when I do the following code inside the method of TF2... I get null for the viewScope bean. I'm doing something wrong here... The regBean is coming with the null value

FacesContext fctx = FacesContext.getCurrentInstance ();
ELContext elctx = fctx.getELContext ();
ExpressionFactory expFactory = fctx.getApplication () .getExpressionFactory ();
String tfName = (String) RequestContext.getCurrentInstance () .getPageFlowScope () .get ("name");
ValueExpression ve = expFactory.createValueExpression (elctx, "#{viewScope.registerbean}", Object.class);
RegisterBean regBean = (elctx) ve.getValue (RegisterBean);


Thank you
Rambeau

Each page has its own scope of view, which will disappear when viewId changes (when the user page)
You can use session scope (but then you should take care of cleaning), or you can use another parameter to the method.
Maybe this can help: http://andrejusb.blogspot.com/2011/02/adf-region-communication-data-exchange.html

You can see time scope of beans on the following diagram:
http://docs.Oracle.com/CD/E15051_01/Web.1111/b31974/adf_lifecycle.htm#CHDGGGBI

Dario

Published by: kdario on November 2, 2012 14:34

Tags: Java

Similar Questions

  • Cannot access the VIDEO CALL button

    Downloaded Skype 5.8, all OK but can not access the "Video call" button (it is not highlighted). I suspect that the video can be disabled. How to check my video call button is turned on?

    What do you see when you go to Tools-> Options-> video settings?

  • Call the method call activities before you navigate to the target jsf page

    Dear all,

    I use JDeveloper Studio Edition Version 12.1.3.0.0.

    Requirement:

    I have a stubborn taskflow. The stubborn workflow is without using page fragments.

    I have three pages: login.jsf, admin.jsf, user.jsf. I have a method call activity in the taskflow. The login.jsf is the default page. The page of login.jsf have an af:selectOneRadio with two af:selectItem: Admin and user. It also has an af:button. When the user select the af: af selectItem: selectOneRadio and click on the af: button, it should call the method call activity (doLogin) and based on logic it will redirect to the page admin.jsf or user.jsf page.

    Please find the taskflow below:

    How to achieve the solution to the prescription above.

    Thank you and best regards,

    Susanto Paul

    Hi all

    I'm able to resolve the obligation.

    The post below was really helpful.

    http://andrejusb.blogspot.in/2011/09/programmatic-ADF-task-flow-router.html

    Thank you best regards &,.

    Susanto Paul

  • How to navigate to the next page based on the value returned by the method call inside the action attribute of the command key.

    How to navigate to the next page based on the value returned by the method call inside the action attribute of the command key.

    I use JDeveloper 12.1.2.0.0

    < af:button id = "tt_b2".

    rendered = "#{attrs.nextRendered} '"

    partialSubmit = 'true '.

    action = "#{attrs.backingBean.nextAction} '"

    Text = "next".

    Disabled = "#{attrs.nextDisabled}" / >

    private static final String NEXT_NAVIGATION_ACTION = "controllerContext.currentViewPort.taskFlowContext.trainModel.getNext";

    public String nextAction() {}

    If (validate()) {}

    updateModel();

    Return NEXT_NAVIGATION_ACTION;

    }

    Returns a null value.

    }

    Use case is made for model train, which is being implemented based on this blog: http://javacollectibles.blogspot.co.UK/2014/10/ADF-train-template.html

    We define a generic action following in the model, but the action must be called under certain conditions, based on the question of whether all validation controls had been passed on no.

    You can do this in two ways:

    1 returnValue = (String) ADFUtils.invokeEL("#{controllerContext.currentViewPort.taskFlowContext.trainModel.getNext}");

    return returnValue;

    2.

    public String getNextTrainStop() {}

    String nextStopAction = null;

    ControllerContext controllerContext = ControllerContext.getInstance ();

    ViewPortContext currentViewPortCtx = controllerContext.getCurrentViewPort ();

    TaskFlowContext taskFlowCtx = currentViewPortCtx.getTaskFlowContext ();

    TaskFlowTrainModel taskFlowTrainModel = taskFlowCtx.getTaskFlowTrainModel ();

    TaskFlowTrainStopModel currentStop = taskFlowTrainModel.getCurrentStop ();

    Terminus of TaskFlowTrainStopModel = taskFlowTrainModel.getNextStop (currentStop);

    nextStopAction = nextStop.getOutcome ();

    _logger.fine ("train, next stop:"+ nextStopAction ");

    Return nextStopAction;

    }

  • Access the method of class (impl) view of bean object (or vice versa)

    Halo everybody, I use JDeveloper 11.1.2.1.0

    I use a UsersViewImpl class with a method that update the table as below.

    public void resetEmployeeSearch() {}
    removeApplyViewCriteriaName ("viewCriteria");
    executeQuery();
    }

    and I have a UserBean class with a method that reset the values of fields of research such as below.

    {} public void resetInput (ActionEvent actionEvent)
    ........ RichInputText = entry...
    input.setValue("");
    AdfFacesContext.getCurrentInstance () .addPartialTarget (searchForm);
    ........
    }


    I want to implement that, once I press a button, the two methods are called.

    I tried to call method of bean using vs UsersViewImpl = new UsersViewImpl... who does not and will not work.
    I've read about something as ViewObject vo = am.findViewObject ("DeptView1") but I duno how to use because I can't have a good example.

    Any suggestion on access to the method of class (impl) view of bean object (or vice versa)?
    Or is it possible to combine the two method in the same class?


    Thanks :(

    and then create a link to this effect in your page. > Sorry, dun get this part. You create the link from the button to the UsersViewImpl method?
    The code below should be method (binding) in UsersViewImpl, right?
    OperationBinding op = ((DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ()) .getOperationBinding ();
    op. Execute();

    What I meant to say call this code your method of bean... this way you can call both the logic in your bean and the method of VO together!

  • JDeveloper 11 g - value of bean to access after the method call.

    Hello

    I created a command button to run a PL/SQL method, as shown in the example call: http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/bcadvgen.htm#BABEIFAI 37-11

    I have the following code, to fill a java bean in my ApplImpl class.

    Result APIResultBean = new APIResultBean();
    // 7. DateValue property value using in-first OUT param
    result.setResultValue (st.getString (28));
    // 8. StringValue property value using THE param 2nd
    result.setMsgValue (st.getString (29));
    System.out.println ("Bean defined:" + st.getString (28) + "and:" + st.getString (29));

    The java bean has the following code and is defined as a java class in my model of controller:

    package CELPAY.model;

    import java.io.Serializable;
    Import oracle.jbo.domain.Date;

    / public class APIResultBean implements Serializable {}



    String ResultVal;
    String MsgVal;

    public setResultValue (String ResultVal) Sub {this. ResultVal = ResultVal ;}
    public String getResultValue() {return ResultVal ;}
    public setMsgValue (String MsgVal) Sub {this. MsgVal = MsgVal ;}
    public String getMsgValue() {return MsgVal ;}

    }



    The procedure runs, but I have no idea how to do to retrieve the output variables in a form as a text of output. That is to say, how can I access this bean? I tried to create a data control, but the methods come not through. I also tried this entry in the adfc. - config.xml and refercing variables.

    My question is tha that the getResultValue methods are not displayed in Jdevloper?

    Great satisfaction to all helped, because I was stuck on this all day

    Your Get accessor method is getMsgValue(), the rule says remove the GET and change case of the first character of the remaining string. If getMsgValue()-> MsgVale-> msgValue.
    Try #{bindings.element.inputValue.msgValue}

    Timo

  • How to access the methods and properties of the main document class

    How can I access methods and properties of the class of main document of other classes?
    Can someone give me a clue what I'm doing wrong?

    I use ActionScript3 in Flash CS3 with strict error checking on. I have an application with several custom classes:

    1. the MainMovie class is associated with the document.

    2. the SomeMovieClip class is associated with a movie clip symbol in the library and an instance of the symbol is placed on the main timeline.

    Compilation Flash returns this error message: "1061: call to a method may not set [name of the method here] through a reference with static type flash.display:DisplayObject.".

    I get the same error if I replace the undelined above with this code:

    root.gotoAndStop ("aFrameLabel");


    If I replace the same code simply with:

    trace (root)

    Flash returns [object MainMovie], which tells me that it recognizes the document class.

    However, if I turn the strict error checking, the compilation ends and the movie works as expected in all cases.

    root cast as a movieclip.

  • To access the methods of AppModuleImpl of expressions Groovy?

    A variable view VO bind test I am tempted to call an accessor (aka. getValue) in its parent AppModuleImpl, via an expression Groovy. I thought I could do something like:

    ((model. (AppModuleImpl) object.getApplicationModule ()) .getValue)

    .. .but the runtime, I get an error that does not know model Groovy. AppModuleImpl.

    I must be missing something here. Does anyone have the Groovy syntax to call the methods in the AppModuleImpl parent please? ADF Groovy white paper by Grant Ronald unsuccessfully tried, and I have not found an example on these forums either.

    With our thanks,

    CM.

    PS. JDev 11.1.1.2.0, ADF BC + ADF Faces RC

    Hey Chris,

    Use this code it will work at the level of RowImpl...

    adf.object.getApplicationModule () .testMethod)

    Kind regards
    Suganth.G

  • How to pass attribute values after ExecuteWithParam to the method call

    Hello

    I use Jdev 11.1.1.6.

    My use case, is that I have mainPage BTF which has ExecuteWithParam as the default activity. It filters the VO using params. I have a requirement to store some of the attributes of current line to pageFlowScope which must be sent to several taskflows child.
    I present a method call after the ExecuteWithParam event and before the page is rendered but do not know how should I pass the current line (or something) in this method call to store values on pageFlowScope.

    What should I switch to this bean managed to store values on pageFlowScope? Is there an alternative?

    Thank you
    JAI

    I see two possible ways to get to the attributes. First of all, you can get the iterator current rank and get attributes here. Secondly, add you links attribute in the file pageDef methods for all attributes that you are interested in. Then you access it by using the attribute binding. I never tested the 2nd method, but I guess that the framework will fill the attribute links, as it does in a normal page.

    Sorry, can't give you enjoy this code adds that I'm not in front of a PC.

    Timo

  • that means the method call error on NPoject

    I get this message every time I go to any site. How can I stop

    *********************

    Content in the double post.

    I continue to see this error message. It specifies the method to call error on npoject. What is this and how can I get rid of it

    Help, please

    Hi koolnene,

    Welcome to the Microsoft community.

    Please answer the questions asked by Imran M.

    Additional to these questions.

    1. What is the full error message?

    2. have you recently installed software?

    Please provide us with more information about the issue to help you best.

  • Bounded task flows with the method call replaces invokeAction

    I use JDeveloper/ADF 12.1.2.

    Case - I have methods in a display object to apply criteria to display.

    I have a (jsf) page with an af:table to display the current contents of the VO.

    I want to use the method to apply one of the two criteria to see if the current user is a federal user, either, if the current user is a State.

    In the past, I would like to add two elements 'invokeAction' to pageDef page, one for each of the methodActions with RefreshCondition set to the Boolean expression that tells to run based on the type of user, it is.

    But invokeAction is obsolete, and we are told to put the page in a stubborn workflow:

    So instead of calling the action, I have a router choose a flow of control, based on the user type and flow by calling the appropriate method.

    It works and it displays the page with the correct view criteria applied.  These and a few flashbacks of workflow are the only things in the workflow - it's whole purpose is to apply the criteria of right view and display the page with the table.

    The problem-

    Af: table has the selection of rows, the value of simple actions and some to navigate to the pages to work with the currently selected line.  If I selects the workflow and "Run" and select a line and navigate - it always shows the first line, regardless of which I selected.  If I navigate back to the workflow and try again, it works fine - line display that I selected.  If I have a page on the unconsolidated parent workflows which only has a button to navigate to the workflow that contains the page with the table and run this page and press the button - it works the first time.

    Can I put a page in the independent workflow that navigates automatically to the flow of tasks without the user to press a button?

    Add the workflow task related to a page as a region of the ADF.

  • Passing parameters to the method call in expressions of value

    JDeveloper 11.1.2.1.0 does support the feature of passing parameters to method calls in expressions of value in JSF pages? AFAIK this is JSF 2 version it and it should support this feature. Unfortunately when I put in a JSF page the following tag
    < h:commandLink value = "#{row.employeeId}" action = "#{empBean.showDetails (row)}" / > "
    The page does not work. Any ideas on this point?

    Thank you to everyone.

    Hello

    The functionality you need is defined in JSR 245.
    If you need to wait for it to become part of the standard, it will be included in JEE6
    I don't know if 11.1.2.1.0 uses JEE6 standard...
    You can try this other thing,
    http://www.coderanch.com/t/213290/JSF/Java/why-JSF-calls-method-parameter

  • Programmatically access the method of service (customer interface)

    Hello

    I work with JDeveloper 11.1.1.6.0. I exposed an ApplicationModule method in the client interface.
    I know I can drag and drop on my view and work with it. But how to access these programmatic method?
    Can I use the bindings, y at - it a "best practice way"?

    Thanks in advance.
    Alex

    Check [url https://blogs.oracle.com/jdevotnharvest/entry/best_practice_invoking_business_services] best practices invoking business services methods from JSF beans

  • To access the methods of the VORowImpl class

    Scenario is,

    I have a view object class VOImpl.java in the model.view package.

    I have another class of JavaBean EntryHandle.java

    EntryHandle class I can Import model.view.VOImpl;

    Help me now how I can access methods of the VOImpl class in the ADF.

    Or I have to create the VOImpl object class in class EntryHandle? as in programming java Simple? or something else

    JDeveloper Version: 11g Release 2 11.1.2.0.0

    Zaid,

    If you have a VO with 2 attributes, you have defined the category value. (This poster Lov sense and sets the value for the category field).

    You want to get the value selected from the lov. Is this correct?

    When do you get this value? When they choose a new value from the LOV.

    If you have written the code in the valueChangeListener, you can check the link below:

    https://blogs.Oracle.com/ADF/entry/getting_selected_value_from_selectonechoice

    Code of the blog

    public void valueChanged(ValueChangeEvent valueChangeEvent) {
        this.setValueToEL("#{bindings.Deptno.inputValue}", valueChangeEvent.getNewValue()); //Updates the model
        System.out.println("\n******** Selected Value: "+resolveExpression("#{bindings.Deptno.attributeValue}"));
        System.out.println("\n******** Display Value: "+resolveExpression("#{bindings.Deptno.selectedValue ne ' ' ? bindings.Deptno.selectedValue.attributeValues[1] : ''}"));
    }
    
    public Object resolveExpression(String el) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ELContext elContext = facesContext.getELContext();
        ExpressionFactory expressionFactory =  facesContext.getApplication().getExpressionFactory();
        ValueExpression valueExp = expressionFactory.createValueExpression(elContext,el,Object.class);
        return valueExp.getValue(elContext);
    }
    
    public void setValueToEL(String el, Object val) {
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ELContext elContext = facesContext.getELContext();
        ExpressionFactory expressionFactory =   facesContext.getApplication().getExpressionFactory();
        ValueExpression exp = expressionFactory.createValueExpression(elContext, el, Object.class);
        exp.setValue(elContext, val);
    }
    

    You can get the selected value and the value of display with the above code. You need to replace Deptno by category.

    See you soon

    AJ

  • How to access the methods of the / in the parent and child responsible sovereign wealth funds?

    Hello world

    Imagine the following configuration. The main SWF load a child swf file.

    In AS2, I would use just _parent or _root to call the desired function. How can be done in AS3?

    Is it still possible? Can I call a function on the main swf that loaded? What happened the other way around, this time of principal to the loaded swf format?

    Thanks for the support!

    See you soon

    :::-)

    In AS3, you can call the _parent (AS2) using MovieClip (parent) (AS3) and similar to the _root.  If you load a child swf, you must understand that the child normally lives in the charger you loaded with, so to return to the loaded swf file you have to go (parent.parent) MovieClip.

    So much to talk to the child going to swf, go through the following discussion...  http://forums.Adobe.com/thread/720211?TSTART=0

Maybe you are looking for