Announcement

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

    ComboBoxItem - null as default value?

    My sql table allows null on the field witch i use a ComboBoxItem to alter.

    The valuemap is like this:
    Code:
    		<field name="annulment_cause_id" type="enum" title="Årsak for tilbakekalling">
    			<valueMap>
    				<value ID="1">cause one</value>
    				<value ID="2">cause two</value>
    				<value ID="3">cause three</value>
    				<value ID="4">cause four</value>
    			</valueMap>
    		</field>
    When i manually backspace the field, the client sends null to server and the field is altered to null. All good so far.

    But, when i try to do the same in code using myComboBox.clearValue() and then myForm.SaveVelues() nothing is sent to server! the field stays unaltered.

    How can i do the same thing in code as i manually do by clearing the ComboBoxItem with backspace?

    SmartClient Version: v8.3p_2013-05-05/PowerEdition Deployment
    (built 2013-05-05)

    #2
    Use setValue(null) to set the value to null.

    Comment


      #3
      Originally posted by Isomorphic View Post
      Use setValue(null) to set the value to null.
      ..Do not compile.

      but this code solved my problem:
      Code:
      String value = null;
      myComboBox.setValue(value);
      Thanks a lot for quick reply!

      Comment

      Working...
      X