I am writing an app with data entry forms. To be able to access the various
UI components (TextField, Checkbox, etc) from different functions in the
class, it seems that I need to declare them as class member variables and
always refer to them with "this" (this.myTextField.getValue()).
While this works, is it the preferred way? In the examples all UI component
access is done in in-line functions/event-listeners where the UI component
has scope and use of member variable is not needed. Looking at the manual,
there does not seem to be a section about variable scope, member access and
use of "this".
Is there anyway to find/access UI components without having them declared as
members?
Currently my code looks like the following;
++++++++++++++
construct : function(){
this.base(arguments);
this._initLayout();
},
member : {
myTextField : null;
_initLayout : function(){
this.myTextField = new qx.ui.form.TextField();
this.add(this.myTextField);
},
getTextValue : function() {
return this.myTextField.getValue();
}
}
--
View this message in context:
http://www.nabble.com/Use-of-%22this%22-to-access-class-member-variables-UI-components-tf4561133.html#a13016777
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel