HTMLB - RadioButton - setClientEvent Javascript

Hi All,
I have a radiobutton, on click of this i need to display another set of radiobuttons. For this I have javascript function which displays the DIV.
Below is the code for this.
<hbj:radioButtonGroup id="radioGrp" columnCount="1" selection="<%=testBean.getSelectedRadio()%>">
<hbj:radioButton  id="radioBtn" key="name" text="Name"  jsObjectNeeded="true">
<%
radioGrp.getRadioButtonForKey(radioBtn).setClientEvent(com.sapportals.htmlb.enum.EventTrigger.ON_CLICK, "onSelectRadio('radioBtn)");
%>
</hbj:radioButton>
This works perfectly fine. When i select the radio button, the javascript function is displayed and relative DIV is displayed.
But the problem here is, if I select the radio button and due to any other event on the page, if the page gets refreshed, I am getting below exception (Portal Runtime error) .
Caused by: com.sapportals.htmlb.page.PageException: Eventhandler- "com.sapportals.htmlb.event.LinkClickEvent" or "onCom.sapportals.htmlb.event.LinkClickEvent" not found! '
I have imported the EventTrigger and Event in the jsp.  If I comment the radiobutton code, I am not geting the above error.
Please let me know your thoughts . I have been struggling to find a solution for this issue.
Thanks
Sudha
Edited by: sona p on Jan 14, 2010 9:19 PM

Hi,
   Try alerting "(theRadio.type)".
If you are getting the proper checkbox instance then the alert should display "checkbox". If that much is working then checking the checkbox is as simple as
var theRadio = eval(func(grpId + htmlb_radiobuttonmodifier.substring(3,7)+ "1"));
if(theRadio)
   theRadio.checked = true
By the way what does the function "func" do?
Regards,
Satyajit

Similar Messages

  • Preselect Htmlb Radiobutton using javascript

    Hi Experts,
    when I  click on a button, i want to preselect a radiobutton using javascript.
    I am using below code to get the instance of the radiobutton in the javascript, but I am unable to select the radiobutton.
    var theRadio = eval(func(grpId + htmlb_radiobuttonmodifier.substring(3,7)+ "1"));
    Thanks in advance

    Hi,
       Try alerting "(theRadio.type)".
    If you are getting the proper checkbox instance then the alert should display "checkbox". If that much is working then checking the checkbox is as simple as
    var theRadio = eval(func(grpId + htmlb_radiobuttonmodifier.substring(3,7)+ "1"));
    if(theRadio)
       theRadio.checked = true
    By the way what does the function "func" do?
    Regards,
    Satyajit

  • HTMLB RadioButton

    Hi
    I am using a HTMLB radioButton in a JSPDynpage.
    I have a radiobutton group consisting of 2 radio buttons.
    I am unable to get the selected value in Javascript.
    I am using the following code
    (eval(func("radiobuttonId"))).getChecked();
    I get an error
    "Undefined is null or not an object"
    Can somebody help out please.

    Hi Prakash
    I tried your suggestion but it still doesn't work.
    I have pasted my JSP code here so that you can have a look.
    Towards the end there is a javascript function openwindow() where I am trying to alert the radio button values.
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    <%@ page import = "com.sapportals.htmlb.enum.EventTrigger" %>
    <%     String buttonid = "";%>
    <jsp:useBean id="ProductInfoBean" scope="application" class="bean.ProductInfoBean" />
    <hbj:content id="myContext" >
    <hbj:document>
         <hbj:documentHead title="test"></hbj:documentHead>
         <hbj:documentBody>
       <hbj:form id="myFormId" >
              <hbj:gridLayout
              id="myGridLayout1"
              debugMode="False"
              width="40%"
              cellSpacing="5"
              >
                   <hbj:gridLayoutCell
                        rowIndex="1"
                        columnIndex="1"
                        width="10%"
                        horizontalAlignment="LEFT"
                   >
                        <hbj:textView
                             text="Title"
                             id="txtTitle"
                             tooltip="Title"
                             encode="false">
                        </hbj:textView>
                   </hbj:gridLayoutCell>
                   <hbj:gridLayoutCell
                        rowIndex="1"
                        columnIndex="2"
                        width="10%"
                        horizontalAlignment="LEFT"
                   >
                        <hbj:inputField
                             id="ipTitle"
                             type="String"
                             invalid="true"
                             width="100"
                             value=""
                             visible="true"
                             disabled="false"
                             required="false"
                             maxlength="30"
                             size="50"
                             design="standard"
                             jsObjectNeeded="true"
                        >
                        <%
                             ipTitle.setClientEvent(EventTrigger.ON_KEYDOWN,"handle_enter()");
                             ipTitle.setClientEvent(EventTrigger.ON_CHANGE,"handle_titleChange()");
                        %>
                        </hbj:inputField>
                   </hbj:gridLayoutCell>
                   <hbj:gridLayoutCell
                        rowIndex="2"
                        columnIndex="1"
                        width="10%"
                        horizontalAlignment="LEFT"
                   >
                        <hbj:textView
                             text="Promotion"
                             id="txtPromotion"
                             tooltip="Promotion"
                             encode="false">
                        </hbj:textView>
                   </hbj:gridLayoutCell>
                   <hbj:gridLayoutCell
                        rowIndex="2"
                        columnIndex="2"
                        width="10%"
                        horizontalAlignment="LEFT"
                   >
                        <hbj:dropdownListBox
                             id="ddPromotion"
                             tooltip="Promotion"
                             disabled="false"
                             jsObjectNeeded="true"
                        >
                             <hbj:listBoxItem
                                  key=""
                                  value="- Select Promotion -"
                             />
                             <%for(int i=0;i<ProductInfoBean.getPromotions().size();i++){%>
                             <hbj:listBoxItem
                                  key="<%=(String)(ProductInfoBean.getPromotions().elementAt(i))%>"
                                  value="<%=(String)(ProductInfoBean.getPromotions().elementAt(i))%>"
                                  />
                             <%}%>     
                        <%
                             ddPromotion.setClientEvent(EventTrigger.ON_CHANGE,"handle_promotionChange()");     
                        %>
                        </hbj:dropdownListBox>
                   </hbj:gridLayoutCell>
                   <hbj:gridLayoutCell
                        rowIndex="3"
                        columnIndex="1"
                        width="10%"
                        horizontalAlignment="LEFT"
                   >
                        <hbj:textView
                             text="Selection #"
                             id="txtSelection"
                             tooltip="Selection #"
                             encode="false">
                        </hbj:textView>
                   </hbj:gridLayoutCell>
                   <hbj:gridLayoutCell
                        rowIndex="3"
                        columnIndex="2"
                        width="10%"
                        horizontalAlignment="LEFT"
                   >
                        <hbj:inputField
                             id="ipSelection"
                             type="String"
                             invalid="true"
                             width="100"
                             value=""
                             visible="true"
                             disabled="false"
                             required="false"
                             maxlength="30"
                             size="50"
                             design="standard"
                             jsObjectNeeded="true"
                        >
                        <%
                             ipSelection.setClientEvent(EventTrigger.ON_KEYDOWN,"handle_enter()");
                             ipSelection.setClientEvent(EventTrigger.ON_CHANGE,"handle_selectionChange()");
                        %>
                        </hbj:inputField>
                   </hbj:gridLayoutCell>                                                                           
              </hbj:gridLayout>
                   <hbj:radioButtonGroup
                        id="rbgTypeSelect"
                        columnCount="2"
                        selection="rb_artwork"
                         >
                        <hbj:radioButton
                             id="rbArtwork"
                             text="Artwork"
                             key="rb_artwork"
                             tooltip="Extranet"
                             disabled="false"
                              jsObjectNeeded="true"
                        >
                        </hbj:radioButton>
                        <hbj:radioButton
                             id="rbProductDetails"
                             text="ProductDetails"
                             key="rb_productDetails"
                             tooltip="OVLC"
                             disabled="false"
                              jsObjectNeeded="true"
                        />
                   </hbj:radioButtonGroup>
                   <hbj:button
                     id="searchButton"
                    text="Search"
                  tooltip="Please click to search"
                  disabled="false"
                  onClientClick = "openWindow()"
                  jsObjectNeeded="true"
                  >
                   </hbj:button>
              </hbj:group>
       </hbj:form>
      </hbj:documentBody>
    </hbj:document>
      <script language="javascript">
         function clearSearchCriteria(){
              var funcName = htmlb_formid+"_getHtmlbElementId";
            func = window[funcName];
           (eval(func("ipTitle"))).setValue("");
           (eval(func("ipSelection"))).setValue("");
           (eval(func("ddPromotion"))).setValue("");
         function handle_enter(){
             var src= window.event.srcElement;
             k = window.event.keyCode;
             if (k == 13) {
                 // enter key pressed
                      openWindow();
         function handle_titleChange(){
              var funcName = htmlb_formid+"_getHtmlbElementId";
            func = window[funcName];
            var title = (eval(func("ipTitle"))).getValue();
            if(title != "")
                 (eval(func("ipSelection"))).setDisabled(true);
                 (eval(func("ddPromotion"))).setDisabled(true);
            else
                 (eval(func("ipSelection"))).setDisabled(false);
                 (eval(func("ddPromotion"))).setEnabled(true);       
         function handle_selectionChange(){
              var funcName = htmlb_formid+"_getHtmlbElementId";
            func = window[funcName];
            var selection = (eval(func("ipSelection"))).getValue();
            if(selection !="")
                 (eval(func("ipTitle"))).setDisabled(true);
                 (eval(func("ddPromotion"))).setDisabled(true);
            else
                (eval(func("ipTitle"))).setDisabled(false);
                (eval(func("ddPromotion"))).setEnabled(true);
         function handle_promotionChange(){
              var funcName = htmlb_formid+"_getHtmlbElementId";
            func = window[funcName];
            var promotion = (eval(func("ddPromotion"))).getValue();
            if (promotion!=""){
                 (eval(func("ipTitle"))).setDisabled(true);
                 (eval(func("ipSelection"))).setDisabled(true);
            else
                (eval(func("ipTitle"))).setDisabled(false);
                 (eval(func("ipSelection"))).setDisabled(false);
          function openWindow(){
               var funcName = htmlb_formid+"_getHtmlbElementId";
            func = window[funcName];
            var title = (eval(func("ipTitle"))).getValue();
            var selection = (eval(func("ipSelection"))).getValue();
                var promotion = (eval(func("ddPromotion"))).getValue();
    //            var selType = (eval(func("rbProductDetails"))).getChecked();
                var rb = eval(func(htmlb_radiobuttonmodifier+"rbArtwork")).getChecked();
                var rb2 = eval(func(htmlb_radiobuttonmodifier+"rbProductDetails")).getValue();
         alert("rb cheked " + rb);
         alert("rb2 value " + rb2);
    </script>
    </hbj:content>

  • Problem with html table and htmlb radiobutton group

    Hello,
    I wrote this code:
           <table width="100%" border="1">
            <tr>
              <th>
                Valutazione manageriale complessiva dell#anno
              </th>
              <th>1</th>
              <th>2</th>
              <th>3</th>
            </tr>
            <tr>
              <th>
                imprenditività
              </th>
              <htmlb:radioButtonGroup id="PROVA1"
                                       columnCount="3"
                                        mode="LOGICAL_GROUPING">
              <th><htmlb:radioButton id="1" text="1"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="2" text="2"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="3" text="3"  encode="TRUE"/></th>
              </htmlb:radioButtonGroup>
            </tr>
            <tr>
              <th>
                Autorevolezza
              </th>
              <htmlb:radioButtonGroup id="PROVA2"
                                       columnCount="3"
                                        mode="LOGICAL_GROUPING">
              <th><htmlb:radioButton id="1" text="1"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="2" text="2"  encode="TRUE"/></th>
              <th><htmlb:radioButton id="3" text="3"  encode="TRUE"/></th>
              </htmlb:radioButtonGroup>
            </tr>
          </table>
    but the third row (where there is "Autorevollezza/PROVA2") appears out of the table.
    Do yuo now why?
    Regards
    Maria

    you need to put the htmlb:radioButtonGroup Tags within the
    tags
    <tr>
    <td>
    imprenditività
    </td>
    <td>
        <htmlb:radioButtonGroup id="PROVA1" columnCount="3" mode="LOGICAL_GROUPING">
        <htmlb:radioButton id="1" text="1" encode="TRUE"></htmlb:radioButton></td>
    <td><htmlb:radioButton id="2" text="2" encode="TRUE"></htmlb:radioButton></td>
    <td><htmlb:radioButton id="3" text="3" encode="TRUE"></htmlb:radioButton>
         </htmlb:radioButtonGroup></td>
    </tr>
    there is a invisible table rendered by htmlb and the browser does not know what to do when you put that between </tr> and </table> so he ends your table...
    better you use <htmlb:gridLayout> instead of html-tables...
    stefan

  • Usage of htmlb controls  in javascript

    hi,
    Could anybody give links regarding the usage of htmlb controls in javascript?

    Hi Ganesh,
    here comes some official documentation: http://help.sap.com/saphelp_nw04/helpdata/en/43/067941a51a1a09e10000000a155106/frameset.htm
    Also see these threads on SDN: HTMLB-Javascript and Access HTMLB controll in Javascript
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • Javascript check on HTMLB radiobutton in radiobutton group

    Hi
    I want to check which radio button in my htmlb radio buttongroup is selected.
    I have tried to
    alert(eval(func("myButtonGroup"+htmlb_radiobuttonmodifier.substring(3,7)+"1")));
    but alert only shows 'undefined'.
    Is there any way to actually check what exactly I must inside "" in eval(func(""))?
    thanks in advance
    Anton Kruse

    Hi,
    First call a javascript function on selection of a radio button and inside that function write the following code.
    <script language="javascript">
      function checkRadio() {
       var funcName = htmlb_formid+"_getHtmlbElementId";
       func = window[funcName];
    //you have to use the name of radio group
       var rb1 = eval(func("myButtonGroup" +
    htmlb_radiobuttonmodifier.substring(3,7)+ "1"));
        alert(rb1.getValue());
        alert(rb1.getChecked());
    </script>
    Regards,
    Tamil K

  • Two bugs in SP9 HTMLB radioButton?

    I am trying to trigger a client-side event when a radio button is clicked.  There are examples of this, but involve embedding Java in the JSP in the radioButton tag.  When I do that, there are two problems.  First, the object is null and cannot be accessed.  Second, the text label for the radio button disappears.
    <hbj:radioButtonGroup
      id="rbgSearchSelect"
      columnCount="1"
      selection="<%=SearchBy%>">
      <hbj:radioButton
        id="rbSubscriptionSelect"
        jsObjectNeeded="true"
        text="Search by popular"
        key="101"
        disabled="false" >
    <% // rbSubscriptionSelect is null, and text does not appear %>
      </hbj:radioButton>
    </hbj:radioButtonGroup>
    If I simply remove the <% %> line, the text label appears again.  Moving the code to add the client event to the bottom should also work, but the object is still null, even if you try to get it directly from the pageContext object (where the internal code puts it).  Here's the code I want to add:
    rbSubscriptionSelect.setClientEvent(EventTrigger.ON_CLICK, "myfunc()");
    Does anyone have a working example of setting a client-side event on a radio button on EP6 SP9?

    Have you seen these Blogs??
    Portal: Bug in the  radio button's javascript api
    Useful undocumented javascript code for portal
    Regards,
    P.

  • Accessing HTMLB checkbox in javascript

    Hi,
    I have the following scenario:
    1) jsp "main.jsp" has a checkbox with id="chkBoxId"
    2) In this "main.jsp" at the end, there is a jsp include
       including another jsp "buttons.jsp" - which contains a
       SUBMIT button.
    3) On this SUBMIT button, I am calling a javascript
       function "check()" in the "onClientClick" attribute.
    4) In this "check()" function I want to access the
       checkBox (present in "main.jsp")
    Now when I try doing this using the following code in the check() function, it gives me a "Undefined is null or not an object".
    function check(chkBoxId) {
    var funcName = htmlb_formid+"_getHtmlbElementId";
    func = window[funcName];
    var chkBox1 = eval(func(chkBoxId));
    // The checkbox is obtained
    if (chkBox1)
      alert("Not Checked");
    Plzz help me !!!
    regards,
    Jitendra

    HI,
    U can write the javascript function in the header tag or create a .js file in which u write the javascript code.
    the javascript code can be like
    function ValidateForm()
    if(document.form1.s_material.value=="")
    alert("enter material");
    return false;
    return true;
    where form1 is id of form and s_material is iD of input field.
    In your coding for button onClientClick like :
    <htmlb:button  id="s_but_submit"
                                       width="20"
                                       onClick="submit"
                                       onClientClick="if(!ValidateForm(this))htmlbevent.cancelSubmit=true;"
    Regards,
    Siddhartha

  • Validating the htmlb inputfield using javascript

    Hi,
    I am trying to validate the htmlb inputfiels using the javascript,i want to get the value entered iin this inputfield in the javascript in order to validate
    plz help me on how do i get the value of the inputfield in the script.
    Thanks
    Ajay

    Hi
       please check the below example if it helps you
    <script language='JavaScript'>     
          function validateInputField() {
              var funcName = htmlb_formid+"_getHtmlbElementId";
              func = window[funcName];
              var inputfield = eval(func("xyzinputfield"));
              var inputFieldValue = inputfield.getValue();
              input  =  inputFieldValue.toLowerCase();
              if ( input.checkforsomecondition ) {
                           true perform some action
                else {  false display some message
                        alert( "please......... give some message upon failure " ); }
    </script>
    use some hbj code similar to this
    <tr><td width = 40%>
    <hbj:inputField
               id="xyzinputfield"
               type="string"
               maxlength="100"
               value="Your name here"
               jsObjectNeeded="true"
    />
    <hbj:button
               id="exbutton"                 
               value="Your name here"
               OnClientclick="validateInputField()"
    />
    regards
    jagdesh
    Message was edited by: jagdeshwar Manipatruni

  • Refresh HTMLB checkbox by JavaScript

    Hi all, I have two HTMLB checkboxes on the browser(IE6.0).
    I would like to selecte one of thses and set the other one
    checked or unchecked. I can get the checkbox's ID on the client side. I can display the boolean value if the checkbox is checked or unchecked. But I can not set the checkbox checked or unchecked and let it displayed. The Javascript code on client side is shown as below:
    // ckid - id of the target checkbox,
    // myContent - objct of PageContext
    // test() is triggered by one of the two chechboxes
    //String ck_id=myContext.getParamIdForComponent(ckid);     
    <script language="JavaScript">
    function test()
       var myval = document.getElementById('<%=ck_id%>');
       alert(myval.checked);
       myval.checked = true; 
    Any hint will be appreciated.
    Best regards.
    Wang

    Hi Dagfinn, thanks for reply. My code is as follows, the missing 'e' is my typing error,
    String s2 = "<script>"
    +"function toggle1(){"
    +"document.forms[\'myForm\'].checkbox1.checked=!document.forms[\'myForm\'].checkbox1.checked"
    +"}"
    + "function toggle2(){"
    +"document.forms[\'myForm\'].checkbox2.checked=!document.forms[\'myForm\'].checkbox2.checked"
    +"}"
    +"</script>"
    +"<body>"
    +"<form name=\"myForm\">"
    +"<INPUT TYPE=CHECKBOX NAME=\"checkbox1\" onClick=\"toggle2();\">Check me1</input>"
    +"<INPUT TYPE=CHECKBOX NAME=\"checkbox2\" onClick=\"toggle1();\">Check me2</input>"
    +"</form>"
    +"</body>";
    getForm().addRawText(s2);
    The error message happens to both of them when they are clicked.
    Thanks for reply.
    BR.
    Wang

  • Access HTMLB controll in Javascript

    Hi,
    I am tring to access an HTMLB controll (InputField) from JavaScript, but having some problems...
    I have created a DynPage and created an InputField: InputField inField = new InputField("inField");
    Now, in the javascripts I am trying to access this InputField text with:
    var txt = document.form.inField.value
    but it does not work... I get a JavaScript error.
    Any suggestion how to access the InputField from the JS? maybe with getElementByid?
    Thanks in advance,
    Aviad

    Hi Aviad,
        Htmlb controls are not a direct reprsentation of html controls. The way to get hold of them is by following lines.
    function validateField()
    //htmlb_formid : this is automatically generated
    //the following lines will get you the javascript function
    //name to call to get hold of your input field
    var funcName = htmlb_formid+"_getHtmlbElementId";
    func = window[funcName];
    //The funtion is called with id of the input field
    //which returns the htmlb control object
    var inputfield = eval(func("fname_input"));
    //this will get you the value of inputfield
    var inputString = inputfield.getValue().toString();
    <b>Note: Make sure you set jsObjectNeeded = true for the htmlb control.</b>
    PS: Please consider rewarding points for helpful answer. thank you.
    Message was edited by: Prakash  Singh

  • Controll HTMLB:Checkbox via JavaScript

    Hi all,
    I`ve created a BSP application containing HTMLB:Checkbox components.
    In this example the checkboxes are organized as a three of 2 levels.
    When clicking/checking the parent checkbox, I want the rest of the checkboxes (children) to change status depending on their parent's status. e.g checked=true/false and disabled=true/false. The checkboxes become disabled/enabled, but you cannot see any change in their checked/unchecked status.
    Though this works fine with design="classic", it doesn't when using design="design2003"...
    I have to use design2003 in my application, and want to use HTMLB:Checkbox instead of regular HTML Checkbox- which also works.
    The javascript syntax follows:
    (it's from a loop containing all the children checkboxes)
    nodeEl = elements<i>;
    nodeEl.checked = true/false;
    nodeEl.disabled = false/false;
    I would have appreciated any kind of help.
    Ogert

    This is my intire code, Raja T. The Javascript works fine with regular HTML Checkbox, or HTMLB:Checkbox combined with classic design.
    **HTML CODE
    <%@page language="abap"%>
    <%@extension name="htmlb" prefix="htmlb"%>
    <%<htmlb:content design="classic">%>
    <htmlb:content design="design2003">
      <htmlb:document>
      <htmlb:documentHead>
      <script language='javascript' src='control_checkbox.js'></script>
      </htmlb:documentHead>
        <htmlb:form>
    <table width="309" border="1">
      <tr>
        <td width="299" bgcolor="#999999">
        <htmlb:checkbox id        = "E1"
                        text      = "Parent"
                        checked   = "true"
                        onClientClick = "check_chkbox('E1');"/>
        </td>
      </tr>
      <tr>
        <td><htmlb:checkbox id        = "00111820|Chk0102|E1"
                        text      = "Child 1.1.1.2"/>
        </td>
      </tr>
      <tr>
        <td><htmlb:checkbox id        = "00111820|Chk0103|E1"
                        text      = "Child 1.1.1.3"/>
        </td>
      </tr>
        </htmlb:form>
      </htmlb:document>
    </htmlb:content>
    **Javascript Code:
    var forms;
    var elements;
    function check_chkbox(id) {
      var el;
      var nodeEl;
      var splitname;
      var ind = 2;
      var name = id;
      var tempname = split_name(id,'',ind);
      if(tempname != '') {
        ind = 1;
        name = tempname;
      getCheckBoxes();
      el = document.getElementById(id);
      if(!eval(el.checked)) {
        for(i = 0; i < elements.length; i++) {
          splitname = split_name(elements<i>.id,name,ind);
          if(splitname != '') {
            if(elements<i>.id != id && name == splitname) {
              nodeEl = elements<i>;
              nodeEl.checked = false;
              nodeEl.disabled = true;
      else {
        for(i = 0; i < elements.length; i++) {
          splitname = split_name(elements<i>.id,name,ind);
          if(splitname != '') {
            if(elements<i>.id != id && name == splitname) {
              nodeEl = elements<i>;
              nodeEl.checked = true;
              nodeEl.disabled = false;
    function split_name(name,splitname,ind) {
      var split_array = name.split("|");
      var size = split_array.length;
      var string;
      if(size == 3) {
        if(splitname != '') {
          string = split_array[ind];
          array = string.split(splitname);
          if(array[0] == '') {
            return splitname;
        string = split_array[1];
        return string;
      return '';
    function getCheckBoxes() {
      var tempArray = new Array();
      if(elements == null) {
        tempArray = document.all;
    <%--    case Firefox, Netscape --%>
        if(tempArray == null) {
          forms = document.forms;
          tempArray = forms[0];
        elements = new Array();
        for(i = 0; i < tempArray.length; i++) {
          if(tempArray<i>.getAttribute("type") == "checkbox") {
            elements[elements.length] = tempArray<i>;

  • Htmlb:tableViewColumn and JavaScript Link

    Hi All,
    I'm developing an HTMLB table the first column of which is supposed to be a hyperlink with custom javascript. In other words, when I click on the hyperlink, it's supposed to launch the custom javascript, thus opening a new browser window. This would be similar to the onClientClick property of regular HTMLB links where you can call a custom JS function.
    Do you know how this can be accomplished within HTMLB table? Here is my code sample:
    <htmlb:tableView id="list"
    table="<%=list%>"
    encode='TRUE'
    headerVisible='FALSE'
    design='STANDARD'
    footerVisible='<%=listinc_footerVisible%>'
    visibleRowCount='<%=listinc_visibleRowCount%>'
    rowCount='<%=listinc_lines%>'
    width='<%=width%>'
    sort          = "SERVER"
    keyColumn     = "ID"
    >
    <htmlb:tableViewColumns>
    <htmlb:tableViewColumn columnName  = "ID"
                           title       = "<%=model->get_textpool_text( 'I28' )%>"
                           encode      = "TRUE"
                           wrapping    = "FALSE"
                           sort        = "TRUE"
                           preSelectedSortDirection = "DESCENDING"
                           type        = 'Link'
                           linkColumnKey   = "tableviewlink"
                           linkClickTarget = "_servicerequest3"
                           >
    </htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName  = "SHORTTEXT"
                           title       = "<%=model->get_textpool_text( 'I22' )%>"
                           wrapping    = "TRUE"
                           sort        = "TRUE"
                           >
    </htmlb:tableViewColumn>
    <htmlb:tableViewColumn columnName  = "RQDAT00"
                           title       = "<%=model->get_textpool_text( 'I52' )%>"
                           wrapping    = "TRUE"
                           sort        = "TRUE"
                           >
    </htmlb:tableViewColumn>
    </htmlb:tableViewColumns>
    </htmlb:tableView>
    The first column "ID" is from where the custom JS is supposed to be launched.
    Thanks!
    Roman D.

    hi,
    do it like this for your first column.
    <htmlb:tableViewColumns>
    <htmlb:tableViewColumn
    columnName  = "ID"                      
    title       = "<%=model->get_textpool_text( 'I28' )%>"                            type        = 'USER'
    >
    <htmlb:link id            = "ID"
                      onClientClick = "your_JS"
                      text          = "your_link_text" >
          </htmlb:link>
    </htmlb:tableViewColumn>
    remember this will launch same javascript for each row.
    if you want to change dynamically for every row then you have to use tableviewiterator to render every row. and change JS accordingly for each row.
    check out weblog for tableview iterator
    /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
    regards.

  • HTMLB eventing using javascript

    Hello experts,
    I have a requirement which i am unable to figure out how to do it .
    I have HTMLB dropdown in which the items are popolauted using listitembox. Now my requirement is to disable another drop down depending upon the value selected in this dropdown .
    There is no controller in this PDK component . Hence need to use javascript to handle this . But not able to do it.
    Could anyone help me in resolving this .
    Points will be awared.
    Regards,
    Pratima.

    Hi,
    never used, but found here: [http://www.sapdesignguild.org/resources/htmlb_guidance/index.html|http://www.sapdesignguild.org/resources/htmlb_guidance/index.html] in this part: [http://www.sapdesignguild.org/resources/htmlb_guidance/dropdown_dev.html|http://www.sapdesignguild.org/resources/htmlb_guidance/dropdown_dev.html] that it should support onClientSelect event - that should do it.
    Romano

  • Disable HTMLB dropdown with JavaScript

    Hi All,
    I ran into the following issue:
    I have a BSP page that used HTMLB dropdowns and some custom javascript that disabled those dropdowns interactively when a user clicked on a checkbox.
    Example: tempDropdown.disabled = true;
    Unfortunately, as soon as I changed the control rendering attribute to "SAP", the look&feel of dropdowns changed and they no longer appear to be based on "select-one" HTML object. Therefore, my custom JavaScript no longer works.
    Do you know how I could visually (interactively) disable the "SAP" rendered HTMLB dropdown with a custom javascript?
    Thanks!
    Roman

    here is the complete code of my sample.
    <b><u>page attribute</u></b>
    tab1     TYPE     TIHTTPNVP
    tab1_wa     TYPE     IHTTPNVP
    tab2     TYPE     TIHTTPNVP
    tab2_wa     TYPE     IHTTPNVP
    <b><u>layout</u></b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003"  controlRendering="SAP" >
      <htmlb:page title=" " >
        <htmlb:form>
          <%
      clear tab1_wa .
      refresh tab1 .
      move: 'PRI' to tab1_wa-name ,
      'Printer' to tab1_wa-value .
      append tab1_wa to tab1 .
      move: 'FAX' to tab1_wa-name ,
      'Fax' to tab1_wa-value .
      append tab1_wa to tab1 .
      move: 'EMA' to tab1_wa-name ,
      'Email' to tab1_wa-value .
      append tab1_wa to tab1 .
          %>
          <%
      clear tab2_wa .
      refresh tab2 .
      move: '[email protected]' to tab2_wa-name ,
      'Some One' to tab2_wa-value .
      append tab2_wa to tab2 .
      move: '[email protected]' to tab2_wa-name ,
      'Mr X' to tab2_wa-value .
      append tab2_wa to tab2 .
      move: '[email protected]' to tab2_wa-name ,
      'Mr Y' to tab2_wa-value .
      append tab2_wa to tab2 .
          %>
    <script language="javascript">
      function SetDisabled(elem,disable)
      var ip = document.getElementById(elem);
      ip.disabled = disable ;
    </script>
          <htmlb:label for  = "DDLB1"
                       text = "Carrier" />
          <htmlb:dropdownListBox id                = "DDLB1"
                                 nameOfKeyColumn   = "NAME"
                                 nameOfValueColumn = "VALUE"
                                 table             = "<%= tab1 %>"
                                 onClientSelect    = "javascript:dd = document.forms[0].DDLB1; alert(dd.options[dd.selectedIndex].value);"
                                 width             = "150" />
          <htmlb:dropdownListBox id                = "DDLB2"
                                 nameOfKeyColumn   = "NAME"
                                 nameOfValueColumn = "VALUE"
                                 table             = "<%= tab2 %>"
                                 width             = "150" />
          <htmlb:button text          = "Press Me"
                        onClientClick = "javascript:SetDisabled('DDLB2', 'true');" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    try this in your system and let me know whether it works or not
    Regards
    Raja

Maybe you are looking for

  • SOAP Fault while invoking ISG Service through BPEL

    Hi, I am trying to invoke a EBS R12 pl sql API exposed as a web service through integrated SOA gateway. But i am hitting the same error for different API`s that i have tried with. the error is : <remoteFault> <part name="summary"> <summary>Error occu

  • How can i get to a website with TOR using firefox as my explorer?

    i have to use TOR to connect to some sites.in the past i used firefox and it had an option of turn on or off vidalia...but then i downloaded this new version and now i can't open any websites by firefox...i can't activate this on firefox.

  • Problem with Notification update from backend (local notif)

    Hi all I created a Local notification and uploaded the same to the server. I found the same notification in the backend and made some changes to it and then tried to sync the data to the MAM application but I got the following error message “Exceptio

  • Family Share Plan

    My boyfriend and I each have separate Verizon wireless contracts and are eligible for an upgrade.  We would like to both get the iPhone and get a family share plan for the two of us.  Are we able to share minutes with an iPhone like one can with othe

  • ABAP Webdynpro: Creating a table on webdynpro screen to enter new data.

    Hello Experts, Does anyone know, how to create a  table on webdynpro screen that can be used to enter new data in database? I have tried to create a Table UI element (with Standard Cell Editor as Input Field) but it is "Display only" if there is no d