mandatory custom form control & disabled save button

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2013 01:40 PM
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):
Thanks, Will
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.
Thanks, Will
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2013 01:36 PM
ok, so I found out that I was not in fact triggering the event. I needed to call input.dispatchEvent(keyUpEvent) on the input field during onchange instead of input.onkeyup(); What threw me off was this kept firing during the input.onkeyup():
<input onkeyup="javascript:alert('onkeyup fired');" />
so I thought the event was happening.
