> -----Original Message-----
> From: Sloan Bowman [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, October 25, 2003 4:03 AM
> To: Jetspeed Users List
> Subject: RE: Velocity and Action Events?
> 
> 
> I have found what I believe to be a bug in Jetspeed. When I create a 
> subclass of 
> org.apache.jetspeed.modules.actions.portlets.VelocityPortletAction 
> and create event methods such as searchUser or searchGroup and supply 
> the argument $jslink.setAction('portlets.searchGroup') to the form 
> action it does not find the method. I looked a little deeper and 
> noticed that every method that I had seem as an example has the do 
> statement before the method so I tried doSearchUser and it still did 
> not work. At this point I was about to pull my hair out when I tried 
> doSearch and it worked just fine with the exact same code.  Is there 
> something in the refelection used that prevents the methods from 
> being a certain size? Why would doSearch work but doSearchUser not? ? 
> Has any body else had this problem or I am missing something? Thanks 
> for the help.

Hello,

yes, that can be frustrating. And yes, it does have to do with the way
reflection is used (or rather, how the request parameters are parsed).
The name of an action event method must be:

do[A-Z][a-z]+

i.e., one capital letter after do, and then no capital letters. So
doSearchuser is fine, doSearchUser is not.
>From the javadoc of ActionEvent:

Because ParameterParser makes all the key values lowercase, we have to
do some work to format the string into a method name. For example, a
button name eventSubmit_doDelete gets converted into
eventsubmit_dodelete. Thus, we need to form some sort of naming
convention so that dodelete can be turned into doDelete.

Thus, the convention is this:

- The variable name MUST have the prefix "eventSubmit_".
- The variable name after the prefix MUST begin with the letters "do".
- The first letter after the "do" will be capitalized and the rest will
be lowercase

If you follow these conventions, then you should be ok with your method
naming in your Action class.

HTH,

Holger


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to