Announcement Announcement Module
Collapse
No announcement yet.
XMLApplicationContext errorhandler Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • XMLApplicationContext errorhandler

    Hello,

    I have a small problem with my mobile application. When the user want's to logon he can connect with a server. For this I use this code:

    Code:
    private var m_context:XMLApplicationContext;
    
    public function execute():*
    		{
    			m_context = new XMLApplicationContext("application-context.xml");
    			m_context.addConfigLocation("application-context-services.xml");
    			m_context.addEventListener(Event.COMPLETE, onComplete);
    			m_context.load(); 
    			ServiceLocator.getInstance().context = m_context;
    		}
    Now my problem is when the server he want's to connect to is wrong or he can't connect I would like to add a popup then saying this. But I can't add an ErrorListner to m_context or an eventlistner to detect when he can't connect.

    Thanks in advance.

    Kind regards,

    Thibault Heylen

  • #2
    not yet

    Hey there,

    at the moment the context doesn't dispatch an error event, I'm pretty sure an exception is thrown whenever the XML can't be loaded.
    For the moment I would wrap the context loading code in a try/catch block and show the Alert in the catch.

    Perhaps you can also add a feature request in JIRA for some more appropriate error events in the context:

    https://jira.springsource.org/browse...ACTIONSCRIPTAS

    cheers,

    Roland

    Comment


    • #3
      Thanks I fixed it!

      Comment

      Working...
      X