THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
Warning | |||
---|---|---|---|
| |||
The Dojo plugin will be deprecated on Struts 2.1 | 2.1 | 2.1 | This documentation refers to version 2.1 which has not been released yet. |
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
...
Code Block | ||||
---|---|---|---|---|
| ||||
<script type="text/javascript"> dojo.event.topic.subscribe("/value", function(textEnteredtext, date, widget){ alert('value changed'); //textEntered: String eneteredentered in the textbox //date: JavaScript Date object with the value selected //widetwidget: widget that published the topic }); </script> <sx:datetimepicker label="Order Date" valueNotifyTopics="/value"/> |
Use other locales.
Warning |
---|
Locales must be specified in the sx:head tag. |
Code Block | ||||
---|---|---|---|---|
| ||||
<sx:head extraLocales="en-us,nl-nl,de-de" /> <sx:datetimepicker label="In German" name="dddp7" value="%{'2006-06-28'}" language="de-de" /> <sx:datetimepicker label="In Dutch" name="dddp8" value="%{'2006-06-28'}" language="nl-nl" /> |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<sx:autocompleter list="{'apple','banana','grape','pear'}" value="apple" />
|
Force valid option (restore option when focus is lost)
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
public class AutocompleterExample extends ActionSupport { public Map<String, String> getOptions() { Map<String,String> options = new HashMap<String,String>(); options.put("FLFlorida", "FloridaFL"); options.put("ALAlabama", "AlabamaAL"); return options; } } |
The mapping:
...
Code Block | ||||
---|---|---|---|---|
| ||||
<s:form id="form">
<sx:autocompleter name="options" label="Options" />
</s:form>
|
Set initial key and value
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<s:url id="optionsUrl" namespace="/autocompleter" action="getStates" />
<sx:autocompleter href="%{#optionsUrl}" value="Florida" keyValue="FL"/>
|
Change default key name
The action:
...