dev@jsftemplating.java.net

Re: JSFTemplating: Compile problem while using com.sun.webui.jsf.model.Option

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Thu, 25 Jan 2007 10:56:42 -0800

Yes, the javax.faces.model.SelectItem is "jsf-api.jar" which for
GlassFish / SJS AS is in "javaee.jar". This jar file can be found in
the <install-root>/lib directory of the app server. The Woodstock
Option component extends from this class, which is why it's required.

On a slightly related note, I hope Woodstock will allow you to directly
use SelectItem in the future (or better yet, allows you to supply Lists
of data instead of their custom type -- like JSFTemplating allows).
Their components don't *require* any functionality from Option, although
Option adds some value added functionality. But for now you must create
Option objects for your model.

Good luck!

Ken

Karam Singh Badesha wrote:
> Digging more it seems like the root cause is same for both of these
> that it can't find javax.faces.model.SelectItem. Does anyone know
> which jar file it belongs to?
>
> thanks
> Karam
>
> Karam Singh Badesha wrote:
>> Ken,
>> I am trying to change my handler to use the
>> |com.sun.webui.jsf.model.Option for the dropdown but I am getting the
>> following compile errors:
>>
>> C:\...\DropDownHandlers.java:30: cannot access
>> javax.faces.model.SelectItem
>> [apt] file javax\faces\model\SelectItem.class not found
>> [apt] lReleases[0] = new Option("11.00.00", "11.00.00"
>> ); [apt] ^
>> [apt] C:\...\DropDownHandlers.java:35: cannot find symbol
>> [apt] symbol : method getValue()
>> [apt] location: class com.sun.webui.jsf.model.Option
>> [apt] String lReleasesSel = (String)
>> lReleases[0].getValue();
>>
>> It seems like I need some jar file for the first error problem, but
>> don't know the reason for the second one as webui-jsf.jar is already
>> in my path. Here is handler code.
>>
>> |
>> import com.sun.jsftemplating.annotation.Handler;
>> import com.sun.jsftemplating.annotation.HandlerInput;
>> import com.sun.jsftemplating.annotation.HandlerOutput;
>> import com.sun.jsftemplating.layout.descriptors.handler.HandlerContext;
>> import com.sun.webui.jsf.model.Option;
>>
>> import java.lang.String;
>>
>> public class DropDownHandlers {
>> @Handler(id="getReleases",
>> output={
>> @HandlerOutput(name="lavaReleases",
>> type=com.sun.webui.jsf.model.Option.class),
>> @HandlerOutput(name="lavaReleasesSel",
>> type=java.lang.String.class)
>> })
>> public static void fetchLavaReleases(HandlerContext context) {
>> Option[] lReleases = new Option[4];
>> lReleases[0] = new Option("11.00.00", "11.00.00" );
>> lReleases[1] = new Option("10.20.00", "10.20.00" );
>> lReleases[2] = new Option("10.10.00", "10.10.00");
>> lReleases[3] = new Option("10.00.00", "10.00.00");
>> String lReleasesSel = (String) lReleases[0].getValue();
>> // Set the output.
>> context.setOutputValue("lavaReleases", lReleases);
>> context.setOutputValue("lavaReleasesSel", lReleasesSel);
>> }
>> }
>>
>> thanks
>> Karam
>