Regarding onClick event of htmlb:Link element.

Hi All,
We have a table in which we are displaying error messages.
The requirment is that each message should be a link which , when clicked should set the focus on respective element in the form.
I am displaying each message as link as follows:
<%
  loop at itab_message into wa_message.
              %>
count = count + 1.
              %>
              </td>
              <td bgcolor="#F0F0F0">
              <htmlb:link id            = "link<%= count %>"
                          text          = "<%= wa_message-msg %>"
                          >
              </htmlb:link>
              </td>
              </tr>
              <%
  endloop.
              %>
              </table>
              <%
  refresh itab_message.
              %>
              <%
  endif.
              %>
Displayng messages as links is fine , but how can i acchieve the functionality , that on clicking a particular link , the focus should be set on the respective field.
For Ex:
There are two error messages:
1)Enter your name
2)Select material group from drop down list box.
If the user clicks 1st message the focus should be set on NAME element.
Thanks,
Anubhav.

Hi,
this is not gonna be easy but first, you´re not using
<div class="jive-quote"> </div>
so you should erase it.
Second, you have to extend the use of label <htmlb:link> in this way:
<htmlb:link id        = "link<%= count %>"
                  text          = "<%= wa_message-msg %>"
                  onClientClick = "set_focus('your_field')" >
And then, some Javascript code:
    function setfocus(myfld) {
            if (document.forms.elements[myfld] != null) {
                document.forms.elements[myfld].focus();
Hope it helps.

Similar Messages

  • Unable to capture onClick event of htmlb:image in a controller

    Hi,
    I am trying to capture onClick event of an htmlb:image (which is present in my view) in DO_HANDLE_EVENT method of my controller.
    Surprisingly, when I click the image, page does refreshes. But the event in not captured in do_handle_event method. Control never reaches that method. Whereas if I put onClick event of a button, it is easily captured in do_handle_event method.
    Ex. code in my view is:
    <%@page language="abap"%>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="htmlb" prefix="htmlb"%>
        <htmlb:image id      = "searchimg"
                     src     = "consvalue.jpg"
                     onClick = "search"  />
        <htmlb:button id="searchbutton" onClick="search"
                                     text="Event Test"/>
    Now, the button event is captured, but not the image event.
    Any idea why this might be happening?
    Regards,
    Kaushal

    Hi Kaushal,
    are image and button enclosed by <htmlb:form> ?
    Please post your of do_handle_event, where you look for the event.
    Regards,
    Sebastian

  • Wrapping a htmlb link element

    I have a long htmlb link that should be wrapped to fit in a FormLayoutCell.
    The generated html page has the <nobr> element inside to indicate that the link will not be wrapped. Any ideas?

    Hi Dethlev,
    a.) The build time is Tue Nov 25 01:27:30 2003. Do I have  the possibility to choose an other one?
    b.) a snippet of the code:
    I use a dynpage, created from the templatedynpage. The layout in subject is:
         FormLayout fl = this.getForm();
    //The layout row has several coloums, but the relevant
    //is this one:     
         FormLayoutRow headerRow = fl.addRow();
         FormLayoutCell imgCell = headerRow.addCell();
         Link editQuestion = new Link( "edit" ,
                                       "Edit Question" );
         editQuestion.setOnClick("editQuestion");
         editQuestion.setFontSize( LinkFontSize.STANDARD );
         editQuestion.setLinkDesign( LinkDesign.RESULT );
         imgCell.addComponent(editQuestion);
    This link produces the <nobr> tag in the html output. I tried to use the link element outside of a formlayout, but it's the same.
    Thank you, Nick

  • EP 6.0 SP2: Update a HTMLB TableView after onClick Event

    Hello,
    i generate a TableView from a JDBC database selection.
    Outside this TableView there are 3 Buttons.
    Now the problem:
    If one of the buttons will click, the TableView has to be updated with a new database result. Have somebody an idea, how to update the TableView?
    Stephan

    Could you be more precise?
    Default behaviour/coding is that an onClick event effects a request to the server - as your component/dynpage handles this request, you should be able to present anything that you like on this occasion. Maybe you code does not react to the HTMLB event properly?
    Regards,
    Armin

  • Htmlb:button  onClick event

    Hi experts I'm using follwoing code  for htmlb :button
              <htmlb:button       id            = "myButton2"
                                text          = "<%= v_save %>"
                               tooltip       = "<%= v_save %>"
                               onClick       = "approveClick"
                               design        = "emphasized"
           />
    and in
    do_handle_event  I'm using followin code
    DATA : button_event TYPE REF TO cl_htmlb_event_button,
             event1 TYPE REF TO cl_htmlb_event.
      event1 = cl_htmlb_manager=>get_event(  runtime->server->request ).
      CASE event1->server_event.
        WHEN 'approveClick'.
          button_event  ?= event1 .
    <   some code >
    ENDCASE.
    when i clicked the button it is not going into do_handle_event
    I'm unable to capture onclick event of button .I tried it by keeping some break points .But couldn't be ableto capture it
    Here I'm using MVC pattern .When one check box clicked in view of another controller  the page which contains this button will be displayed.Do i need to write any additional code for it

    There are 2 kind of break-points.
    1. Session break-points - This will wok only to debug normal ABAP codes.
    2. External break-points - This will help you to debug BSP/Webdynpro application.
    Set the external-break point to figure out whether its triggering the events or not.
    <b>
    To set the external Break-points:</b>
    Before settings the external-break-point, you need to Active External break-point for HTTP. YOu can find this option in
    SE80, in
    Utilites--> Break-point/External break-point or Utilites--> External break-point --> Set External break-point
    or if you dont find, then
    utilities-->setttings -> ABAP Workbench -> look at the debugger tab
    & find the external Debugging check box or External Debugging user ID. Give SAP User ID
    Also have a look at this..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/00ab3b72d5df3be10000000a11402f/frameset.htm
    <i>* Reward each useful answer</i>
    Raja T
    Message was edited by:
            Raja Thangamani

  • Capture onclick event on the Download Link of a File Browse Item

    I'm using APEX 4.0.1 and need to create a javascript:popupURL after a file browse item's onClick event fires and before the download dialog popup appears.
    Here's a related thread: {thread:id=2135877}
    Is this possible to do? If so, any help will be appreciated.
    Edited by: CM Randy SD on Jan 11, 2011 7:54 AM

    >
    I tried each of the following in the the Element HTML Form Element Attributes for the File Browse item:
    onClick=javascript:alert(this.value);
    onClick=javascript:popupURL('http://www.google.com');
    onFocus=javascript:alert(this.value);
    onChange=javascript:alert(this.value);And what happened?
    [A few points on good practice:
    1. In the XHTML normally used in APEX 4.0 mark-up, all XHTML, including attribute/event handler names, should be in lower case: <tt>onclick</tt>, <tt>onfocus</tt>, <tt>onchange</tt>...
    2. Attribute values should always be quoted.
    3. The <a href="http://crisp.tweakblogs.net/blog/313/the-useless-javascript-pseudo-protocol.html">"javascript:" pseudo-protocol is evil</a>. There are a few places in APEX where we may have to resort to using it as URL is all we're offered to work with, but it's always better to use an event handler of some kind, either inline or (better) registered dynamically at runtime following the principles of <a href="http://en.wikipedia.org/wiki/Unobtrusive_JavaScript">unobtrusive JavaScript</a>. +It absolutely should not be used in inline event handlers.+
    So:
    {code}
    onclick="alert(this.value);"
    etc

  • Client side eventing with HTMLB in a jsp file

    Hi All,
    Can u give me the solution to work with client side eventing with HTMLB with a jsp page but not with a dynpage.
    Regards,
    sireesha.

    Hi sireesha,
      Check this.
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <%@ page import="com.sapportals.htmlb.enum.EventTrigger,com.sapportals.htmlb.event.Event" %>
    <hbj:content id="myContext" >
    <hbj:page title="PageTitle">
    <script language="Javascript">
    function checkinput(){
         var funcName = htmlb_formid+"_getHtmlbElementId";
         func = window[funcName];
         var inputfield1 = eval(func("inf1"));
         var input1 = inputfield1.getValue();
         if (input1==""){
              alert("Enter mandatory fields");
    </script>
    <hbj:form>
    <hbj:textView id="tv1" text="Name"/>
    <hbj:inputField id="inf1"
    type="String"
    required="true"
    jsObjectNeeded="true">
    <% inf1.setClientEvent(EventTrigger.ON_BLUR, "checkinput()"); %>
    </hbj:inputField>
    <br>
    <hbj:textView id="tv2" text="City"/>
    <hbj:inputField id="inf2" type="String"/>
    <hbj:button id="b1" text ="submit" onClick="onSubmitclicked"/>
    </hbj:form>
    </hbj:page>
    </hbj:content>
    Regards,
    Harini S

  • HTMLB Link : opening in new window

    Hello,
    I have a custom worksetmap component (which extends AbstractPortalComponent).
    In one scenario it renders a list of sap systems, on click of which, opens a saplogonpad.
    Now the issue we are facing is that when user clicks on one such link, worksetmap component screen goes blank.
    We are using following way to set HTMLB link properties: -
    titleLink.setReference(<link to sap system>);
    Is there any way to open this in a new window so that worksetmap component stays on its current state?
    Thanks & Regards,
    Amey

    Hi Amey,
    you can use titleLink.onClick="EPCM.doNavigate(targetUrl....);"
    see this page to understand the navigation API.
    Navigation API - Running an Enterprise Portal - SAP Library
    in your case you should either use navigation mode 1 (new window),
    3 (new headerless window) or 10 (new headerless window standards mode).
    according to your previous statement I think you need navigation mode 1.
    BR,
    Saar

  • Joining 2 onclick event

    Hello
    I have an image link and it works just fine
    but...... I also need to have the other onclick executed at
    the same time.
    how best should I do this.
    <img src="images/fp_pic.jpg" alt="Elbow" width="132"
    height="101"
    onclick="P7_EPMctl('p7EPMtrg2_1','trigger')">
    <a href="javascript:void(0);"
    onclick="play();">Play</a>
    i do no longer need the word play in the above link, i need
    to combine both
    to work with one onclick event.
    regards
    k

    Twocans wrote:
    > i do no longer need the word play in the above link, i
    need to combine both
    > to work with one onclick event.
    Separate the function calls with a semicolon:
    <img src="images/fp_pic.jpg" alt="Elbow" width="132"
    height="101"
    onclick="P7_EPMctl('p7EPMtrg2_1','trigger');play()">
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • How to create a navigation bar entry with onclick event

    I have requirement of creating navigation bar entry with a an "on click" event. When a user clicking time a location list should open. I didn't understand how to do it on NAVIGATIONBAR_ENTRY.
    Also Navigation Bar Entry IMage is not displaying.
    Regards
    Edited by: satheeshkumars on Oct 25, 2010 7:52 PM

    Do you specifically need to use the onclick event, or do you jts want to run Javascript from the navbar entry? If the latter then you can use the URL method and set the URL to:
    javascript:myfunction()
    If it must be an onclick event then I think you would need to attach it dynamically in Javascript (using jQuery if available) to locate the link somehow (it's not easy to give it a unique ID unfortunately).
    Edited by: Tony Andrews on Oct 26, 2010 10:35 AM

  • Navigation Tree event on a link

    Hello everybody,
    I have a Navigation tree and I want to put an event on a link. How could I do that ?
    I have the following code:
    private void CreateLink(
                   IPortalComponentRequest request,
                   TreeNode treeNode,
                   INavigationNode node)
                   String url = node.getName();
                   String title = node.getTitle(request.getLocale());
                   Link link = new Link("LINK_" + FirstNodeCount++, title);
                   String navigationAction = "EPCM.doNavigate('" + url + "',2)";
                   //l.setOnClientClick(navigationAction);
                   link.setOnClick("onLink");
                   treeNode.setComponent(link);
    and
    public void onLink(Event event)
                   TreeNodeSelectEvent myEvent =  (com.sapportals.htmlb.event.TreeNodeSelectEvent) event;
                   TreeNode myNode = navigationBean.getTree();
                   System.out.println(myNode.getID());
                   TreeNode tempNode = myNode.getNodeByID(myEvent.getNodeKey());
                   myNode.setOpen(true);
                   navigationBean.setTree(myNode);
    Thanks for any feedback
    Regards.
    Altafin

    try link.setOnClientClick("javascript:raiseEvent('" + url + "')");
    instead of link.setOnClick("onLink");
    Include the javascript to fire the event.
    <SCRIPT language=javascript>
    function raiseEvent(value){
    EPCM.raiseEvent("urn:com.sap:PassEvent", "SetParam", value, null);
    </SCRIPT>
    Then add the subscribe event to the iview you want to receive the event.
    <SCRIPT language=javascript>
    EPCM.subscribeEvent("urn:com.sap:PassEvent", "SetParam", getEvent);
    function getEvent(eventObject){
    EPCM.doNavigate('" + eventObject.dataObject + "',2)";
    </SCRIPT>

  • Htmlb link to binary content

    I'd like to have a htmlb link and when processing the onClick action I'd like to output some binary content. I've tryed to write the following on the onClick(Event event) handler:
                IPortalComponentResponse response = (IPortalComponentResponse) this.getResponse();
                response.setContentType(new PortalComponentContentType("application/json"));
                try{
                    response.getWriter().write("[1, 2, 3, 4]");
                    binary = true;
                catch(IOException ex){
                    throw new PageException(ex);
    but without success since i get lots of htmljscss and pre appended to my binary output and more htmljscss after.
    Can someone enlighten me on this subject?

    If you want to create a link to the file in the repository, I suggest you use the ShowBinaryServlet.
    From javadoc...
    public class ShowBinaryServlet
    extends ShowPropertyServlet
    Writes a Binary property of a Node to the response OutputStream. The available paramater options are as follows:
    # 1) Pass the node Id in as a request parameter. Eg. http://server:port/app/ShowBinary?nodeId=/repo/12345.
    # 2) Pass the node path as part of the the request pathInfo. Eg. http://server:port/app/ShowBinary/repo/path/file.ext.
    # 3) Pass the node path in as a request parameter. Eg. http://server:port/app/ShowBinary?nodePath=/repo/path/file.ext

  • Htmlb link error

    Hi all,
    I have a jsp with only one htmlb link, pressing the link triggers a server event. The link works fine, but when i put this iview in the home page, i get a JavaScript error: 'all(...)' is null or not an object.
    working with EP6 SP14.
    Any suggestions ?
    Best regards,
    Keren

    Hi,
    Can you give more details about the application and the error.
    Thanks
    Senthil

  • Input Field in table - I need a OnClick Event

    Hello everybody,
    I have the following problem:
    I have created a table in my view which is filled at runtime. The table has 3 different rows and every row has TableSingleMarkableCells, these cells further have a input field as their celleditor.
    I now want to know which cell the user is editing. I have a AttributePointer through which I know that at the time the user presses the enter key. But I need to know whether the focus has changed. Because there is the possibility that the user switches between the differnt cells with the arrow key or the tab key. But the AttributePointer only gives me the first selected cell.
    Have anybody a suggestion to solve this problem -  it seemed to be something like definingb a OnClick event for a input field (additionaly to the default OnEnter event...)
    Best regards,
    Sebastian

    Hi,
    You can find out at which row the editing goes, by using
    onLeadSelect action of TableUIElement.
    in onLeadSelect action you can find row number using this statement
    int rownumber= wdContext.node<TableNode>().getLeadSelection();
    Regards
    LakshmiNarayana

  • Regarding terminating events in workflows

    Hi,
    I know that terminating events are used with asynchronous methods. Can anyone tell me, why do we need to do so????
    Thanks and Regards,
    Ravi Varma

    Hi
    Check the links below
    Workflow automates the steps and activities in a business process according to predefined procedures and rules.
    Workflow presents information and documents to the appropriate knowledge worker or agent (another entity such as a program) to make a decision or perform an activity.
    Workflow tracks each and every step in the process flow and maintains an ongoing status.
    Workflow also collects and reports all of the metrics associated with the execution and completion of the process.
    Check the below links u will get lot of info..
    http://www.sap-press.com/product.cfm?account=&product=H950
    Workflow
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    For examples on WorkFlow...check the below link..
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    Go through the following links on FORK :
    http://help.sap.com/saphelp_nw04/helpdata/en/24/e2283f2bbad036e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/8d/25f1e7454311d189430000e829fbbd/frameset.htm
    http://help.sap.com/saphelp_46c/helpdata/en/c5/e4a930453d11d189430000e829fbbd/content.htm
    http://www.insightcp.com/res_23.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSTART/BCBMTWFMSTART.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMDEMO/BCBMTWFMDEMO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPM/BCBMTWFMPM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    For more reference on workflow: http://****************/Tutorials/Workflow/Workflow.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/04/9277a346f311d189470000e829fbbd/frameset.htm
    Check these links.
    http://www.sapgenie.com/workflow/index.htm
    /people/ginger.gatling/blog/2005/12/01/link-workflow-business-objects-to-your-collaboration-tasks
    http://help.sap.com/saphelp_nw04/helpdata/en/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm
    http://help.sap.com/saphelp_bw33/helpdata/en/92/bc26a6ec2b11d2b4b5006094b9ea0d/content.htm
    http://help.sap.com/saphelp_bw31/helpdata/en/8d/25f94b454311d189430000e829fbbd/content.htm
    http://www.sap-press.com/product.cfm?account=&product=H950
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    Workflow
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    For examples on WorkFlow...check the below link..
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/a5/172437130e0d09e10000009b38f839/frameset.htm
    For examples on WorkFlow...check the below link..
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    Workflow tutorials with step-by-step and with screenshots are available at http://www.****************/Tutorials/Workflow/Workflow.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/42/c14a9b55103116e10000000a1553f7/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c5/e4a930453d11d189430000e829fbbd/frameset.htm
    http://www.sapgenie.com/workflow/
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    http://www.sap-basis-abap.com/wf/sap-business-workflow.htm
    https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2857887
    https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2855919
    https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2735228
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMSTART/BCBMTWFMSTART.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMDEMO/BCBMTWFMDEMO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCBMTWFMPM/BCBMTWFMPM.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    Debug a workflow.
    This has a step by step procedure :
    http://fuller.mit.edu/workflow/debugging.pdf
    www.erpgenie.com/sap/workflow/debugging.htm
    http://www.erpgenie.com/workflow/debugging.htm?2b5de440
    Workflow tutorials with step-by-step and with screenshots are available at
    http://www.****************/Tutorials/Workflow/Workflow.htm
    http://www.sapgenie.com/workflow/
    http://www.sap-img.com/workflow/sap-workflow.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/3d/6a9b3c874da309e10000000a114027/frameset.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PSWFL/PSWFL.pdf
    http://help.sap.com/saphelp_47x200/helpdata/en/4a/dac507002f11d295340000e82dec10/frameset.htm
    http://www.workflowing.com/id18.htm
    http://www.e-workflow.org/
    http://web.mit.edu/sapr3/dev/newdevstand.html
    http://www.sap-basis-abap.com/wf/sap-business-workflow.htm
    https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2857887
    https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2855919
    https://forums.sdn.sap.com/click.jspa?searchID=791580&messageID=2735228
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/WORKFLOW_tutorial.html
    Reward points for useful Answers
    Regards
    Anji

Maybe you are looking for