David, I will take a look at that example for sure, however, I don't use velocity in my portlets, so I'll have to figure out exactly what needs doing for a portlet in general in order to join in the "doHeader" phase.
One question I have though is how we prevent multiple portlets from including the same resources multiple times? (Eg. if 5 portlets in the page all need dojo.js, then how do we prevent it from being needlessly included 5 times). Perhaps this will become obvious when I look at the example, in which case, disregard the question. I use dojo heavily though, so I'm sure when I upgrade to 2.1, I'll have a few things to figure out... On 7/17/06, David Sean Taylor <[EMAIL PROTECTED]> wrote:
Hans Brattberg wrote: > Hi! > I'm struggeling trying to have a dynamic tree structure in a portlet. > And I am realy not sure if I'm walking the rigth path. > > Is there anyone out there that has succeded in putting a tree structure > in a portlet? > What techs did u use? > > /Hans > Dojo also has a tree widget You can use Dojo in any portlet running in Jetspeed, either in /desktop or /portlet. Take a look at the SecurityPermissionsPortlet.java for an example of how to do this (and its vm, view.vm) Important: SecurityPermissionsPortlet extends AbstractDojoVelocityPortlet You will need to extend AbstractDojoVelocityPortlet (just add a dep to the jetspeed-gems jar) This is necessary to join in the "doHeader" phase of the portlet request cycle. Currently there are two cycles for a portlet request: 1. action 2. render With JSR-286, there will be 3 phases: 1. header 2. action 3. render The AbstractDojoVelocityPortlet handles the header phase There are two methods to override for your dojo imports: 1. includeDojoRequires 2. includeDojoWidgetRequires See the SecurityPermissionPortlet for examples of including in dojo imports into the <head> area All of this will get sorted out with the new spec I really don't like that we have to include dojo imports via java It would be much better via a vm or jsp file But, this is where its at right now... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
