Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Combo Box value returning NULL

$
0
0
Hello there,

I am using SmartClient Version: v10.0p_2015-07-08/PowerEdition Deployment (built 2015-07-08) with FF26.

I have 2 components, a Combo Box and a listgrid. The user user selects a value from a combo box and then fills some data in the listgrid. Now when the user clicks the save button I want to save the CB id and the data in the listgrid in a database table but for some reason the combo box value is not saving.

cheers
Zolf

Code:

distributorName = new ComboBoxItem();
distributorName.setName("mfk");
distributorName.setDisplayField("name");
distributorName.setValueField("id");
distributorName.setWidth(170);
distributorName.setTitle("Select Distributor");
distributorName.setPickListWidth(250);
distributorName.setOptionDataSource(ds1);

Code:


if (StringUtills.isNull(record.getAttribute("mfk"))
                                                        && !StringUtills.isNull(oldGridRecord.getAttribute("mfk")))
                                        {
                                                listGridRecord.setAttribute("mfk", oldGridRecord.getAttribute("mfk"));
                                        }

and on the server side I have this code

Code:

if (values.containsKey("mfk"))
                {
                        if (!StringUtills.isNull(values.get("mfk").toString()))
                        {
                                String numbervalue = values.get("mfk").toString().trim().replace(",", "");
                                if (StringUtills.isNumber(numbervalue))
                                {
                                        newValues.put("mfk", Integer.parseInt(numbervalue));
                                }
                        }
                }


Viewing all articles
Browse latest Browse all 4756

Trending Articles