AnsweredAssumed Answered

mandatory custom form control & disabled save button

Question asked by jonesgeek on Jan 7, 2013
Latest reply on Jan 8, 2013 by jonesgeek
Hello, I am on alfresco community-4.0.a, and I am trying to create a custom form control.  The control is a drop down, and a few radio buttons and checkboxes, and a hidden input field (this is the main field which the control gets it's value from with the id from ${fieldHtmlId}).  As the user makes selections from the select box, radio buttons, and checkboxes, the value in the input is built.  I've had the input field unhidden to make sure that the value is indeed getting updated  (I am kind of modeling this off of the OOTB period control that has a hidden input that it uses for it's control value).  The problem is when I have the property as a mandatory property (defined as mandatory in the object model definition), and I try to edit a new document's properties.  As I see the value in the input field being updated, the save button is never enabled.  If I tab down the form, and tab in and tab out of the input field (without keying in any value), the save button enables itself.  I am guessing it has to do with the field with the control value never having a keystroke in it, the value is changed via javascript, but I'm doing the same thing as the OOTB period control, so mine should work, right?

Here are some things that I've tried doing (without any success):
  • change the constraint-handler in share-custom-config.xml for this field so that it fires on event="change".

  • trigger the keydown, keypress, keyup, change, and blur events on the input field after the value has changed to emulate a keystroke in the input field.
I'm out of ideas of why the save button doesn't get enabled unless I use the keyboard inside the input field, and I've spent two days looking at it, so I am now offering this up to you.  If you have any insight or other ideas to try, I would be ever greatful!

Thanks, Will