Simple Form EditButton & SaveButton

  • Attila Szomor

    Attila Szomor - 2009-04-30


    This form has only FormattedTextControls and some buttons, after I started it
    -1st, I pressed ReloadButton and saw all data in the Controls
    -2nd, I pressed EditButton went to EditMode
    -3rd, I pressed SaveButon and got "Error while saving: incorrect data." with all linkLabel.text
    -4th, I clicked over all FormattedTextControls
    -5th, I pressed SaveButon all data that was String types went to null, but that was not String eg Integer was good.

    I put BrakePoint into FormController.validateControl all "oldValue" was good but all "newValue" was null where the VO property was String.

    I debuged "org.openswing.swing.form.client"
    -3rd, Form.getInputControlsNotValid and (FormattedTextControl)comp).isEditValid() all textBox.isEditValid() was false
    -5th, Form.getInputControlsNotValid and (FormattedTextControl)comp).isEditValid() all textBox.isEditValid() was true but all textBox.getValue() was null

    thus in Form.push() the model.setValue(comp.getAttributeName(), comp.getValue()) seted all String type attribute to null

    How can I hadle this problem ?

    Thanx your answers,

    • Attila Szomor

      Attila Szomor - 2009-05-05


      I changed all FormattedTextControls to TextControls and NumericControls and everything was okay.

      Why, how does FormattedTextControls work ?

      Thanx your answers,


    • mcarniel

      mcarniel - 2009-05-09

      FormattedTextControl is based on std java component JFormattedTextField, so you have to define the Formatter to use, through method:
      public final void setFormatter(JFormattedTextField.AbstractFormatter format)

      See JFormattedTextField component

    • Attila Szomor

      Attila Szomor - 2009-05-09

      Thanx, I will tried it shortly.


Log in to post a comment.