Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Triggering component event from raw text HTML element -- Answered
#1
Is there a way to trigger an IWControl event from a HTML element created in raw text?

For example, if I create a series of HTML elements, for example anchor tags <a>, using the raw text mode of an IWText component, can I hook the onClick event of that HTML element to an onClick event defined in an IWForm, or the WebApplication for that matter?

I'm trying to create a visually unique navigation and the only way I found I can do this is by using the raw text mode of the IW Text component. I need the HTML elements within the raw text to be interactive and I need that interaction to be managed by the WebApplication session, for example, navigating to another page.

I hope this makes and any insight and especially code examples would be much appreciated.

Many thanks,
Michael
Reply
#2
Hi Michael, YES, you can.

Code:
<a href="#" onclick="return SubmitClick('IWBUTTON1','optional_parameter', false);"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i><span>Agenda</span></a>
Reply
#3
(08-02-2018, 11:14 AM)José Nilton Pace Wrote: Hi Michael, YES, you can.

Code:
<a href="#" onclick="return SubmitClick('IWBUTTON1','optional_parameter', false);"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i><span>Agenda</span></a>

You can also register a call back 

  WebApplication.RegisterCallBack('fxGridEditCallBack', fxGridEditCallBack);

then in the html do something like this for an ajax call or use the submitclick example above for the non ajax call

            lJS.Add('     var paramlist = "&edittype=0&Agid="+options.gid+"&ArowId="+options.rowId;');
            lJS.Add('     var clk = "executeAjaxEvent(''"+paramlist+"'',null,''fxGridEditCallBack'',true,null,true)";');
            lJS.Add('     return "<a onclick = \"" + clk + "\" href=''#''><img title=''Edit'' src=''/files/Images/default/edit.png''></a>";');
Reply
#4
(08-02-2018, 11:14 AM)José Nilton Pace Wrote: Hi Michael, YES, you can.

Code:
<a href="#" onclick="return SubmitClick('IWBUTTON1','optional_parameter', false);"><i class="fa fa-calendar fa-fw" aria-hidden="true"></i><span>Agenda</span></a>

This worked perfectly. Thank you so much!

Michael
Reply
#5
Please explain a bit more. Does that code display a calendar that calls SubmitClick() on every click?
Reply
#6
Hi Daniel, YES, exactly this. A clickable calendar image from fontAwesome, check it here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)