TaskFlow as call CreateInsert in backing bean before display region

Build JDEVADF_11.1.1.4.0_GENERIC_101227.1736.5923

I use a stubborn workflow (area dybnamic)
I like to call a workflow method before showing the form Page(binding inside)
my error is a pointer exception zero
    public void createInsertMember() {
            BindingContainer bindings = getBindings(); 
            OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert"); // <<<<<<<<<<<<<<<<<<null Pointer exception
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return ;
            }
            
            DCIteratorBinding dciter =(DCIteratorBinding) bindings.get("VOMemberIterator");
            ViewObjectImpl vo = (ViewObjectImpl)dciter.getViewObject();
            Row row = vo.getCurrentRow();
            if(row == null){
              System.out.println("Current Row is null");
              return;
            }
            String clientIpAddress =
                     ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getRemoteAddr();
            
            row.setAttribute("Memberuuid", UUID.generateUUID().toString());
            row.setAttribute("LastIp", clientIpAddress);
            row.setAttribute("Registerat", new java.util.Date());
        // Add event code here...
    }
}
How can I call method to CreateInsert before you see the shape (backingBean)?
THX Thomas

Edited by: thietho the 14.03.2011 13:08

Hello

the NPE you see is because the method call activities do not have a binding of the ADF (PageDef) file. You can avoid all your code by using the CreateWithParams operation. How to work with the operation CreateWithParams is explained here:

http://www.Oracle.com/technetwork/developer-tools/ADF/learnmore/13-create-with-params-169140.PDF

Instead of manually adding the CreateWithParams operation, you simply drag the operation on the workflow diagram where it shows like a method call activity and. GOS to the PageDef created and create arguments you must

Frank

Tags: Java

Similar Questions

  • How to call popup of backing bean

    Hello

    I have a request under jdev 11.1.1.1.0
    I use the model of Solution Explorer.
    I have my popups on a page and another page, I need to call these pop-up windows.
    I can't use the < af:showPopupBehavior > because I use the < af:setActionListener > on my command button.
    Then, in the action attribute, I called my grain of support
     public String showDelBoxPopup() {
       FacesContext context = FacesContext.getCurrentInstance();
       ExtendedRenderKitService extRenderKitSrvc = 
         Service.getRenderKitService(context,ExtendedRenderKitService.class);
       extRenderKitSrvc.addScript(context,"AdfPage.PAGE.findComponent('delBoxPopup').show()");
       return null;
    }
    But I always get an error NULL.
    How can I call a popup in a page in another page using backing bean.

    Thank you in advance.
    Emile BITAR

    Hello

    If you set triggerType = 'click' on the showPopupBehavior and contentDelivery = "lazyUncached" on the popup to ensure the popup will be triggered after setActionListener you can use with .
    I don't understand what you mean by calling the context menu from another page (this page is included as a region is?), but if you say that it works, then your other option would be to link the popup to support bean and use popup.getClientId () in your javascript.

    String script = "var popup = AdfPage.PAGE.findComponent(\"" + popup.getClientId(fc) +  "\"); popup.show();";
    

    Pedja

  • Is it possible to call a custom method in the App Module to a backing bean?

    I would like to know if a custom in the App Module method can be called from inside of a pod of support.
    I don't know if it is logically just call, to a backing bean, a custom in the App Module method. But I would like to know if this is necessary or if it is possible.

    Hello..
    Yes it is possible. You must add this interface method customer of AppModule.Now you can see this method in data Controls(Refresh the data control). To call this method using bean, should be added as an action method links (click on links > + > methodAction > and create the binding of the action).
    Now, you can call this method in the bean class.
    Check like uses this concept to run the display criteria

    http://ADF-Lk.blogspot.com/2011/05/Oracle-ADF-create-view-criteria-and_4727.html

  • The difference by calling an application to a backing bean module

    Hello everyone!


    I do not understand exactly, where is the difference by calling an application of a bean of the following support module.

    Example 1
    FacesContext context = FacesContext.getCurrentInstance();
    ValueBinding vb = context.getApplication().createValueBinding("#{data}");
    BindingContext bc = (BindingContext)vb.getValue(context);
    DCDataControl dc = bc.findDataControl("AppModuleDataControl");
    AppModuleImpl appModule = (AppModuleImpl)dc.getDataProvider();
    Example 2
    String amDef = "model.services.AppModule";
    String config = "AppModuleLocal";
    AppModuleImpl appModule = (AppModuleImpl)Configuration.createRootApplicationModule(amDef, config);
    Example 3 (same as example 1?)
    String EL = "#{data.AppModuleDataControl.dataProvider}";
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding(EL);
    AppModuleImpl appModule = (AppModuleImpl)vb.getValue(fc);
    Please can someone explain, the three examples do? What kind of example is best to call an application-module to a backing bean method?


    Thanks and greetings
    Majo

    Edit: I use ADF BC 10g in JDev10 :)

    Hello

    BindingContext bctx = DCUtil.getBindingContext (request);

    There is nothing else that #{data}. Best is to always access #{bindings} El to get a handle to the binding object. This way you can be sure that the object exists and is instantiated.

    DCBindingContainer links =... solve #{bindings}
    BindingContext bctx = bindings.getBindingContext ();
    Control of DCDataControl = bctx.findDataControl ("Name");
    ApplicationModule m = control.getDataProvider () (ApplicationModule);

    Frank

  • How to set up a call to a method of bean before the rendering of a page jspx?

    What are the different ways available in ADF to configure a jspx page to a bean method is called to do something initialization before the rendering of the page?

    I have a default page in the workflow without terminals that need to call a method of bean every time a new query parameter is page.
    That is to say. I don't want to call the method of bean on a post (postback).

    I was thinking about using a method call activity, but do not know how to make the method call activity tobe called first when the default page is accessible directly via a URL.

    Published by: Priscilla on April 28, 2010 12:50

    You can try using invokeaction in pageDef page, something we have done in 10g.

    Published by: manieshsailoz on April 28, 2010 13:27

  • Backing bean - scope pageflow

    experts,

    use jdev 11.1.1.5.0 using adfbc.

    I had two grain of bean type.

    and two jspx pages. each grain of backup a utlizse page. ratio 1:1

    am fineshed my conception of my two pages compltly ui. and enter a logical operation on the bean.


    all are complted. but I need a value inputtext only content want to reach illustrated in another text of page output.

    Hold on...


    concept of pageflow tells me something like that

    proablay value of travel from one page to another page. It adapts.

    concept of backing bean teach. values of a work around page itself. not a page to another page.


    Chase now

    but. my much of the work was already done. with backing bean. now that an individual must travel from one page to another page.

    what I can do.


    If you prefer pageflow is a must. I want all change them a bit hard for me. a lot of work I have around him.

    I hope you understand.


    otherwise means here a few examples

    consider a
    I have my grain like this:

    Text1 of entry.
    Text2 entry.
    Text3 entry.
    Text4 entry.

    and some af:table and some af:query Panel. n blah blah n. biindings base many backing bean.



    simply, I needed only special Text4 entry > contnet indicate in another page.

    It's my scenario. No am not yet implemented it. get before implementation. with a notice appropriate (expert) u.

    n then perform it.

    Published by: Les on September 23, 2011 02:25

    Published by: Les on September 23, 2011 02:26

    Hello..
    I'll give you sample cases to do this,
    Page A - Bean
    Page B - Bean B
    These two pages are in a taskflow and scope is pageFlowScope
    pageA

    
    
      
      
      
    
    

    BaenA

    package view;
    
    import javax.faces.event.ActionEvent;
    
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    import org.apache.myfaces.trinidad.context.RequestContext;
    
    public class A {
        private RichInputText it1;
    
        public A() {
            super();
        }
    
        public String cb1_action(ActionEvent ae) {
            // Add event code here...
            RequestContext afContext = RequestContext.getCurrentInstance(); //ur coede
            afContext.getPageFlowScope().put("p_user", it1.getValue());
            System.out.println(":"+ it1.getValue());
            return null;
        }
    
        public void setIt1(RichInputText it1) {
            this.it1 = it1;
        }
    
        public RichInputText getIt1() {
            return it1;
        }
    }
    

    PageB

    
    
      
    
    

    BeanB

    package view;
    
    import oracle.adf.view.rich.context.AdfFacesContext;
    
    public class B {
        String valForOutputText;
        public B() {
            super();
         valForOutputText =  AdfFacesContext.getCurrentInstance().getPageFlowScope().get("p_user").toString();
        }
    
        public void setValForOutputText(String valForOutputText) {
            this.valForOutputText = valForOutputText;
        }
    
        public String getValForOutputText() {
            return valForOutputText;
        }
    }
    

    If you need a source for complete project to send a message to me ([email protected]), TaskFlow and .jspx page not included and I think that above code enough to solve your problem...

    -Suresh

  • How to refresh data in backing bean-based component SelectOneChoice

    Hello.

    I use JD Studio Edition Version 11.1.1.5.0 on Weblogic 11.1.1.5

    I have the resulting page with SelectOneCoice fragment of the backing bean (used as filter)

    < af:selectOneChoice label = "#{projectBundle ['label.toolbar.spinbox.period']}" "

    valueChangeListener = "#{backingBeanScope.backing_jsf_fragments_project_ContentMainView.onPeriodValueChangeListener} '"

    Binding = "#{backingBeanScope.backing_jsf_fragments_project_ContentMainView.SOC2} '"

    ID = value = "#{pageFlowScope.ContentMainView.period"soc2"} ' autoSubmit ="true">"

    < f: selectItems value = "#{pageFlowScope.YearsListBean.yearItems} '"

    Binding = "#{backingBeanScope.backing_jsf_fragments_project_ContentMainView.SI2}" id = "si2" / > "

    < / af:selectOneChoice >

    It supports bean which reads the data from the database and creates the list + adds value null

    package sk.web.view.bean;

    import java.util.ArrayList;

    import java.util.List;

    Import javax.faces.model.SelectItem;

    Import oracle.adf.model.binding.DCIteratorBinding;

    Import oracle.adf.share.logging.ADFLogger;

    Import oracle.jbo.Row;

    Import sk.web.view.common.utils.ADFUtils;

    /**

    * Class is supposed to provide a list of the years for the af:SelectOneChoice component.

    */

    public class YearsListBean {}

    private static final String PERIOD_ITERATOR_NAME = "PeriodView1Iterator"; Auto generated id

    private list < SelectItem > yearItems;

    public YearsListBean() {}

    Super();

    yearItems = new ArrayList < SelectItem > ();

    addYearsToList();

    }

    public void addYearsToList() {}

    DCIteratorBinding iter = null;

    ITER = ADFUtils.findIterator (PERIOD_ITERATOR_NAME);

    Rank [] rows = iter.getAllRowsInRange ();

    addYearItemToList ("", "");

    for (int i = 0; i < rows.length; i ++) {}

    Line = lines [i];

    log.info ("row [" + Integer.toString (i) + "]:" + rows [i].getAttribute("Year").toString ());

    addYearItemToList (rows [i].getAttribute("Year").toString (), rows [i].getAttribute("Year").toString ());

    }

    }

    public void clearYears() {}

    log.info ("called.");

    getYearItems () .clear ();

    }

    ' private void addYearItemToList (String strInYearLabel, String strInYearValue) {}

    SelectItem tObjItem = new SelectItem();

    Configuration object

    tObjItem.setLabel (strInYearLabel);

    tObjItem.setValue (strInYearValue);

    Add list ro

    yearItems.add (tObjItem);

    }

    public list < SelectItem > getYearItems() {}

    Get an output

    Return yearItems;

    }

    }

    When I insert the new record in the DB table, I want to see the new value in the filter. How to get there?

    I tryied to get the current instance of YearsListBean

    YearsListBean yearsList = (YearsListBean) FacesUtils.getManagedBean ("pageFlowScope.YearsListBean");

    Clear and then refill

    yearsList.clearYears ();

    yearsList.addYearsToList ();

    at the end I refresh view Add partial target

    AdfFacesContext.getCurrentInstance () .addPartialTarget (getSoc1 ());

    But this procedure does not work. Please help me find the working method.

    Thanks in advance.

    I found the bug in my code. I added partial target the wrong component. Now, refresh works fine.

  • Get the value of the bind variable in backing bean class VO Impl

    Hello

    I have a VO that includes a bind "pOrgId" variable, the VO has a java VO Impl class that includes:

    /**
    * Returns the value of the variable to pOrgId.
    value of the variable * @return for pOrgId
    */
    public {getpOrgId() number
    return (Number) ensureVariableManager () .getVariableValue ("pOrgId");
    }

    So it is possible to obtain the value is concluded by the binding variable using this class in a backing bean? (I tried to import the VOImpl class in the bean to support, but getpOrgId is not available?).

    (JDEV 11.1.2.3.0)

    Concerning
    Carl

    Hello

    When you create a ViewObjectImpl class, none of these options is to generate the getter/setter for bind variable. Create a client class interface and expose the get method for the variable binding. Now, you can reference the method since a binding method in the ADF, which you then access a managed bean by calling

      BindingContext bctx = BindingContext.getCurrent();
      BindingContainer bindings = bctx.getCurrentBindingsEntry();
      OperationBinding oper = (OperationBinding) bindings.get("name of the method binding");
      Object returnVal = oper.execute();
    

    Frank

  • execute a Storedprocedure backing bean output parameter whith

    How can I execute a Storedprocedure whith out parameter back bean? I use a getDBTransaction? How do I?

    I need function excute a DB of backing Bean.

    I use 2 versions:
    Studio Edition Version 11.1.2.0.0
    Studio Edition Version 11.1.2.3.0

    You implement the call to the stored procedure in the client module of your application, expose it as an interface and call it from your bean. To do this, you add the method for links on the page and call it add do you with any other method of the pagedef.

    Never directly call such a method of your bean.

    Timo

  • Browse from backing bean

    Hello.

    My current view is a task flow issue, let's call it "exit".
    Now in my current opinion, I serverListener and inside backing bean I want to access this result to "leave".
    How?


    x 10
    Concerning

    Check harvest Article Frank http://www.oracle.com/technetwork/developer-tools/adf/learnmore/nov2010-otn-harvest-190744.pdf 'How to navigate in the stubborn workflow' on p. 31.

    Timo

  • Basic jsf navigation/backing bean interaction

    I have a problem with jdeveloper 11.1.1.4. No ADF is involved.

    I have 3 pages (pg1, pg2, pg3) with the support of the beans (bn1, bn2, bn3). They are all defined in faces - config.Xml.
    The user enters data in pg1, bn1 db query results appears in pg2 then go to pg3 if you need to do more.
    PG2 and pg3 display data entered in pg1, but the user cannot change.
    PG2 and pg3 have pimples back to pg1 for another query.

    1st time through the display of pages and backup of bean routines are invoked; checked with the debugger.

    If I click on a button to save any routine in a pod of support is called. Going back is wired in faces - config.Xml. It's as if the page is be redisplayed from the cache of the browser.

    If I click on a submit button in pg1 query in the bean of support, bn1, is processed, the action value is correct but he goes to pg2 without invoking anything in bn2; not even the manufacturer.

    Beans in faces-config. XML are extended session.

    Could be a basic misunderstanding of the JSF navigation flow. If so please direct me to a good resource.


    Thank you...

    Can I get you right, the first time you go through the flow it works?

    In this case, it is the normal behavior, as the b2 bean was created the first time and stay alive during the entire session. Then the next time it didn't need to be created.

    Timo

  • Get the Application via Backing Bean ADFBC model

    I'm trying to get an instance of an Application model via a backing bean and it will return null; I see the error message:

    * < InstantiateDataControl > [1097] INFO: search mDCRefMap has failed. The cpx has an entry dataControlUsages 'dc '? *

    I can drag a VO on my jsff page and that seems to work fine but when I want to get the app module and manipulate a VO in the code, I get the above.

    I tried both approaches, and they produce the same error message and null data control.
    1.
    String dcFrameName = BindingContext.getCurrent () .getCurrentDataControlFrame ();
    DataControlFrame dcframe is BindingContext.getCurrent () .findDataControlFrame (dcFrameName);.
    DataControl dc = dcframe.findDataControl("NavModuleAMDataControl");

    ApplicationModule am = ((DCDataControl) dc) .getApplicationModule ();
    am back;

    2 return (ApplicationModule) JSFUtils.resolveExpression ("#{data." + name + ".dataProvider"});


    Anyone seen this before?

    See the section "9.10.3 How to access an Application Client Module Interface in a Web Application from merger" of the Guide of Fusion JDev 11.1.2.0.0:

    http://download.Oracle.com/docs/CD/E16162_01/Web.1112/e16182/bcservices.htm#sthref356

    DMI

  • How to develop the Table of Backing Bean tree nodes?

    I have a requirement where I want my table to be expanded all three nodes. InitiallyExpanded = True develops alone.
    Is it possible to have all the Backing Bean nodes?

    Code snippet will be very useful.

    Thanks in advance,
    TK

    For all nodes in a treetable can be expanded, you will need to add all the rows of the disclosedRowKeySet.

    (1) create a binding for the treetable in average managed code as "treeTable.
    (2) create a CommandButton named "Expand" (under the picture of the tree) and Visible set to false and create a link to a page named expandButton & in the get accessor for the commandButton control method, call the following method:

    public RichCommandButton getExpandButton() {}
    this.expandTreeTable ();
    }

    private RowKeySet disclosedTreeRowKeySet = new RowKeySetImpl();

    private void expandTreeTable() {}
    If (this.treeTable! = null) {}
    disclosedTreeRowKeySet = new RowKeySetImpl();
    Model CollectionModel = (CollectionModel) treeTable.getValue ();
    JUCtrlHierBinding = treeBinding
    (JUCtrlHierBinding) model.getWrappedData ();
    JUCtrlHierNodeBinding RootNode = treeBinding.getRootNodeBinding ();
    disclosedTreeRowKeySet = treeTable.getDisclosedRowKeys ();
    If (disclosedTreeRowKeySet == null) {}
    disclosedTreeRowKeySet = new RowKeySetImpl();
    }
    List = firstLevelChildren
    rootNode.getChildren ();
    for (node JUCtrlHierNodeBinding: firstLevelChildren) {}
    List ArrayList = new ArrayList();
    List.Add (node.getRowKey ());
    disclosedTreeRowKeySet.add (list);
    expandTreeChildrenNode (node, treeTable, list);
    }
    treeTable.setDisclosedRowKeys (disclosedTreeRowKeySet);
    }
    }

    Private Sub expandTreeChildrenNode (RichTreeTable, rt,
    JUCtrlHierNodeBinding node,
    The list parentRowKey) {}
    ArrayList children = node.getChildren ();
    List rowKey;
    If (children! = null) {}
    for (int i = 0; i)< children.size();="" i++)="">
    rowKey = new ArrayList ();
    rowKey.addAll (parentRowKey);
    rowKey.add (((JUCtrlHierNodeBinding) children.get (i)) .getRowKey ());
    disclosedTreeRowKeySet.add (rowKey);
    If (((JUCtrlHierNodeBinding) (children.get (i))) .getChildren () is
    null)
    continue;
    expandTreeChildrenNode (rt,
    (JUCtrlHierNodeBinding) (node.getChildren () .get (i)),
    rowKey);
    }
    }
    }

    Thank you
    Nini

  • [Beginner] Best practices for Backing Bean, data binding

    Hello world


    I followed a course of oracle in November ' Oracle Fusion Middleware 11g: Creating Applications with ADF I '

    Awesome, now I know what are the different parts of the framework.

    But now, I would go a little in depth.

    Here's a simple example

    Login page
    Backing Bean
    Session Bean
    Read only the View (the view selection) object
    Application module

    We have a user name and password in a table, but the password is encrypted in the column, in fact, is the checksum of the password.

    Here's what should be done.

    Login (username, password) Page-> proceed button-> to get the data of VO-> compare usernames-> transform password from the login page (MD5)-> compare him the password of database->
    assignment of params session bean-> redirect to Connexion2 page.

    Here's what I actually

    I have an AM listening with a java class having a doLogin (String username, String password) method with a return value of string.

    This method is exposed to the UI via a client interface.

    Here are my questions.

    Where can I check and turn all these params. In playback only VO via a class Java tuned, which extends ViewRowImpl or listening AM class java?

    And now for the session bean where I have to instantiate. I guess the Backing Bean.

    Wouldn't be better to call the client interface of the bean to support, then instantiate the session bean, with params from AOS, in this BackBean.

    I so much question that I don't know where to start. :-(

    Sincerely for your help.

    Senecaux Davis

    Hello

    If you want to keep the information for the duration of session, create a managed bean and configure it to session scope. If you need to access you can use EL directly or from Java in another managed bean (or bean backing) whereby the bean is instantiated. You can also use managed properties to pass the reference of a bean to support session bean.

    As for the location of the method, you must use a View object to query the user table just the user name. You read the encrypted password (assuming a single user entry is found) and compare it with the provided password. You return true/false value and use an OperationBinding in a bean managed to access the customer interface method through the ADF (action method) link layer

    OperationBinding operation = bindings.get ("login") (OperationBinding);
    operation.getParamsMap () .put ("username", username);
    operation.getParamsMap () .put ("passwd", pw);

    Boolean result = operation.execute ();

    ...

    Frank

  • Open a new fenΩtre of backing bean

    Hi all
    I have a chart in which one of the columns is a link to open a new page. Because the url of the new page must be calculated dynamically, I call the action for the command link method, calculate your, add query parameters and use window.open to launch the url in a new window. The problem is, window.open launches the URL using a GET request. Y at - it approach to launch the URL from backing bean using a post request.


    Thank you
    Bala

    In order to perform a job, you will probably need add an html form to the page and send it using javascript. Note in the PS2 if you open a workflow in a new window using a direct URL using a get, ADF will send first down of javascript that will add some parameters to the url and then reload the page, kind of a javascript redirect. Avoid us this by using a post

    We used the technique below to open a blank window in the script, update the DOM to display a 'recover data...' Splash screen message and that you post a form to get the page with the help of a post

    function openWindowWithSplash (url, winProps) {}

    var msgStyle = "body {background-color: #B2CA7E} #m {-font family: Arial;}" do-size: 16px; width: 200px; height: 100px; background-color: #CBE2FF; border: 1px solid black;position:absolute;left:50%;top:50%;margin-top:-50px;margin-left:-100px;text-align:center ;} » ;
    var msg ="



    Data recovery... .
    ";

    hWin var = window.open ("about: blank", null, winProps);

    URL = (window.location.protocol+"//"+window.location.host+url);

    hWin.document.open("text/html");
    hWin.document.write(")"msg + notice);
    hWin.document.write(")

    ")
    hWin.document.write(")
    ");
    hWin.document.close ();

    }

Maybe you are looking for