Hi,
I'm having an issue with implementing GuideBride API. I have a adaptive form embedded on Dynamic page through AEM Form component. I need to assign Email address from api call to the email field in Form so it can be used to send email.
I understand GuideBride can be used and I have put together a code to do that. But the event is NOT working consistently. Sometimes it work the other times it doesn't also if I open Chrome Dev tool then it works fine. This is my code. This issue driving me nuts. I try putting this code in footer, I debug the code. I see the event in Event Listener but when I close the dev tool it doesn't work on window refresh.
Am I missing anything?
window.addEventListener("bridgeInitializeStart", function (evnt) {
// get hold of the guideBridge object
var gb = evnt.detail.guideBridge;
//wait for the completion of adaptive forms
gb.connect(function () {
//this function will be called after adaptive form is initialized
var somExpression = "SOM_EXPRESSION_VALUE";
var eligibilityAmountComp = gb.resolveNode(somExpression);
eligibilityAmountComp.value = "testEmail@hotmail.com";
})
})
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
Could it be caused by a race condition? I mean, could this be due to the "bridgeInitializeStart" event being triggered before you add the listener to your page? Perhaps using DevTools is delaying that, and that's why it is working in your debug environment. Although it may sound silly, you could try using a logger to check that everything is set in the right order.
Hope this helps
Hi,
Could it be caused by a race condition? I mean, could this be due to the "bridgeInitializeStart" event being triggered before you add the listener to your page? Perhaps using DevTools is delaying that, and that's why it is working in your debug environment. Although it may sound silly, you could try using a logger to check that everything is set in the right order.
Hope this helps
@snowwhite92 Did you find the suggestions from users helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
Views
Likes
Replies