<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-layout.tld" prefix="layout" %>
<%-- In real life, these would be loaded from a database --%>
<%@page import="fr.improve.struts.taglib.layout.field.ajax.select.Option,java.util.Vector" %>
<%
Vector countries = new Vector();
Option country1 = new Option();
country1.setLabel("France");
country1.setValue("France");
countries.add(country1);
Option country2 = new Option();
country2.setLabel("Deutschland");
country2.setValue("Deutschland");
countries.add(country2);
Option country3 = new Option();
country3.setLabel("UK");
country3.setValue("UK");
countries.add(country3);
pageContext.setAttribute("countries", countries);
%>
<html>
<head>
<title>Test suggest tag</title>
<layout:skin includeScript="true"/>
</head>
<body bgcolor="#ffd9d9">
<br />
<layout:form action="/examples/selectDependent" reqCode="init" key="demoSelectDependentForm.title" styleClass="FORM">
<layout:row>
<layout:selectDependent key="" property="country" name="demoSelectDependentForm"
fillDropDownAction="/examples/getCitiesOptions"
doubleCombo="true"
targetName="city"
size="1">
<layout:option key="_ _ _ _ _ _ _ _ _" value="NA" />
<layout:optionsCollection name="countries" value="value" label="label" />
</layout:selectDependent>
<layout:select key="" name="demoSelectDependentForm" size="1" property="city">
<layout:option key="_ _ _ _ _ _ _ _ _ _ _ _" value="NA" />
</layout:select>
</layout:row>
</layout:form>
</body>
</html>