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!

Similar Messages

  • 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

  • HTMLB control for displaying clientside error messages

    Hi all,
    I want to display client side validation error messages in a JSP DynPage.I have tried MessageBar but it can't be accessed from JavaScript file.Becuase of that i couldn't write error messages from .js file using MessageBar.Can U plz tell me is there any other HTMLB control or other way to display clientside error messages.
    Urgent
    Thanks
    Sampath.G

    Hi Sampath,
    I have an idea to use message bar in client side.
    1.First create a div at the begining of a page which is always visible.
    2.create some hidden div tags which contains message bars with different error or information messages.
    3. during the validation in javascript if u want to show error message just assign the content of hidden div tag
    to visible div tag.Now u will get error message as like real message bar.
    Then in javascript just write this code
    document.getElementById('sample').innerHTML=document.getElementById('Error').innerHTML
    where sample-->id of visible div
    Error-->id of hidden div inside which u need to write the code for messagebar
    this wiil show the error message at the place of visible div (sample).
    <b>Note:</b>
    If u want to change the messageBar text dynamically that can be possible only through server side only using bean to set and get error messages.
    I am not able to give some sample coding since the code button throws some script error.
    Ragards,
    Tamil K

  • Proplem: Access HTMLB controls from java code

    Hi,
    I am new to iView development for EP6. So my problem should be easy to solve (for you ).
    I created in the NW Dev Studio a JSP DynPage.
    The following files were created or edited:
    1.     JSP file (created)
    2.     java file (created)
    3.     portalapp.xml (edited)
    In order to make the page running (proccessing) I changed the following things:
    1.     JSP file – Add taglib reference to HTMLB-class
    2.     portalapp.xml – Remove the „native“ property so the JSP file will not be accessed directly.
    Now I want to do the following:
    On the JSP page I placed severeal HTMLB controls (textViews).
    From the java code I try to access these controls in the „doProcessBeforeOutput“ method and change/set values.
    But I get all the time a null-Exception.
    Code (JSP)
    <%-- mcmsprovider.jsp --%>
    <%@ taglib uri= "tagLib" prefix="hbj" %>
    <hbj:content id="cntMcmsProvider" >
      <hbj:page title="MCMS Provider Dynpage">
       <hbj:form id="frmMcmsProvider" >
                 <hbj:textView id="tvwScript" encode="false"></hbj:textView>
                 <hbj:textView id="tvwStyle" encode="false"></hbj:textView>
       </hbj:form>
      </hbj:page>
    </hbj:content>
    Code (JAVA):
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
           TextView tvw = (TextView) this.getComponentByName("tvwStyle");
           tvw.setText("Here the dynamic text");
    I also tried to add raw text to the form but also null excpetion:
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
           Form frmCurrent = (Form) this.getForm();
           frmCurrent.addRawText("<h3>This comes from here</h3>");
    My goal is to dynamically add controls to the form, but until now I think it will be a dream:
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
      Form form = (Form)this.getForm();
           TextView tvw  = new TextView("tvwDynamic");
           tvw.setText("Here the dynamic control");
           form.addComponent(tvw);
    The normal page processing runs:
    public void doProcessBeforeOutput() throws PageException {
           this.setJspName("mcmsprovider.jsp");
    Any help is greatly appreciated.

    Eike
    Here is the example straight from the PDK documentation. This should help you a little
    UsingAbstractPortalComponentWithHTMLB.java
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.enum.DataType;
    import com.sapportals.htmlb.enum.GroupDesign;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.rendering.IPageContext;
    import com.sapportals.htmlb.rendering.PageContextFactory;
    import com.sapportals.portal.prt.component.AbstractPortalComponent;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    public class UsingAbstractPortalComponentWithHTMLB extends AbstractPortalComponent {
        //Fill in your output for "normal" content creation mode here
        protected void doContent(IPortalComponentRequest request, IPortalComponentResponse response) {
            IPageContext myContext = PageContextFactory.createPageContext(request, response);
            if (myContext == null) {
                System.out.println("htmlb service did not start up as expected.");
            Form myForm = myContext.createFormDocument("First Experiment");
            Event lastEvent = myContext.getCurrentEvent();
            Group myGroup = new Group();
            myGroup.setWidth("350");
            myGroup.setTitle("First Experiment");
            myGroup.setDesign(GroupDesign.SAPCOLOR);
            myForm.addComponent(myGroup);
            GridLayout gl = new GridLayout();
            myGroup.addComponent(gl);
            if ((lastEvent != null) && (lastEvent.getComponentName().equals("submit"))) {
                String name = myContext.getDataForComponentId("USER_NAME").toString();
                TextView label = new TextView("Hi, " + name);
                gl.addComponent(1, 1, label);
                Button myButton = new Button("goback", "Go back");
                myButton.setOnClick("goBack"); // ignored anyway
                gl.addComponent(2, 1, myButton);
            } else {
                TextView label = new TextView("What's your name?");
                gl.addComponent(1, 1, label);
                InputField inf = new InputField("USER_NAME");
                inf.setType(DataType.STRING);
                gl.addComponent(1, 2, inf);
                Button myButton = new Button("submit", "Tell");
                myButton.setOnClick("submit");
                gl.addComponent(2, 2, myButton);
            myContext.render();

  • Dynamic Object for Checkbox in HTMLB control

    Hi all,
    I want to create dynamic object for Checkbox in HTMLB control.
    I have created dynamic check box in JSP using JSPDynpage. I can select multiple values in the list of checkbox.After clicking the submit button , I have to read the value of checkbox.  For this first i want to create the object for checkbox in controller.
    How can i create the dynamic object?
    Help me in this regard.
    Thanks & Regards
    Hemalatha J

    Krish
      Will this link helps you ????
      <a href="http://help.sap.com/saphelp_nw04/helpdata/en/7d/9b0e41a346ef6fe10000000a1550b0/frameset.htm">Check Box</a>
    Thanks
    Jack
    Allot points if it helps

  • Need to set the tab order in HTMLB controls

    I readed in another thread that it was not possible to set the tab order in HTMLB controls on BSP forms.
    However it was possible to do a little workaround, by setting the tooltip property, and put in the tabindex in that. Because Browsers do understand the property tabindex.
    Examble:
    <htmlb:inputField id="authorfname1"
    tooltip='tooltip1" tabindex="2'
    value = "<%= authorfname %>" />
    HTML Output would be like this:
    <input title="tooltip1" tabindex="2" class="sapEdfTxtEnbl"
    size="20" name="authorfname1" id="authorfname1" value="">
    <b>It works a little bit differently in my HTMLB controls.</b> Output is like this:
    <input title="tooltip1&quot; tabindex=&quot;2" class="sapEdfTxtEnbl"
    size="20" name="authorfname1" id="authorfname1" value="">
    <i>It doesn't work. " becomes &quot; <b>How do I solve this?</b></i>

    thanks for sharing the info.
    to handle your issue you could do the following
    <% data: replace_string type string .
    clear replace_string .
    replace_string = `<input  tabindex="2"`.
                  %>
                  <bsp:findAndReplace find    = "<input"
                                      replace = "<%= replace_string                  %>" >
                   <htmlb:inputField id="authorfname1"
    tooltip="tooltip1"
    value = "<%= authorfname %>" />
                  </bsp:findAndReplace>
    Hope this helps.
    Regards
    Raja

  • HTMLB Controls for Table Format

    How to display information in table format by using HTMLB
    controls in JSP Dynpage from Oracle

    Hi  Srikanth ,
    Here is the code in HtmlB for Displaying content in Table Format.
    You need to retrieve 1stColumn, 2nd Column,,,,, and Rows from the database using sql statements.  Connection con = DriverManager.getConnection(url);
                        ResultSet rs ;
                        String query ="Query to passed to DB";
                        Statement stmt = con.createStatement();
                        rs = stmt.executeQuery(query);
                        if(rs.next())
    private DefaultTableViewModel createNewTable
                                      (DefaultTableViewModel model) {
            Vector data = createData();
            Vector colName = new Vector();
            /* Define column names */
            colName.addElement("1stColumn");
            colName.addElement("2ndColumn");
            colName.addElement("3rdColumn");
            model = new DefaultTableViewModel(data, colName);
            return model;
        private Vector createData() {
            Vector dataVec = new Vector();
            Vector retVector = new Vector();
            /* 1st entry */
            dataVec.addElement("Row 1, Column 1");
            dataVec.addElement("Row 1, Column 2");
            dataVec.addElement("Row 1, Column 3");
            retVector.addElement(dataVec);
            /* 2nd entry */
            dataVec = new Vector();
            dataVec.addElement("Row 2, Column 1");
            dataVec.addElement("Row 2, Column 2");
            dataVec.addElement("Row 2, Column 3");
            retVector.addElement(dataVec);
            /* more entries */
            return retVector;
    private DefaultTableViewModel createNewTable
                                      (DefaultTableViewModel model) {
            Vector data = createData();
            Vector colName = new Vector();
            /* Define column names */
            colName.addElement("1stColumn");
            colName.addElement("2ndColumn");
            colName.addElement("3rdColumn");
            model = new DefaultTableViewModel(data, colName);
            return model;
        private Vector createData() {
            Vector dataVec = new Vector();
            Vector retVector = new Vector();
            /* 1st entry */
            dataVec.addElement("Row 1, Column 1");
            dataVec.addElement("Row 1, Column 2");
            dataVec.addElement("Row 1, Column 3");
            retVector.addElement(dataVec);
            /* 2nd entry */
            dataVec = new Vector();
            dataVec.addElement("Row 2, Column 1");
            dataVec.addElement("Row 2, Column 2");
            dataVec.addElement("Row 2, Column 3");
            retVector.addElement(dataVec);
            /* more entries */
            return retVector;
    private DefaultTableViewModel createNewTable
                                      (DefaultTableViewModel model) {
            Vector data = createData();
            Vector colName = new Vector();
           /* Define column names */
            colName.addElement("1stColumn");
            colName.addElement("2ndColumn");
            colName.addElement("3rdColumn");
            model = new DefaultTableViewModel(data, colName);
            return model;
        private Vector createData() {
            Vector dataVec = new Vector();
            Vector retVector = new Vector();
            /* 1st entry */
            dataVec.addElement("Row 1, Column 1");
            dataVec.addElement("Row 1, Column 2");
            dataVec.addElement("Row 1, Column 3");
            retVector.addElement(dataVec);
            /* 2nd entry */
            dataVec = new Vector();
            dataVec.addElement("Row 2, Column 1");
            dataVec.addElement("Row 2, Column 2");
            dataVec.addElement("Row 2, Column 3");
            retVector.addElement(dataVec);
            /* more entries */
            return retVector;
    Hope This will Be Helpful to you. Reward Points if this helps you.
    Regards,
    Eben Chella Metilda

  • HTMLB controls and upgrade for HR-CEE patch level

    Hi,
    we have applied support patches in order to update the machine to the following level: HR-CEE (100_470)  SAPK-10059INHRCEE - Level 59.
    This has been made following the OSS note 524948 guidelines and they have required this other patches level update:
            SAP_BASIS 620 0055 SAPKB62055
            SAP_ABA   620 0055 SAPKA62055
            SAP_HR    470  0048 SAPKE47048
    We have noticed that after apply those patches, some HTMLB controls like inputfield type date have change their appearance and design.
    Somebody could help me to fix this problem?. I don't know what happend and what public folders, mime objects and show on I have to check.
    Thanks in advanced.

    Is there a particular application this is occuring in? In that case an application may have been changed from Design2002 to Design2003.  This would cause appearance change, but this would be normal and correct.
    Can you check out HTMLB_SAMPLES or SBSPEXT_HTMLB and see how that same element looks there.

  • How to fill html control from javascript

    I am trying to create a panel with html in it and I am not able to fill dropdown control from javascript.

    Tim,
    In order to consume a SOAP API I recommend you use something other than JavaScript.
    Any platform can offer you a good SOAP client should be OK. (.Net, Java, php, Ruby, python).
    I didn't see anyone successfully used javascript and consume the Eloqua SOAP API.
    I know you can create a SOAP client in Java script but it will be too much work to handle the Eloqua response in some cases.
    Regards,
    Daniel

  • 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>;

  • 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

  • Hide datefield coldfusion control using JavaScript

    I have a straight forward datefield control.  Looks like the following:
    <cfinput type="dateField" name="dt_RtDate" width="60px"  id="dt_RtDate" title="Enter or select repeat date" value=""  >
    Now I have a javascript function that happens on a click event that I use to want to hide this control it looks similar to the following:
    //Hide Repeater control
        var dtRepeater =  document.getElementById('dt_RtDate'); 
        dtRepeater.style.visibility = "hidden";
    this works fine, but there is a problem I notice.  The textbox dissapears and this is fine, but the calendar image control IS STILL VISIBLE?!
    So my question is I am not sure how to reference this control or property to make the entire thing go away.  I would also then like to know the flipside of showing it too (which I am using by saying ...  dtRepeater.style.visibility = "";   )
    So what do I have to do to reference the coldfusion date control to make it dissapear completely?
    Thanks,

    You could always put it inside a span or div and do your show/hide on that element.

  • 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

Maybe you are looking for

  • Sorry - basic question; 'Simplest way to set-up Remote Log-in'

    I'm not sure if this is the right area to post this, but the question is at least quite simple; what's the best, quickest, 'easiest' way of remotely logging on from home to work i.e. to access and use applications and files. Leopard at home, Leopard

  • Transaction Processor Error in View Pending Transactions

    Dear All, I am getting the Error: "Transaction Processor Error" in View Pending Transactions. How can I identify due to what reason, this error had occured because of this I am not able to close the inventory period for these transaction months.. and

  • IFCU in R/3 4.7

    Hi All Pl confirm me whether IFCU can be used in 4.7 Version. I have activated EA-PLM also done all configs under Consumption relevant Counter Reading Update. When I select the Fluid type in IFCU it is not accepting the Fluid type configured and thro

  • How to configure a parallel printer to a USB port?

    Hi people....I'm trying to set up our old, trusty Laserjet 5P with our new G70 using a USB to parallel cable, but to no avail. Any ideas on how to configure this odd couple so that they can live and work in harmony? My wife would rather lose me than

  • Sleep mode in windows 8.1

    I installed Windows 8.1, 23/10/13  and the sleep mode does not work.