The JSP Tag Approach
<%@ taglib uri="#" prefix="h" %>
<%@ taglib uri="#" prefix="f" %>
              (1) <%@taglib prefix="ui" uri="#"%>
...

<f:view>
...

<h:form id="autofillform">
   <h:panelGrid cellpadding="5" cellspacing="0" columns="3" style="margin-bottom: 20px">
   ...

      <h:outputText value="City:" />
                 
             (2) <ui:autoComplete size="40" maxlength="100" id="cityField"
                     completionMethod="#{ApplicationBean.completeCity}"
                     value="#{SessionBean.city}" required="true"
                     ondisplay="function(item) { return extractCity(item); }"
                     onchoose="function(item) { return chooseCity(item); }"
                />
       ...


          <h:outputText value="State:" />
                 
             (2) <ui:autoComplete size="2" maxlength="100" id="stateField"
                    completionMethod="#{ApplicationBean.completeState}"
                    value="#{SessionBean.state}" required="true" />

   ...
   </h:panelGrid>
...
</f:view>
          
 
 
Copyright 1994-2006 Sun Microsystems, Inc. Close