HTMLLoader fires complete event too soon ?

Hi to all,
I have following problem i`m displaying pdf in a nativewindow (pdf is around 5 mb so i guess it takes some time to be rendered) I want to show user some custom progress bar until pdf is prepared to be shown in htmlLoader.The problem is that Event.COMPLETE is being dispatched too soon, pdf is not prepared to be shown.I tried with HTML_DOM_INITIALIZE event but same thing happened.
I don`t want users to see empty window, i want to either progress bar or fully loaded PDF be shown.
I figure out some workaround : i will download file from the location and open it up with openWithDefaultApplication() option within AIR 2, but i want to now if i can do it the way i wanted at the first place.
Am i doing something wrong or there is some problem with HTMLLoader ?
Here is simple code:
htmlLoader.location = url;
htmlLoader.addEventListener(Event.COMPLETE,onLoad);
onLoad (...)
//hide progress bar

Dmennenoh, pulling the playSound function out of the other functions worked perfectly!  I should have known better.  Even though everything is working correctly I am now recieving an error stating that "Parameter url must be non-null."  I'm certain this has to do with the sound file urls that I am passing from the xml document... but if the sounds are playing the urls must be non-null already.
I tried changing the tl["snd"+i] to container_mc["snd"+i] as you suggested but the sounds would not play at that point.  I recieve an error saying: "a term is undefined and has no porperties."  Below is how I built it:
function buildScroller():void{
     for (var i:Number = 0; i < 55; i++){
        //create movie clips
        var container_mc:container = new container();
        addChild(container_mc);
        container_mc.x = 325 * i;  // set the number here to the width of the movie clip being repeated
        //sound info
        container_mc["snd"+i] = new Sound();       
        container_mc["snd"+i].load(new URLRequest(xmlData.sound.loc[i]));
        container_mc.snd = container_mc["snd"+i];
        container_mc.addEventListener(MouseEvent.CLICK, playSound, false, 0, true);
function playSound(event:MouseEvent):void {
     event.currentTarget.container_mc.play();

Similar Messages

  • [svn:osmf:] 14812: Fix bug where setting a resource a second time on a VideoElement caused an RTE due to the loadStateChange event listener being unregistered too soon .

    Revision: 14812
    Revision: 14812
    Author:   [email protected]
    Date:     2010-03-17 09:02:11 -0700 (Wed, 17 Mar 2010)
    Log Message:
    Fix bug where setting a resource a second time on a VideoElement caused an RTE due to the loadStateChange event listener being unregistered too soon.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/media/LoadableElementBase.as

    Revision: 14812
    Revision: 14812
    Author:   [email protected]
    Date:     2010-03-17 09:02:11 -0700 (Wed, 17 Mar 2010)
    Log Message:
    Fix bug where setting a resource a second time on a VideoElement caused an RTE due to the loadStateChange event listener being unregistered too soon.
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/media/LoadableElementBase.as

  • [svn:osmf:] 15456: Fix bug FM-707: Nested SerialElements signaling complete too soon.

    Revision: 15456
    Revision: 15456
    Author:   [email protected]
    Date:     2010-04-15 14:53:59 -0700 (Thu, 15 Apr 2010)
    Log Message:
    Fix bug FM-707: Nested SerialElements signaling complete too soon.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-707
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/elements/compositeClasses/CompositeTimeTrait.as
        osmf/trunk/framework/OSMFTest/org/osmf/elements/TestSerialElementWithTimeTrait.as

  • Starting an iPhone app "too soon"

    When an app starts up on the device, the default image (if one exists) appears, and then, some time later, the application becomes actually active (e.g., data appears on the screen "filling in the blanks"). I've noticed on my applications that if I tap the screen too soon, i.e., after the default image loads (which, to the average user, means the app is running) but before the app is fully loaded, that it tends to "hang," ignoring keypresses etc even after the app has subsequently loaded.
    Is there a "trick" to disable the user interactivity until it is ready to be acknowledged?

    If it helps, my iSO is 7.1.1
    It is an action from two events
    1. using the kissanime streaming site. [which I can understand]
    2. happens even when I'm not using the site. [but not as often, yet]
    In the first case, I sometimes get an iPhone pop-up that asks me if I want to open the app page. it reads more like something wants to open an app page, do you agree ? More exactly like the pop-up says something can't open to the app store page, will I allow it?
    I'll do a capture of it later and be more exact.
    The times it just pops me over there when I'm not on that site nor using the browser are completely unexpected.
    What I would prefer is that any such action acting upon my phone -always- asks the user if he/she/I will allow it.
    It seems to be neccessary to prevent what I will think of as 'slimeware' forcing the iPhone to go to their app-store pages.
    Since that requestor happens sometime, there should be a way to have it always be active; even if it requires an iSO update to have it be so. If I could make it always be active, I would consider the problem to be solved.

  • BackgroundWorker starting again in Completed event

    I want a background worker to continue running and occasionally update the user interface. My first idea was to use a BackgroundWorker and in its completed event just fire it up again.
    Is using a BackgroundWorker in this fashion acceptable? Or are there potential issues from using the completed event to trigger the worker?
    Below is some Pseudo code of what my intentions are
    class Program
    private static BackgroundWorker worker;
    private static Int32 runs = 0;
    static void Main(string[] args)
    worker = new BackgroundWorker();
    worker.DoWork += worker_DoWork;
    worker.RunWorkerCompleted += worker_RunWorkerCompleted;
    worker.RunWorkerAsync(runs);
    Console.ReadLine();
    static void worker_DoWork(object sender, DoWorkEventArgs e)
    //Do time consuming work
    Thread.Sleep(3000);
    static void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    //Update the UI and start time consuming work again
    runs++;
    Console.WriteLine("Completed run #" + runs);
    worker.RunWorkerAsync();

    Assuming you are doing something that must always be done in the background while your app is running, like monitoring a file location or pinging a host, what you suggest, as well as the other answers, is actually a really bad idea. Creating and destroying
    a thread is not a free operation... there are costs associated with that and repeatedly doing it will incur a performance penalty. Timers and Tasks are just fancy wrappers for threads so those suggestions are just putting a different colored lipstick on the
    same pig.
    You are doing the right thing by using a background worker... that is what they are designed for... but instead of killing the thread and restarting it, DoWork should remain in a loop checking to see if the thread has been cancelled while using the ReportProgress
    event whenever there is something to report to the UI. Whenever your thread raises that event, you can catch it in the ProgressChanged event handler and update the UI for your user. This way the thread never gets shut down and is always doing its job tossing
    up notices when there is something to note.
    When your app shuts down or you are done monitoring, just cancel the thread. Background workers support that if you set WorkerSupportsCancellation = true when you create the worker and then call CancelAsync to cancel the thread. Again, be sure to check within
    the loop to see if the thread has been cancelled to see if you need to break out and end the DoWork method. Make sure that the thread isn't too busy doing something long running that it becomes unresponsive to the cancellation call (i.e. some sort of really
    long blocking call).
    The MSDN docs have an example here: http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker%28v=vs.110%29.aspx

  • How can I fire an event case on the value change of an indicator, or a network variable?

    Hi!  I have an event structure setup to look for a value change of an indicator on the front panel.  The indicator is updated by the value of a boolean network-published shared variable through a seperate parallel loop that is polling all of the network-published shared variables.  The event, however, does not fire when the indicator changes value.  I have switched the indicator to a control and tested it with user interaction and that works just fine.
    I want to use the event structure space for my code exectution because it seems logical that that is where it would go, and it will help keep my block diagram tity.  The code is also something I would like executed with the front pannel temperarily disabled.  I would rather not have the code in my network-variable polling loop because again the tity issue.   I would also rather not use a notification VI wired to an independent loop for this particular code.
    Is there a way to have an event structure fire an event with the value change of an indicator, or a network variable directly?
    Thanks for your input.
    LV 8.5
    -Nic

    Thanks for the reply.
    I went about things a little differently, but got them to work so..... .  It really was not my desire to have a boolean indicator on the front panel.  As previously stated, my ultimate goal was to have an event fire on the change of a network variable, which I had to poll for anyway but that is tucked away in a section where I am handling all my network variables.  I ended up using that Create User Event, Register User Event, and Generate User Event SubVIs to handle the task.
    I've read the help for all of those SubVI's and it is not entirely clear to me if the event fires every time the "Generate User Event" receives some inputs, or if it only fires when the value changes.  I could do a test to find out.  It wouldn't be too difficult to add a shift register or a feedback node and place the Generate User Event in a case structure so that it is only fired when the input changes state.

  • Not receiving COMPLETE event in URLLoader

    Hi:
    I'm querying a web application in a remote server through XML files and receiving answers in the same file format. Until now, sometimes I received a connection error:
    Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://server/Services/startSesion.com
        at reg_jugadores_fla::MainTimeline/queryGQ()
        at reg_jugadores_fla::MainTimeline/reg_jugadores_fla::frame1()
    When this occurs, trying to access the services through a web browser, there's a test page where you can try queries, returns a "500 Internal server error". I managed that problem adding a listener to catch the error:
    xmlSendLoad.addEventListener(IOErrorEvent.IO_ERROR, catchIOError);
    But since yesterday I can't connect anymore using Flash while it's possible to access the test page. I'm not able to talk to any support guy as the company is closed for vacations! I added listeners to try to know what's happening and this is the result in the output window:
    openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
    progressHandler loaded:154 total: 154
    httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200]
    AFAIK, status=200 means OK but why the COMPLETE event isn't dispatched?. So, is there anything I can do or just wait until the tech guys return from the beach?
    Thanks in advance
    queryGQ(sessionURL,sessionQS);  // Start session
    stop();
    function queryGQ(url:String,qs:String):void {
    var serviceURL:URLRequest = new URLRequest("http://server/Services/"+url);
    serviceURL.data = qs;
    serviceURL.contentType = "text/xml";
    serviceURL.method = URLRequestMethod.POST;
    var xmlSendLoad:URLLoader = new URLLoader();
    configureListeners(xmlSendLoad);
    xmlSendLoad.load(serviceURL);
    function configureListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.COMPLETE, loadXML);
    dispatcher.addEventListener(Event.OPEN, openHandler);
    dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR, catchIOError);
    function openHandler(event:Event):void {
    trace("openHandler: " + event);
    function progressHandler(event:ProgressEvent):void {
    trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
    function securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    function httpStatusHandler(event:HTTPStatusEvent):void {
    trace("httpStatusHandler: " + event);
    function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);

    Hugo,
    View may not fire events. View may call method on other controller (component / custom) and this controller fires event.
    You are absolutely right: in WD only instantiated controllers receives the event, event itself does not cause controller instantiation.
    The only controller that is always instantiated is component controller.
    Custom controllers instantiated on demand when their context is accessed or user-defined method called.
    As far as view may not have externally visible context nodes and methods (you may not add view controller as required to other one and use nodes/methods of view), the only time when view is instantiated is when it get visible for first time.
    To solve your problem, try the following:
    1. Save event parameters to component controller context node element before firing event.
    2. Create mapped node in target view and set node from controller as source.
    3. In wdDoInit of target view insert the following code:
    wdThis.<eventHandlerName>(
    null, //no wdEvent
    wdConext.current<NameOfMappedNode>Element().get<NameOfParamA>(),
    wdConext.current<NameOfMappedNode>Element().get<NameOfParamB>(),
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • VideoPlayer complete event firing early

    I'm not sure why this is happening, but for some reason the complete event is firing about 5-10 seconds into my minutes long video.
    Here is the code for the VideoPage that loads the video and listens for the events. Does anything seem off to anyone?
    package com.applied.flex.pages
         import com.applied.flex.events.PageEvent;
         import flash.events.ProgressEvent;
         import spark.components.VideoPlayer;
         import spark.events.VideoEvent;
         public class VideoPage extends BasePage
              private var _video:VideoPlayer;
              private var _startTime:uint = 0;
              private var _endTime:uint;
              private var _cuePoints:Array;
              private var _displayedPoints:Array;
              private var resetting:Boolean = false;
              private var seekSafe:Boolean = true;
              public var readyToStart:Boolean = false;
              public function VideoPage(xml:XML,majorType:String,minorType:String,path:String)
                   super(xml,majorType,minorType,path);
                   _video = new VideoPlayer();
                   if(xml..Video[0].@StartTime != undefined)
                        _startTime = xml..Video[0].@StartTime;
                   if(xml..Video[0].@EndTime != undefined)
                        _endTime = xml..Video[0].@EndTime;
                   _cuePoints = new Array();
                   for each(var i:XML in _pageXML.Video.CuePoints.children())
                        _cuePoints.push(i.@OnTime);
                   _video.addEventListener(VideoEvent.READY,doVideoReady);
                   _video.source = path;
                   this.addChild(_video);
              private function doVideoReady(e:VideoEvent):void
                   _video.removeEventListener(VideoEvent.METADATA_RECEIVED,doVideoReady);
                   if(_pageXML..Video[0].@EndTime == undefined)
                        _endTime = _video.totalTime;
                   readyToStart = true;
                   this.dispatchEvent(new PageEvent(PageEvent.READY_TO_START,false,false,0,this));
              public override function startPage():void
                   addListeners();
                   _video.seek(_startTime);
              public override function resumePage():void
                   addListeners();
                   _video.play();
              public override function pausePage():void
                   removeListeners();
                   _video.pause();
              public override function stopPage():void
                   removeListeners();
                   var ar:Boolean = _video.autoRewind;
                   _video.autoRewind = true;
                   _video.stop();
                   _video.autoRewind = ar;
              public function seekPage(seekTo:Number):void
                   if(seekSafe)
                        removeListeners();
                        _video.pause();
                        _video.addEventListener(VideoEvent.PLAYHEAD_UPDATE,doSeekSafe);
                        _video.seek(seekTo);
                        seekSafe = false;
              private function doSeekSafe():void
                   _video.removeEventListener(VideoEvent.PLAYHEAD_UPDATE,doSeekSafe);
                   addListeners();
                   _video.dispatchEvent(new VideoEvent(VideoEvent.PLAYHEAD_UPDATE));
                   seekSafe = true;
              private function addListeners():void
                   _video.addEventListener(VideoEvent.COMPLETE,dispatchPageComplete);
                   _video.addEventListener(VideoEvent.PLAYHEAD_UPDATE,doVidProgress);
              private function removeListeners():void
                   _video.removeEventListener(VideoEvent.COMPLETE,dispatchPageComplete);
                   _video.removeEventListener(VideoEvent.PLAYHEAD_UPDATE,doVidProgress);
              private function doVidProgress(e:VideoEvent):void
                   var scrubObj:Object = new Object();
                   scrubObj.currentTime = (e.currentTarget as VideoPlayer).playheadTime;
                   scrubObj.totalTime = _endTime - _startTime;
                   trace("playheadTime | "+e.currentTarget.playheadTime);
                   trace("end time | "+_endTime);
                   dispatchUpdateScrubber(scrubObj);
                   checkForCuePoint(e);
                   if(_video.playheadTime >= _endTime)
                        dispatchPageComplete();
              private function checkForCuePoint(e:VideoEvent):void
                   if(_cuePoints.length > 0)
                        if( (e.currentTarget as VideoPlayer).playheadTime > _cuePoints[0].toString() && !resetting )
                             var item:Object = new Object();
                             item.point = _pageXML..CuePoints[_displayedPoints.length].toString()+"<br><br>";
                             dispatchUpdateScrubber(item);
                             _displayedPoints.push(_cuePoints.shift());                         

    Not sure if you found an answer to your problem, but I have come across this a few times, and I eventually found that is was a "corrupted" FLV.  It seems as though at a given point in the encoding process, there is a little "skip".  This skip causes the COMPLETE event to fire when there might be a good amount of video left in the file.  Try making the FLV in a different encoding program and see if you still have your problem.

  • Waveform complete event?

    Is there any sort of Waveform Complete event for a continuous waveform generation? That is, an event that would fire at the beginning or end of every repeat of a waveform?
    NI-DAQmx 7.4, Win XP, M-series DAQ device, writing in C++.
    Thanks!
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

    Thank you, Serges, but I think you have misunderstood what I'm asking. There are no acquired samples involved- I'm talking about analog output.
    I'm generating a repeating waveform from the analog outputs. To start, I give it a buffer of data and specify that it be a continuous generation, but I don't write any further data to the task after the initial buffer. That way, I get a repeating waveform.
    What I want is an event or a function call that I can use to know when the waveform generation has recycled to the beginning of the buffer.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • How to set fire action event for particular rows in a table

    HI All,
    I have a requirement in which I want to set fire action event for particular rows in a table based on some condition.
    The table has columns like fullname,employee id etc.
    So i want to set fire action event for particulars rows only which will saisfy some condition.

    Atanu,
    Your approach(setting fire action for few rows) seems not possible. Better to go ahead with workaround.
    Do you want this functionality in processRequest(while page loading) or processFromRequest(on some event) method ? Give more explanation regd. your requirement ?
    In either case loop through the rows and when your condition is met write the action to be performed in controller.
    Regards,
    Anand

  • Why does URLStream complete event get dispatched when the file is not finished loading?

    I'm writing an AIR kiosk app that every night connects to a WordPress server, gets a JSON file with paths to all the content, and then downloads that content and saves it to the kiosk hard drive. 
    There's several hundred files (jpg, png, f4v, xml) and most of them download/save with no problems.  However, there are two f4v files that never get downloaded completely.  The complete event does get dispatched, but if I compare the bytesTotal (from the progress event) vs bytesAvailable (from the complete event) they don't match up; bytesTotal is larger.  The bytesTotal (from the progress event) matches the bytes on the server. 
    The bytesLoaded in the progress event never increases to the point that it matches the bytesTotal so I can't rely on the progress event either.  This seems to happen on the same two videos every time. The videos are not very large, one is 13MB and the other is 46MB.  I have larger videos that download without any problems.  
    [edit] After rebooting the compter, the two videos that were failing now download correctly, and now it's a 300kb png file that is not downloading completely.  I'm only getting 312889 of 314349 bytes.
    If I paste the url into Firefox it downloads correctly, so it appears to be a problem with Flash/AIR.
    [edit] I just wrote a quick C# app to download the file and it works as expected, so it's definitely a problem with Flash/AIR. 
    Here's the code I'm using:
    package  {
        import flash.display.Sprite;
        import flash.events.Event;
        import flash.events.ProgressEvent;
        import flash.net.URLRequest;
        import flash.net.URLStream;
        [SWF(backgroundColor="#000000", frameRate="24", width="640", height="480")]
        public class Test extends Sprite {
            private var fileSize:Number;
            private var stream : URLStream;
            private var url:String = "http://192.168.150.219/wordpress2/wp-content/uploads/2012/12/John-Butler-clip1.f4v";
            public function Test() {
                if (stage)
                    init();
                else
                    this.addEventListener(Event.ADDED_TO_STAGE, init);
            private function init(e:Event=null):void {
                this.removeEventListener(Event.ADDED_TO_STAGE, init);
                stream = new URLStream();
                stream.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
                stream.addEventListener(Event.COMPLETE, onLoadComplete);
                stream.load(new URLRequest(url));
            private function onLoadProgress(event:ProgressEvent):void {
                fileSize = event.bytesTotal;
                var percent:Number = event.bytesLoaded / event.bytesTotal * 100;
                trace(percent + "%");
            private function onLoadComplete(event:Event):void {
                trace("loaded", stream.bytesAvailable, "of", fileSize);
                // outputs "loaded 13182905 of 13184365"
                // so why is it "complete" when it isn't finished downloading?

    Thanks for your quick reply !
    I am relatively new to programming so please bear with me on this as I still haven't managed to grasp some of those things that "make perfect sense". If I am setting mouseEnabled to false doesn't that mean that the object no longer gets MouseEvents ?
    If I have understood you correctly then once the mouseEnabled is set to false the btn object is removed from the objects recognizable by the mouse - hence dispatching a mouseout event (and I am guessing here) from the mouse?
    I still don't get it though, if the listeners are set to the object and the object is no longer accessible to the mouse why is the event still being dispatched ?
    I get it that the making of the object unavailable to the mouse causes the "removing" (deactivating) of the object from under the mouse,
      step 1. deactivate object, and  step 2. (as a result of step 1) register the removal of the object.
    but why is the mouse still listening after step 1?
    Even if the action is that of "out" (as in the object is no longer under the mouse) it still is an action isn't it ? so haven't we turned off the listening for actions ?
    I promise I am not trying to drive you crazy here, this is just one of those things that I really want to get to the root of !
    Thanks,

  • How to fire an event dynamically in JSF Page

    Hi All
    How to fire an event dynamically in JSF Page?
    Thanks
    Sudhakar

    Hi,
    Thanks for the response. I mean to say, if I create the components dynamically then how can I fire events for those components.
    In otherwords,
    If I create the Button dynamically with particular ID being set to that component, then how can I call button action event when the button is clicked??
    Hope you understand
    What is the role of MethodBinding mechanism here??
    Thanks
    Sudhakar Chavali

  • Why the battery of iphone 5s  be decharged too soon?

    why the battery of iphone 5s  be decharged too soon?

    Perhaps these suggestions will help:
    http://www.apple.com/batteries/iphone.html
    also
    http://theweek.com/article/index/250098/ios-7-battery-life-6-simple-ways-to-keep -your-iphone-powered-up
    http://www.tuaw.com/2013/09/18/how-to-stop-ios-7-from-destroying-your-iphones-ba ttery-life/
    One final unconfirmed possibility:
    http://ipadnerds.com/fix-battery-drain-issue-ios-7/
    Regards.

  • Possible to highlight a row in text area which in turn would fire an event?

    I'm making a GUI of which the main portion consists of a large text area. The text area would list problems that our company is experiencing - each row would represent a problem. Each row would give a problem ID and a description of the problem. I want to make it so that when the user clicks on a row (a problem), another dialog box would open which would present possible solutions to the user regarding the problem at hand. How would I write code to highlight a row which in turn would fire an event opening up another box?
    I thought about going about this another way - have a drop down (jcombobox) integrated into each row which the user can choose from but I'm not sure if you can insert a drop down into a text area (and neatly into a row at that!) so I think the former way may be preferable.
    Thanks in advance.
    Regards,
    Paul

    If a java application is required (as opposed to a web-based solution using HTML's linking capabilities) the best approach might be a JList implementation. It could go something like this...
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class ListFrame extends JFrame
       public ListFrame()
          super("JList example frame");
          getContentPane().add(getListPanel(), BorderLayout.CENTER);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          pack();
          setVisible(true);
       private Component getListPanel()
          JPanel panel = new JPanel(new BorderLayout());
          final JList list = new JList(new Object[]
             "List option 1...",
             "List option 2...",
             "List option 3..."
          // This will make sure only one item can be checked at a time.
          list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
          // Handle the selection here.
          list.addListSelectionListener(new ListSelectionListener()
             public void valueChanged(ListSelectionEvent e)
                // No need to go on if this was a deselection.
                if (e.getValueIsAdjusting() || list.isSelectionEmpty())
                   return;
                // This is where you would have to convert the value that's selected into whatever
                // it is you want to display to the user.  This example just puts the text of the
                // selected item into a messagebox.
                Object selectedItem = list.getSelectedValue();
                JOptionPane.showMessageDialog(ListFrame.this, selectedItem);
          list.setVisibleRowCount(5);
          // The scrollpane will control the scrolling of the list (so you can have as many options
          // as you want).  Standard JScrollPane functionalities can be used to control various
          // visual aspects of the list.     
          JScrollPane scroll = new JScrollPane(list);
          scroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
          panel.add(scroll, BorderLayout.CENTER);
          return panel;
       public static void main(String[] args)
          new ListFrame();
    }I know this is quite after-the-fact, but I hope it helps (if you hadn't already solved the problem :) )

  • Web dynpro to fire an event automatically via url in iview

    Hi expert,
    I create an iview, and would like to via the application parameter: 'auto = true' to fire an event in htmlb (bsp java) application.
    I have already successful calling the service in my wdDoInit() method.
    but next step is how to fire the event automatically in init method ? any code snippets will be appriciated.
    Ben.J.

    Hi,
    I have 2 main DCs bound. Now from DC2 I have to read the Context of DC1 (which is bounded to another application).
    To bind your context from DC1 to DC2
    Copy the context that you want to expose from the component controller to interface controller of DC1.
    Once this is done you will be able to see the context in DC2.
    Based on your requirement you can set the Input type property of the context node.
    Regards
    Ayyapparaj

Maybe you are looking for