Guest
Welcome login
Share/Save
Share/Save
TIBCOmmunity > Products > General Interface > GI 3.2 to 3.7 Development > Conversations
Home   Members Communities
Conversations () Resources () Blogs ()

GI 3.2 to 3.7 Development

Up to Conversations in GI 3.2 to 3.7 Development

This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)

Synchronous Method Call

Created on: Jun 20, 2009 4:57 AM

Hi All,

 

The scenario:

 

  • I have a GUI Component XML called 'testPage.xml'
  • It calls a method called init() onAfterDeserialize
  • init() method calls method1 and method2
  • method1 executes a rule, i.r. receives an xml on service call ans sets the xml doc in cache
  • Requirement: - method2 should be executed only after full execution of method 1, i.e. a synchronous method call because method 2 reads the xml from cache which was set by Method 1
  • Note: If I put an alert in between calling of 2 methods, I am successfully able to execute the methods with proper data, i.e. by the time the user clicks OK in the alert, the data is populated in the cache, but when I remove the alert, the methods are called asynchronously which returns a null in method 2 when it tries to read the data from cache.

 

Please guide me how do I achieve synchronous method call. I tried to look into the APIs onAfterAssemble(), onBeforeAssemble(). But I am not aware as how to use the APIs.

 

I am using TIBCO GI 3.6.1

 

Thanks in advance

 

Regards

Jayant

Click to view fred's profile Dabbler 42 posts since
May 25, 2009
1. Jun 20, 2009 6:01 AM in response to: Jayanta Datta
Re: Synchronous Method Call

whoa!!!!

just use window.settimeout() for the 2nd method.

by this it will invoke the 2nd method after the specified delay.

hope it'll work.

Click to view fred's profile Dabbler 42 posts since
May 25, 2009
3. Jun 20, 2009 11:55 AM in response to: Jayanta Datta
Re: Synchronous Method Call

oh, this seems to be a interesting case.

Well in ur case write the 2nd method just after the onsuccess of the service.

Click to view Darren Hwang's profile Authority 1,397 posts since
Aug 6, 2008
4. Jun 22, 2009 10:50 PM in response to: Jayanta Datta
Re: Synchronous Method Call

Yes, why not simply add your method2 call within the onSuccess() callback of your method1?

 

method1.doCall()

onSuccess() { method2.doCall() }

 

A network request does not have to be synchronous to be sequential.

Click to view fred's profile Dabbler 42 posts since
May 25, 2009
6. Jun 24, 2009 11:11 AM in response to: Jayanta Datta
Re: Synchronous Method Call

try to catch the cache change event , then subscribe ur method to this event.

don't forget to mark it as a answer if it solves ur purpose.



More Like This

  • Retrieving data ...