Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-131

Add Binder.setConverter(TypeConverter tc)

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • Databind
    • None

      https://sourceforge.net/tracker/?func=detail&aid=3315234&group_id=152762&atid=785194

      Add a setConverter() method to the Binder class. Then in the "onBindingValidate(BindingValidateEvent event)" event listener on my composer I can apply a custom converter to all components of a certain type.
      I'm using Hibernate Validator annotations on my entity beans that are bound to zk ui components. If you put @Size(min=10, max=10) on a String field then Hibernate evaluates it when a non-null value is set on the field but does not evaluate it when a null value is set. The problem is that the <textbox> component sets an empty string on the field when the user removes the value in the textbox. I can create a custom converter to convert empty strings to nulls and apply it to the textbox using the "@

      {..., converter='MyConverter'}

      " syntax but when the form has lots of textbox components it gets a bit tedious.

            Unassigned Unassigned
            asukachen asukachen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: