dev@jsftemplating.java.net

Compile problem while using com.sun.webui.jsf.model.Option

From: Karam Singh Badesha <Karam.Badesha_at_Sun.COM>
Date: Thu, 25 Jan 2007 10:03:12 -0800

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