This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 3, 2014, 3:52 AM
3 Posts

Receive event on XPage component, trigger only once

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags: XPages,composite application,event
  • Replies: 4

Hi all gurus,

I build composite application but found something funny.

I have XPage component and registered a receiving event on that XPage and this event also registered on the component. On other component i have a button that triggering the XSP.publishEvent() to trigger that event. The first button click, the event is successfully received at other component, but next click could not be received. If i hit the refresh button on receiving component, this event is automatically triggered. For example i hit the button 5 times, the event from the first hit is successfully received on other component, but the next 4 hit is not received, and if we hit the refresh button 4 times on the receiving component, the event is automatically triggered 4 times. But next refresh is not triggering the event, it seems the event is burried some where by the xpage component and only can be released by hitting the refresh button.

If i change the server-side of receiving event handler to be "Full Update", all event is successfully received, unfortunately i don't want a do full update, i utilize the Knockout framework to do client side GUI.

Thanks for any help

Jun 3, 2014, 12:20 PM
366 Posts
On your button

add the following to the CLIENT side onClick event

 

setTimeout(function() { XSP.allowSubmit() }, 1000);

Jun 3, 2014, 3:35 PM
3 Posts
I dont think its on sender side

I have add the code, but the event only delivered once to the receiver.

I think its not on the sender side, but more on receiver side.

If someone need to replicate my problem, here is my components:

1. The first XPages is configured as event sender by placing button that execute XSP.publishEvent("sampleEvent", "sampleValue", "string")

2. The second XPages is configured as event receiver by creating receiving event namely "sampleEvent" and execute simple alert("Got event")

Put both components inside Composite Application, and wired the event.

 

Now, click the button. First click, the event succesfully sent to receiver.
Then second click, nothing happen. But if you put the cursor on receiving component then hit the refresh button, suddently the previous receiving event is triggered and the alert is popup.

Now, if the server side of receiving event is configured for "Full Update", continuous button click is successfully send to receiver page.

 

Anyway, thanks for your time

Jun 5, 2014, 2:13 AM
3 Posts
Using server as the helper

It seems receiving platform's event at XPage requires full update, its very little documentation about it.

To overcome this bad design, i route my event as follows:

1. The triggering side is sending the event via XSP.publishEvent
2. Still on triggering side, on the server side javascript is configured for partial refresh that submit some required parameter to server, and based on this parameter, the SSJS will check and wait the document with the key is calculated from the sent parameter.
3. On receiving side, the event is configured for full update (so it can be repeatable). All response that need to be passed to triggering side is saved on temporary document which the key is calculated from event argument.

 

This way, i can command the SAP Gui via COM automation  that launch by Lotus Script on old standard lotus form. After got the data, the lotus script publishing via property broker, then a another xpages with act as the helper xpages will receive this event and store the data at temporary document, which later will be found by the triggering button which waiting this document.


Do i walk on the right way ?

Aug 29, 2014, 5:34 AM
1 Posts
The same trouble

I have got the same problem.

Composite event in xpages  is received only once with partial refresh, everything works fine if I set full update, but I do need to process it more than once with partial refresh. Are there any solutions?

 


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal