Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: issue with document.getElementById in XPages
Feedback Type: Problem
Product Area: Notes Client
Technical Area: Error Message
Platform: Windows
Release: 8.5.1
Reproducible: Always

I have a Edit Box control with Name : "config_value"

I have a button control coded with the following client side java_script in it

<b>var x=document.getElementById('#{java_script:getClientId("config_value")}').value
alert (x);</b>

This alerts what ever I put into the editbox control when I click the button.

But when I split up the same code in the following fashion it fails.

<b>var test='"config_value"';
var x=document.getElementById('#{java_script:getClientId('+test+')}').value
alert (x);</b>

and the same gives me the following error message

The runtime has encountered an unexpected error.
500 Exception
Error while executing JavaScript action expression
Script interpreter error, line=1, col=1: Invalid component name

I have attempted eval() commands as well and it gives me the same error as well

It is mandatory that I should pass the id through a variable as mentioned in the second code fragment.

Please suggest me a work around for this issue

Thanks in Advance

(I have purposely used the word java_script for the sake of this post only.)


Feedback number WEBB838L7D created by ~Lily Churesaplopetsi on 03/04/2010

Status: Open
Comments:

issue with document.getElementById ... (~Lily Churesapl... 4.Mar.10)
. . I thought #{id:<elt name>} was for ... (~James Brewever... 4.Mar.10)
. . . . Re: I thought #{id:<elt name>} was ... (~Lily Churesapl... 5.Mar.10)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS