Jean Barmash has published an example showing how to do dynamic list constraints for Alfresco properties. His example accepts a Lucene query to populate the list but it can easily be extended to query anything you want.UPDATE (12/1/2009):The link to Jean’s example in my original post wasn’t a permalink. I’ve corrected that. To clarify:
- Jean’s post on dynamically updating dependent dropdowns is here.
- His original post on data-driven dropdowns is here.
Obviously, these two techniques can be combined.
Hi Jeff,
this is exactly what I want to do, one dropdown whose value set is dependant on the value of another one. The only difference is that I don’t want to base the constraint in a Lucene Search but in a database query instead. My first dropdown list will be populated with clients and the dependant one with matters related with each client.
Obviously, there is no problem with the clients one, as the dropdown is populated taking as source a simple query, but in the matters one I need to include in the query de id of the selected client. This has been my headache for weeks, I don’t know how to tell the second combo which value is selected in the first one. Is there any way to write the value in the propertySheet object, or maybe setting the value in the FacesContext?. I still don’t have enough skills with the SDK to know this.
Please, I wouId be very, very grateful if you could suggest me a way to solve this.
Many thanks in advance and congratulations for the book.
Regards,
Alex.
Alejandro,
I’ve updated my original post with two links you should take a look at. Download Jean’s code. You should see a class that handles the Lucene query. To do what you’re trying to do, simply follow the same pattern–instead of implementing a class that does a Lucene query, implement one that does a database query (using your favorite database connection approach) and you’ll be there.
Jeff
Hi, this topic looks like the solution for an implementation, but all links to get some information about are broken:
-http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/
-http://blogs.alfresco.com/wp/jbarmash/2008/08/18/implementing-cascading-dropdowns-for-editing-properties/
Could you tell me another place to get this information?
Thanks in advance.
Jean doesn’t work for Alfresco any longer and his blog has since been archived. I’m working to see if we can possibly get those posts restored.
Jeff
Hi Jeff
The link for the Jean’s post is not active, the link has been removed
Thanks
Joseph John
Joseph,
I’m checking with the Alfresco webmaster to see if we can put those old posts of Jean’s back up.
Jeff
Restoring the old blog would be the best solution indeed. However we can get it there https://forums.alfresco.com/en/viewtopic.php?f=19&t=43663 for the time being
Has anyone got code samples
It’s quite an old post but joshijimit might still have it:
http://forums.alfresco.com/comment/71012#comment-71012