How access an element using getElementById() without absolute path?

hello,
Currently I'm working on a JSF woodstock project.
I'm trying to acceess the different components used the JSF page inside a javascript by using document.getElementById()
this is a part of code in my JSF file. please have a look on it.
<webuijsf:form id="form1">
                        <webuijsf:panelGroup id="pnlGrpBankListMainContainer" style="left:2px; top:89px; margin-left:1.5%; margin-top:1%; width:50%; position:absolute;">
                            <webuijsf:table augmentTitle="true" title="#{BankList.screenName}" id="table1" paginateButton="true"
                                paginationControls="true" clearSortButton="true" extraActionTopHtml="style='height:35px'">
                                <f:facet name="actionsTop" >
                                    <webuijsf:panelGroup id="grpPnlButtons">
                                        <webuijsf:checkbox binding="#{BankList.chkBoxSelectAllItems}" id="chkBoxSelectAllItems" name="chkBoxSelectAllItems" rendered="#{BankList.renderChkBoxAndImgSeparator}"
                                            selectedValue="selectAllItems" onClick="selectAllTableRows(this,'chkBoxBankListSelectedRowId',5);"/>
                                        <webuijsf:image id="imgSeparator" url="/resources/images/select_image_separator.gif" rendered="#{BankList.renderChkBoxAndImgSeparator}" />
                                        <webuijsf:button id="btnAdd" rendered="#{BankList.renderAddButton}"  text="Add" styleClass="btnStyle" immediate="true"
                                            onClick="return openAdd('#{BankList.requestContextPath}/faces/BankEntry.jsp', 500, 755,'Add  #{BankList.screenIdentifier}', '&action=ADD');"/>
                                        <webuijsf:button id="btnEdit"  rendered="#{BankList.renderEditButton}"  text="Edit" styleClass="btnStyle" disabled="#{BankList.disableEditButton}"
                                            onClick = "return openEdit('#{BankList.requestContextPath}/faces/BankEntry.jsp', 'chkBoxBankListSelectedRowId', 500, 755,'Edit  #{BankList.screenIdentifier}', '&action=EDIT');"/>
                                        <webuijsf:button id="btnDelete"  text="Delete" onClick="return confirmRecordsDelete();"  rendered="#{BankList.renderDeleteButton}"  styleClass="btnStyle" disabled="#{BankList.disableDeleteButton}"/>
                                        <webuijsf:button id="btnExportXls" disabled="#{BankList.disableExcelButton}" rendered="#{BankList.renderXlsButton}"
                                            styleClass="btnStyle #{BankList.excelButtonStyleClass}" style="position:relative; margin-left: 10px"
                                            text="x" onMouseOver="setMouseOverStyle(this);" onMouseOut="setMouseOutStyle(this);"
                                            onClick="return openXlsExport('#{BankList.requestContextPath}/faces/Export.jsp', 'chkBoxBankListSelectedRowId', 'Export  #{BankList.screenName}', '&screenIdentifier=#{BankList.screenIdentifier}');">
                                        </webuijsf:button>
                                    </webuijsf:panelGroup>
                                </f:facet>when i access button element using absolute path like
document.getElementById("form1:pnlGrpBankListMainContainer:table1:grpPnlButtons:btnEdit") it works fine.
But when i try to access it using
document.getElementById("form1:table1:btnEdit") it returns null.
I've common javascrpt functions for all the screens.
so i do not want to change the current javascript functionality nor do i want want to specify complete path for an element.
So is there any way so that i can access the elements without absolute path or any othet solution?
Edited by: sonali_amonkar on Apr 1, 2008 11:17 PM

thanks for your reply mjswallow.
Do you mean that I'll write a new javascript which will accept all the parent elements and inside this method I'lll call the common javascript methods that are present in our project?
but this solution would result in changing the already existing javascript methods that i coded for all screens. right?
that is i do not want to change.
any other solutions you can think of?

Similar Messages

  • How can I start using IPad without first syncing with my computer?

    I'm out of town and just bought a new IPad2.  I don't have my computer with me and won't be able to use it for another 2 weeks.  How can I start using my IPad before syncing with my computer? 

    You must activate it by syncing it to iTunes on a computer. An Apple Store can do it for you - or anybody with a computer that meets the minimum requirements and has iTunes 10.2 on it can activate it for you.
    If you have someone else activate it, bear in mind that when you do finally sync to your computer, iTunes is going to tell you that all content will be erased because you already set it up on another computer with another iTunes library. Your iPad will sync to one iTunes library only. That is way they are designed to perform.
    You CAN transfer any purchases that you make on the iPad to your iTunes library when you perform your first sync with your own computer, however, and I would strongly suggest that you do that when you get the chance.
    If you do set it up with another computer, I would keep the purchases and downloads to a minimum so that keeping all of your data is not a big problem when you finally sync to your own PC.

  • Without absolute path, SAXParser1.4   does not find schemLocation!!!!!

    Hello
    I am validating soap messages according to xsd files with the SAXParser, Java 1.4.
    My xsds include references to other xsd files as following sample shows:
    <xs:include schemaLocation="C:/temp/shiphome.xsd"/>      
    The problem is, how to say the parser where the including files are without working with absolute path to the including xsds!!!?
    The code finds the file as follow:
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", new File(schemaSource));
    Help!!
    Thanks

    Hi,
    well solution seems to be the following (from tomcat-users@...):
    j2ee.jar conflicts with some libraries from the tomcat-engine itsself.
    So my j2ee.jar 1.4 beta is ignored by the tomcat engine.
    I cannot place it in the general lib path, because i do not administrate the box myself.
    Solution for me is now to use the separate mail API (http://java.sun.com/products/javamail/) and javabeans (http://java.sun.com/products/javabeans/glasgow/).
    Hope that others find this helpfull, too.
    Do i get a refund for my J2EE book in my bookshelf, that i cannot use ?
    grml

  • How to access an element using its name or id if it is not a class variable?

    I am trying to retrieve the element I added to my UI in a different  function. I am using actionscript 3. I know I can put the variable into a  class variable, so it can be access anywhere in the class, but I have  too many elements. Is there anyway I could access them without putting  them into class variable?
    Thanks.
    public class Test extends SkinnableContainer{
    // private var image:Image; <-- I try not to do this, too messy
    private function func1() {
        var image:Image = new Image();
        addElement(image);
    private function func2() {
        var image:Image = /* how to get the element from my UI without putting into class variable */

    Here is what works for me:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   creationComplete="init()"
                   minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import spark.components.Image;
                private var  image:Image;
                private function init():void
                    image = new Image();
                    addElement(image);
                    trace(this["image"]);
            ]]>
        </fx:Script>   
    </s:Application>

  • How to send email using u201CSO_DOCUMENT_SEND_API1u201D without attachment.

    Dear Expert,
    I am using the folowing code to get the content of smartform as otfdata :
          CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
            EXPORTING
              formname           = v_formname
            IMPORTING
              fm_name            = v_fm_name
            EXCEPTIONS
              no_form            = 1
              no_function_module = 2
              OTHERS             = 3.
          CALL FUNCTION v_fm_name
            EXPORTING
             control_parameters         = control_parameters
             output_options             = output_options
          orderadm_h = orderadm_h
          activity_h =  activity_h
          status_i = status_i
          working_set_e_s_bbp = working_set_e_s_bbp
          language = l_langu  "sY-LANGU
           IMPORTING
             document_output_info       = document_output_info
             job_output_info            = job_output_info
             job_output_options         = job_output_options
           EXCEPTIONS
             formatting_error           =  1
             internal_error             =  2
             send_error                 =  3
             user_canceled              =  4
             OTHERS                     =  5
    How can I send the data in job_output_info-otfdata in the email body without putting it into attachment?
    I am using the function u201CSO_DOCUMENT_SEND_API1u201D.
    I am sending also a normal text in the email and I want to put the data in the job_output_info-otfdata at the end of the text.
    Thank for very much in advance.
    Best regards
    Ahmed Hadi

    Hi Ahmed,
    I believe this blog will help you:
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417800%29ID1330314450DB01968839116473008128End?blog=/pub/wlg/2273
    Kind regards,
    Garcia

  • How to reformat a used iMac without any restoration disc.

    We were recently giving a used 2007 iMac. It still has all the previous owners settings and applications. How do I reformat the computer to factory settings without any of the disc that came with the computer.

    I don't have experience with 2007 Mac, but with the newer machines and Snow Leopard, you can use any newer version OS X installer
    Actually, if the newer OS was purchased at the app store, then its license is tied to the Apple ID it was purchased with and the license is not transferable, meaning they are running a pirated copy. That also means that the seller is obligated to erase the disk and reinstall the original OS.
    The buyer of such a Mac will never be able to reinstall unless they purchase their own license as Apple's servers will check the machine/Apple ID; in order to do that, they would need Snow Leopard in order to wipe the drive, install SL, and then purchase the newer OS using their own Apple ID.

  • How do i install using bootcamp without lion install disk ?, how do i install using bootcamp without lion install disk ?

    i want to download windows to play windowx games but when i bought my i mac it came with lion on it already so ho do i download windows without the lion disk?

    You need to watch more updated videos. Do as I suggested earlier and read the documentation. All is explained including how you download the drivers. The video you were watching must be a few years old and well out of date.
    http://support.apple.com/kb/index?page=answerlink&url=http%3A%2F%2Fmanuals.info. apple.com%2Fen_US%2Fboot_camp_install-setup_10.7.pdf&answerid=16777218&src=suppo rt_site.manuals.search
    Boot Camp - Installation & Setup Guide (OS X Lion)
    Boot Camp 4.0, OS X Lion: Frequently asked questions
    Boot Camp Support
    Boot Camp: Windows 7 installation frequently asked questions

  • How to delete element using XmlCursor

    Hi
    I am using XMLBeans for bidirectional binding (XML to Java and after user updates
    back to XML).
    I do not want to use a direct setter (e.g. doc.setAccount (account)) because I
    am developing a framework and I need to provide an API to the callers. It would
    have helped if the setters accepted XmlObject, then I could use polymorphism.
    But that is a different topic.
    Hence, I have tried to use cursors. I have my cursor advance to an element. I
    do not find a method in the Javadoc to delete the element (so that I can replace
    it with the updated XML). I tried the method remove, but got an error that read
    "java.lang.IllegalStateException: Can't remove this". Does not tell why (reminded
    me of MC Hammer).
    Can someone tell me what method I can use to delete or update the element being
    pointed by the cursor ?
    Thus if Account is a complex Type, I would like to update just the Account element
    (and all the elements it contains). The rest of the doc should remain the same.
    Thanks

    Remove is the correct function to call on the cursor. If the current token is
    a start token, then the remove should work. You will get such a message if the
    current token is s startdoc, enddoc or end.
    "Shashi Garje" <[email protected]> wrote:
    >
    Hi
    I am using XMLBeans for bidirectional binding (XML to Java and after
    user updates
    back to XML).
    I do not want to use a direct setter (e.g. doc.setAccount (account))
    because I
    am developing a framework and I need to provide an API to the callers.
    It would
    have helped if the setters accepted XmlObject, then I could use polymorphism.
    But that is a different topic.
    Hence, I have tried to use cursors. I have my cursor advance to an element.
    I
    do not find a method in the Javadoc to delete the element (so that I
    can replace
    it with the updated XML). I tried the method remove, but got an error
    that read
    "java.lang.IllegalStateException: Can't remove this". Does not tell why
    (reminded
    me of MC Hammer).
    Can someone tell me what method I can use to delete or update the element
    being
    pointed by the cursor ?
    Thus if Account is a complex Type, I would like to update just the Account
    element
    (and all the elements it contains). The rest of the doc should remain
    the same.
    Thanks

  • How can I re use titles without effecting the original title?

    Im new to Premiere pro CS5  was originaly an Avid user and I'm currently working on a sequence  where i use a lot of titles for lower thirds and I have added keyframes to the titles to animate them in and out of the screen ,  in avid instead of recreating titles every time, i copy and paste the title and just change the name of the title but in Premiere everytime i change the title it changes all of the the titles from where i copied it from. do i always have to recreate titles in premiere pro or is there a way i can re use an existing title copy and paste it  without effecting the original title? help.

    Open up the original title and click on the 'New Title Based on Current Title' button (A film frame with a T in it). This will then ask you to give it a new name. If you have effects on your first title just copy it and 'Paste Attributes' to the new title.
    Richard Knight

  • MDT Application - Running a batch file and copy file locally without absolute path??

    I have an application defined in MDT along with its respective files. One of these files is an install and needs to be run locally. How do I copy this file locally then have it run? I've used a fair amount of batch scripts so I opted for that, but every
    batch script I get (even empty ones or one with just an exit) returns code 1. If I enter in cmd /c directly in the command line with the commands separated by && it would not work either.
    I DO not want to hardcode any IP into this which is why this is so hard. Is there no way to do this easily without a full \\IPADDY\Share?

    You could make a self extracting EXE with WinZip, and then do something like..  (You would create an application with source files to do this, with the below code being your 'install.bat')
    @echo off
    xcopy "AppFiles.exe" %WINDIR%\Temp
    %WINDIR%\Temp\AppFiles.exe
    %WINDIR%\Temp\AppFiles\Install.exe
    RMDIR /S /Q %WINDIR%\Temp\AppFiles
    If you monitor the install and your satisfied its working correctly, you can modify the success return codes under the 'Option' tab, or just check the box 'Continue on Error' to keep the build rolling after this install is complete.  Additionally, you
    may find this works better as VBS script.

  • How can I embed a video with absolute path into a PDF

    I'm having some difficulties in embedding a video into a pdf; I followed the instructions to embed it properly, but the path points to my personal computer , so that the video will be available only on the computer I used to embed the document.
    Any suggestion? Can I modify the path directly? The PDF is supposed to be linked to another interactive PDF and to work both online and offline.
    Thanks!

    Thanks for the reply. I tested the file on other computers, though, and it doesn't open the video on any computer but mine (mine: the one I used to embed the video).
    Am I doing something wrong? I'm using Acrobat X and the procedure I'm following is: Multimedia/Add Video/Choose file
    I searched for manuals online and I saw that some of them were checking the box "embed file", but I don't have that choice..
    Maybe I'm supposed to use another version of acrobat?

  • How to Dynamically Load jvm.dll without setting PATH

    Please help, invoking CreateJavaVM via a function pointer is returning -3, but I'm not sure why.
    When my PATH is setup up to include the jvm.dll and I invoke JNI_CreateJavaVM() directly, it works fine. But I want it to work regardless of my PATH setting, so I am trying to use LoadLibrary and dynamically load the jvm.dll and then a function pointer to invoke CreateJavaVM().
    The LoadLibrary returns non-NULL result, the GetProcAccress() returns non-null, but when I invoke the pointer to the CreateJavaVM call, it returns -3. I know -3 is JNI_EVERSION error, but any ideas what is wrong with the code below, such that it would give me this error?
    Currently my code is as follows:
    typedef jint (JNICALL CreateJavaVM_t)(JavaVM **pvm, void **env, void *args);
    JavaVM *m_jvm;
    JNIEnv *m_env;
    SetDllDirectory(L"C:\\Program Files\\Java\\jdk1.6.0_20\\jre\\bin\\client");
    HINSTANCE hVM = LoadLibrary(L"jvm.dll");
    if ( hVM == NULL ) {
       // report error
    CreateJavaVM_t *pfnCreateJavaVM = (CreateJavaVM_t*)GetProcAddress(hVM, "JNI_CreateJavaVM");
    #ifdef JNI_VERSION_1_6
    char cpChars[1024] = {0};
    sprintf_s(cpChars, "-Djava.class.path=%s", classPath); // classpath is defined elsewhere
    JavaVMOption options[1];
    options[0].optionString = cpChars;
    JavaVMInitArgs vm_args;
    vm_args.version = JNI_VERSION_1_6;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    pin_ptr<JNIEnv*> env = &m_env;
    pin_ptr<JavaVM*> jvm = &m_jvm;
    int result = pfnCreateJavaVM(jvm, (void**)env, &vm_args);
    // This is where the failure occurs. result is -3 for some reason here...why?For some reason, pfnCreateJavaVM is returning -3, but I'm not sure why? Any ideas what is wrong with this code, such that it would give me a -3?
    Thanks in advance,
    Bill

    wkoscho wrote:
    For some reason, pfnCreateJavaVM is returning -3, but I'm not sure why? Any ideas what is wrong with this code, such that it would give me a -3?As an experiment try using a different jvm.dll from a different location. From my box there are several different jvm.dll under my jdk install dir.

  • Hide subform without absolute path.

    Hi All,
    I have a form design with several subforms, I get the a $ separated subform names list in a hidden field which I need to hide them. I had the below recursive function. But if for example there are 100 subforms and I have 5 subforms to hide it runs 500 times.
    if somebody can help me with a simple method if any which does this work and is more efficient.
    var lv_sflist = form1.ParentX.SFLIST.rawValue;
         lv_sflist = lv_sflist.toUpperCase();
         lv_sflistArray = lv_sflist.split("$");
    for(var i=0; i<lv_sflistArray.length; i++){
         ProcessAllFields(this,lv_sflistArray<i>);
    function ProcessAllFields(oparent,osubform)
         if (oparent.className == "subform")
              if(oparent.getAttribute("name").toUpperCase() == osubform){
                   oparent.presence = "hidden";
              }else{
                     for (var i = 0; i < oparent.nodes.length; i++)
                           var oChildNode = oparent.nodes.item(i);
                           ProcessAllFields(oChildNode,osubform);
    Thanks in Advance,
    cheers,
    sai

    Hi Sai,
    You can create a blog of that if you feel it can be usefull for someone. Anyways it will be reviewed by SDN experts and will be published only after their approval.
    Just explain using comments for every piece of code. If it will be well explained, for sure it will be published.
    Regards,
    Vaibhav.

  • Is there any way to create a HTTP_AAE Receiver without a path in NW PO 7.31

    Hi ,
    Does anyone know how to create a HTTP_AAE Receiver without a path??
    We are in a phase of migrating Interfaces from PI 7.1 to PO 7.31(Java Only).
    For one of the Interface in PI 7.1 there is a RFC Destination for vendor communication through HTTPS connectivity  :
    TargetHost: IP Address
    Post: value
    Path Prefix: Blank
    During migration  requirment is to keep the Path field BLANK of the Communication Channel,however since  PO has mandatory path field   a "/" is been provided, because of which data post fails.
    PI:  https://IP:9443
    PO:  https://IP:9443/  (Since Path Prefix is mandatory)
    As per my understanding The data is supposted to be posted directly to the IP (https://IP:9443) however it is getting posted to (https://IP:9443/) where the service is not available. For Reference attached relevant screenshots.
    Is there any way to  create a HTTP_AAE Receiver without a path. Need ardent support and suggestions
    regarding this.
    Regards
    Riju

    Hi,
    For Service auto- PO from PR, you need to activate Automatic Purchase order creation for Service requisitions in ML91 t.code.
    Note:
    For material :automatic PO creation from PR, follow the steps.
    1) Material Master purchasing view tick automatic PO check box
    2) Vendor Master purchasing view tick automatic PO check box.
    3) Maintain Source list for Vendor & Material.(ME01)
    4) Maintain Purchase Info Record.(ME11)
    5) Create a Purchase Requisition.(ME51)
    6) Use T.Code: ME59 & execute for PR for vendor, you will be able to create automatic PO.
    During creation of PR , select check box of Source Determination in the 1st screen of ME51
    Ensure that Purchase Info Record should be there.
    If you have more than one vendor then fixes only one vendor in source list.
    Regards,
    Biju K

  • HT1918 Created an apple I'd using a wrong e-mail address. Can't access the e-mail to varify the Apple ID in order to be able to change the account settings. Any idea how can change the account information without having to varify the account through the e

    Created an apple I'd using a wrong e-mail address. Can't access the e-mail to varify the Apple ID in order to be able to change the account settings. Any idea how can change the account information without having to varify the account through the e-mail?

    You are trying to find a loophole to circumvent a basic rule that prohibits the transfer of purchased content from one Apple ID to another.
    Content tied to an Apple ID are bound to that Apple ID forever. You can not merge or trade accounts. Well, not (officially) anyway...

Maybe you are looking for

  • Windows and Mac with same iPod

    I have an iPod I have been using for over a year on my Mac with iTunes. I wanted to be able to connect it to my girlfriends PC so she can use it when she is working on her 'puter. She downloaded iTunes, then the iPod software from the Apple site, ins

  • Regarding Reporting

    hello, Please tell me the t.codes in FI to see the trial balance , Ageing report for customer and vendor, P&l a/c and b/s point will be given

  • PPTP doesn't work on 10.4.6 Intel?

    I'm having issues connecting to PPTP servers. No matter what PPTP server, my connections get to the "negotiating" portion and then stall. The message upon failure is: Could not negotiate a connection with the remote PPP server. Please verify your set

  • DV4170US - new battery not charging

    My first battery had progressively shorter battery life, so I replaced it with an after-market battery.  That worked for over a year.  Then, it wouldn't charge.  I was able to use the laptop with the charger attached, but the battery would not charge

  • Available space in iMovie HD

    At the bottom right hand corner of iMovie HD is a little box telling you how many GBs of space you have left. To the right of this is a little trash icon telling you how much you have in the trash. The GBs of space I have left is getting smaller and