I can not do a javascript fireEvent

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!
0
0

I have read https://wisej.com/docs/html/Events.htm but I can not trigger javascript events.

I have a listview that allows HTML and I want to trigger a javascript event from <a> tag.

  • You must to post comments
0
0

Hello Sebastian,

This is exactly the scenario for which we added the Role property. See attached samples and few points below:

  • href=’javascript:this.’ cannot work since “this” is the element and not the object.
  • You could use “javascript:this” but you’d have to retrieve the widget that owns the element, in alternative you could pass the id of the list view to the string, etc… It becomes unnecessarily complicated. In addition to that, you’d have to override OnWebEvent() and OnWebRender() to handle then new event and to register the new event with the client.

The solution that is available with Wisej is a lot simpler (attached). give a role attribute to the tag (to any tag or even multiple tags within the same cell) and handle ItemClick. The arguments will have the value of the role string in the Role property.

Best,

Luca

  • You must to post comments
0
0

myLV.Subitems.add("<a href='javascript: this.fireEvent(""labelClicked"",""4"");'> Item 4 </a>")

I want fire an event when I click on the HTML link that is inside a subitem of the listview

  • You must to post comments
1
0

Please attach a small sample and description of what you need to do: what event, where are you sending it to, who’d handling the event, …

Thanks,

Luca

  • You must to post comments
Showing 3 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Attachment
File Name Size
There are currently no files uploaded.
Maximum number of files 1, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json