Hi Wisej,
please help me with custom events… The scenario is:
(A) i have htmlPanel with its html content dynamically generated from database rows, part of generated html is [a href.. onclick] etc. From here, I would like to use fireDataEvent. Actual html code for such link is <a href=”#” onclick=”this.fireEvent(‘SetGuiColorRequested’, { noteID:455733 });”>…</a>
Why html panel? Because we need copyable texts to show to user.
(B) that htmlPanel is inside a classic user control, which overrides the OnWebEvent, thus its listening to various …fireEvent/fireDataEvent calls. The individual event types are registered within OnWebRender
Now, how to achieve (if possible) that if the user clicks the ahref link in (A) that such event is delivered to (B) into OnWebEvent? Currently the javascript debugger console says “this.fireEvent is not a function”
Thanks for help / guidance
Pavel Weiss
Hi Pavel
Thank a lot for share your solution
This will help to others users
Best regards
Well, I have succesfully resolved this by….
i] in default.html create new js function
var myFireEvent = function (dataElementId, eventName, eventParams) {
window.parent.App.MainPage.core.fireEvent(dataElementId, eventName, eventParams);
}
ii] in c#, while constructing the html for htmlPanel, use
var htmlElementId = ((IWisejComponent)this).Id;
iii] then in onClick in ahref in html, simply call window.myFireEvent(a,b,c) where “a” is the value collected from (ii)
And it works!
Regards,
Pavel Weiss
Please login first to submit.