Select Loader demo

Description
This page displays the SelectLoader mixin, chaining 3 selects.
Have a look to the event redefinition, cleaning the third select on first one choice.


In Action
Submitted country :
Submitted city :
Submitted type :



TML Source code

		<t:form>
			<t:select t:mixins="exanpe/selectLoader" t:targetId="city" t:id="country" 
					  model="countryModel" value="countryValue" encoder="countryEncoder"/>
	
			<script type="text/javascript">
			YAHOO.util.Event.onDOMReady(function(){
				country.afterUpdateSuccess = function(){
					YAHOO.util.Dom.get("type").options.length = 0;
				}
			});
			</script>
	
			<t:select t:mixins="exanpe/selectLoader" t:targetId="type" t:id="city" 
					  model="cityModel" value="cityValue" encoder="cityEncoder" />
			
			<t:select t:id="type" model="typeModel" value="typeValue" blankOption="never"/>
			
			<t:submit/>
		</t:form>
		
		Submitted country : ${countryValue?.id}<br/>
		Submitted city : ${cityValue?.id}<br/>
		Submitted type : ${typeValue}<br/>
	



Java code

    	@OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT, component = "country")
    	public SelectModel populateSelect(String value)
    	 ...
    	@OnEvent(value = ExanpeEventConstants.SELECTLOADER_EVENT, component = "city")
    	public SelectModel populateSelectType(String value)