Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Combo Box value returning NULL

    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));
    				}
    			}
    		}

    #2
    Sorry, we basically can't do anything with this information. It's exactly the same usage pattern as is clearly shown working in Showcase examples.

    We need, at a minimum, the various logs and diagnostics listed in the FAQ, and ideally, a way to reproduce the problem.

    Comment


      #3
      Thanks, I managed to resolve the issue.

      Comment


        #4
        Hi Zolf,

        where is the 2nd part of your if-statement? You seem to never access the distributorName-ComboBoxItem.

        Best regards
        Blama

        Comment


          #5
          Crossposting...

          Comment


            #6
            Hi Blama,

            you were correct!!...It was infact that. As always appreciate your feedbacks!!

            cheers
            Zolf

            Comment

            Working...
            X