Results 1 to 2 of 2

Thread: Comminting JFormattedTextField dont work

  1. #1
    Join Date
    Aug 2004
    Posts
    9

    Default Comminting JFormattedTextField dont work

    When commit or revert a form with JFormattedTextField dont work
    in SwinFormModel:

    Code:
       
    public JFormattedTextField createBoundFormattedTextField(
                String formProperty, AbstractFormatterFactory formatterFactory) {
            ValueModel valueModel = new PropertyAdapter(formModel
                    .getPropertyAccessStrategy(), formProperty);
            if (formModel.getBufferChangesDefault()) {
                valueModel = new BufferedValueModel(valueModel);
            }
            JFormattedTextField textField = createNewFormattedTextField(formatterFactory);
            TypeConverter typeConverter = new TypeConverter(valueModel, textField);
            ValueModel validatingModel = formModel.add(formProperty, typeConverter);
    in DefaultFormModel:
    Code:
        public ValueModel add(String formPropertyPath, ValueModel formValueModel) {
            if (formValueModel instanceof BufferedValueModel) {
                ((BufferedValueModel)formValueModel)
                        .setCommitTrigger(commitTrigger);
            }
    pass a TypeConverter not a BufferedValueModel

    It works
    Code:
        public ValueModel add(String formPropertyPath, ValueModel formValueModel) {
            ValueModel bufferedValueModel;
            if(formValueModel instanceof TypeConverter){
                bufferedValueModel=((TypeConverter)formValueModel).
                                                        getWrappedInstance;
            }else{
                bufferedValueModel=formValueModel;
            }
            if (bufferedValueModel instanceof BufferedValueModel) {
                ((BufferedValueModel)bufferedValueModel)
                        .setCommitTrigger(commitTrigger);
            }
    Good work

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Thanks besbello; this is fixed now.
    Keith Donald
    Core Spring Development Team

Similar Threads

  1. Replies: 1
    Last Post: Aug 1st, 2005, 01:52 AM
  2. Getting Locale to work.
    By solasta in forum Web
    Replies: 5
    Last Post: Jun 3rd, 2005, 11:04 AM
  3. Replies: 3
    Last Post: Dec 22nd, 2004, 02:30 PM
  4. Spring can't work on Eclipse
    By ryanhowai in forum Architecture
    Replies: 1
    Last Post: Nov 9th, 2004, 06:50 AM
  5. Replies: 2
    Last Post: Aug 25th, 2004, 05:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •