Question accessing a h:outputText element from Javascript from JSF portlet

I have a <h:outputText element that I'd like to update the value from javascript.
However the element is not found in the form. I can access all the other form elements,
just not <h:outputText elements. Does anyone know how to get around this?
The code is running in a JSF portlet on WLP 10.3.2, Code snippets below:
JSP
<f:view>
<h:form id="updaterForm">
<h:panelGroup layout="block" id="pg_geoWrapper">
<table id="t_geoFields">
<tr><td><h:outputText id="ot_geoStatus" value="Status:"/></td></tr>
</table>
</h:panelGroup>
</h:form>
</f:view>
When a button is clicked the javascript is called
JAVASCRIPT
function displayProperComponents(myForm) {
var statusLabelId = null;
for(i=0; i<myForm.elements.length; i++) {
if (myForm.elements.id.indexOf("ot_geoStatus")>=0){
statusLabelId = myForm.elements[i].id;
if (document.getElementById(statusLabelId) != null){
document.getElementById(statusLabelId).innerHTML = '';

There are more possibilities as well. If you depend it on for example the User's rights/groups, then you can also do for example:
rendered="#{user.admin}" // getter = public boolean isAdmin()
rendered="#{user.groupName == 'admin'}" // getter = public String getGroupName()
rendered="#{user.groupId > 1}" // getter = public int getGroupId()
rendered="#{fn:contains(user.groups, 'admin')}" // getter = public String[] getGroups() or public List<String> getGroups()
etc..I think it's after all just a matter of learning about the capabilities of EL a bit more.

Similar Messages

  • Accessing parent window form elements from a JSP file

    Actually I have a JSP page . It calls a popup function to load another JSP file on the event Onclick of a label. In the JSP file loaded on the popup window, I need to access the form elements of the parent.
    Eg: the Parent has a Textarea named "ta_1" in the form "appl_1".
    Now i cannot access this element in the child JSP page using,
    window.opener.document.ta_1.appl_1.value;
    The window.opener is not defined for this HTML page cos the HTML page was generated as an output of the JSP file.
    Please give a JSP code snippet which accesses the parent form element..

    Actually I have a JSP page . It calls a popup function to load another JSP file on the event Onclick of a label. In the JSP file loaded on the popup window, I need to access the form elements of the parent.
    Eg: the Parent has a Textarea named "ta_1" in the form "appl_1".
    Now i cannot access this element in the child JSP page using,
    window.opener.document.ta_1.appl_1.value;
    The window.opener is not defined for this HTML page cos the HTML page was generated as an output of the JSP file.
    Please give a JSP code snippet which accesses the parent form element..

  • Accessing the Query String parameter from a portlet

    Hi!
    I have developed a PDK portlet in Jdev 10.1.3.3 for Web Center (Just for testing, later it'll go on Oracle Portal 10.1.4). I am trying to access the query string parameter coming in the URL but not successfull at all. Following are the options that I have tried in vain :
    In MyPDkPortletShowPage.jsp with *<passAllUrlParams>true</passAllUrlParams>*
    1.) PortletRenderRequest pReq = (PortletRenderRequest) request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    pReq.getParameter("data");
    2.) request.getParameter("data");
    3.) request.getAttribute("data")
    This makes me ask that is there any other way to access the parameter or is it simply not possible?
    Please suggest!
    Regards,
    Neeraj.

    Hi Neeraj:
    I didn't deal with web center before i am working on Oracle Portal 10.1.4 so if you done that on oracle portal and got the same problem check for this?
    - add the parameter in the page parameter then you will get the value from either preq.getParameter or from request.getParameter,just go to page properties and add a page
    parameter called data
    - did you publish your page containing your portlet as portlet and included it in other page or it is just a page containing this portlet?

  • Accessing a JSF element from a back bean method

    Hi,
    short question, can I access the JSF element from a back bean method?
    So, for example, if I have the following JSF code:
    <h:panelGroup id="test1" rendered="#{bean.someMethod}">...</h:panelGroup>
    <h:panelGroup id="test2" rendered="#{bean.someMethod}">...</h:panelGroup>
    <h:panelGroup id="test3" rendered="#{bean.someMethod}">...</h:panelGroup>
    Can I found out in some way, which element (esp. which ID) calls the someMethod-method?
    Kind regards
    Matthias

    There are more possibilities as well. If you depend it on for example the User's rights/groups, then you can also do for example:
    rendered="#{user.admin}" // getter = public boolean isAdmin()
    rendered="#{user.groupName == 'admin'}" // getter = public String getGroupName()
    rendered="#{user.groupId > 1}" // getter = public int getGroupId()
    rendered="#{fn:contains(user.groups, 'admin')}" // getter = public String[] getGroups() or public List<String> getGroups()
    etc..I think it's after all just a matter of learning about the capabilities of EL a bit more.

  • Hi, I godt 2 Questions: 1) My Adobe PhotoShop Elements 10.0 for MAC cannot read the RAW files taken with the new Canon 7D Mark II camera. 2) My Photoshop Elements has changed from the danish language to german language, how do I put this back ?

    Hi, I godt 2 Questions: 1) My Adobe PhotoShop Elements 10.0 for MAC cannot read the RAW files taken with the new Canon 7D Mark II camera. 2) My Photoshop Elements has changed from the danish language to german language, how do I put this back ?

    You're in the wrong forum.  This is not the Elements forum.
    Here's the link to the forum you want:
    https://forums.adobe.com/community/photoshop_elements/content

  • Accessibility, exclude UI elements from the Tab-chain

    Hi,
    I have a complex UI which is very uncomfortable to access with the Tab key when using sap-accesssibility=true parameter. The main problem are the many transparent containers, which are necessary to create the refined composition of the UI. They get focused when the Tab key is pressed and this is completely useless. I there a way to exclude UI elements from the Tab-chain?
    Best regards,
    Krasimir

    Hi,
    I have same prolem here.
    In my UI I am using mastercolumn for expand /collapse functionality in parent - child node .
    The problem is the keyboard tab-chain is skipping the master column which makes it a accessibility issue.
    Is there any way we can include/exclude UI elements from tab chain.
    My NWDS version is 7.0.10.

  • Javascript create parent xml element from selection

    Hello,
    With help from these forums I finally learned how to script creating a parent xml element from a selection in the Structure Pane.
    var myDoc = app.activeDocument;
    var mySel = app.selection;
    var newParent = myDoc.xmlElements[0].xmlElements.add({markupTag:"c_bullet_list"}).move(LocationOptions.before, mySel[0]);
    var i = mySel.length;
    while(i--){
              mySel[i].move(LocationOptions.AT_BEGINNING, newParent);  
    Hope this helps somebody.

    Use placeXML instead of move().
    var myXMLElementA = app.selection[0];
    var myTextFrameA = app.activeDocument.pages[2].textFrames.add({geometricBounds:[0, 0, 160, 160], contents:" "});
    myXMLElementA.placeXML(myTextFrameA);
    Shonky

  • 3102 question - access from cell phone

    Hello,
    I am thinking about buying a SPA3102 after seeing the comments that you can access it from a cell phone or other landline.
    My wife's family is overseas, and I want to use the free international calling from my Voip provider when she is calling from her cell phone or from her job.
    I want to verify it will work with the following scenario.
    I do not have any PTSN phone service.  I only have voip service. 
    I do have a voip service with unlimited international calling.
    Can I configure one of the ports on the 3102 with my current voip provider, and provision the second port on the 3102 to use another voip service (such as gizmo5 etc..).  My wife would call the gizmo number from her cell phone, enter a pin, and be able to dial internationally via the free international voip service?
    As an alternative, is there anyway of doing this with just the single voip provider (and not worry about the second number)?
    I just switched to my current voip service because ATT canceled CallVantage.  I am not very happy with the service, but I selected it because it was the only one with unlimited calling to South America, and had the ability to dial an access number to call free from a cell phone. 
    I'd rather get a new voip service that has better quality, even if they don't have the cell phone access, if I can get the celll access from the 3102.
    Thanks in advance.
    Solved!
    Go to Solution.

    The SPA3102 doesn't allow voip-to-voip call bridging.  It only allows bridging a voip call with a pstn line (FXO port) call.  You possibly could use the SPA3102 to bridge a call to another voip service if you interface the other service's ata to the FXO port of the SPA3102.  Even if you do that it is not quite optimal and you may have problems.
    Some voip providers do not allow you to configure your own adapter and insist that you use a locked adapter that they provide.  Others do not have this restriction.
    When calling South America with VoIP you can encounter some severe quality problems depending on the voip provider and the provider they use to route and terminate the call.  Day of the week and time of day can also make a significant difference.  This probably has something to do with the bandwidth available to the provider on the long haul to South America.
    One nice advantage of the SPA3102 is that you can setup up to four additional outgoing only providers on the adapter and this allows you to use additional pay-as-you-go (pay per minute) providers and have a choice in calling.
    I would try different providers to sample the voice quality to the destination(s) you are calling to find the right combination of cost vs voice quality.
    Four pay-as-you-go (pay per minute) providers to check out are CallCentric, Future-Nine, CallWithUs, and OneSuite.   Future-Nine and Callwithus have different quality levels (termination routes) that you can specify when you dial.  
    The providers also have "access numbers" that you can call without having to use a pin although some have more numbers than others and with Future-Nine you can also access their "calling card" function thru SipBroker's access numbers. Access numbers are nice because you can use them without actually having a physical voip service.
    With CallCentric you can also get a CallCentric DID (incoming number) and setup your own private incoming number as an access number.  CallCentric also has some South American DID's that you can setup as your own private access number..
    Message Edited by hw on 10-24-2009 04:25 PM

  • Accessing a user array elements in Captivate 6

    Hi guys I have a piece of code that's not working I was hoping someone had any clue as to why, I've wasted too many hours trying to figure this out.  Here's the code, explanation below.
    var objCP = document.Captivate;
    objCP.cpEISetValue("m_VarHandle.questionList", new Array(7));
    objCP.cpEISetValue("m_VarHandle.questionList[0]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[1]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[2]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[3]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[4]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[5]", 2);
    var cat1Len = 0;
    var cat2Len = 0;
    for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){
    var value = objCP.cpEIGetValue("m_VarHandle.questionList[i]");
    if (value == 1)
       {cat1Len++;}
    if (value) == 2)
       {cat2Len++;}
    alert(i);
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]"));
    alert(value);
    I'm attempting to create a list using a captivate variable I've created called "questionList".
    I fill questionList with data and and then use that data to count, in this instance with cat1Len and cat2Len.
    After that I attempt to verify that the data is being returned correctly with a series of alerts.
    Here's the problem:
    alert(i) correctly reports the number my incrementer should be at.
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]")) correctly reports the data in cell [2] of questionList
    but...
    alert(value) reports undefined.  How can this be? I know that I can access array elements from inside this loop and I know that I my incrementer is at the correct location so what's the deal?
    Thanks for any help!

    should be:
    var objCP = document.Captivate;
    objCP.cpEISetValue("m_VarHandle.questionList", new Array(7));
    objCP.cpEISetValue("m_VarHandle.questionList[0]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[1]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[2]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[3]", 2);
    objCP.cpEISetValue("m_VarHandle.questionList[4]", 1);
    objCP.cpEISetValue("m_VarHandle.questionList[5]", 2);
    var cat1Len = 0;
    var cat2Len = 0;
    for (var i=0;i<objCP.cpEIGetValue("m_VarHandle.questionList.length");i++){
    var value = objCP.cpEIGetValue("m_VarHandle.questionList["+i+"]");
    if (value == 1)
       {cat1Len++;}
    if (value) == 2)
       {cat2Len++;}
    alert(i);
    alert(objCP.cpEIGetValue("m_VarHandle.questionList[2]"));
    alert(value);
    i is only defined local to the javascript eval, not a global variable.  You have to pass the value, not the name of the index...
    (I just realized that this question was from 2012, but maybe it might still benefit someone...  I saw it while I was looking for something else)

  • How to create an array in one field and have another field display certain elements from that array?

    I am making a form in Acrobat XI pro.
    In one text field, I created an array of several elements. I want other text fields to display certain elements from that array. For instance, one field should display the 3rd element, another field should display the 13th element, etc.
    The Javascript for making the array is very long, and so I don't want to have to re-calculate the array every single time (in order to reduce rendering time when I open the form on an iPad). This is why I'd like to only have to create the array once, and simply refer to it throughout the form.

    What code are you using to update the array currently? Are you completely rebuiding it when an element changes, or just changing specific elements for certain fields? I'm still not sure what exactly you are trying to do, but something like this in a document level script will create your array:
    var myArray;
    // Call 'updateArray' to initialize array
    updateArray();
    function updateArray() {
         // Code here to create/update array
         myArray = new Array();
         myArray[0] = "Value 1";
         myArray[1] = "Value 2";
         myArray[2] = "Value 3";
    Then, for each field that needs to update this array, you can add a call to 'updateArray()' in the appropriate event. This will rebuild the array completely; if you just want to update specific elements, then you can access them directly.

  • Error when trying to access a secured web service from Forms 10g 10.1.2.3

    Hello,
    I'm trying to access a secured web service from Forms10g 10.1.2.3 but i'm getting the next error when pressing the button the first time:
    java.rmi.RemoteException: ; nested exception is: HTTP transport error: javax.xml.soap.SOAPException:
    java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 401 UnauthorizeWhen i press the button a second time i got this error:
    javax.xml.rpc.soap.SOAPFaultException: The SOAP request is invalid. The required node 'Envelope' is missingThis is the code i have in my button:
    DECLARE
    jo ora_java.jobject;
    pdfObject ora_java.jobject;
    pdf     varchar2(900);
    rv varchar2(100);
    ex ora_java.jobject;
    BEGIN
    JO := SEARCHSOAPCLIENT.new;
    SEARCHSOAPCLIENT.setUsername(JO,'weblogic');
    SEARCHSOAPCLIENT.setPassword(JO,'welcome1');
    pdfObject := SEARCHSOAPCLIENT.quicksearch(JO,'1234',NULL);
    pdf := SEARCHSOAPCLIENT.tostring(pdfObject);
    message(pdf);
    message(' ');
    EXCEPTION
    WHEN ORA_JAVA.JAVA_ERROR then
    message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
    WHEN ORA_JAVA.EXCEPTION_THROWN then
    ex := ORA_JAVA.LAST_EXCEPTION;
    :error := Exception_.toString(ex);
    END;When i run it from JDeveloper it works, this is a portion of java code the proxy web service has:
    import oracle.webservices.transport.ClientTransport;
    import oracle.webservices.OracleStub;
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Stub;
    public class SearchSoapClient {
        private webservicesproxywebcontent.proxy.SearchSoap _port;
        public SearchSoapClient() throws Exception {
            ServiceFactory factory = ServiceFactory.newInstance();
            _port = ((webservicesproxywebcontent.proxy.Search)factory.loadService(webservicesproxywebcontent.proxy.Search.class)).getSearchSoap();
            this.setUsername("weblogic");
            this.setPassword("welcome1");
            System.out.println("callling from _port "+ _port.quickSearch("1234234", null));
         * @param args
        public static void main(String[] args) {
            try {
                webservicesproxywebcontent.proxy.SearchSoapClient myPort = new webservicesproxywebcontent.proxy.SearchSoapClient();
                System.out.println("calling " + myPort.getEndpoint());
            } catch (Exception ex) {
                ex.printStackTrace();
         * delegate all operations to the underlying implementation class.
        public QuickSearchResult quickSearch(String queryText, IdcPropertyList extraProps) throws java.rmi.RemoteException {
            return _port.quickSearch(queryText, extraProps);
        }Also the secured web service was generated from Webcenter Content 11.1.1.6 that is why it's a secured web service.
    Kind Regards
    Carlos

    Without going into any technical discussion about the code, my first question is what JDK version was used to create this which was imported into the form? Understand that Forms 10 runs on JDK 1.4.2, so if you used any newer JDK version, likely there will be problems.

  • How get all child elements from XML

    Hi
    I have one xml i tried to parse that xml using dom parser and i need to get some child elements using java
    <Group>
    <NAME>ABC</NAME>
    <Age>24</AgeC>
    ---------some data here......
    <Group1>
    <group1Category>
    <NAME>ABCTest</NAME>
    <age>27</Age>
    ----Some data here
    <group1subcategory>
    <subcategory>
    <NAME>ABCDEF</NAME>
    <age>28</Age>
    my intention was
    get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    my xml contains any number of Group nodes...but only i want name contains ABC
    i wriiten code like this
    DocumentBuilderFactory factory = DocumentBuilderFactory
    .newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(xmlFile);
    NodeList nodeList = document.getElementsByTagName("*");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    what is next step i need to do..please help

    964749 wrote:
    Sorry for inconvenience caused..i only asked if any ideas i not ask any body to spent time for me...
    This is simple code developed using xpath..i not know how i proceed further
    public class Demo {
    public static void main(String[] args) {
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    try {
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document dDoc = builder.parse("hello.xml");
    XPath xpath = XPathFactory.newInstance().newXPath();
    javax.xml.xpath.XPathExpression expr = xpath.compile("//Group/NAME");
    Object Name= expr.evaluate(dDoc, XPathConstants.STRING);
    System.out.println(Name);
    } catch (Exception e) {
    e.printStackTrace();
    i need get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    ..how i done in XPATH and also do manipulation of remining result...
    i also try with DOM like
    NodeList nodeList = document.getElementsByTagName("GROUP");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    if (element.getNodeName().matches("ECUC-MODULE-DEF"))
    String str=((Element) nodeList.item(i)).getElementsByTagName("NAME").item(0).getFirstChild().getNodeValue();
    if(str.equalsIgnoreCase("abc")){
    NodeList children = element.getChildNodes();
    for (int k = 0; k < children.getLength(); k++) {
    Node child = children.item(k);
    System.out.println("children"+children.getLength());
    if (child.getNodeType() != Node.TEXT_NODE) {
    if(child.getNodeName().equalsIgnoreCase("Group1"))
    how iterate for particular ABC name to group1 and subcategoryFew things
    1. Use code tags to format code
    2. Explain the problem statement clearly. Take time to formulate your question. Explain what you expect from your code and what you are getting along with any exceptions that are being thrown

  • G'day.  I am using iMovie 11 and need to clear disk space.  How can I do that using an external drive, leaving me the option to go back and make changes or access old events or projects from that external drive?

    G'day.  I am using iMovie 11 and need to clear disk space.  How can I do that using an external drive, leaving me the option to go back and make changes or access old events or projects from that external drive?

    The slightly bigger question is whether you want to move all movie content to the external drive (essentially meaning that drive will always need to be attached when you're working with your videos), or whether you just want to archive older videos off to the external drive.
    If you want to move all videos, then just move the 'Movies' folder in your home directory to the external drive, then create an alias of the external 'Movies' back in to your home directory. Now the 'Movies' icon in your home directory will point to the external drive and everything will just work (as long as the external drive is attached when you launch iMovie)
    If you want to archive older movies then each Movie should have its own subdirectory within your Movies folder. These can easily be moved off to the external drive, and moved back should you ever need to work on those movies again.

  • How to completely delete Photoshop Elements from my computer??

    Hi
    I am trying to completely remove Photoshop Elements from my computer.   So far, I have failed in my attempts to do this.   The reason I'm doing this is b/c for some reason that I can't fathom, the folders in My Pictures -- the folders named by shot date -- contain random duplicates.When this happens, the file names folow the convention of DSC_0222 and DSC_0222-1. Exactly the same file size and metadata.  In some folders, every picture is duplicated. In other folders, only selected pitcures within the folder are duplicated.   I can't figure out how they got there -- e.g. it doesn't seem to bear any connection to the photos I've edited, which was one theory I had for a while.   Is Elements responsible? Or is this some sort of bug in the download process from the camera (I have a Nikon D40).  Anyway, I've given up on trying to sovle this problem and decided I would go back to the beginning and reload everything from my camera.   So, my real question here is about how to completely uninstall Elements.
    Here's what I did:    I uninstalled Photoshop Elements through the Add/remove programs utility.  I got no errors during the uninstall process.   Then I completely deleted the My Pictures directory (don't worry -- I have it backed up in multiple places!!).   So, at this point there are *no* pictures on my computer at all.    I reinstall Elements, open it up and -- you guessed it!!! -- the catalog is still there with all the thumbnails of the pictures that i deleted from my hard disk.   Of course, each thumbnail is flagged as "Missing File".
    So, how do I uninstall/reinstall Elements and get it to forget all memory of the previous catalog?   Why is it "remembering" it in this way when the pictures aren't even on the computer anymore?  Isn't this a bug???
    I've been working on this issue for much longer than I care to remember-- if anyone can tell me how to get myself truly back to ground-zero so I can start over I would be deeply grateful.   After upgrading to Elements 9 (from 7) to try to solve this problem I am close to just abandoning Elements entirely.....
    WHile we're at it, if anyone has any idea where the duplicates pictures are coming from and how I prevent that from happening, I'm' all ears!!!!
    Thanks!

    Hi
    Thanks so much for the response.   So, Help/System Info says that the catalog is here:
    Catalog Location: C:\Documents and Settings\All Users\Application Data\Adobe\Elements Organizer\Catalogs\My Catalog\
    but no such file appaers to exist.  In fact, I can only get as far as All Users.   Then there is no directory under that called "Application Data".
    i'm still seeing the thumbnails when I got into Elements tho'....   :-(
    hjr

  • How to include HTML file in JSP using HTML elements or Javascript?

    Hi,
    I have around 15000 static html files one for each item which we display each upon invoking an item.The HTML file should be part of a JSP file.
    Please note that the name of the HTML file is determined dynamically
    Placing all the HTML files within the web application does not give us good performance so i would like to put all of them in the webserver.
    I am not able to include the file in the JSP using the jsp:include attribute if i place the HTML files in the webserver ,
    in order to do that i think should use either HTML element or javascript to include the HTML in the JSP.is there any alternative to <Jsp:include>
    Does anyone have an idea how to include the HTML file and take advan tage of webserver?
    Any ideas are appreciated

    What you need to do is simply read the HTML file from the disk and dump it out to the outputstream. It really is that simple.
    There's no reason you need to include all 15000 files in the actual WAR, you can place those files any place handy that is easy for the application to see (in another directory, or accessible from a file server if you have multiple front ends).
    Then, just write a utiility function that takes the output stream (i.e. the 'out' JSP variable), and the file name, read the file, and write it to the stream.
    If you start noticing performance issues, then you can try doing some caching, but truth is your OS should be doing that for you.
    But, truth be told that's the only practical way to do it.
    Another solution would be to use JavaScriipt and XMLHttpRequest (i.e "AJAX") to load the file at the client side, and simply replace a tag with the results.
    That's also pretty trivial to write, any web site talking about AJAX should give you hint there.
    Of course, that won't work for folks who have JavaScript turned off, or some other incompatible browser, whereas the server side solution obviously works everywhere.

Maybe you are looking for