Dear Jerome,
Thanks for the quick reply.
El 24/07/2012 14:19, Jerome Caffaro escribió:
Dear Miguel,
On 07/19/2012 10:03 AM, Miguel Martín wrote:
If you add a new mandatory CKEDITOR bibformat element
Thanks for the feedback.
It is indeed a limitation of WebSubmit, which does not allow a response
element to be made mandatory:
<http://invenio-demo.cern.ch/help/admin/websubmit-admin-guide#2.2>
(bullet 3.3 of section 2.1, or within the related sections of each
element)
Oops, should have RTFM! :) My mistake!
The reason is that a response element might be any kind of user
interface (for eg. an advanced form with many fields, powered by
jQuery and the likes) for which it is not possible to define if
it has been filled in or not (for CKEditor one can use .getData(),
but for another UI it will be get_value() or get_json_dict(), etc.)
The same applies to "User Defined Input" elements, and "Hidden Input"
elements (for which it does not make sense to check the value).
To be more helpful WebSubmit should warn when such an element
is made mandatory on the admin interface.
Yes, that would be nice.
Or you could also modify the Field Level <option> so that it checks the
nature of the Element and does not display de option "Mandatory" for
User Defined Inputs/Response elements.
On our side, we've hacked the code that generates tester2 js funcion to
avoid the JS checking of those elements.
What tester2 function should be checking is
CKEDITOR.instances.BulletinCKEditor2.getData()
I've fix this by changing the code of tester2 function at
/opt/invenio/lib/python/invenio/websubmit_templates.py
I would suggest to 1) make your 'WYSIWYG' element optional and 2) move
this code to a custom JS check so that you can 3) connect this check
to your element (as it is done for 'DatCheckNew' connected to element
'DEMOART_DATE' in DEMOART submission).
<http://invenio-demo.cern.ch/help/admin/websubmit-admin-guide#3.3>
That is indeed the way we achieved it.
Best regards
Cheers!