AnsweredAssumed Answered

ListOfValuesConstraint callback

Question asked by sanjaymk on May 24, 2011
Hello -

I was looking for a way implement database driven dropdowns in share.  During my research, I came across a some forum posts and Jean Barmash's blog on dynamic and cascading dropdowns.  All of them are implemented using a constraint in the model and hooking that constraint to a class implementing ListOfValuesConstraint callback. 


1) One issue / complaint I see in those posts(and my implementation) is that the JAVA class implementing ListOfValuesConstraint is only being called during startup and not when the form is displayed. Is that how it was designed to work? If yes, is there a workaround? (Just to prove this, I started alfresco in debug mode, connected eclipse and had breakpoints in all implementing methods of ListOfValuesConstraint class.  The breakpoints were reached only during startup and not during displaying the form).  The wiki for Constraints here, doesn't mention much about when the  methods in the  callbacks are triggered.

2) An issue I see by implementing a dropdown using a constraint is, if some of the constraints values in the dropdown become obsolete or not-valid, and if those are deleted from the database, the documents marked with the deleted constraints will have problems displaying in the UI. In light of this, is there any other ideas for implementing dynamic dropdowns?  I could think of calling an AJAX script that calls a JAVA webscript during onFocus of the control OR writing a custom JSP tag and calling it in ftl!

Any suggestions or comments about the above questions would be highly appreciated.