Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
JSP - A mailing list about Java Server Pages specification and reference
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Change updateFreq in a DIV

Change updateFreq in a DIV

2007-11-07       - By Jeromy Evans

 Back
Reply:     1     2     3  

Your code references "quoteDetails" but the div you provided is
"myDivId".  Other than that I don't see anything wrong with it.
updateFreq should be writeable using your approach although I haven't
tried it.

Try a simple script:

var myWidget = dojo.widget.byId("myDivId");
 myWidget.updateFreq = 10;

Use a breakpoint in FireBug to ensure the widget is found and that the
updateFreq member is public.

Hope that helps,
Jeromy Evans

Grish wrote:
> Ok I've made some progress but now i'm stuck. What I did was have a a div tag
>
>  <s:div id="myDivId" theme="ajax" href="%{url}" formId="frmMyForm"
>           showLoadingText="false" updateFreq="5000" autoStart="false"
>           startTimerListenTopics="/startTimer"
> stopTimerListenTopics="/stopTimer" />
>
> then I have select box
>
> <s:select id="refreshEvery" onchange="updateFreq(this)" list="myList" />
>
> then on my updateFreq function i have the following:
>
> function updateFreq(obj) {
>      
>      
>       if (obj.selectedIndex == 0) {
>         dojo.event.topic.publish("/stopTimer");
>       }
>       else {
>         // get Div and update frequency
>         var quoteDiv = dojo.byId("quoteDetails");
>         quoteDiv.updateFreq = obj.options[obj.selectedIndex].value;
>         dojo.event.topic.publish("/startTimer");
>       }
>      
> }
>
> Right now everything is working except the change to the updateFreq. When
> the timer starts it still keeps with the 5 second interval Is it possible to
> access this property and change it?
>
>
>
> Grish wrote:
>  
>> Hi,
>>
>> I'm having a hard time trying to implement this - I want to have a select
>> box containing options for the user to select the update frequency of my
>> div tag. So my select box has "no refresh", "30 seconds", "60 seconds",
>> "120 seconds" and depending on what the user selects the frequency will
>> change.
>>
>> I was thinking i could make a topic to change the updateFreq parameter
>> then with the onchange event with the select tag i'll make a call for that
>> topic:
>>
>> dojo.event.topic.subscribe("/changeRefresh", function(data, type, request)
>> {
>>   // code to change the updateFreq of the div tag
>> }
>>
>> <s:select onchange="onchange="dojo.event.topic.publish('/changeRefresh')"
>> ......
>>
>> I just don't know how to access the div tag and change the updateFreq
>> parameter. I tried using the dojo.byId("myDivId") function but it didn't
>> work. Suggestion on how to do this?
>>
>> Also just curious as to why there's no type variable when i call my topic
>> from an event like onchange, it's always undefined.
>>
>>    
>
>  


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.