Any one can help ?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Any one can help ?

fei wang


In my sample, do follow step:
1) select 'A' tab
2) enter 'hello' string in TextArea
3) click 'btn' button

My question is : 
why the alert dialog show the 'null' string?
If I want to show 'hello' string in alert dialog, how should I do?

Thanks,
Wang Feiku

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

Werner Thie
On 5/14/13 8:36 AM, fei wang wrote:
>
> http://tinyurl.com/bwwcfru
>
> In my sample, do follow step:
> 1) select 'A' tab
> 2) enter 'hello' string in TextArea
> 3) click 'btn' button

Because when clicking on the button your variable txt contains the text
area of tab 'B'

Keep a ref to the TextArea of A handy to display the entered text

HTH, Werner


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

fei wang
If I have many TabPages in TabView and many TextFields and TextAreas and Buttons in each TabPage, 
Is there any conveniences way to keep textarea ref of each TabPage ?



On Tue, May 14, 2013 at 3:09 PM, Werner Thie <[hidden email]> wrote:
On 5/14/13 8:36 AM, fei wang wrote:
>
> http://tinyurl.com/bwwcfru
>
> In my sample, do follow step:
> 1) select 'A' tab
> 2) enter 'hello' string in TextArea
> 3) click 'btn' button

Because when clicking on the button your variable txt contains the text
area of tab 'B'

Keep a ref to the TextArea of A handy to display the entered text

HTH, Werner


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

Werner Thie
On 5/14/13 9:43 AM, fei wang wrote:

> If I have many TabPages in TabView and many TextFields and TextAreas and
> Buttons in each TabPage,
> Is there any conveniences way to keep textarea ref of each TabPage ?
>
>
>
> On Tue, May 14, 2013 at 3:09 PM, Werner Thie <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On 5/14/13 8:36 AM, fei wang wrote:
>      >
>      > http://tinyurl.com/bwwcfru
>      >
>      > In my sample, do follow step:
>      > 1) select 'A' tab
>      > 2) enter 'hello' string in TextArea
>      > 3) click 'btn' button
>
>     Because when clicking on the button your variable txt contains the text
>     area of tab 'B'
>
>     Keep a ref to the TextArea of A handy to display the entered text
>
>     HTH, Werner

Like for instance an array? If you're looping over an array anyway, I
would suggest just that.

But that's JavaScript 101 and has nothing to do with qooxdoo!

Werner


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

Fink, Andreas-2
In reply to this post by fei wang
Hi,

your variable txt holds only the last reference your loop creates.
One way to do what you want is binding the listener context to the correct text area:

http://tinyurl.com/cknuoe4

Regards,
Andreas


Von: fei wang [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 08:36
An: qooxdoo Development
Betreff: [qooxdoo-devel] Any one can help ?


http://tinyurl.com/bwwcfru

In my sample, do follow step:
1) select 'A' tab
2) enter 'hello' string in TextArea
3) click 'btn' button

My question is : 
why the alert dialog show the 'null' string?
If I want to show 'hello' string in alert dialog, how should I do?

Thanks,
Wang Feiku

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

Fink, Andreas-2
Sorry, wrong url. This one should do the job ;)

http://tinyurl.com/br8aq67

-----Ursprüngliche Nachricht-----
Von: Fink, Andreas [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 11:57
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Any one can help ?

Hi,

your variable txt holds only the last reference your loop creates.
One way to do what you want is binding the listener context to the correct text area:

http://tinyurl.com/cknuoe4

Regards,
Andreas


Von: fei wang [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 08:36
An: qooxdoo Development
Betreff: [qooxdoo-devel] Any one can help ?


http://tinyurl.com/bwwcfru

In my sample, do follow step:
1) select 'A' tab
2) enter 'hello' string in TextArea
3) click 'btn' button

My question is : 
why the alert dialog show the 'null' string?
If I want to show 'hello' string in alert dialog, how should I do?

Thanks,
Wang Feiku

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

fei wang
Thanks very much!
It's OK to bind listener to correct text area.

BUT,  Another question : 
-------------------
  ...
  var txt = new qx.ui.form.TextArea();
  var btn = new qx.ui.form.Button("btn", "icon/22/apps/internet-web-browser.png");
  btn.addListener("execute", function(e) {
    alert(this.getValue());
    // In Here,
    // If bind listener to 'txt', not 'this', How to call the APP instance method, such as '__saveDataToDB()' ?
  }, txt);
  ...
--------------------


On Tue, May 14, 2013 at 6:30 PM, Fink, Andreas <[hidden email]> wrote:
Sorry, wrong url. This one should do the job ;)

http://tinyurl.com/br8aq67

-----Ursprüngliche Nachricht-----
Von: Fink, Andreas [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 11:57
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Any one can help ?

Hi,

your variable txt holds only the last reference your loop creates.
One way to do what you want is binding the listener context to the correct text area:

http://tinyurl.com/cknuoe4

Regards,
Andreas


Von: fei wang [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 08:36
An: qooxdoo Development
Betreff: [qooxdoo-devel] Any one can help ?


http://tinyurl.com/bwwcfru

In my sample, do follow step:
1) select 'A' tab
2) enter 'hello' string in TextArea
3) click 'btn' button

My question is : 
why the alert dialog show the 'null' string?
If I want to show 'hello' string in alert dialog, how should I do?

Thanks,
Wang Feiku

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Any one can help ?

Fink, Andreas-2
Another Solution would be to save the TextArea instance with setUserData inside the button:

var txt = new qx.ui.form.TextArea();
var btn = new qx.ui.form.Button("btn", "icon/22/apps/internet-web-browser.png");
btn.setUserData("myTextArea", txt);
btn.addListener("execute", function(e) {
  alert(e.getTarget().getUserData("myTextArea").getValue());
  //this.__saveDataToDB();
}, this);

I just hacked this code inside the email, it's not tested but should work ;)

Regards,
Andreas

Von: fei wang [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 16:45
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Any one can help ?

Thanks very much!
It's OK to bind listener to correct text area.

BUT,  Another question : 
-------------------
  ...
  var txt = new qx.ui.form.TextArea();
  var btn = new qx.ui.form.Button("btn", "icon/22/apps/internet-web-browser.png");
  btn.addListener("execute", function(e) {
    alert(this.getValue());
    // In Here,
    // If bind listener to 'txt', not 'this', How to call the APP instance method, such as '__saveDataToDB()' ?
  }, txt);
  ...
--------------------

On Tue, May 14, 2013 at 6:30 PM, Fink, Andreas <[hidden email]> wrote:
Sorry, wrong url. This one should do the job ;)

http://tinyurl.com/br8aq67

-----Ursprüngliche Nachricht-----
Von: Fink, Andreas [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 11:57
An: qooxdoo Development
Betreff: Re: [qooxdoo-devel] Any one can help ?

Hi,

your variable txt holds only the last reference your loop creates.
One way to do what you want is binding the listener context to the correct text area:

http://tinyurl.com/cknuoe4

Regards,
Andreas


Von: fei wang [mailto:[hidden email]]
Gesendet: Dienstag, 14. Mai 2013 08:36
An: qooxdoo Development
Betreff: [qooxdoo-devel] Any one can help ?


http://tinyurl.com/bwwcfru

In my sample, do follow step:
1) select 'A' tab
2) enter 'hello' string in TextArea
3) click 'btn' button

My question is : 
why the alert dialog show the 'null' string?
If I want to show 'hello' string in alert dialog, how should I do?

Thanks,
Wang Feiku

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel