dev@jsftemplating.java.net

Re: getParentDropDownOptions Handler

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Sat, 10 Jun 2006 08:58:44 -0700

Hi Jennifer,

You can specify an array class like: String[].class

However, there was a bug in the Annotation Processor where instead of
generating a String that is understandable (to forName, not humans)
like: "[Ljava.lang.String;", it was generating: "java.lang.String[]". I
wrote some code to convert from one to the other... it should now work.

Ken

Jennifer Chou wrote:
> okay I gotcha now ..The annotations were very straightforward. The
> only thing is if I wanted to specify an Option[] or String[] as a
> type, how would I do it? I just did type=Object.class.
> Either List or String[] is fine, I'll just do List for now.
>
> Thanks,
> Jennifer
>
> Ken Paulsen wrote:
>>
>> Hi Jennifer,
>>
>> It looks good, however... ;)
>>
>> I would like there to be 2 handlers similar to how you have 2 Util
>> methods. This would allow the following:
>>
>> <rave:dropDown id="parent" options="$attribute{opts}"...>
>> <!beforeCreate
>> getPageComponents(pageName="#{...}"
>> displayName=>$attribute{disp} qualifiedName=>$attribute{long});
>> getDropDownOptions(labels="$attribute{disp}",
>> values="$attribute{long}", options=>$attribute{opts});
>> >
>> </rave:dropDown>
>> <rave:dropDown id="componentType" options="$attribute{opts}" ...>
>> <!beforeCreate
>> getComponentTypes(...);
>> getDropDownOptions(labels="$attribute{...}" values="..."
>> options=>$attribute{opts});
>> >
>> </rave:dropDown>
>>
>> It looks like you got the @annotations figured out... what it hard?
>>
>> As for the loading... yes, I think we'll have it work the same way.
>> The LDM (LayoutDefinitionManager) will find it by name... it probably
>> won't be in the classpath, but the API doesn't change.
>>
>> Oh... one more thing. There exists a handler called
>> "getGlobalComponentTypeInformation" in MetaDataHandlers.java. One of
>> its outputs is a "List" (we can change this to a String[] if you
>> want), this is the handler we'll probably use for the other drop
>> down. The list output can be used for both display names and
>> values... so it may be better to accept 2 lists/arrays vs. 1 Map.
>> Sorry I didn't think of this yesterday.
>>
>> Thanks!
>>
>> Ken
>>
>>
>> Jennifer Chou wrote:
>>> I created a handler getParentDropDownOptions in DropDownHandler. It
>>> takes a String input - pageName
>>> and returns an output - array of com.sun.rave.web.ui.model.Option
>>> I wasn't sure where to put getMap(...) and getOptions(map) so I put
>>> it in DropDownUtil.java.
>>> Ken - In my Test.java, pageName was just "propSheet.jsf" and
>>> propSheet.jsf was in the classpath. Will this work the same way for
>>> our tool?
>>>
>>> Jennifer
>>> ------------------------------------------------------------------------
>>>
>