Disable an InputText when another one is modified

Hi all,
I have 2 h:inputText and I'd like to do this :
when the user types some text in the first one, the second one becomes disabled and vice-versa. And when the user delete the text of the first one, the second one becomes enabled and vice-versa...
I hope I make myself clear... :/
Any idea ?

<script>
  text1 = getElementById("myForm:text1");
  text2 = getElementById("myForm:text2");
  function check() {
    if (text1.value.length<0) {
      text2.disabled = true;
    else {
      text2.disabled = false;
</script>
<h:form id="myForm">
  <h:inputText id="text1" onChange="check()" ....>
  <h:inputText id="text2">
</h:form>not testet 100% but the solution is something like that

Similar Messages

  • Getting a movie clip to stop playing, when another one is activated.

    Hello,
    I have a file with 3 movie clips and three buttons that control them to play...with the script below It is working fine.
    stop()
    function startImageOne(Event:MouseEvent):void
        imageOne_mc.play();
    function startImageTwo(Event:MouseEvent):void
        imageTwo_mc.play();
    function startImageThree(Event:MouseEvent):void
        imgThree_mc.play();
    start1_btn.addEventListener(MouseEvent.CLICK, startImageOne);
    start2_btn.addEventListener(MouseEvent.CLICK, startImageTwo);
    start3_btn.addEventListener(MouseEvent.CLICK, startImageThree);
    Then, I wanted to stop a movieClip, if another one was selected to play..so I inserted stop options to the function, which I thought would work, but doesn't. Does any one know why...See this code below..
    thanks
    stop();
    function startImageOne(Event:MouseEvent):void
        imageOne_mc.play();
        imageTwo_mc.stop();
        imgThree_mc.stop();
    function startImageTwo(Event:MouseEvent):void
        imageTwo_mc.play();
        imageOne_mc.stop();
        imgThree_mc.stop();
    function startImageThree(Event:MouseEvent):void
        imgThree_mc.play();
        imageOne_mc.stop();
        imageTwo_mc.stop();
    start1_btn.addEventListener(MouseEvent.CLICK, startImageOne);
    start2_btn.addEventListener(MouseEvent.CLICK, startImageTwo);
    start3_btn.addEventListener(MouseEvent.CLICK, startImageThree);
    thanks
    Babs

    Hi Ned,
    I checked the names and they are all correct...(I named one of the instances img instead of image, but it is all fine.
    The movie clips are simple...They have a stop action in the first frame, and then it is just an image that fads in and fades out..
    Pretty simple?
    The code looks fine, so I can't figure out, why the movie clip that is currently playing doesn't stop, when another button is activated.
    It seems like is should work??
    I'll keep playing .. thanks!!
    babs

  • Close a Frame when another one opened

    How do i Close a frame (dependent Frame) when another frame opened
    dispose() method did nothing and so do system.exit(0); as the System.exit(0) close the whole app that meant also the frame i would like to open when the other frame closed and moved from " Memory " huge topic for me
    dispose(); didn't do what i really needed to happened
    please any suggestions ASAP ? i need that in swing app

    i used dispose() but didn't work with me as i noticed the memory usage with this java app when i run the app after closing the frame . the memory usage didn't change that meant as least the frame didn't closed or cleared from the memory ?!
            try {
                    Socket ss = new Socket("14.23.5.122", 1235);
                  //  JOptionPane.showMessageDialog(null, "Server's OK", "Connection", JOptionPane.INFORMATION_MESSAGE);
                    new LoginFrame().setVisible(true);
                  //  this.dispose();
                    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                } catch (UnknownHostException eh) {
                    System.out.println("Unknow Host Exception"+ eh.getMessage());
                } catch (IOException eo) {
                    System.exit(0);
                   System.out.println("IO Exception"+ eo.getMessage());
             /*finally{
            System.exit(0);
            }*/

  • All open windows close when another one is opened

    Running OSX10.6.7
    Recently the window behavior has changed, now when a different active app is selected, all the windows from other active apps become hidden
    if one holds the Option key when selecting a new app or a hidden window in an open one, the new window opens and the old ones remain on screen but not active
    this behavior is new, perhaps coincident with the latest snow leopard update
    I suppose that I may have triggered this change by some accidental combination of key strokes 
    I prefer that the act of opening a new window not affect the other open windows
    is this behavior controlled by a preference pane somewhere, or some combination of key strokes or by one of those programs such as Macpilot or Tinkertool, although I do not recollect deliberately changing anything

    It's a hidden Dock preference. You can change it in TinkerTool, or launch the Terminal application, copy or drag -- don't type -- the following text into the window, and press Return:
    defaults write com.apple.dock single-app NO
    You may have to relaunch the Dock or log out for it to take effect, I'm not sure.

  • Issue with pulling down one view controller and posting another one

    I have a situation where I need to post a modal view when another one is closed by the user.
    Say i have a EULA a user must accept before continuing and once the EULA is accepted I want to show a Splash screen which is another View controller.
    So essentially when the user accepts the EULA, the EULAViewController calls its delegate's eulaAccepted method. In this case the delegate is a view controller inherited from UIViewController object.
    - (void) eulaAccepted {
    // Dismiss the EULA controller first
    [self dismissModalViewController animated:YES];
    // Now show the splash screen to the user
    SplashController *splash = [[SplashController alloc] init];
    [self presentModalViewController:splash animated:YES];
    [splash release];
    When I do this, the code sort of goes into recursive loop with lot of the following in the stack:
    UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:
    If I present the splashController in another method which I invoke after a certain delay then it works fine. But the timing is again an issue since it works on some devices and not on others. So I do not like that solution.
    What is the best practice to handle such situations? I was under the impression that the OS would sequence these animations and perform one after the other and I would not have to worry about them but doesn't look like it works that way.
    Would greatly appreciate your inputs.
    TIA,
    -TRS

    Here is what I did. I overrode the presentModalViewController:animated: and then if a controller is already posted, I start a thread which waits for the old one to be pulled down before the new one is posted.
    There could still be a problem here if postModalViewController is called before another one has been posted since then self.modalViewController will still be nil. But the UIViewController can deal with it. My current issue is posting one when another is being pulled down, not posting 2 views at the same time
    This works but I still would like to know if there is a better way to handle such situations.
    -TRS
    // Invoke the super with animation set to YES
    - (void) presentModalViewControllerWithAnimation:(UIViewController *) vc {
    [super presentModalViewController:vc animated:YES];
    // This method should be invoked in its own thread
    // If there is a modal controller already posted then wait for it to be pulled down before posting this one
    - (void) checkAndPresentModalViewControllerWithAnimation:(UIViewController *) vc {
    while (self.modalViewController != nil) {
    [NSThread sleepForTimeInterval:0.1];
    [self performSelectorOnMainThread:@selector(presentModalViewControllerWithAnimation:) withObject:vc waitUntilDone:NO];
    // Invoke the super with animation set to NO
    - (void) presentModalViewController:(UIViewController *) vc {
    [super presentModalViewController:vc animated:NO];
    // This method should be invoked in its own thread
    // If there is a modal controller already posted then wait for it to be pulled down before posting this one
    - (void) checkAndPresentModalViewController:(UIViewController *) vc {
    while (self.modalViewController != nil) {
    [NSThread sleepForTimeInterval:0.1];
    [self performSelectorOnMainThread:@selector(presentModalViewController:) withObject:vc waitUntilDone:NO];
    // Override the UIViewController method
    // If no modal controller is yet posted then directly invoke the super's presentModalViewController:animated:
    // If one is already posted then start a worker thread to wait for it to be pulled down before posting the new one
    - (void) presentModalViewController:(UIViewController *) vc animated:(BOOL)animated {
    if (self.modalViewController == nil) {
    [super presentModalViewController:vc animated:animated];
    } else {
    if (animated) {
    [NSThread detachNewThreadSelector:@selector(checkAndPresentModalViewControllerWithAnimation:) toTarget:self withObject:vc];
    } else {
    [NSThread detachNewThreadSelector:@selector(checkAndPresentModalViewController:) toTarget:self withObject:vc];

  • When i Log into instagram it say my account  is disable but when i log in on another iphone my instagram account log's in. when i try logging into another account it continue to say disable. Why cant i log into instagram or make another one on my iphone?

    When i Log into instagram it say my account  is disable but when i log in on another iphone my instagram account log's in. When i try logging into another account on my phone it continue to say disable. i also tried to make a new instagram on my phone but it wont let me. i deleted the app over and over again but it still wont let me log into any instagram account. Why cant i log into instagram or make another one on my iphone?
    Is is=t possable to have your phone banned from a app forever???
    HELP !!

    I just asked the same thing and did some research. Some people have said  that the UDID code is like banned from instagram, but your account isn't. I'm able to use it on my phone but not on my iPod.

  • Choice list in af:query turns into inputText when AM pooling is disabled

    Hi all,
    I have a choice list field in an af:query search area. This field is based on attribute FlagYN VARCHAR2(1) and is bound to a list of values.
    When AM pooling is disabled, executing the search makes that field loose its Display property and search operator original value: it turns into an inputText, the operator, originally set as "equal to" is now "less than" and the expected value is now the index in the choice list.
    What can be happening?
    Thanks
    JDeveloper 11.1.1.3.0
    Anyone has the same problem?
    Edited by: Marge on 02-sep-2010 3:02

    Hi,
    there are two bugs associated with bind variables in successors that I am aware of. One of them is supposed to be fixed in the next patch set, another one is still open. However, both problems were found with AM pooling enabled as well, so I don't know this is the same problem (though it sounds like). If you can, I suggest to create a reproducible testcase on one of the Oracle database schema, like HR or OE, and file a bug. If you don't have a time for or access to support, send the test case in a zip file (rename ".zip" to ".unzip") to the mail Id you find in my OTN profile. However, be aware that when I file the bug then it wont be visible for you, nor can it be escalated on your behalf. Anyway, at least it would get filed
    Frank

  • How do I disable call waiting when sending a FAX on a Photosmart C410a All-in-One?

    When sending a FAX from my computer, I added *70 to the dialing prefix to disable Call Waiting.  The problem appears to be that either my C410a does not recognize the * or perhaps I must add a pause after the *70.  The user guide says to hit the up arrow to insert a pause but I think that might only work for FAXes that are dialed from the All-in-One, not the computer.  In another place in the User Guide, it instructs to hit asterisk twice ** to get a pause.  When dialing from the computer, if I hit ** I get ** not a pause.  (I use Comcast and they do not give a new dial tone after hitting *70 so I don't think the pause is necessary.)
    If I remove the *70 from the dialing sequence on the computer, the FAX goes right through but a Call Waiting signal might stop the FAX.
    Anyone know how to include *70 for computer dialing?

    Hello LCHutton, I hope you are well
    I read your post about your attempts to disable call waiting when sending a fax. I would suggest looking in the fax menu on the printer and turning off the ECM (Error Correction Mode), and also changing the Fax Speed to slow.
    I hope either of those steps help you!
    If the troubleshooting does not help resolve your issue, I would then suggest calling HP's Technical Support to see what their options are for you. If you are calling within North America, the number is 1-800-474-6836 and for all other regions: click here.
    Also, I have found this thread that is related to your scenario that might help you!
    How do I disable call waiting
    Have a great weekend
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • Cant put pdfs or music on.the message i get when itunes comes up is "iTunes was unable to load data class information from sync services.reconnect or try again later." and its just my itouch i tried another one and was able to put songs and pdfs on it...

    I cant put pdfs or music on my itouch,it wont sync.the message i get when itunes comes up is "iTunes was unable to load data class information from sync services.reconnect or try again later." and its just my itouch i tried another one and was able to put songs and pdfs on it...please help!

    Try here:
    iTunes for Windows: "Unable to load data class" or "Unable to load provider data" sync services alert
    If not successful see the previous discussion on the right side of this page with the green checkmark.

  • I recently transfered everything from my emac to another one but now when I try to open iTunes I get the window that states: The file "iTunes Library" cannot be read because it was created by a newer version of iTunes.

    I recently transfered everything from my emac to another one but now when I try to open iTunes I get the window that states: The file "iTunes Library" cannot be read because it was created by a newer version of iTunes. The computer I transfered to had a bunch of files on it and I got full ownership of what was already there, so, how do I get to my iTunes library, I do have access as an administrator to the iTunes library (that works just fine) already there and I guess I must have had a newer version ofiTunes on my defunt eMac....

    Tell us some version numbers please, of your Mac OS versions and iTunes versions on both computers (two eMacs yes?).
    dlrobinson49 wrote:
    I guess I must have had a newer version ofiTunes on my defunt eMac....
    That is a pretty good guess.Try updating the second eMac's iTunes to at least the version that was on the first.

  • HT204053 I have a big problem in my account in Game Center .. I have been an account before in the game center and i change it to another one ...when i play any game its change by itself to the last account not still to the new one and i lost my update in

    I have a big problem in my account in Game Center ..
    I have been an account before in the game center and i change it to another one ...
    when i play any game its change by itself to the last account not still to the new one and i lost my update in my game
    How can i keep the new account in my game center and didn't change again ?
    My new account is :[email protected] ............Thats i wanna to keep it
    The old one is :michael-adel [email protected]
    Thank you

    I have a big problem in my account in Game Center ..
    I have been an account before in the game center and i change it to another one ...
    when i play any game its change by itself to the last account not still to the new one and i lost my update in my game
    How can i keep the new account in my game center and didn't change again ?
    My new account is :[email protected]. ............Thats i wanna to keep it
    The old one is :michael-adel [email protected]
    Thank you

  • We have to stop one job when another job is running

    Hi,
    I have a new Requirement. There are two jobs running in background one is delta load and another one is Full load. Delta load runs for every two hours( Daily 12 loads) and full load runs on sundays(weekly only one load) for 6hrs. Now what happening is Full load and delta load are running on same time i.e when the full load is running, delta loads are also running on the same time, Full load runs for 6 hrs and 3 Delta loads runs on same time. Now we have a requirement to stop the delta loads when full load is running. Is there any posibility how to stop the delta load.
    Rgds
    Kishor

    hi Kishor,
    check this
    Re: How to Cancel a ACTIVE background Job scheduled in SM37.
    hope it will help you.
    thanks
    Sachin

  • Iphoto:  When I choose a photo and click on it, another one appears.

    When I choose on a photo in Iphoto and click on it, another one appears.

    Back up your iPhoto library, Depress and hold the option (alt) and command keys and launch iPhoto - rebuild your thumbnails - this may take a few trys
    LN

  • CallerPrincipal when calling one sessionbean from another

    Hi all,
    I have a little problem when calling one sessionbean from another sessionbean. The problem is, that in the method, which is called, is used SessionContext's getCallerPrincipal().getName(). This works great from client, but from other sessionbeans getCallerPrincipal() retuns an "ANONYMOUS" principal. How can I set the correct principal (the principal from the first sessionbean)?
    Thank you
    My env: Glassfish 2.1.1, Netbeans 6.8, Eclipselink 2.0.0, Java 1.6.0.18
    My code:
    @Stateless
    public class ABean implements ASessionRemote{
    @Resource
    SessionContext ctx;
    @Override
    public void aMethod(){
    String name = ctx.getCallerPrincipal().getName(); // the name is ANONYMOUS, when the call is done from other sessionbean
    @Stateless
    public class BBean implements BSessionRemote{
    @Resource
    SessionContext ctx;
    @EJB
    private ASessionRemote aSessionBean;
    @Override
    public void bMethod(){
    aSessionBean.aMethod();
    }

    "This works great from client"
    What do you mean by this, i.e what sort of client are you using (stand alone app, servlet) ?
    what shows up if you printout the caller principal in the calling bean ?
    are the two ejbs in the same ear ?
    what security meta-information are you using in ejb-jar.xml and sun-ejb-jar.xml, if any ?

  • Hi, I just downloaded iBooks and I downloaded a book but i wanted to get the hunger games one and they dont Havre it so I erased the app and when I wanted to download another one it just says waiting and it does nothing , CAN YOU HELP ME!

    Hi, I just downloaded iBooks and I downloaded a book but i wanted to get the hunger games one and they dont Havre it so I erased the app and when I wanted to download another one it just says waiting and it does nothing , CAN YOU HELP ME!

    Don't know if there is an option make the download window stay up, but you can bring it back with Ctrl+J then right-click on the download to open the folder it was downloaded to.
    * keyboard shortcuts -- http://dmcritchie.mvps.org/firefox/keyboard.htm
    Where files get downloaded to is in your '''about:config''' settings.
    * [http://kb.mozillazine.org/About:config About:config - MozillaZine Knowledge Base]
    * [http://kb.mozillazine.org/About:config_entries About:config entries - MozillaZine Knowledge Base]
    check out variables beginning browser.download.

Maybe you are looking for

  • This is a quick but v.important question.

    hi, i have a thread thats part of a class that implements runnable (class b) in it's run method it executes code that retrieves values in a database and stores it in a string array. i need to pass this array to the caller class a. how can this be don

  • How to compile a java file in J9 for windows mobile 5.0

    I have downloaded J9 for windows mobile 5.0 and need help on how to compile a java file.

  • ORA -06413 Database connection

    I am testing an application in Windows 7 64 bits . while doing the ODBC connection, the following error message is being return. [Microsoft][ODBC Driver for ORacle ][Oracle]ORA-06413- connection not open. Can someone please help? thanks in advance

  • Content length mismatch

    Hi all I'm getting these type of errors when accessing content on my web server Dows anyone know why this could happen??? [23/Nov/2004:21:17:35] warning ( 2167):      for host 192.168.107.20 trying to GET /RCU/css/ing_exchange.css, finish-response re

  • I'm having trouble updating iPhoto and iMovie.

    This has been an ongoing issue that I just get aggravated and stop trying for awhile.  Updated to OS X Mavericks and now I can't even access iPhoto.  It says this version can't be used with OS X.  Everytime I try to update iPhoto and iMovie, I get a