[Confirmation Dialog] Client Script 'getAttribute' error

Forge Component
(15)
Published on 2015-01-21 by ITDelivery OutSystems
15 votes
Published on 2015-01-21 by ITDelivery OutSystems

Hi I experience an client script error regarding "getAttribute" this only happens when I first use the Confirmation Dialog after initial load of the page. It displays but whatever action I click (Continue or Cancel) this error occurs but when I do the same action it did not happen again



Rogelio Guanlao wrote:

Hi I experience an client script error regarding "getAttribute" this only happens when I first use the Confirmation Dialog after initial load of the page. It displays but whatever action I click (Continue or Cancel) this error occurs but when I do the same action it did not happen again




Hi Rogelio,

can you check on the console on chrome and see if there is an error on the page you're loading.


Cheers,

Julius


I've encountered this same issue while utilizing this forge component.

The root cause for this console error was that document.getElementById (used in the web block JS code) was unable to find a matching element on the page with the specified ButtonId parameter (bound to this web block's properties list). The ButtonId parameter is used to trigger the dialog display when the specified button is clicked.

If you're dynamically setting the "Visible" property on your button, then you need to ensure that the Confirmation Dialog web block is also wrapped in an If condition to prevent it from initializing when your button is not rendered.

However it would be better practice for the web block code to perform a null check after the button element selector fires rather than assuming it's always rendered and available. Maybe this could be added through a feature request with the author of this forge component.