Alfresco dynamic list constraints example

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.

9 comments

  1. Alejandro Ramiro says:

    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.

  2. jpotts says:

    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

  3. Diego Godoy says:

    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.

  4. jpotts says:

    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

  5. jpotts says:

    Joseph,

    I’m checking with the Alfresco webmaster to see if we can put those old posts of Jean’s back up.

    Jeff

Comments are closed.