Hi Husseyin,

you can use the setModel or setUserData methods to safe values for your 
db queries.

Here an example:
<code>
var selectBox = new qx.ui.form.SelectBox();

for (var i = 0; i < 10; i++) {
var item = new qx.ui.form.ListItem("Item " + i);
item.setModel("Model " + i);
item.setUserData("myKey", "UserData " + i);
selectBox .add(item);
}

selectBox.addListener("changeSelection" , function(e) {
var selection = e.getData();
alert("model: " + selection[0].getModel() + "\n" +
"user data:" + selection[0].getUserData("myKey"));
});

this.getRoot().add(selectBox);
</code>

You can also us other values - Numbers, Objects, ... - not only Strings. 
Please have a look at the API Viewer for details.

Cheers,
Chris

Am 15.02.2010 11:33, schrieb hkalyoncu:
> thanks both petr and alexander
>
> documents and demo examples are very helpful.
> actually its quite simple. only 5 lines of codes.
> i can now populate selectBox.
> but there is one small question
>
> my original selectbox options in html is like this:
>
> ....
> <option value="">text</option>
> ....
>
> now i can show them in qx selectBox as value#text
> (i need those values for db queries)
> then i am parsing them in form submit.  showing value
> with text is not a nice way  and parsing it on every form
> submit is not a good practice. is there any way to include
> values. if its only way to extend the selectBox class,  which
> methods do i have to overwrite?
>
> regards
>
> Huseyin
>    


-- 
Christian Schmidt
Software Entwickler

1&1 Internet AG - Web Technologies
Ernst-Frey-Straße 9 · DE-76135 Karlsruhe

Amtsgericht Montabaur / HRB 6484
Vorstände: Henning Ahlert, Ralph Dommermuth, Matthias Ehrlich, Thomas 
Gottschlich, Robert Hoffmann, Markus Huhn, Hans-Henning Kettler, Dr. Oliver 
Mauss, Jan Oetjen
Aufsichtsratsvorsitzender: Michael Scheeren


------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to