Slider demo

Description
This example shows an Ajax Slider component.
It is bound to a page @Property sliderValue.
ExanpeEventConstants.SLIDER_EVENT is used to intercept Ajax Slider event.
An ajax request is triggered on slide end.
Notice here the ajax and zone attributes.
The zone parameter must be used with ajax parameter (set to true) and allow to update the target Tapestry zone element.
The displayId attribute is set to "none" and is used to hide current slider value.


In Action
Ajax Slider value : 0



TML Source code

		<t:form>
			<t:zone t:id="zone" id="zone">
				Ajax Slider value : ${sliderValue}<br/>
			</t:zone>
			<ex:slider t:id="slider" value="sliderValue" ajax="true" zone="zone" displayId="none"/>
		</t:form>
	



Java code

    @Property
    @Persist
    private int sliderValue;
    
    @InjectComponent
    private Zone zone;

    @OnEvent(ExanpeEventConstants.SLIDER_EVENT)
    Object handleSliderAjaxEvent(String value)
    {
        return zone.getBody();
    }