mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
* 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:
@@ -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>
|
||||
* <sx:datetimepicker id="picker" label="Order Date" valueNotifyTopics="/value"/>
|
||||
*
|
||||
* <script type="text/javascript">
|
||||
* 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
|
||||
* });
|
||||
* </script>
|
||||
* </pre>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*/
|
||||
@StrutsTag(name="datetimepicker", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.DateTimePickerTag", description="Render datetimepicker")
|
||||
public class DateTimePicker extends UIBean {
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
+2
-2
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user