I realized that my question was kind of dumb... i've inserted into the map
the objects and not just their values...
So i solved my problem using a map like this:
this.propertyModel =
"table" : "properties",
"table_l10n" : "properties_l10n",
"unlocalized" : {
"ctype" : ctype,
"ptype" : ptype,
"currency" : currency,
"price" : price,
"sqmtrs" : sqmtrs
},
"en" : {
"city" : city_en
"quarter" : quarter_en
"street" : street_en
},
"ru" : {
"city" : city_ru
"quarter" : quarter_ru
"street" : street_ru
}
};
I'm try to bind this form to a row of the table. I'm doing something like
this. I'm using a context menu with the table so on the "cellContextmenu"
context menu event i bind the data of the row to my form, like this:
var TM = this.PTM; // the table model for my properties table
table = this.PTable; //the property table
table.addListener("cellContextmenu", function()
{
focusedRow = table.getFocusedRow();
if(focusedRow !== undefined)
{
row = TM.getRowDataAsMap(focusedRow);
}
}, this);
var model = this.propModel;
model.unlocalized.ptype.setModelSelection([row["Property type"]]);
model.unlocalized.price.setValue(row["Price"]);
model.unlocalized.sqprice.setValue(row["Price/square meters"]);
model.unlocalized.currency.setModelSelection([row["Currency"]]);
[...]
model.en.city.setValue(row["City (en)"]);
model.ru.city.setValue(row["City (ru)"]);
model.en.quarter.setValue(row["Quarter (en)"]);
model.ru.quarter.setValue(row["Quarter (ru)"]);
model.en.street.setValue(row["Quarter (en)"]);
model.ru.street.setValue(row["Quarter (ru)"]);
I'm using this kind of weird approach so i can manage more easily the json
with my php functions that INSERT data into multiple tables at once (like
the multilingual table). Dividing the json organizes the data in a semantic
way that i can use better.
Now... if some expert can tell me if this is a nice way and is compatible
with older browser (like IE6) i would feel more safe.
Anyway, sorry for the dumb question, i just wanted to share my solution for
documentation purposes.
Contact me if you want more infos.
Thank you all
-----
La coincidenza non ha madre.
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/Form-model-with-arrays-tp6057547p6057886.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel