* Make valueNotityTopics in datetimepicker pass parameters: text, Date, widget

* Add example to datetimepicker example

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@543768 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Musachy Barroso
2007-06-02 17:43:20 +00:00
parent 0106dea923
commit 35a6233625
5 changed files with 22 additions and 6 deletions
@@ -162,6 +162,22 @@ import com.opensymphony.xwork2.util.ValueStack;
* </script>
* </pre>
* <!-- END SNIPPET: example2 -->
*
* <!-- START SNIPPET: example3 -->
* <p>Publish topic when value changes</p>
* <pre>
* &lt;sx:datetimepicker id="picker" label="Order Date" valueNotifyTopics="/value"/&gt;
*
* &lt;script type="text/javascript"&gt;
* dojo.event.topic.subscribe("/value", function(textEntered, date, widget){
* alert('value changed');
* //textEntered: String enetered in the textbox
* //date: JavaScript Date object with the value selected
* //widet: widget that published the topic
* });
* &lt;/script&gt;
* </pre>
* <!-- END SNIPPET: example3 -->
*/
@StrutsTag(name="datetimepicker", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.DateTimePickerTag", description="Render datetimepicker")
public class DateTimePicker extends UIBean {
@@ -56,7 +56,7 @@ dojo.widget.defineWidget(
var topic = this.valueNotifyTopicsArray[i];
if(!dojo.string.isBlank(topic)) {
try {
dojo.event.topic.publish(topic, this.inputNode.value);
dojo.event.topic.publish(topic, this.inputNode.value, this.getValue(), this);
} catch(ex) {
dojo.debug(ex);
}
@@ -62,7 +62,7 @@ dojo.widget.defineWidget(
var topic = this.valueNotifyTopicsArray[i];
if(!dojo.string.isBlank(topic)) {
try {
dojo.event.topic.publish(topic, this.inputNode.value);
dojo.event.topic.publish(topic, this.inputNode.value, this.getValue(), this);
} catch(ex) {
dojo.debug(ex);
}
@@ -16836,7 +16836,7 @@ for(var i=0;i<this.valueNotifyTopicsArray.length;i++){
var _e07=this.valueNotifyTopicsArray[i];
if(!dojo.string.isBlank(_e07)){
try{
dojo.event.topic.publish(_e07,this.inputNode.value);
dojo.event.topic.publish(_e07,this.inputNode.value,this.getValue(),this);
}
catch(ex){
dojo.debug(ex);
@@ -17298,7 +17298,7 @@ for(var i=0;i<this.valueNotifyTopicsArray.length;i++){
var _e63=this.valueNotifyTopicsArray[i];
if(!dojo.string.isBlank(_e63)){
try{
dojo.event.topic.publish(_e63,this.inputNode.value);
dojo.event.topic.publish(_e63,this.inputNode.value,this.getValue(),this);
}
catch(ex){
dojo.debug(ex);
@@ -27127,7 +27127,7 @@ dojo.widget.defineWidget(
var topic = this.valueNotifyTopicsArray[i];
if(!dojo.string.isBlank(topic)) {
try {
dojo.event.topic.publish(topic, this.inputNode.value);
dojo.event.topic.publish(topic, this.inputNode.value, this.getValue(), this);
} catch(ex) {
dojo.debug(ex);
}
@@ -27916,7 +27916,7 @@ dojo.widget.defineWidget(
var topic = this.valueNotifyTopicsArray[i];
if(!dojo.string.isBlank(topic)) {
try {
dojo.event.topic.publish(topic, this.inputNode.value);
dojo.event.topic.publish(topic, this.inputNode.value, this.getValue(), this);
} catch(ex) {
dojo.debug(ex);
}