I didnt use properties, I know it would be smarter and i will use them from
now on.. I'm just wondering why the self-made getters dont work the way I
expected.. The class myData is almost the same as registerPage since they
display mostly the same information (aside from passwords and legal stuff)
Now when i call myData.getSalutation().getValue(); i get the value from the
registerPages salutation since I initialised the registerPage object AFTER
the myData object.. if I initialize registerPage first,
registerPage.getSalutation().getValue(); returns the myData-pages'
salutation.. it appears the methods are overridden since they have the same
name.. which is weird, since they are from different classes and
non-static..
Here is the example:
/* ************************************************************************
Benutzerdaten
************************************************************************ */
qx.Class.define("myproject.view.tablet.v_myData",
{
extend : qx.ui.mobile.page.NavigationPage,
construct : function() {
this.base(arguments);
this.set({
title : this.tr("Meine Daten"), // will be replaced by username
showBackButton : true,
backButtonText : "Back"
});
},
members :
{
__fo_form1 : null,
__fo_form2 : null,
__fo_changable : null,
__fo_notChangable : null,
__gr_notChangable : null,
__gr_changable : null,
__tf_salutation : null,
__tf_name : null,
__tf_surname : null,
__tf_company : null,
__tf_street : null,
__tf_zipcode : null,
__tf_city : null,
__tf_country : null,
__tf_mail : null,
__tf_phone : null,
__tf_fax : null,
__tf_password : null,
__tf_passwordRepeat : null,
__bt_saveChanges : null,
_initialize : function()
{
this.base(arguments);
//Forms erstellen
this.__fo_changable = this.createChangableForm();
this.__fo_notChangable = this.createNotChangableForm();
//Elemente erstellen
__bt_saveChanges = new qx.ui.mobile.form.Button(this.tr("Änderungen
speichern"));
//Gruppen initialisieren
__gr_notChangable = new qx.ui.mobile.form.Group();
__gr_changable = new qx.ui.mobile.form.Group();
//Form zu Gruppen hinzufuegen
__gr_notChangable.add(new
qx.ui.mobile.form.renderer.Single(this.__fo_notChangable));
__gr_changable.add(new
qx.ui.mobile.form.renderer.Single(this.__fo_changable));
//Gruppen hinzufuegen
this.getContent().add(__gr_notChangable);
this.getContent().add(__gr_changable);
this.getContent().add(__bt_saveChanges);
},
createChangableForm : function()
{
__fo_form1 = new qx.ui.mobile.form.Form();
//Elemente initialisieren
__tf_company = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Firma")});
__tf_street = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Strasse")});
__tf_zipcode = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Postleitzahl")});
__tf_city = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Ort")});
__tf_country = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Land")});
__tf_mail = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("E-Mail")});
__tf_phone = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Telefon")});
__tf_fax = new qx.ui.mobile.form.TextField().set({placeholder:this.tr
("Fax")});
__tf_password = new qx.ui.mobile.form.PasswordField().set({placeholder:
this.tr("Passwort")});
__tf_passwordRepeat = new
qx.ui.mobile.form.PasswordField().set({placeholder:this.tr("Passwort")});
// Felder hinzufuegen mit Benennung
__fo_form1.add(__tf_company,this.tr("Firma:"));
__fo_form1.add(__tf_street,this.tr("Strasse: (*)"));
__fo_form1.add(__tf_zipcode,this.tr("Postleitzahl: (*)"));
__fo_form1.add(__tf_city,this.tr("Ort: (*)"));
__fo_form1.add(__tf_country,this.tr("Land: (*)"));
__fo_form1.add(__tf_mail,this.tr("E-Mail: (*)"));
__fo_form1.add(__tf_phone,this.tr("Telefon: (*)"));
__fo_form1.add(__tf_fax,this.tr("Fax:"));
__fo_form1.add(__tf_password,this.tr("Passwort: (*)"));
__fo_form1.add(__tf_passwordRepeat,this.tr("Passwort wiederholen (*)"));
return __fo_form1;
},
createNotChangableForm : function()
{
__fo_form2 = new qx.ui.mobile.form.Form();
//Elemente initialisieren
__tf_salutation = new qx.ui.mobile.form.TextField().set({value:"Herr"});
__tf_name = new qx.ui.mobile.form.TextField().set({value:"Tobias"});
__tf_surname = new qx.ui.mobile.form.TextField().set({value:"Roeder"});
//Felder ReadOnly setzen
__tf_salutation.setReadOnly(true);
__tf_name.setReadOnly(true);
__tf_surname.setReadOnly(true);
// Felder hinzufuegen mit Benennung
__fo_form2.add(__tf_salutation,this.tr("Anrede:"));
__fo_form2.add(__tf_name,this.tr("Vorname:"));
__fo_form2.add(__tf_surname,this.tr("Nachname:"));
return __fo_form2;
},
getSalutation : function() {
return __tf_salutation;
},
getFirstname : function() {
return __tf_name
},
getLastname : function() {
return __tf_surname;
},
getCompany : function() {
return __tf_company;
},
getStreet : function() {
return __tf_street;
},
getCity : function() {
return __tf_city;
},
getZipcode : function() {
return __tf_zipcode;
},
getCountry : function() {
return __tf_country;
},
getMail : function() {
return __tf_mail;
},
getPhone : function() {
return __tf_phone;
},
getFax : function() {
return __tf_fax;
},
getSaveButton : function() {
return __bt_saveChanges;
}
}
});
2014-02-03 Christopher Zündorf <christopher.zuend...@1und1.de>:
> Hey,
>
> could you please provide an example of the pages you use?
>
> Just post that class:
>
> myproject.views.registrationPage
>>
>>
> Greetz Christopher
>
>
> Am 03.02.2014 um 14:12 schrieb Tobias Roeder <roeder1...@googlemail.com>:
>
> Hey Chris,
>
> thanks for your reply.
> But unfortunately the "getName" was just an example.. I have various
> getters like getSalutation, getZipcode and so on and the problem is
> occuring throughout them all.
>
> Just to clarify: I'm not using any properties! the getter returns the
> values of the textfields directly and the names of the textfields are
> exactly the same in both of the navigationpage-classes. But they are all
> marked as private (__variableName).
>
>
> 2014-02-03 Christopher Zündorf <christopher.zuend...@1und1.de>:
>
>> Hi Tobias,
>>
>> i think it is because the property "name" of the mobile Widget:
>>
>>
>> http://demo.qooxdoo.org/current/apiviewer/#qx.ui.mobile.core.Widget~getName!method_public
>>
>> Just give you property and getter a different property name, and
>> everything should work fine.
>>
>> And: Please make sure to call this.base(arguments) inside your
>> NavigationPage's constructor.
>>
>> Greetz Christopher
>>
>>
>> Am 03.02.2014 um 09:59 schrieb Tobias Roeder <roeder1...@googlemail.com
>> >:
>>
>> Hello folks,
>>
>> everything that follows is regarding qooxdoo mobile 3.5
>>
>> I'm facing a rather weird problem at the moment and therefore I would
>> need some help.
>> I have 2 qooxdoo classes.. One with a registration form and another one
>> with a "myData" form, which is displaying the personal data of a already
>> registered user.
>> Both of these classes have textfields and other formelements (declared
>> private with __name) with the same names! Normally, to my understanding,
>> not a problem.
>> When i initialize these form elemente in both objects, i use "__name =
>> new formelement(); "(formelement being a textfield, button, label etc..
>> standard qooxdoo classes).
>>
>> Now i noticed, that when i create my objects, and call the getter for,
>> lets say, the phone number, i only receive the value of the last
>> initialized object.. no matter whose getter I call..
>>
>> To make this a little clearer:
>>
>> __registrationPage = new myproject.views.registrationPage();
>> __myDataPage = new myproject.views.myDataPage();
>> (both of them being own classes extending NavigationPage)
>>
>> __registrationPage.initialize();
>> __myDataPage.initialize();
>> (making the view available before calling the .show() method)
>>
>> __registrationPage.getName(); <-- returns the value of the textfield
>> name in MYDATA-PAGE, which is just WRONG
>> __myDataPage.getName(); <-- returns the value of the textfield name in
>> MYDATA-PAGE, which is correct.
>>
>> The getters aren't standard property getters, but selfcoded getter
>> which return the value of the corresponding private textfield of the
>> navigationpage.
>>
>> I figure i might have to declare the instance variables differently..
>> maybe involving the THIS operator somehow? I just cant seem to find the
>> correct way..
>>
>> Somewhere along the line qooxdoo overrides the (to my understanding
>> private) variables and doesnt treat them as two different things (which
>> they were supposed to be).
>>
>> I'm most likely going to use properties for this particular matter to
>> avoid the problem but it worries me that I am obviously declaring instance
>> variables in a wrong way, since they are overridden no matter what class
>> they belong to.
>>
>> Any ideas? It is most likely just a small alteration...
>> Thanks in advance!
>>
>>
>> Greetz,
>> Tobias
>>
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk_______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Managing the Performance of Cloud-Based Applications
>> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
>> Read the Whitepaper.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
>> _______________________________________________
>> qooxdoo-devel mailing list
>> qooxdoo-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk_______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Managing the Performance of Cloud-Based Applications
> Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
> Read the Whitepaper.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel