Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Warning
titleDojo plugin is deprecated

The Dojo plugin will be deprecated on Struts 2.1

2.12.1

This documentation refers to version 2.1 which has not been released yet.

Table of Contents
minLevel3
indent20px
stylenone

...

Code Block
HTML
HTML
<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
HTML
HTML
<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
HTML
HTML
<sx:autocompleter list="{'apple','banana','grape','pear'}" value="apple" />
Force valid option (restore option when focus is lost)

...

Code Block
Java
Java
titleAutocompleterExample.java
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
HTML
HTML
<s:form id="form">
  <sx:autocompleter name="options" label="Options" />
</s:form>
Set initial key and value
Code Block
HTML
HTML
1JSP page

<s:url id="optionsUrl" namespace="/autocompleter" action="getStates" />

<sx:autocompleter href="%{#optionsUrl}" value="Florida" keyValue="FL"/>
Change default key name

The action:

...