Using javascript : menutabs/ commandMenuItem has to get selected. How?

I have piece of code in my jspx JSF page as follows
<af:menuTabs id="menuTabs1">
<af:commandMenuItem id="wo1" text="#{msg['menubar.workorder']}" onclick="javascript: getSubMenu('#{msg['menubar.workorder']}');"
action="#{MenuSubMenu.menuButton_Action}" />
<af:commandMenuItem id="ts1" text="#{msg['menubar.troubleshooting']}" onclick="javascript: getSubMenu('#{msg['menubar.troubleshooting']}');"
action="#{MenuSubMenu.menuButton_Action}"/>
</af:menuTabs>
Using java script function i want to make the clicked CommandMenuItem as selected.
i tried like this
if(document.getElementById('tilesView2:menu:menu:menuTabs1:wo1') !=null)
alert("6");
document.getElementById('menuTabs1:wo1').selected = true;
But it is not getting selected.
Need help!!!!!!!!!

Thanks jgkoops.
I agree that the "selected" property is limited to select box options and radio buttons...in normal HTML tags scenario.
But in ADF tags when you see list of attributes of <af:commandMenuItem> we have "selected" as one of those.
As we can call the attributesNames in javascript as document.getElementByID('idName').attributeName = "something";
i.e., document.getElementByID('wo1').style = "some Style";
document.getElementByID('wo1').name = "some Name"
document.getElementByID('wo1').value = "some Value "...etc
the above said are working but
document.getElementByID('wo1').selected="true"; is not working.
Hope you understand my argument.

Similar Messages

  • I need to get my verification code via mobile number but use a different and can't get it, how do I update my number?

    I need to get my verification code via mobile number but use a different number and can't get it, how do I update my new number so that I can get the text message verification code?

    Verification code for two-step verification? If so, you can register a new new number to receive the code via text message by going to https://appleid.apple.com/account/home and click on "Manage Your Apple ID" and then on "Password and Security" and then "Add or Remove Trusted Devices." You will need a verification code in order to log in so if you currently only have one and it is no longer available you will need to use your Recovery Key. More information at: Frequently asked questions about two-step verification for Apple ID - Apple Support

  • I just switched to icloud, and found that one of my email "aliases" that I use all the time has been deleted.  How do I get it back!

    Apple apparently deleted one of my email aliases, and I would like to know how to restore it. Please help.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Used iMac (fall 2006) has no OS.  How to install from flash drive?

    We purchased a used iMac from Notre Dame University.  The hard drive has been completely wiped clean, as is their policy.  We have a USB flash drive with
    Mavericks on it, but when we follow the installation instructions, nothing happens.  We get the icon "OSX BASE", but when we select it, the mac goes
    to a gray screen with a flashing question mark and never moves from there.  Any advice is helpful.

    You will need to call Apple and order a set of replacement disks for your specific iMac Model, or purchase a Snow Leopard DVD.
    "Fall 2006," is not a good enough description, as there were both Mid 2006 and Late 2006 iMac 17" models and a Late 2006 iMac 20" model.
    All of these models shipped with versions of Tiger 10.4, and all are compatible with Snow Leopard 10.6.8. The Late 2006 models can be further upgraded to Lion 10.7.5, provided that they have the minimum 2 Gigs of RAM.
    None of these iMacs would be compatible with Mountain Lion, Mavericks, or Yosemite.
    How to identify your Mac: http://support.apple.com/en-us/HT201634
    How to locate its serial number: http://support.apple.com/en-us/HT201718

  • I have tuch screen ipod and i forget the secret number, I gess and tried more than 5 times by using diffrent number but then it get locked, how to reset the ipod

    I have Tuch screen ipod and I forget the Secret number , I gessed and try to use different numbers but I could not Open it ( O preate) and then it get locked,  and on the screen there is this words ( ipod is locked ,,, contact iTunes ) please help me to solve this problems.

    Do as the maual says and restore.

  • Opening new window without using javascript..

    Hi,
    This is the second time iam posting this question. I didnt get satisfactory answer to my previous post..
    Is there any possibility of displaying a new window on button click using only JSF and without using javascript? if yes please tell me how to do..
    Thanks...

    Yes, with target="_blank" in a link or a form.Thanks for ur valuable suggestion. I changed the button to link.
    Its working fine now without JavaScript.
    Now i got another requirement. When user select some items and press a button in the new popup window, the window must close on button click and the parent window must refresh. This must also be done without using JavaScript.
    Is this possible? Please give me an idea to do this.
    Thanks.

  • Find the startpage of current web using javascript?

    I want to hide a "div" from all startpages/welcomepages. But I cant just compare "start.aspx" and my url parameter cause sometimes the page "start.aspx" isn't there in the url. Is there a way to know if I'm on a "startpage"
    or not using javascript?

    SPWeb has RootFolder which internally has WelcomePage property. You can use that to get this information
    var clientContext = new SP.ClientContext.get_current();
    var spWeb = clientContext.get_web();
    var rootFolder = spWeb.get_rootFolder();
    clientContext.load(rootFolder, 'WelcomePage');
    clientContext.executeQueryAsync(Function.createDelegate(this, onQuerySucceeded), Function.createDelegate(this, onQueryFailed));
    function onQuerySucceeded() {
    alert(rootFolder.get_welcomePage());
    function onQueryFailed(sender, args) {
    alert('error');
    In case of publishing web
    var web = context.get_web();
    var pubWeb = SP.Publishing.PublishingWeb.getPublishingWeb(context, web);
    context.load(pubWeb, 'DefaultPage');

  • How to Read Variable Values in WAD 7.0 Using JavaScript

    I found a how to: How to Read Variable Values in WAD 7.0 Using JavaScript on SDN.
    I get a Javascript error:
    bics.getElementsByTagName is not a function
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    Thats my script:
    function currency()
    var varnm = "SFS_CP_CURR"; // Name of the variable to be read
    root = document.childNodes[0]; // <HTML>
    body = root.getElementsByTagName("BODY")[0]; // <BODY>
    xml = body.getElementsByTagName("XML")[0]; // <XML>
    bics = xml.childNodes[0]; // <BICS_VIEW>
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    varl = vars.getElementsByTagName("VARIABLE"); // gives no. of variable in DP
    for ( i = 0; i <= varl.length; i++ ) // Loop one by one
    vari = vars.getElementsByTagName("VARIABLE")<i>;
    varnam = vari.attributes[0].text; // get variable name
    mem = vari.getElementsByTagName("MEMBER")[0];
    varval = mem.attributes.getNamedItem("name").value; // read variable value
    if (varnam == varnm) //check varname in loop needs to be read
    if (varval == "ZMON") // check for value1 and fire command1
    SFS_CP_M();
    if (varval == "ZKON") // check for value2 and fire command2
    SFS_CP_K();
    break;
    Where's the mistake?

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • Since downloading firefox my computer has been getting infected every day

    Have had this laptop since December 2010. Never had any problem with infiltrations. Everyone said Firefox was better than Internet Explorer. Don't know if it is a coincidence but since I started using Firefox, my computer has been getting infected every day. Have ESET Smart Security 4 and it will clean some of the files but shows error when cleaning others. Is there something I can do?

    ''C:\ProgramData\Java\VerifierNotifier.dll and the threat says a variant of Win32/Kryptik.TGTtrojan (two of these) and one C:\Users\All Users\JavaVerifierNotifier.dll and a variant of Win32Kryptik.TGT.trojan''
    I'm not familiar with those. Can you try a supplemental scanner/cleaner for a second opinion and possible better luck with removal? These two tools are highly regarded:
    Malwarebytes Anti-malware : http://www.malwarebytes.org/products/malwarebytes_free
    SUPERAntiSpyware : http://www.superantispyware.com/

  • External XML using Javascript

    Hi
    By using captivate 5.5, I have created the Glossary using Javascript. But I am unsure on how to 'call' external xml content in a textbox in Captivate 5.5. Please guide me on how to call external xml using javascript.
    And is there any possibility to call "For Loop" javascript in the captivate 5.5. Please advice on how to proceed further.
    Thanks
    Sathish BC

    Explore this:
    http://macrofireball.blogspot.com/2007/07/adding-xml-data-in-adobe-captivate.html

  • How to get page number from the PDF using Javascript

    Hi,
    We are having list of Single page PDF. The pdf are named in the order,
    ISBN_Author_01.PDF  (with real page number as i)
    ISBN_Author_02.PDF  (with real page number as ii)
    ISBN_Author_03.PDF  (with real page number as iii)
    ISBN_Author_04.PDF  (with real page number as 1)
    ISBN_Author_05.PDF  (with real page number as 2)
    ISBN_Author_06.PDF  (with real page number as 3)
    ISBN_Author_nn.PDF  (with real page number as 500)
    Here each pdf has a page number and in sequential order.
    The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
    To do this task, I am writing a Javascript to get the real page number from the PDF.
    Can anybody help me how to get the page number from the PDF using Javascript.
    Thanks,
    Gopal

    The "real" page number within a PDF is the count of the physical page starting at 0, zero.
    pageNum numPages
    The number printed on each page is the page label.
    setPageLabels  getPageLabel
    You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional  array of the file names and the page label for the page within that array.

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • Using Javascript to require 2 drop down menus to have something selected

    Hi everyone. I'm trying to get 2 drop down menus to each have something selected when the form is submitted. I'm using javascript for this, but I can't get it to work. Basically, if one is blank and the other one isn't, I want an error to pop up saying they have to fill in the one that is blank and vice versa. What am I doing wrong? Here's what I have for the javascript and on the form below. My 2 drop down names are Mfg_Spec_Prod_Approval_Initials and Mfg_Spec_Prod_Approval_Rev. Thanks for anyone's help!
    Andy
    <SCRIPT LANGUAGE="JavaScript">
            function verify() {
                var partNumber = '';
                var ecoNumber = '';
                var ProdInit;
                var ProdInitValue='';
                var ProdRev;
                var ProdRevValue='';
                var allArray = document.getElementById('listofids').value.split(",");
                var error=false;
                for(var i=0;i<allArray.length;i++) {
                    ProdRev = document.getElementById('Mfg_Spec_Prod_Approval_Rev'+allArray[i]);
                    ProdInit = document.getElementById('Mfg_Spec_Prod_Approval_Initials'+allArray[i]);
                    ProdRevValue = ProdRev[ProdRev.selectedIndex].value;
                    ProdInitValue = ProdInit[ProdInit.selectedIndex].value;
    <!--- This code is if the BOM Initials is not empty and the PNR Initials is empty.--->
                    if(ProdInitValue != '' && ProdRevValue == '') {
                        error=true;
                        ecoNumber = document.getElementById('ECID'+allArray[i]).value;
                        partNumber = document.getElementById('Part_Number'+allArray[i]).value;
                        alert("You must enter a Rev for ECO " + ecoNumber + " Part Number: " + partNumber);
                    else if(ProdRevValue != '' && ProdInitValue == '') {
                        error=true;
                        ecoNumber = document.getElementById('ECID'+allArray[i]).value;
                        partNumber = document.getElementById('Part_Number'+allArray[i]).value;
                        alert("You must enter your initials for ECO " + ecoNumber + " Part Number: " + partNumber);
                if(error) {
                return false;
            else {
                return true;
        </script>
    Start of form
    <cfform name="EditItem" method="post" action="My_Machining_action.cfm" onsubmit="return verify();">
    <cfset MfgSpecProdInitials = DocumentationSearch.Mfg_Spec_Prod_Initials>
    <td align="center">
    <cfif Mfg_Spec_Prod_Initials Is Not ""<!---  and Mfg_Spec_Prod_Initials EQ cookie.UserInitials --->>
    <select name="Mfg_Spec_Prod_Approval_Initials#ItemID#" id="Mfg_Spec_Prod_Approval_Initials#ItemID#">
    <option value=""></option>
    <cfloop query="ShowProdInitials">
    <option value="#Initials#"
    <cfif #Initials# EQ MfgSpecProdInitials>selected</cfif>>#Initials#</option>
    </cfloop>
    </select>
    <cfelse>
    </cfif>
    </td>
    <cfset MfgSpecProdRev = DocumentationSearch.Mfg_Spec_Prod_Rev>
    <td align="center">
    <cfif Mfg_Spec_Prod_Initials Is Not ""<!---  and Mfg_Spec_Prod_Initials EQ cookie.UserInitials --->>
    <select name="Mfg_Spec_Prod_Approval_Rev#ItemID#" id="Mfg_Spec_Prod_Approval_Rev#ItemID#">
    <option value=""></option>
    <cfloop query="ShowDocRevChoices">
    <option value="#Doc_Rev_Initials#"
    <cfif #Doc_Rev_Initials# EQ MfgSpecProdRev>selected</cfif>>#Doc_Rev_Initials#</option>
    </cfloop>
    </select>
    <cfelse>
    </cfif>
    </td>
    <input type="submit" value="Update">

    Eddie,
       I actually got this javascript below to work so if one drop down is left blank, and the other one is filled out, an error will pop up saying to entering either some initials or a rev. The only problem is that I have a dynamic list of drop downs in rows, so I need this javascript to run for each row. If I do the 1st row with 1 drop down selected and the other not, it gives me the error, which is perfect. But if I want the 2nd row to error out, for instance, doing the same thing, the error will not pop up. How do I make this work so it does this for each row since the list of drop downs is dynamic? My drop down menu names are Mfg_Spec_Prod_Approval_Initials and Mfg_Spec_Prod_Approval_Rev.
    <script type="text/javascript">
                        function verify() {
                            var Mfg_Spec_Prod_Approval_Initials = document.getElementById('Mfg_Spec_Prod_Approval_Initials');
                            var Mfg_Spec_Prod_Approval_Rev = document.getElementById('Mfg_Spec_Prod_Approval_Rev');
                            if(Mfg_Spec_Prod_Approval_Initials.selectedIndex == '' && Mfg_Spec_Prod_Approval_Rev.selectedIndex != '') {
                                alert('select Initials!');
                                return false;
      else if(Mfg_Spec_Prod_Approval_Rev.selectedIndex == '' && Mfg_Spec_Prod_Approval_Initials.selectedIndex != '') {
                                alert('select a Rev!');
                                return false;
                            return true;
                    </script>
    Andy

  • How to get image properties in PDF using javascript or plug ins

    Hi
    How to get the image(all the images) properties in PDF using javascript or suggest plug ins
    Thanks in Advance

    HI,
    In the PDF Edit API's ( as has already been suggested) there is the PDEImage and using this you should be able to find out everything you need to know about any image in a PDF file.
    I would recommend starting with PDEImageGetAttrs
    Hope this helps
    Malcolm

Maybe you are looking for

  • Converting an int to a string

    i want to know how to convert an int to a string . I have tried toString() but it says can't dereference an int. any ideas ???? thanks

  • IPod Nano 6th Gen needs a restore every day...?

    My iPod Nano 6th Gen works well for arond 24 hours but every morning when i wake up it says it needs to be restored using iTuunes. When I restore it, it works perfectly. No problems at all. I can fill it to capacity with music and it works all day. T

  • Date format on form submit

    After setting up the date formats with the developer toolbox, the help instructs you to insert KT_formatDate($row_rsRecordset['name_emp']) into your pages. This works great for displaying data, however I can't find what to do to fix the date format u

  • Characters "fl" or "fi" are not displayed in safari

    My html file contains words as  "fill" or "float". Safari (last version, with Yosemite) displays a dot instead of fi or of fl. Chrome browser or MFF display it without problem. And Safari did it too, I would say one or two years ago. You'll see the p

  • Import Project Structure (Business Blueprint) into Solution Manager

    Hi, we are searching for a way to import a project or process structure from external formats like MS Visio, BPML, XML into Solman SOLAR01. I think there should be a possibility via XML. Anybody knows how to import xml-files into SolMan Blueprint and