xpages - add SSJS action to a bootstrap pill -


i have added simple pill list navigator:

<div class="container-fluid">         <ul class="nav nav-pills">             <li role="presentation" class="active">                 <a href="#">profiles</a>             </li>             <li role="presentation">                 <a href="#">applications</a>             </li>             <li role="presentation">                 <a href="#">automation</a>             </li>         </ul>     </div><!-- container --> 

and workd fine if want add href link, need run ssjs when pill clicked. starting bootstrap hill perhaps not doable. have searched have not been able find how 1 that. appreciated.

thanks

use <xp:link> instead html <a>. allows add on click event ssjs code:

<div class="container-fluid">     <ul class="nav nav-pills">         <li role="presentation" class="active">             <xp:link                 escape="true"                 text="profiles"                 id="link1">                 <xp:eventhandler                     event="onclick"                     submit="true"                     refreshmode="complete">                     <xp:this.action><![cdata[#{javascript:print("your ssjs code")}]]></xp:this.action>                 </xp:eventhandler>             </xp:link>         </li>         <li role="presentation">             <xp:link             ... 

<xp:link> gets rendered <a> tag like

<a id="view:_id1:link1" href="#" class="xsplink">profiles</a> 

you asked in comment how add data-toggle="tab" rendered <a ...>. can accomplish <xp:this.attrs> within <xp:link>:

        ...             <xp:link                 escape="true"                 text="profiles"                 id="link1">                 <xp:this.attrs>                     <xp:attr                         name="data-toggle"                         value="tab">                     </xp:attr>                 </xp:this.attrs>                 <xp:eventhandler                     event="onclick"         ... 

the rendered link looks then

<a id="view:_id1:link1" href="#" class="xsplink" data-toggle="tab">profiles</a> 

Comments