+1
Отвечен

Calling an action / code in main wire after finishing with subwire?

sstava 11 лет назад обновлен 11 лет назад 6
I have separated a sign-in process into a subwire. When the sign-in process is successful I call the superwire action in the main wire and unload the subwire.

All is well at this point.

Next, since the person successfully logged in, I want to execute the data loading process for that user, in the main wire (after having come back from the subwire).

When I try to execute anything in the "superwire" action other than the unload and alpha calls the app crashes.

The question is: How do I initiate code in the superwire action that is doing the unload/alpha of the subwire beyond the unload/alpha calls?

Can I call a separate action somehow?

I have tried adding code to the superwire action as well as adding a play tag for another action in the main wire...all with no luck. The app crashes.

Any suggestions or ideas would be greatly appreciated

Thanks!
Steve
Steve,

This is expected behavior. We currently have a ticket out to see if we can't solve this issue. Currently you cannot jump to another action using play when coming from a subwire. You would need to put those actions directly inside your main.wire action rather than use a play action.
Steve,

On second thought. Try adding superwire="yes" to the play action in your main.wire that is causing the crash. This should refind the main.wire and run the play tag.



SUBWIRE:
<action name="main-back">
<play action="close" superwire="yes" target=".."/>
</action>

MAIN.WIRE:
<action name="close">
<sync>
<unload delay=".1" target="ISSUE"/>
<alpha value="0" time=".5" target="ISSUE"/>
<play action="alert" superwire="yes" />
</sync>
</action>
<action name="alert">
<alert message="NEAT"/>
</action>
Excellent! I will give that a try.

Also, my prior response was added to the post before I saw this reply, just in case it seems like I wasn't paying attention to your "superwire" option...I wasn't :) I hadn't seen it yet.
Thanks for the persistence and finding a solution! The use of "superwire" in the main.wire action, called from the subwire did the trick!

It looks like I have a z-order issue with my main navigation menu that wasn't there before, but that should be easy to work through. Everything else is workin great.

I am excited to be able to modularize the distinct portions of code into subwires!
Thanks for the response!

As an FYI...My testing shows that any code in the action called by the subwire, except for the unload and the alpha actions, leads to a crash.

The crash happened even without a play tag in the subwire callback action.

Sharing just in case the additional info helps with the outstanding ticket.
Hm, I did not find that to be the case in my tests. Were you using a sync block in your action?

Сервис поддержки клиентов работает на платформе UserEcho