Asynchronous method call.

Is it possible to do an asynchronous method call?

I mean this: when a view is loaded I would like first of all to display the interface to the user and when the data is retrieved from the web server, load the data into the view. If the user must wait until the data is retrieved for the view. For this first step how do we proceed? And secondly, I would like to know if it is possible an asynchronous call to create the view and load the data so that even if this could make the application faster.

Hey charly,.

You should be able to achieve using the load() to URLLoader objects. When loading the content of a web page, the load method is asynchronous. Based on the State of the load() method that you can check if its operation is complete using the Event.COMPLETE event. Like this:

package
{
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.text.TextFieldAutoSize;

    import qnx.ui.buttons.LabelButton;
    import qnx.ui.text.Label;

    [SWF(width="1024", height="600", backgroundColor="#CCCCCC", frameRate="30")]
    public class URLLoaderTest extends Sprite
    {
        private var loader:URLLoader;
        private var request:URLRequest;
        private var myTextField:Label;
        private var myBtn:LabelButton;

        public function URLLoaderTest()
        {
            super();

            // support autoOrients
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;

            request = new URLRequest("http://www.digg.com");

            loader = new URLLoader();
            loader.load(request);
            loader.addEventListener(Event.COMPLETE, handleData);

            myTextField = new Label();
            myTextField.setSize(100, 50);
            myTextField.setPosition(10,10);
            myTextField.textField.autoSize = TextFieldAutoSize.LEFT;

            myBtn = new LabelButton();
            myBtn.label = "This will already be here";
            myBtn.setSize(200, 70);
            myBtn.setPosition(10, 50);

            addChild(myTextField);
            addChild(myBtn);

        }
        private function handleData(e:Event):void
        {
            myTextField.text = "Complete!";
        }
    }
}

as you will see that loads everything on the screen even if the site is not fully loaded via URLLoader object. Once this is done, it calls the handData() function and the object Label is filled with the words "complete." the same concept apply to any situation involving the URLLoader.

hope that helps. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • FGV VI within the class method called the array of objects in a for loop

    I have an array of objects connected to the loop for I call the VI method on the object in the loop for. If the method uses/calls some VI with state/memory (such as FGV) State is shared for each method call in a loop despite the called VI is reentrant preallocated. Someone knows how to fix this?

    NVM. I found an answer:

    https://lavag.org/topic/19014-dynamic-dispatch-shared-reentrancy/

  • NIDAQmx fails with 'pure virtual method called' when calling DAQmxStartTask

    I'm running on Linux Fedora-15 and I see a 'pure virtual method called' message in the system log when you call DAQmxStartTask

    If someone has encountered this?

    Here is the stack trace:

    Program received signal SIGABRT, abandoned.
    [Switching to thread 0xb423eb70 (LWP 11204)]
    0xb770f424 in __kernel_vsyscall)

    Program received signal SIGABRT, abandoned.
    [Switching to thread 0xb423eb70 (LWP 11204)]
    0xb770f424 in __kernel_vsyscall)
    (gdb) where
    #0 0xb770f424 in __kernel_vsyscall)
    #1 0x456b90ef in raise () from /lib/libc.so.6
    #2 0x456baa25 in abort () from /lib/libc.so.6
    #3 0xb677c287 in? (from /usr/local/lib/libnidmxfu.so.1)
    #4 0xb677c2d4 in? (from /usr/local/lib/libnidmxfu.so.1)
    #5 0xb677c4c7 in? (from /usr/local/lib/libnidmxfu.so.1)
    #6 0xb666d4de in? (from /usr/local/lib/libnidmxfu.so.1)
    #7 0xb67da514 in nNIMSAI100::MAPIControl130 (nNIMSAI100::tTask *, unsigned long, unsigned long & nNIMDBG100::tStatus2 &) (/usr/local/lib/libnidmxfu.so.1)
    #8 0xb69be31e (/usr/local/lib/libnidaqmx.so DAQmxTaskControl)
    #9 0xb69be3f5 (/usr/local/lib/libnidaqmx.so DAQmxStartTask)
    #10 0xb69fc3fe in CMdlNI6509::readPort (unsigned short, unsigned char *))
    of /var/www/html/tsw/runtime/devices/libDevDigio/libDevDigio.so
    ....

    What is installed on the system is:

    nidaqmxcfgi - 1.4.0 - f0.i386
    1.4.1 - nidaqmxef - f3.i386
    1.6.1 - nidaqmxcapihelp - f0.i386
    1.6.1 - nidaqmxcapii - f0.i386
    1.6.1 - nidaqmxcapiexmp - f0.i386
    1.6.1 - nidaqmxswitch - f0.i386
    nidaqmxhelp - 1.0.2 - f0.i386
    nidaqmxinfi - 8.0.1 - f0.i386

    If an output on the DigIO port is used as an input, this is the behavior if StartTask is called.

    Turns out that we were not catch the error of DAQmxCreateDIChan properly.

  • 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;

    }

  • 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

  • Method call as default activity in ADF task flows

    Hello

    I have a workflow to execute a method on the page loading to set cookie values.
    I added a control method of data as the default activity in the workflow. But it is not called immediately, it is executed only if it is called from another view.

    Any help will be appreciated.

    WebCenter Portal App 11.1.1.6


    Code workflow task:

    <? XML version = "1.0" encoding = "UTF-8"? >
    < adfc-config xmlns = "http://xmlns.oracle.com/adf/controller" version = "1.2".
    ID = "___5" >
    < task-flow-definition = id "cookie-task-flow" >
    < default activity id = "__17" > addEmpNoCookie < / default activity >
    < transaction id = "__38" >
    < new-transaction / >
    < / transaction >
    < data-control-scope id = "__39" >
    < shared / >
    < / data-control-scope >
    < managed-bean id = "__1" >
    < id managed-bean-name = "__4" > cookieBean < / managed-bean-name >
    < managed-bean-class id = "__3" > tr.com.signum.roketsan.utils.CookieBean < / managed-bean-class >
    < managed-bean-scope id = "__2" > pageFlow < / managed-bean-scope >
    < / managed-bean >
    <-l' call the method id = "addEmpNoCookie" >
    < method id '__8' = > #{bindings.addEmpNoCookie.execute} < / method >
    < result id = "__16" >
    < id fixed-result = "__7" > addEmpNoCookie < / fixed-results >
    < / results >
    < / method >
    < use-page-fragments / >
    < / task-flow-definition >
    < / adfc-config >

    Def of the activity of the Middle page of

    <? XML version = "1.0" encoding = "UTF-8"? >
    < pageDefinition xmlns = "http://xmlns.oracle.com/adfm/uimodel."
    version = "11.1.1.61.92".
    ID = "cookie_task_flow_cookie_task_flow_addEmpNoCookiePageDef".
    Package = "TR.com.Signum.roketsan.pageDefs" SkipValidation = "true" > "
    < Settings / >
    < executables / >
    < links >
    < methodAction id = "addEmpNoCookie" RequiresUpdateModel = "true".
    Action = 'invokeMethod' MethodName = "addEmpNoCookie."
    IsViewObjectMethod = 'false' DataControl = "CookieBean."
    InstanceName = "CookieBean.dataProvider" > "
    < NamedData NDName = 'cookieValue.
    NDValue = "#{webCenterProfile [securityContext.userName] .employeeNumber} '"
    NDType = "java.lang.String" NDOption = "3" / > "
    < / methodAction >
    < / links >
    < / pageDefinition >

    Hello

    It contains only the activity of the method, and if so, why is he launched with the help of a new transaction? Note that navigation always is an ID of the view and the workflow will not run if there is no view to navigate to. So either the calling flow calls this workflow and workflow returns immediately after execution of the activity of default method then it refers to a display of flow tasks calling or you add a view. Note that cookies are set on the response of a call and it is not issued before coming to a view. For this reason, using a method call activity could be a bad approach to try this so a phase listener is better suited

    Frank

  • To access a page method call parameters jsf page fields

    I have a workflow with a single method, call the execution after a point of view (jsf page).

    The view is a jsf page that allows to edit several fields to then filter a view object. This inputtext fields - components in general-have no connection.

    The next step in the workflow is executing a method call that takes these parameters - values entered previously in the jsf page - and to run a vo.setwhere and then a vo.exeuteQuery methods but I need the input provided in the previous page. I don't know what is the best method to get access in the ADF.

    I usually pass parameters to the method call in the page 'Change the binding of the Action', section 'settings' via EL expressions.

    You can have a support with scope pageFlow bean and bind the attribute to the property value as John mentioned. However, if you do not want to generate a bean, you can simple binding to a pageflow scope variable (might be created automatically).

    Something like

    value="#{pageFlowScope.someVariable}"
    

    and then for the methodCall activity, set the value of the parameter to the same as above EL.

    Arun-

  • 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

  • OAException: Illegal method call because there is no connection to the base.

    We are gertting this error when connecting

    Details of the exception.

    oracle.apps.fnd.framework.OAException: the method call illegal because there is no connection to the base.
    at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1251)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:2195)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:543)
    at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:431)
    + OA. jspService(_OA.java:212) +.
    at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:59)

    Database version: 11.2.0.2.0
    Application version: 12.1.3

    Published by: Vicky-DBA on February 7, 2011 05:23

    Salvation;

    What is your EBS and the OS? DB version? How do you get this error, what is your steps?

    It worked before? Any newspaper in the alerts log and log apache?

    Check these notes:

    Manage results [ID 1277384.1] Java.Lang.Nullpointerexception purchase order tax
    Create a customer in AR, attempt to remove the vacuum Business purpose-error [1178665.1 ID]

    Respect of
    HELIOS

  • Method call error on NPObject!

    Hey,.

    I use to run an AS3 app and the Facebook Graph API. When I try to launch it I get the error

    Method call error on NPObject!

    I don't know what to look for here... My facebook settings are correct, I use swf... integrate the allowscriptaccess is on, debugging shows that I am able to get information from facebook. Yet I get this error.

    Where should I start?

    more click "permit debugging", you can solve all problems in almost all (except those related to the network) by using the trace() function.

  • class .as CFC method call

    so I got a .swc and I was informed that its got a method called doSomething();

    for one reason or another, I can't include the swf file in my fla. what I need to do, it's somehow include the swc in an AS3 class and then call the CFC method therefrom.

    so I got it here, in a directory called 'swc' sound called 'someSWC.swc' and I need import into someClass.as and call the doSomething() about it.

    and I have no idea how I would... anyone?

    Hi andrei1

    of course, Ive had to bash my head against this for a few days to find a solution. Yes I found out that if you can bust open a CFC as you suggest it you find an xml file that indexes the content of CFC and a swf file that contains the different methods/assets/graphics/etc. When you look in the tags in the XML indexical you can find references to AS3 objects like this:

  • Message info JSF in the activities of method call

    Hello
    I have a taskflow bounded with an activity of method call that contains a call to a method on backing bean. I would like to put a message of information prior to the loading of the page.
    However, I get NPES from the call to JSFUtils.addFacesInformationMessage (errorMsg) due to the fact that there is no id of root view component.
    Anyone know a solution for this use case?
    Thank you
    Kenneth

    Hello

    write in an attribute of memory and have the page check this attribute and display its value. You can use a PhaseListener on the page to add the message memory for faces message stack

    Frank

  • 10.1.2 EZ way to check method calls until I change and break them.

    Is there a way to JDeveloper to see what methods call a method (incase I make changes, I do not break several pages)?

    Well, if you have upgraded to JDeveloper 10.1.3 or 11g, you would have had the option of menu uses find to help you with this.
    Why are you still using 10.1.2?

  • delegate method calls to the members of a class

    Hello

    I'm new to LabView and using the 2013 version.

    I am familiar with the concepts of object-oriented programming.

    situation/goal

    I have a controller that controls axes. The controller said communication happens via plain text messages.

    I want to control the two axes with orders abstract (moving, stop, speed change, etc.) of LabView.

    That's why I created a class of axis with several parameters. (although)

    The controller communication is established via an ActiveX reference.

    I created a controller class that holds said reference in addition to the two axes.

    My goal here is to create a controller object, which past its ActiveX reference for the two axis.

    To add lines to the controller I dragged the class axis from the window of the class controller twice overall project.

    I created some accessors to all members of the class of the axis, including its ActiveX reference.

    problem

    In the Set accessor method for the controller class ActiveX reference, I would like to call the setters for the return of the two axes objects that contains the ActiveX controller.

    I can separate the controller to see the two axes, but I can neither unbundle either of the axes nor can I add a method node to them.

    It is logical that the separation is not possible to ensure encapsulation, but why can't I just call a method?

    Am I still add references to objects when you drag the axis class?

    Or is what adds the class itself?

    If this adds the class, how can I add a reference to an object of a certain class as a member of another class?

    I've attached a screenshot of the controller class.

    Thank you for your help.

    Hello

    The object Oriented Design is rater hard. Encapsulation banned, as you said, the data from your classes are defined outside their class.

    In your case it means that you have to create a data member access VI inside of the class of the Axes. These access screws (methods) allows you to set the values for these axes of type two objects inside of the controller of the class. Make sure that these two classes are in the less community.

    You can refer to a class using reference data value, Yes, BUT in this data type to the reference class is included. At the time, it seemed more convenient: LabVIEW programming job: The decisions behind the Design http://www.ni.com/white-paper/3574/en/

    Self an example here:

    Examples for the new reference value of data with the Forums of Discussion LVOOP https://forums.ni.com/t5/LabVIEW/Examples-for-New-Data-Value-Reference-with-LVOOP/td-p/1317493

    If you want to use data heavily references, I would recommend the GOOP package, which has different design questions build in singleton as etc. (which are not possible by default in LabVIEW)

Maybe you are looking for