struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Beautiful Moonlight <nguyendiemh...@gmail.com>
Subject how to set value of valueNotifyTopics by javascript
Date Sun, 25 Jul 2010 16:18:52 GMT

Hi everybody, I'm having a trouble with dojo and really really need your
help. I want to catch changedValue event of datetimePicker controls in my
pages (which haven't had valueNotifyTopics attribute yet). So, in
dojo.addOnLoad function, I use setValueNotifyTopics to set value of
valueNotifyTopics on it. But I don't know why setValueNotifyTopics function
doesn't work. Hopefully there is someone has the solution for me ^^. Here is
my code :

<sx:datetimepicker name="fromDate" id="fromDate"
displayFormat="dd/MM/yyyy"/>

<script type="text/javascript">
   dojo.addOnLoad( function(){  
 var picker=dojo.widget.byId('fromDate');  
        picker.setValueNotifyTopics("/dtpChangeValue");
   });

   dojo.event.topic.subscribe("/dtpChangeValue", function(textEntered, date,
widget){   
     alert('changed');
 });
</script>

I'm using struts2-dojo-plugin-2.1.8.1

Thanks very much for your help.

-- 
View this message in context: http://old.nabble.com/how-to-set-value-of-valueNotifyTopics-by-javascript-tp29260734p29260734.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message