How to get the tag name into javascript

Hi,
Is there any way to get the tag name into java script when user clicks on.
For eg: if i use netui:anchor tag, how can I pass the tag id to the javascript when user clicks on the link using onClick attribute. This tag id needs to be evaluated at run time.
Ex code is given below.
function fun1(){
// how to get the tag name;
<%
String st="hai";
%>
<netui:anchor action="x" onClick="fun1()" tagId="<%=st%>>
I want to get this tagId (st) to the java script function fun1() when user clicks on this link. How can I do that. can you please help in this issue.
Thanks,
Satish.

Hi,
You can set the java variable as a js variable at run time:
<script>
var anchorName = <%=getNetuiTagName%>;
function fun1()
var anchorID = getNetuiTagName(anchorName);
alert(anchorID);// this will show the rendered ID for the anchor specified
</script>
this works because the jsp variable will be rendered before the js.
Thanks,
Steve

Similar Messages

  • How to get the tag name of HTMLDocument?

    I am now using JEditorPane to display and edit a html file.
    My code is like this:
    kit = new HTMLEditorKit();
    doc = (HTMLDocument) (kit.createDefaultDocument());
    editor.setEditorKit(kit);
    editor.setDocument(doc);
    editor.setContentType("text/html; charset=utf-8");
    editor.getDocument();
    [editor is the class JEditorPane,  doc is HTMLDocument,  kit is HTMLEditorKit]
    When a user clicks on the pane, it's easy to me to get the caret position. However, how can I get the tag?
    For example,
    <p><font class="book">I am a boy.</font> Hello! </p>
    On the pane, the position between "I am a boy" is clicked, I want to get the name of the tag - "font". Moreover, how can I get the class - "book" also?
    Moreover, can I get the <p> tag also?
    Many Thanks!
    Stephen

    Hi Stephen,
    is it possible to get the EditorKit from the EditorPane and then get the ViewFactory for the editor kit.
    Since u have the some tags of the elements hardcoded in the HTMLEditorKit.HTMLFactory it will be handy i guess.
    Let me know whether it helped or not so that either same method be approached or some other has to be tried.
    Cheers,
    Nagaraj

  • How to get the column names of the table into the Dashboard prompt

    how to get the column names of the table into the Dashboard prompt
    Thanks & Regards
    Kishore P

    Hey john,
    My requirement is as follows
    I have created a Rank for Total sales by Region wise i.e RANK(SUM(Dollars By Region)) in a pivot table.
    My pivot table looks like this
    COLUMN SELECTOR: TOTAL US , REGION , DISTRICT , MARKET
    ---------------------------------------------------- JAN 2009          FEB 2009        MAR 2009
    RANK              REGION                  DOLLARS           DOLLARS        DOLLARS DOLLARS
    1 CENTRAL 10 20 30 40
    2 SOUTHERN 10 30 30 70
    3 EASTERN 20 20 20 60
    4 WESTERN 10 20 30 40
    When i select the District in column selector
    Report has to display rank based on Total Sales by District. i.e
    ------------------------------------------------- JAN 2009         FEB 2009       MAR 2009
    RANK             DISTRICT              DOLLARS           DOLLARS        DOLLARS DOLLARS
    for this i need to change the fx of rank i.e RANK(SUM(Dollars By Region)) to RANK(SUM(Dollars By District)) and fx of Region i.e Markets.Region to Markets.District dynamically.
    so , i need to capture column name of the value selected from the column selector and dynamically i need to update the fx 0f RANK & fx of region.
    do you have any solution for this?
    http://rapidshare.com/files/402337112/Presentation1.jpg.html
    Thanks & Regards
    Edited by: Kishore P on Jun 24, 2010 7:24 PM
    Edited by: Kishore P on Jun 24, 2010 7:28 PM

  • How to get the function name/ID  of the current page

    HI,
    I searched the forum and google, but it is not clear on how to get the function name of the current page.
    I have 4 functions in my self service A ,B,C,D (seeded page links ) they all have to go to a page called hhhPG. Based on which function user is clicks I have to show the data in hhhPG.
    so my question is how to get the function name ? I mean I need to know if user click on link A , B, C or D link and came to this page.
    I found below in one forum and also there is getfunctionID in pageContext , but I do not know what to pass to getfunctionid("???") to get value.
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    Or is there a better way of know where user is coming from ? like geturl....
    Please help, I need this ASAP.
    Thank you.

    Use below to find out how the user came into the page
    FunctionSecurity funcSecurity = pageContext.getFunctionSecurity();
    boolean isFunc1 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME1"));
    boolean isFunc2 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME2"));
    boolean isFunc3 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME3"));
    boolean isFunc4 = funcSecurity.testFunction(funcSecurity.getFunction("YOUR_FUNCTION_SHORT_NAME4"));
    So one of them will be true based on the function the user came in.
    Write your logic based on these flags.
    Regards,
    Peddi.

  • How to get the sheet name in a cell?

    I need to dynamically get the sheet name into a series of cells, how do I do this?
    Thank you.

    I don't see a function that does this and the formula based solution I started working on became so convoluted that it was easier to type the name of the sheet into the cell.
    Sorry,
    Terry

  • How to get the ACCOUNTING_FLEXFIELD Name  in a Multi Ledger Instance?

    Hi,
    How to get the <ACCOUNTING_FLEXFIELD> Name in a Multi Ledger Instance from logged-in Responsibility? Is there any profile option available?
    SELECT id_flex_num
    INTO l_structure_num
    FROM apps.fnd_id_flex_structures
    WHERE ID_FLEX_CODE = 'GL#'
    AND ID_FLEX_STRUCTURE_CODE=<ACCOUNTING_FLEXFIELD>;
    Tx

    SMOD->SEUED001->Display componens->double click on EXIT_SAPLEDITOR_002->See the source code...
    function exit_sapleditor_002.
    *"*"Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(PROGRAM) LIKE  SY-REPID
    *"       EXCEPTIONS
    *"              CANCELLED
    include zxseuu22 .
    endfunction.
    PROGRAM is the importing parameter for the function module.
    matt

  • How to get the profile name

    I did not know how to get the profile name in photoshop file using javascript? Kindly help me.

    var myDocProfile = app.activeDocument.colorProfileName;

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How to get the Text name to pass in the  parameter header in save_text

    Hi,
      I am trying to change the long text of operation for historical order by using the flat file.I am using the save_text to do this.I would like to know how  to get the text name in order to pass the parameter header in save_text.
      I went to the tcode iw62 to get the header information of the long text.300100000009200000001
    i would like to know what this 1000000092 indicates and where is this value updated in the table so that i can link it thru the order no  to get the link and pass it in the text_name.
      can anyone help me out?
    krishnan

    Hi,
    Your query is.
    I went to the tcode iw62 to get the header information of the long text.300100000009200000001
    i would like to know what this 1000000092 indicates
    In above number
    300 - Client
    1000000092 - AUFPL - Routing number of operations in the order (You can fetch this from table HIVG)
    00000001 - APLZL - General counter for order ( You can fetch this from table HIVG).
    BR,
    Vijay

  • How to get the specific name of the workset which is currently selected by the user in sap portal 7.0

    Dear Expert,
    I have one requirement like to read the selected workset name in portal by the current user.I have read two documents regarding how to retrieve the PCD contents (iViews, Pages, Worksets and Roles) and its properties like Created by, Changed by, Last changed by and others using PCD API.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/6112ecb7-0a01-0010-ef90-941c70c9e401?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508baf88-9335-2d10-efa6-c6ad61e5fc4b?quicklink=index&overridelayout=true
    But I am not able to understand how to get the specific name of the workset which is currently selected by the user.Can you please help me.
    I am using portal 7.0.
    Thanks & Regards,
    Patralekha

    Hi Expert,
    I found that we can use Interface INavigationHelperService to read Portal Role selected by user at runtime from http://scn.sap.com/thread/52194
    But this class is available in SAP NetWeaver 7.30 Enterprise Portal .
    But in SAP NetWeaver 7.0 Enterprise Portal that interface is not available.
    INavigationService is available there.
    But didn't get any proper discussion on this interface for the same requirement.
    Can you please help me.
    Thanks & Regards,
    Patralekha

  • Get the file name into a Odi variable

    Hi,
    I need to get the file name into odi variable like ..A/ETC/file.txt
    For eg.the filename file.txt should get store in a variable.
    Then i want to compare the file name stored in the variable with some other value.
    Please suggest.
    Thanks.

    in package,
    declare the variable, then evaluate it with another variable, generally using # syntax
    if the variable is date type, suggest to use : syntax, because # will treat the variable value as text value
    in loadplan
    use case when syntax,

  • How to get the VARIANT name in the program

    Hi Guys,
    Can somebody tell me how to get  the VARIANT name in a program.
    I have to perform some code with specific variant only. So I want to check in program which variant has been used to call the program.
    Thanks,

    Hi,
    Variants are stored in table VARI and VARID.
    You can use RS_ALL_VARIANTS_4_1_REPORT to get all the variants for a report program.
    please check out the link below it will be helpful to you
    Re: Programs for a transaction variant
    Hope this helps.
    ashish

  • How to get the role name in which query is published ?

    Hi Experts,
       Is there any table where i can get the name of the role in which a particular query is published. I know that if i have a role , i can check in pfcg giving that role name and in menu tab i can see all the queries published under that role. But if i know query but not role how to get the role name . Is there any table or functon modules or programs to get the information.
    Thanks & Regards
    Vamsi Kiran

    Check this table
    AGR_HIER

  • How to get the field name of an internal table during runtime?

    How to get the field name of an internal table during runtime?

    Hi  Sudhir,
    Declare and Use Get Cursor Field in Your Prm to get the field Name of the Intenal Table
    Example Code:
        <b>  DATA: v_field(60).                        " Insert this code.
         GET CURSOR FIELD v_field.        " Insert this code.</b>
         <b>CHECK v_field = 'ITAB-KUNNR'.    " Insert this code. (or)
    Write: v_field.</b>
    Regards,
    Ramganesan K.

  • How to get the selectOneRadio value in javascript

    Hi,
    I want the selectOneRadio value in javascript. Can anyone give us a solution how to get the selectOneRadio value to javascript from jspx page.
    Thanks,
    Eswari

    Hi,
    I assume you are talking about JDeveloper 10.1.3 in where there is no JavaScript API ADF Faces.Here you will have to use document.getElementById() to access the radio button component (which is a list component). You can look at the generated HTML for how the component and its ID look like.
    However, what is the usecase that you cannot handle in native JSF ?
    Frank

Maybe you are looking for

  • Windows 8.1 Enterprise "update 1" programs not closing

    Since I've applied Update 1 to my Windows 8.1 Enterprise machine, programs and apps do not close. If you Exit or click the X, the window closes. If you open Task Manager, you will see that they are still running. The only way to finish closing them i

  • Event Handling in JTable Custom Cell Renderer

    I have a JLabel as a custom cell Renderer for a column. I want to handle mouse click event for the JLabel rendered in the cell. I tried adding the listener for the label in the custom cell renderer but it is not working. Any ideas how to handle this

  • File sender with content conversion and ignoreRecordsetName

    Him, I have an scenario with a compressed file sender with content conversion. In my sender cc i have: 1     AF_Modules/PayloadZipBean     Local Enterprise Bean     unzip 2     AF_Modules/MessageTransformBean     Local Enterprise Bean     transform 3

  • Photo Size is WAY TOO BIG!

    Once I synch a photo album I created specifically for the iphone I notice the file sizes bloat on the Iphone to literally almost 1mb per photo. I exported my photos using Picasa and resized the .jpg files so they are around 40kb per pic. This means w

  • After changing passwords, my app updates now all require different passwords in order to update.

    Whatever my password was at the time of the app download, it require that same password to update, even though it was since changed. How do I sync them so they all can be updated with the same password?