PDA

View Full Version : combox value field



mrhari
13 Dec 2010, 8:11 PM
hi,
i can't get the value field .every time i get value as the display value..i am creating combo box dynamically so iam getting the value through xdom.please see my code
[ CmbFilterCondition(String condName,String condValue)
{
set("name", condName);
set("value",condValue);
}

ListStore<CmbFilterCondition> filterList=new ListStore<CmbFilterCondition>();
filterList.add(new CmbFilterCondition("=", "equals"));

ComboBox cmbCondition = new ComboBox<CmbFilterCondition>();

cmbCondition.setStore(filterList);
cmbCondition.setDisplayField("value");
//cmbCondition.setWidth(15);
cmbCondition.setValueField("name");
cmbCondition.setId("cmbCondition" + String.valueOf(i));

for(i=0;i<size;i++)
{
Element fieldElement=(Element) XDOM.getElementById("cmbCondition"+i);
String value=fieldElement.getPropertyObject("value").toString();
}





][/CODE]

mrhari
13 Dec 2010, 11:29 PM
please help me

mrhari
14 Dec 2010, 2:11 AM
i am stuck with it..:-/

sven
14 Dec 2010, 3:14 AM
You bump this thread 2 times in 6 hours, maybe you should be a little bit more patient. This is a forum. If you want fast help, you should always post a complete testcase implementing EntryPoint, so everybody can help you without having to create an own testcase first.


I dont even understand your code, why to you query for elements there? The value of a combo is not stored on any element. It would be
cmbCondition.getValue().get("value")

mrhari
14 Dec 2010, 3:46 AM
ya ok..

i am creating com box dynamically.so i can't refer cmbCondition .So i set unique id for each combo box and access it via xdom

sven
14 Dec 2010, 3:49 AM
xdom returns elements, not widgets. You should organize your code in a way, so that you have access to what you need.

mrhari
14 Dec 2010, 3:56 AM
so any other way for creating widgets dynamically and getting values from it

sven
14 Dec 2010, 4:00 AM
There is a ComponentManager which you can use.

But i highly suggest that you fix your code so you have access to everything you need accses to.

mrhari
14 Dec 2010, 4:09 AM
should i put the combo box in flex table and and get the dynamically created combo box from table.getWidgetMethod and take the value..is it would be a good approach

sven
14 Dec 2010, 4:11 AM
No its not a good approach. Dont think in HTML and javascript. think object orientated. How would you solve this in a real java application (or objective c or whatever)?

mrhari
14 Dec 2010, 4:31 AM
ok..now no idea came through my mind but i will definitely try as you said..Thank you once again for your support..