Results 1 to 6 of 6

Thread: MessageBox prompt

  1. #1

    Question MessageBox prompt

    how to get user Input from a MessageBox prompt?

    Code:
    MessageBox.prompt("Titre", " valeur :", new Listener<ComponentEvent>(){
        public void handleEvent(ComponentEvent ce) {   
                 Info.display("MessageBox", /*box.getTextBox().getValue()*/"???"  );  
        }  
    });
    thx. David

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572

    Default

    simple...

    Code:
    final MessageBox box = MessageBox.prompt("Titre", " valeur :", new Listener<ComponentEvent>(){
        public void handleEvent(ComponentEvent ce) {   
                 Info.display("MessageBox", box.getTextBox().getValue()  );  
        }  
    });

  3. #3

    Default

    compiler tell me :
    Code:
    The local variable box may not have been initialized

  4. #4
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572

    Default

    ok,

    So try this...
    Code:
     public void handleEvent(ComponentEvent ce) {   
                 MessageBox box = (MessageBox)ce.component;  
                 ....etc
        }

  5. #5

    Default

    sorry, but Cannot cast from Component to MessageBox...

  6. #6
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572

    Default

    yep - well I guess the only other option is to assign the MessageBox returned by MessageBox.prompt() to a global and check that when the event fires...

    I'd agree that perhaps a better solution should be developed considering the only use case available... odd hey !!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •