Javascript to check only one of the two checkboxes in JSF

Hi,
I have this working in HTML, but when trying to simulate the same in JSF, I get error.
<input id="checkbox1" type="checkbox" onClick="selecionatudo(true,1)"/>
<input id="checkbox1" type="checkbox" onClick="selecionatudo(true,2)"/>
Javascript
function selecionatudo(check,n) {
var frm = document.getElementById('form1');
for (i=0;i<2;i++) {
if (check) {
frm.checkbox1.checked=false;
frm.checkbox1[n-1].checked=true;
JSF checkboxes
A<h:selectBooleanCheckbox id="checkbox1" onclick="selecionatudo(true,1)"/></h:selectBooleanCheckbox>
B<h:selectBooleanCheckbox id="checkbox2" onclick="selecionatudo(true,2)"/></h:selectBooleanCheckbox>
Since in <h:selectBooleanCheckbox I cannot use the id attribute which can hold duplicate values, I get an error, using the above method.
Also, <h:selectBooleanCheckbox cannot have a name attribute .(having which, I can use the above Javascript to work)
Please help me.

Hi!
I think that:
If you have pairs of checkboxes to make actions, you can try to set id in Jsf like this " checkBoxA1" and "checkBoxA2".
Then in JavaScript, you can get de string "checkBoxA" and build the two id's, adding and "1" and "2".
Later, you can do that you want.
But, I think that in JavaScript across Jsf, you can't use "frm.checkbox1", i think that you must use: "document.getElementById("checkbox1").
I'm a starter in Jsf and very bad with English, but I hope that it help you!
Regards!

Similar Messages

  • HT1657 Why is only one of the two movies I've payed for from iTunes store refusing to download onto my iTouch 4 gen?

    I payed for two movies through iTunes store on my computer, after they were ready to be transfered to the iTouch from my
    rental library, only one successfully went through. The other film completely disregarded the attempt to show even a 'loading' bar.

    no, i had to leave so i logged out and when i opened itunes on my mac and went into the downloads tab it only had one paused download listed. i resumed the download for the one movie listed and the other one never showed up. its been about two weeks since i initially bought the two movies so i figured something was wrong.

  • Report with two Command is empty if one of the two commands returns no data

    Hi all,
    I have a report with two Commands not linked together.
    If ONLY one of the two Commands returns no data, the full report is empty (although the other Command returns data).
    I'm using Crystal Report 2008 and the CRJ 12.2.205
    Have an idea?

    Hi Ted,
    how can I solve the problem, please? It is important.
    If I can help yourself, the problem is appeared in many reports since I updated the library (the old library version 11.8.4.1094 works fine with all). I'm waiting for your answer, please.
    Thank you very much.

  • ZFS mirror on root, one of the two devices appears offline

    Hello everybody,
    I'm a new Archlinux user. I've managed to install it on a pool (called RAID1) composed of two LUKS encrypted devices (/dev/mapper/HD3 and /dev/mapper/HD10).
    This is the pool:
    # zpool status
    pool: RAID1
    state: ONLINE
    scan: resilvered 11.4M in 0h0m with 0 errors on Mon Jan 13 07:41:13 2014
    config:
    NAME STATE READ WRITE CKSUM
    RAID1 ONLINE 0 0 0
    mirror-0 ONLINE 0 0 0
    HD10 ONLINE 0 0 0
    HD3 ONLINE 0 0 0
    errors: No known data errors
    I wrote a custom hook, run before the zfs hook, which opens a small (5MB) LUKS image (/etc/keys.img) asking for its key, and mounts it under /keys. Then, for each device in /etc/earlycrypttab, it opens the device taking the respective keyfile from /keys.
    Here is the code, if it could help debug the problem. Feel free to use it, if it might be useful to you. Sorry if it's not too good.
    http://pastebin.com/PAbaTUcq   /etc/earlycrypttab
    http://pastebin.com/JULEdHx9   /usr/lib/initcpio/hooks/customcrypt
    http://pastebin.com/Ew44anvY   /usr/lib/initcpio/install/customcrypt
    Now, the problem is this: for some reason, after booting, HD3 is shown as offline and the pool is shown as DEGRADED. /dev/mapper/HD3 is open and working, though. Running a simple
    # zpool online RAID1 HD3
    fixes the pool.
    I know for sure that after the customcrypt hook is run, that LUKS device is open. I've managed to get into ash just after the customcrypt hook, and the LUKS device is open, but
    # zpool list
    keeps saying that HD3 is offline.
    Anyway, if (still inside ash, after the customcrypt hook and before the zfs hook) I run
    # zpool export RAID1
    # zpool import
    zpool finds both devices as online.
    I first thought it could be a problem of the /etc/zfs/zpool.cache file. I tried recreating it and recreating the initram (with mkinitcpio -p linux), but still no luck.
    Do you have any idea about what could be the problem?
    Thank you very much for your time!

    @stefa : Did you get any resolution on this?  I ran into the exact same problem two days ago and I can't seem to find the "right" fix.  I'm using a zfs mirror on top of luks and figured it was due to the luks device not being online but after reading your post... I'm not so sure.
    Post boot I'm able to offline the missing device and online it without issue.  My only concern is why isn't this coming up with both disks at the time of import and will it boot if the offline drive is the only one of the two active at the time of boot?  I setup the mirror so I could have a drive fail and still boot...
    @esko: I've got zfs set to auto-mount and the mount points are all working properly.

  • Imessage on my iMac has created two iMessage account both asking for Apple ID....and no option to - (delete) one of the two duplicate accounts....how can I delete one of them it just bothers me due to sign in issues....goes inactive when signed in on othe

    imessage on my iMac has created two iMessage account both asking for Apple ID....and no option to - (delete) one of the two duplicate accounts....how can I delete one of them it just bothers me due to sign in issues....when signed into one it signs out the other and goes inactive I just wanted to delete one of them so this issue doesn't happen....why doesn't it give the option to delete ONLY these two accounts

    1. Don't confuse "Apple ID" with iTunes Account ID.  You can have many Apple IDs but only one iTunes account active at a time.
    2. If you "changed" your iTunes account ID, you actually have 2 accounts - one under the old name plus the new name.
    3. You can't merge the accounts - they remain separate.  Apps purcahsed under the old account name will update ONLY WHEN THE PHONE IS SIGNED IN TO THE OLD ACCOUNT NAME  and visa versa.
    4. Likewise, you can sync only the apps, music, media purchased under the account the phone AND iTunes are signed in to.

  • Spry menu bar -- only one of the submenus of a drop down set works.

    I created a spry drop-down menu bar for navigation within my site for a special event (on October 19). Most items have only one filie (e.g., tickets) but some of the items (e.g., Historic Homes) have up to 8 sub-items.
    I renamed the spry file. I defined all my menu and sub menu items using the dialog box. I styled the bar for both basic state and "hover."
    So far, so good.
    I then created multiple new pages by using "Save As" (the original menu bar file)-- substituting appropriate text to to make the additional item and sub item files.
    But when I link it all up and test it, only ONE of the submenus work. The menu disappears from the other sub menu pages when I navigate to them. Users can't get back to the original menu choices..
    This is the first time with a Spry Menu bar.
    Can you help?
    Susan

    Without seeing your code, I'm guessing your lists and sub-lists are not properly coded. Check your HTML & CSS with the validation tools below:
    Code validation tools
    CSS - http://jigsaw.w3.org/css-validator/
    HTML - http://validator.w3.org/
    Nancy O.

  • Qosmio X300 - One of the two fans rattles abnormally

    This started about two weeks ago.
    One of the two fans under the laptop rattles abnormally. If I tilt the laptop for a while the rattling stops... but it's embarassing in the very least to have to do that on such an advanced laptop.
    Sometimes the rattling stops when the fan's been running a while...
    So anyone else had this issue? I've got next business day on-site support but would need to take a day off work if I want them to come out so am tryin to avoid that.
    Aanyone had the issue? If so how was it addressed?

    right... Toshiba sent someone out today.... and guess what... Toshiba managed to mess the whole thing up!
    The way support works (well my understanding of ti following the disaster today) is as follows:
    1) customer logs call with Toshiba
    2) Toshiba order parts necessary and contact a support company that is not actually a part of Toshiba, but is contracted to carry out support
    3) support company replaces parts as necessary
    so, i 1) called Toshiba they told me they'd send someone over with 2 cooling fans, 2) they ordered two thermal conductors for the graphics boards (NOT FANS, JUST THE METAL PLATES!!!), 3) support guy came, when i told him what the problem was he was surprised Toshiba gave him thermal conductors and not fans. so we called Toshiba and logged a new call
    i had to call Toshiba and log a new call... however, i insisted the operator note in the call records that this is the second time i am calling for the same issue as the first time they gave the poor support guy the wrong parts. now my contract only supports next business day on site visit.... as it's not practical for me to take this laptop with me to work i took a day off to be at home.....
    Now that means i'll have to do it again,... so i think, hang on, Toshiba offer 24/7 on site support, so i'll ask them if, as it was their fault, they'll send someone over the weekend. "it's not within our power to do that" toshiba said "you'll have to contact the engineers company and ask them if they'll do it"... i didn't make the mistake, why should i ask?
    The engineer didn't make the mistake, so why should his company have to be generous and give me a free day on site on a weekend?
    Toshiba made the mistake, they should pay the engineers company to have him back on a weekend.
    that is what i shall be arguing on the phone tomorrow (to Toshiba and not the engineering company) when the engineer calls up and no doubt says Toshiba are only paying for me to have a monday to friday service.
    A customer should not have to worry about who Toshiba award their contracts to.
    Oh, and on the matter of the fans themselves, the engineer took them out, he could find nothing inside... i tapped the fans and am very sure one of them is a lil loose although the engineer didn't think tha should be causing the level of noise he heard. however, he stood there and did hear the awful noice it was making, as if repeatedly scraping against something as the blades rushed past.
    So... more updates as soon as possible... but Toshiba really screwed this one up and it's cost me a day of my annual leave... thanks Toshiba.

  • Design Problem : How to design/code a java client which is deployed to all the machines in a cluster and make sure that only one of the java client is active

              hi ,
              I have to design a java client (which is basically a JMS message listener)which
              is deplloyed to all the servers in the cluster. But as these are message listeners,
              i want only one of the instance to be active at a time.
              If the server on which the client is active goes down , I want the second server
              to start listening to messages.
              How do i design this ? Also is there a public api for multicasting that we can
              use ?
              Anybody has an idea on how to go about this..
              Thanks
              nisha
              

    Hi Nisha,
              Failover message listeners? Sounds like you want MDBs, which are deployed on all nodes in a
              cluster. If your JMS destination is a queue, then only one MDB will pick up the message. And just
              like any other ejb service, MDBs failover.
              Gene
              "Nisha" <[email protected]> wrote in message news:[email protected]..
              hi ,
              I have to design a java client (which is basically a JMS message listener)which
              is deplloyed to all the servers in the cluster. But as these are message listeners,
              i want only one of the instance to be active at a time.
              If the server on which the client is active goes down , I want the second server
              to start listening to messages.
              How do i design this ? Also is there a public api for multicasting that we can
              use ?
              Anybody has an idea on how to go about this..
              Thanks
              nisha
              

  • Can't sign in to iMessage and Facetime with my Apple ID, only one or the other

    I have an iPhone 5 running iOS 6.1.2 on AT&T.
    I've noticed I am unable to use my Apple ID for both Facetime and  iMessage; if I am signed in to one of them, I'm unable to sign in to the  other. I get in a loop of the phone repeatedly popping up a password  entry screen for the Apple ID.
    If I cancel the process and sign out of either, I can successfully sign  in to the other. But no matter which I sign into first, I cannot sign in  to both at the same time. >__< It's working fine on my other iDevices (iPad 1, iPhone 4), this is the only one having the issue. The issue has been happening since my purchase of the iPhone 5 last year.
    Any ideas on a fix? It's driving me nuts. I've even just restored my phone and still receiving the exact same issue. Thanks in advance for any help as I am at a loss. ;(

    I THINK I might have found out a fix. First, I went in and signed into iMessages, but left Facetime logged out. I then went in Settings and turned off FaceTime altoghter. Afterwards I went to ensure iMessages was still signed in (Paranoia perhaps lol). Then I went back in and re-enabled FaceTime. The information was inserted back in, but Caller ID for Facetime was unchecked, so I selected my email address instead of phone. And both have oddly been working fine and stayed signed in since. No password requests at all.
    I have zero clue why this works, but it does. I only figured it out thanks to obcessive behavoir and inablilty to accept it was broken lol. Anyone else with the issue want to confirm if it works for them as well?

  • I had made a copy of the main revel file on my mac, and then i put it in my google drive folder for safety. I accidentally deleted one of the two libraries form my iPhone. I opened it up and panicked and thankfully I guess I had a backup of the other libr

    I had made a copy of the main revel file on my mac, and then i put it in my google drive folder for safety. I accidentally deleted one of the two libraries form my iPhone. I opened it up and panicked and thankfully I guess I had a backup of the other library in my spouses phone... but mine is still gone. I don't have them saved to my computer... the pictures are important and I really really need them back.  Is there a way for me to get the pictures back from what I believed at the time was a smart way to backup when i made a duplicate of that main mac file to my google drive? The best way to let me know is my email... [email protected]  I am really relying on you guys if there is a way?

    Hi meghage,
    From your code, it is a WebForm project.
    This forum is to discuss problems of Windows Forms. Your question is not related to the topic of this forum.
    You can consider posting it in asp.net forum for supports . Thanks.
    ASP.NET: http://forums.asp.net
    Regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Deactivating one of the two registration with Photoshop Elements 8

    My old computer has been cleared from all programs and the system. I'd like to use the Adobe Photoshop Elemets 8 product on my new computer, but I need the one of the two registration of the product cleared to be able to use it. I can not deactivate from my Dell computer as it has been already cleared. Please help me to solve the problem.
    Best regards
    Adam Tertak

    Contact Support to reset the activation count

  • How to use Mulitple DAQs with a single triggered event on only one of the DAQs

    I have three PXI6115 and would like to tie all these to a single triggered event on one of the DAQs. I've scaned the examples and any assistance would be greatly appreciated....

    TCjr,
    Please refer to your other post:
    How to use Multiple DAQs with a single triggered event on only one of the DAQs

  • At home I have two wifi networks , I try to use one of them depending on their strength of signal, can I not save  both their passwords on Apple TV , so that I can switch to one of the two wifi networks as required

    At home I have two wifi networks , I try to use one of them depending on their strength of signal, can I not save  both their passwords on Apple TV , so that I can switch to one of the two wifi networks as required
    Also the passwords are long and cumbersome to type every time on the apple  TV remote, what is the alternative if I cannot store them on the memory of the Apple TV

    Is it possible that you are using the same password for the old O2 Study and newer O2 Apple Base Station networks?
    If so, Keychain Access is storing the old information about the old network and may be associating it with your AirPort Extreme settings based on the BSSID that William has mentioned.
    If that's the case, open Macintosh HD > Applications > Utilities > KeyChain Access and look for a listing with the old network name. Delete this entry. You may need to power down both the computer and the AirPort Extreme and restart them.

  • If Firefox 5 is not compatible with Avast... what am I supossed to do? Choose one of the two or what?

    With Firefox 5 freshly installed I learn it's not compatible with Avast! What do I do now? Do I choose '''''one of the two''''' or what?

    Hi Amarillo,
    There are a few different toolbars and plugins which are not yet compatible with Firefox 5 including Google, avast and AVG ([http://www.canadiancontent.net/commtr/firefox-rather-soon-released_1093.html source]). I bet it's going to take a day or two for updates to be released.

  • Dimension which belongs to only one of the several fact tables

    Hi,
    I'm newbie in BI. I have good knowledge of DW and Administration (OCP).
    Firstly could you give me, please some link expalining aspects of creating "Business Model And Mapping" better than SE Tutoarial.
    Now how my problems looks like :
    I have several fact tables and dimensions.
    But not all dimensions are shared among all facts.
    So when i try to put in Answers measurements from all facts it's ok - results are retrieved.
    But when i try to add to report some Dimensions attributes which belongs to only one of the facts all facts measurements are gone except measurements for fact table to which dimension attribute is linked to.
    I think i know what is the reason but i don't know how to simply solve it :
    Below is session trace excerpt only with facts measurements :
    RqList
    Liczba Transakcji:[DAggr(Fakty - Transakcje (ZSFK).Liczba Transakcji by [ Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c7 GB,
    Kwota Opłaty Netto:[DAggr(Fakty - Opłaty za Terminale (CBD).Kwota Opłaty Netto by [ Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c11 GB,
    Below iis session trace excerpt with facts measurements and added dimension attribute:
    RqList
    Liczba Transakcji:[DAggr(Fakty - Transakcje (ZSFK).Liczba Transakcji by [ Słownik - Rodzaje Walut.KOD_WALUTY, Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c7 GB,
    Kwota Opłaty Netto:[DAggr(Fakty - Opłaty za Terminale (CBD).Kwota Opłaty Netto by [ Słownik - Rodzaje Walut.KOD_WALUTY, Słownik - Daty.Nr Miesiąca, Słownik - Daty.Miesiąc Rozliczenia, Słownik - Outlety.Outlet Numer (MID), Słownik - Outlety.Outlet Nazwa, Słownik - Terminale.Nr Terminala, Słownik - Daty.Rok Rozliczenia] )] as c12 GB,
    Second plan is the plan when report retrieves only results for one fact table and null's for others
    Problem is with attribute : "Słownik - Rodzaje Walut.KOD_WALUTY" which is from dimension which belongs only to one fact table.
    So other fact table are not linked to this dimension and therefore this plan cannot retrieve results for them.
    It is obvious that some of the facts cannot share some dimensions with others but i would like to join them on other common attribute
    and my question is how ?
    Thanks's in advance Arkadiusz Masny
    Edited by: Arkadiusz Masny on Dec 10, 2009 6:49 AM

    It's normal behavior. How would fact measure know the value for accurate "non-fact" dimension
    Workaround:
    First solution is:
    Add into logical source of each fact (in logical layer) tables to which belongs dimension attribute and join dimenstion to that fact.
    Second you may:
    Create fact table which join all needed dimensions with some useless fact ( i.e. count). Next you have to set option "Implicit Fact Column" in presentation catalog to use this fact table.
    I can explain it to you in Polish by mail or phone
    You bring me a next topic for my blog (in Polish) http://obiee.pl so I'll write sth about such behavior :)
    Regards

Maybe you are looking for

  • Keep getting "not responding" error message as DW hangs

    I have had the following problem consistently used DW 12.1, as well as the version that was with CS 5.5. And I am almost sure it has something to do with the html or other code on my pages, but I thought a DW guru might help. Basics First: DW 12.1 wi

  • Issue with "unknown user type 6" on Coherence 3.5.2

    Having an issue with a cluster which is running using an internally developed cluster starter tool. This tool, and the associated cluster, all use POF, and upon attempting to connect a non-storing member to the cluster from java, the following except

  • Infopackage Loading error - The file is not open

    Hi Experts, I have an issue in my process chain. When the loading starts from deleting the psa contents then the infopackages - this is where the error starts. Infopackage source is 'Load Text-Type File from Application Server'. The error only says:

  • IPOD A/V Connection Kit

    So the iPod A/V Connection Kit caught my eye. This is mostly because I'd like to be able to control my iPod from across the room and see what I'm doing, but I'm wondering, since there is no video output on my iPod, will I still see the interface on m

  • How can I turn OFF Sitemaps in Muse

    Do not tell me why they matter. I do not want sitemaps in Muse How can I turn their creation off so I do not have to delete them every time I do something? If you do not know how to turn off sitemaps DO NOT RESPOND TO THIS QUESTION