|
View:
New views
13 Messages
—
Rating Filter:
Alert me
|
|
|
dojo endTopic eventsHi,
When a dropdown is changed I make a busy indicator component visible and call the value change listener on the server. I want to listen for the refresh.endTopic event so that I can hide the busy indicator when the request is completed. I've read the TLD example and an other woodstock AJAX example which helped me come up with this: var processEvents = { update: function(props) { document.getElementById('form1:progressBar1').setProps({"visible":false}); } } // Subscribe to refresh event. var domNode = document.getElementById("form1:dropDown1"); domNode.subscribe(domNode.event.refresh.endTopic, processEvents, "update"); I put that code in the method that is called by dropDown1's onChange. I've also tried it outside of any function. The error I get is: "domNode.subscribe is not a function". I've also tried it like this (also from woodstock docs): dojo.event.topic.subscribe(webui.suntheme.widget.dropDown.event.refresh.endTopic, processEvents, "update"); and the error I get is: "dojo.event has no properties". Please forgive me if this is a dumb question, but I am new to doing JavaScript stuff and AJAX. I'll be reading a book on JavaScript soon. Thanks, Ryan --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsWhen are you calling the document.getElementById function? I suspect
you're calling this too early and the widget has not been created, yet. In Woodstock 4.3 (next milestone), I've added an onLoad attribute to the head tag. This will ensure your function is executed after all widgets have been initialized. In the mean time, you can use the approach below. <head> <script type="text/javascript"> var processEvents = { update: function(props) { document.getElementById('form1:progressBar1').setProps({"visible":false}); } } function init() { var domNode = document.getElementById("form1:dropDown1"); if (domNode == null || domNode.event == null) { setTimeout("init();", 10); } domNode.subscribe(domNode.event.refresh.endTopic, processEvents, "update"); } </script> </head> <body onload="init();"> ... Dan Ryan de Laplante wrote: > Hi, > > When a dropdown is changed I make a busy indicator component visible > and call the value change listener on the server. I want to listen > for the refresh.endTopic event so that I can hide the busy indicator > when the request is completed. > I've read the TLD example and an other woodstock AJAX example which > helped me come up with this: > > var processEvents = { > update: function(props) { > > document.getElementById('form1:progressBar1').setProps({"visible":false}); > > } > } > > // Subscribe to refresh event. > var domNode = document.getElementById("form1:dropDown1"); > domNode.subscribe(domNode.event.refresh.endTopic, processEvents, > "update"); > > I put that code in the method that is called by dropDown1's onChange. > I've also tried it outside of any function. The error I get is: > "domNode.subscribe is not a function". > > I've also tried it like this (also from woodstock docs): > > dojo.event.topic.subscribe(webui.suntheme.widget.dropDown.event.refresh.endTopic, > processEvents, "update"); > > and the error I get is: "dojo.event has no properties". Please > forgive me if this is a dumb question, but I am new to doing > JavaScript stuff and AJAX. I'll be reading a book on JavaScript soon. > > > Thanks, > Ryan > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsThe init function was causing hundreds of "dojo.event has no properties"
errors. I think you intended for the subscribe to be in an else block, so I changed it to look like this: function init() { var domNode = document.getElementById('form1:dropDown1'); if (domNode == null || domNode.event == null) { setTimeout("init();", 10); } else { alert('before subscribe'); domNode.subscribe(domNode.event.refresh.endTopic, processEvents, "update"); alert('after subscribe'); } } I never see the alerts because it seems that domNode.event always == null. Thanks, Ryan Dan Labrecque wrote: > When are you calling the document.getElementById function? I suspect > you're calling this too early and the widget has not been created, > yet. In Woodstock 4.3 (next milestone), I've added an onLoad attribute > to the head tag. This will ensure your function is executed after all > widgets have been initialized. In the mean time, you can use the > approach below. > > <head> > <script type="text/javascript"> > var processEvents = { > update: function(props) { > > document.getElementById('form1:progressBar1').setProps({"visible":false}); > > } > } > function init() { > var domNode = document.getElementById("form1:dropDown1"); > if (domNode == null || domNode.event == null) { > setTimeout("init();", 10); > } > domNode.subscribe(domNode.event.refresh.endTopic, > processEvents, "update"); > } > </script> > </head> > <body onload="init();"> > ... > > Dan --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsActually, I meant to use a "return" statement like so:
function init() { var domNode = document.getElementById("form1:dropDown1"); if (domNode == null || typeof domNode.subscribe != "function") { return setTimeout('init();', 10); } domNode.subscribe(domNode.event.refresh.endTopic, processEvents, "update"); } If your alerts are not being executed, it may be that you have the wrong id. Dan Ryan de Laplante wrote: > The init function was causing hundreds of "dojo.event has no > properties" errors. I think you intended for the subscribe to be in > an else block, so I changed it to look like this: > > function init() { > var domNode = document.getElementById('form1:dropDown1'); > if (domNode == null || domNode.event == null) { > setTimeout("init();", 10); > } else { > alert('before subscribe'); > domNode.subscribe(domNode.event.refresh.endTopic, > processEvents, "update"); > alert('after subscribe'); > } > } > > I never see the alerts because it seems that domNode.event always == > null. > > Thanks, > Ryan > > > Dan Labrecque wrote: >> When are you calling the document.getElementById function? I suspect >> you're calling this too early and the widget has not been created, >> yet. In Woodstock 4.3 (next milestone), I've added an onLoad >> attribute to the head tag. This will ensure your function is executed >> after all widgets have been initialized. In the mean time, you can >> use the approach below. >> >> <head> >> <script type="text/javascript"> >> var processEvents = { >> update: function(props) { >> >> document.getElementById('form1:progressBar1').setProps({"visible":false}); >> >> } >> } >> function init() { >> var domNode = document.getElementById("form1:dropDown1"); >> if (domNode == null || domNode.event == null) { >> setTimeout("init();", 10); >> } >> domNode.subscribe(domNode.event.refresh.endTopic, >> processEvents, "update"); >> } >> </script> >> </head> >> <body onload="init();"> >> ... >> >> Dan > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsThanks. I am certain that I have the right id:
<webuijsf:form binding="#{Page1.form1}" id="*form1*"> <webuijsf:dropDown binding="#{Page1.dropDown1}" id="*dropDown1*" items="#{Page1.list1}" label="Proximity To Elevator" labelOnTop="true" onChange="dropDown1Changed(); return false;" style="left: 216px; top: 48px; position: absolute" valueChangeListenerExpression="#{Page1.dropDown1_processValueChange}"/> function init() { var domNode = document.getElementById('*form1:dropDown1*'); if (domNode == null || domNode.event == null) { return setTimeout("init();", 10); } alert('subscribing to dropDown1 endTopic'); domNode.subscribe(domNode.event.refresh.endTopic, processEvents, "update"); } <webuijsf:body binding="#{Page1.body1}" id="body1" onLoad="*init();*" style="-rave-layout: grid"> The alert in init() never happens. This is a new visual web project with very little code in it. You can get it to work? Thanks, Ryan Dan Labrecque wrote: > Actually, I meant to use a "return" statement like so: > > function init() { > var domNode = document.getElementById("form1:dropDown1"); > if (domNode == null || typeof domNode.subscribe != > "function") { > return setTimeout('init();', 10); > } > domNode.subscribe(domNode.event.refresh.endTopic, > processEvents, "update"); > } > > If your alerts are not being executed, it may be that you have the > wrong id. > > Dan > > Ryan de Laplante wrote: >> The init function was causing hundreds of "dojo.event has no >> properties" errors. I think you intended for the subscribe to be in >> an else block, so I changed it to look like this: >> >> function init() { >> var domNode = document.getElementById('form1:dropDown1'); >> if (domNode == null || domNode.event == null) { >> setTimeout("init();", 10); >> } else { >> alert('before subscribe'); >> domNode.subscribe(domNode.event.refresh.endTopic, >> processEvents, "update"); >> alert('after subscribe'); >> } >> } >> >> I never see the alerts because it seems that domNode.event always == >> null. >> >> Thanks, >> Ryan >> >> >> Dan Labrecque wrote: >>> When are you calling the document.getElementById function? I suspect >>> you're calling this too early and the widget has not been created, >>> yet. In Woodstock 4.3 (next milestone), I've added an onLoad >>> attribute to the head tag. This will ensure your function is >>> executed after all widgets have been initialized. In the mean time, >>> you can use the approach below. >>> >>> <head> >>> <script type="text/javascript"> >>> var processEvents = { >>> update: function(props) { >>> >>> document.getElementById('form1:progressBar1').setProps({"visible":false}); >>> >>> } >>> } >>> function init() { >>> var domNode = document.getElementById("form1:dropDown1"); >>> if (domNode == null || domNode.event == null) { >>> setTimeout("init();", 10); >>> } >>> domNode.subscribe(domNode.event.refresh.endTopic, >>> processEvents, "update"); >>> } >>> </script> >>> </head> >>> <body onload="init();"> >>> ... >>> >>> Dan >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsI meant to send my last email in HTML format. The places that have
*stars* around them were bolded for clarity. The *stars* are not really in the code. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Rendering fails on all browsersHi list,
I have a small web app that has had problems rendering on some pc's running firefox. Now i'm trying to redeploy the latest, except the controls do not render on any platform now!!! Object cannot be created in this context" code: "9 (no name)() Blogger (line 89) loaded()bootstrap.js (line 1002) _callLoaded()bootstrap.js (line 1087) _modulesLoaded()bootstrap.js (line 1074) _loadInit(load ) woodstock4_3._base.body is not a constructor woodstock4_3._dojo.addOnLoad(function() {new woodstock4_3._base.body('/index.xhtml', '/Blogger/index.xhtml',null,null,'com_sun_webui_util_FocusManager_focusElementId',true);});90 I have upgraded to latest woodstock and here's the page: <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:w="http://www.sun.com/webui/webuijsf" xmlns:f="http://java.sun.com/jsf/core" xmlns:webuijsf="http://www.sun.com/webui/webuijsf"> <w:page frame="false" xhtml="false"> <w:html> <w:head title="PaySett Blogger"/> <w:body> <w:messageGroup /> <w:markup tag="h1">PaySett Blogger</w:markup><br/> <w:markup tag="div" styleClass="#{themeStyles.CONTENT_MARGIN}"> <w:form id ="loginForm"> Username123 : <w:textField id="tfUsername" text="#{LoginBean.username}" /><br/> Password : <w:passwordField id="tfPassword" text="#{LoginBean.password}" /><br/> <w:button id="cmbSubmit" action="#{LoginBean.doLogin}" primary="true" text="Login"/> <w:hiddenField id="isLoggedIn" value="#{LoginBean.isLoggedIn}"/> </w:form> </w:markup> </w:body> </w:html> </w:page> </f:view> Any ideas would be highly appreciated! Federico Vela Dan Labrecque wrote: > Actually, I meant to use a "return" statement like so: > > function init() { > var domNode = document.getElementById("form1:dropDown1"); > if (domNode == null || typeof domNode.subscribe != > "function") { > return setTimeout('init();', 10); > } > domNode.subscribe(domNode.event.refresh.endTopic, > processEvents, "update"); > } > > If your alerts are not being executed, it may be that you have the > wrong id. > > Dan > > Ryan de Laplante wrote: >> The init function was causing hundreds of "dojo.event has no >> properties" errors. I think you intended for the subscribe to be in >> an else block, so I changed it to look like this: >> >> function init() { >> var domNode = document.getElementById('form1:dropDown1'); >> if (domNode == null || domNode.event == null) { >> setTimeout("init();", 10); >> } else { >> alert('before subscribe'); >> domNode.subscribe(domNode.event.refresh.endTopic, >> processEvents, "update"); >> alert('after subscribe'); >> } >> } >> >> I never see the alerts because it seems that domNode.event always == >> null. >> >> Thanks, >> Ryan >> >> >> Dan Labrecque wrote: >>> When are you calling the document.getElementById function? I suspect >>> you're calling this too early and the widget has not been created, >>> yet. In Woodstock 4.3 (next milestone), I've added an onLoad >>> attribute to the head tag. This will ensure your function is >>> executed after all widgets have been initialized. In the mean time, >>> you can use the approach below. >>> >>> <head> >>> <script type="text/javascript"> >>> var processEvents = { >>> update: function(props) { >>> >>> document.getElementById('form1:progressBar1').setProps({"visible":false}); >>> >>> } >>> } >>> function init() { >>> var domNode = document.getElementById("form1:dropDown1"); >>> if (domNode == null || domNode.event == null) { >>> setTimeout("init();", 10); >>> } >>> domNode.subscribe(domNode.event.refresh.endTopic, >>> processEvents, "update"); >>> } >>> </script> >>> </head> >>> <body onload="init();"> >>> ... >>> >>> Dan >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsI added your code verbatim and it works as expected. The only reason I
can see that "domNode" or its "event" property would be null is if the wrong id were used. Or, there could be a JavaScript error somewhere in the page. That said, I'm assuming you're using Woodstock 4.2 or later? If you're using an earlier version, then you may be looking at the wrong TLD examples. Dan Ryan de Laplante wrote: > Thanks. I am certain that I have the right id: > > <webuijsf:form binding="#{Page1.form1}" id="*form1*"> > <webuijsf:dropDown binding="#{Page1.dropDown1}" id="*dropDown1*" > items="#{Page1.list1}" label="Proximity To Elevator" labelOnTop="true" > onChange="dropDown1Changed(); return > false;" style="left: 216px; top: 48px; position: absolute" > valueChangeListenerExpression="#{Page1.dropDown1_processValueChange}"/> > > function init() { > var domNode = document.getElementById('*form1:dropDown1*'); > if (domNode == null || domNode.event == null) { > return setTimeout("init();", 10); > } > alert('subscribing to dropDown1 endTopic'); > domNode.subscribe(domNode.event.refresh.endTopic, processEvents, > "update"); > } > > <webuijsf:body binding="#{Page1.body1}" id="body1" onLoad="*init();*" > style="-rave-layout: grid"> > > The alert in init() never happens. This is a new visual web project > with very little code in it. You can get it to work? > > > Thanks, > Ryan > > Dan Labrecque wrote: >> Actually, I meant to use a "return" statement like so: >> >> function init() { >> var domNode = document.getElementById("form1:dropDown1"); >> if (domNode == null || typeof domNode.subscribe != >> "function") { >> return setTimeout('init();', 10); >> } >> domNode.subscribe(domNode.event.refresh.endTopic, >> processEvents, "update"); >> } >> >> If your alerts are not being executed, it may be that you have the >> wrong id. >> >> Dan >> >> Ryan de Laplante wrote: >>> The init function was causing hundreds of "dojo.event has no >>> properties" errors. I think you intended for the subscribe to be in >>> an else block, so I changed it to look like this: >>> >>> function init() { >>> var domNode = document.getElementById('form1:dropDown1'); >>> if (domNode == null || domNode.event == null) { >>> setTimeout("init();", 10); >>> } else { >>> alert('before subscribe'); >>> domNode.subscribe(domNode.event.refresh.endTopic, >>> processEvents, "update"); >>> alert('after subscribe'); >>> } >>> } >>> >>> I never see the alerts because it seems that domNode.event always == >>> null. >>> >>> Thanks, >>> Ryan >>> >>> >>> Dan Labrecque wrote: >>>> When are you calling the document.getElementById function? I >>>> suspect you're calling this too early and the widget has not been >>>> created, yet. In Woodstock 4.3 (next milestone), I've added an >>>> onLoad attribute to the head tag. This will ensure your function is >>>> executed after all widgets have been initialized. In the mean time, >>>> you can use the approach below. >>>> >>>> <head> >>>> <script type="text/javascript"> >>>> var processEvents = { >>>> update: function(props) { >>>> >>>> document.getElementById('form1:progressBar1').setProps({"visible":false}); >>>> >>>> } >>>> } >>>> function init() { >>>> var domNode = document.getElementById("form1:dropDown1"); >>>> if (domNode == null || domNode.event == null) { >>>> setTimeout("init();", 10); >>>> } >>>> domNode.subscribe(domNode.event.refresh.endTopic, >>>> processEvents, "update"); >>>> } >>>> </script> >>>> </head> >>>> <body onload="init();"> >>>> ... >>>> >>>> Dan >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@... >>> For additional commands, e-mail: users-help@... >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Rendering fails on all browsersIf you're using a milestone build of 4.3, the browser may have cached
previously loaded resources. Try clearing the browser cache and reload the page. During development, we are setting the browser cahce to 24 hours via the web.xml file. You can also disabled the cache completely. <!-- <context-param> <param-name>com.sun.webui.theme.CACHE_DISABLED</param-name> <param-value>true</param-value> </context-param> --> <!-- Set browser cache to expire in 24 hours for milestone releases. --> <context-param> <param-name>com.sun.webui.theme.CACHE_EXPIRES</param-name> <param-value>86400</param-value> </context-param> Dan Federico Vela wrote: > Hi list, > > I have a small web app that has had problems rendering on some pc's > running firefox. > > Now i'm trying to redeploy the latest, except the controls do not > render on any platform now!!! > > Object cannot be created in this context" code: "9 > (no name)() Blogger (line 89) > loaded()bootstrap.js (line 1002) > _callLoaded()bootstrap.js (line 1087) > _modulesLoaded()bootstrap.js (line 1074) > _loadInit(load ) > > > > woodstock4_3._base.body is not a constructor > woodstock4_3._dojo.addOnLoad(function() {new > woodstock4_3._base.body('/index.xhtml', > '/Blogger/index.xhtml',null,null,'com_sun_webui_util_FocusManager_focusElementId',true);});90 > > > > > I have upgraded to latest woodstock and here's the page: > > <f:view xmlns="http://www.w3.org/1999/xhtml" > xmlns:w="http://www.sun.com/webui/webuijsf" > xmlns:f="http://java.sun.com/jsf/core" > xmlns:webuijsf="http://www.sun.com/webui/webuijsf"> > <w:page frame="false" > xhtml="false"> > <w:html> > <w:head title="PaySett Blogger"/> > <w:body> > <w:messageGroup /> > <w:markup tag="h1">PaySett Blogger</w:markup><br/> > <w:markup tag="div" > styleClass="#{themeStyles.CONTENT_MARGIN}"> > <w:form id ="loginForm"> > Username123 : <w:textField id="tfUsername" > text="#{LoginBean.username}" /><br/> > Password : <w:passwordField > id="tfPassword" text="#{LoginBean.password}" /><br/> > <w:button id="cmbSubmit" > action="#{LoginBean.doLogin}" > primary="true" > text="Login"/> > <w:hiddenField id="isLoggedIn" > value="#{LoginBean.isLoggedIn}"/> > </w:form> > </w:markup> > </w:body> > </w:html> > </w:page> > </f:view> > > Any ideas would be highly appreciated! > > > Federico Vela > > > > Dan Labrecque wrote: >> Actually, I meant to use a "return" statement like so: >> >> function init() { >> var domNode = document.getElementById("form1:dropDown1"); >> if (domNode == null || typeof domNode.subscribe != >> "function") { >> return setTimeout('init();', 10); >> } >> domNode.subscribe(domNode.event.refresh.endTopic, >> processEvents, "update"); >> } >> >> If your alerts are not being executed, it may be that you have the >> wrong id. >> >> Dan >> >> Ryan de Laplante wrote: >>> The init function was causing hundreds of "dojo.event has no >>> properties" errors. I think you intended for the subscribe to be in >>> an else block, so I changed it to look like this: >>> >>> function init() { >>> var domNode = document.getElementById('form1:dropDown1'); >>> if (domNode == null || domNode.event == null) { >>> setTimeout("init();", 10); >>> } else { >>> alert('before subscribe'); >>> domNode.subscribe(domNode.event.refresh.endTopic, >>> processEvents, "update"); >>> alert('after subscribe'); >>> } >>> } >>> >>> I never see the alerts because it seems that domNode.event always == >>> null. >>> >>> Thanks, >>> Ryan >>> >>> >>> Dan Labrecque wrote: >>>> When are you calling the document.getElementById function? I >>>> suspect you're calling this too early and the widget has not been >>>> created, yet. In Woodstock 4.3 (next milestone), I've added an >>>> onLoad attribute to the head tag. This will ensure your function is >>>> executed after all widgets have been initialized. In the mean time, >>>> you can use the approach below. >>>> >>>> <head> >>>> <script type="text/javascript"> >>>> var processEvents = { >>>> update: function(props) { >>>> >>>> document.getElementById('form1:progressBar1').setProps({"visible":false}); >>>> >>>> } >>>> } >>>> function init() { >>>> var domNode = document.getElementById("form1:dropDown1"); >>>> if (domNode == null || domNode.event == null) { >>>> setTimeout("init();", 10); >>>> } >>>> domNode.subscribe(domNode.event.refresh.endTopic, >>>> processEvents, "update"); >>>> } >>>> </script> >>>> </head> >>>> <body onload="init();"> >>>> ... >>>> >>>> Dan >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@... >>> For additional commands, e-mail: users-help@... >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: Rendering fails on all browsersThank you for your reply,
It seems that somehow i got it fixed on IE. Whaddayaknow? IE is more compatible??? Sacrilege!!! I'll try the cache parameter. Thanks!!! Federico Vela Dan Labrecque wrote: > If you're using a milestone build of 4.3, the browser may have cached > previously loaded resources. Try clearing the browser cache and reload > the page. > > During development, we are setting the browser cahce to 24 hours via > the web.xml file. You can also disabled the cache completely. > > <!-- > <context-param> > <param-name>com.sun.webui.theme.CACHE_DISABLED</param-name> > <param-value>true</param-value> > </context-param> > --> > > <!-- Set browser cache to expire in 24 hours for milestone releases. --> > <context-param> > <param-name>com.sun.webui.theme.CACHE_EXPIRES</param-name> > <param-value>86400</param-value> > </context-param> > > Dan > > Federico Vela wrote: >> Hi list, >> >> I have a small web app that has had problems rendering on some pc's >> running firefox. >> >> Now i'm trying to redeploy the latest, except the controls do not >> render on any platform now!!! >> >> Object cannot be created in this context" code: "9 >> (no name)() Blogger (line 89) >> loaded()bootstrap.js (line 1002) >> _callLoaded()bootstrap.js (line 1087) >> _modulesLoaded()bootstrap.js (line 1074) >> _loadInit(load ) >> >> >> >> woodstock4_3._base.body is not a constructor >> woodstock4_3._dojo.addOnLoad(function() {new >> woodstock4_3._base.body('/index.xhtml', >> '/Blogger/index.xhtml',null,null,'com_sun_webui_util_FocusManager_focusElementId',true);});90 >> >> >> >> >> I have upgraded to latest woodstock and here's the page: >> >> <f:view xmlns="http://www.w3.org/1999/xhtml" >> xmlns:w="http://www.sun.com/webui/webuijsf" >> xmlns:f="http://java.sun.com/jsf/core" >> xmlns:webuijsf="http://www.sun.com/webui/webuijsf"> >> <w:page frame="false" >> xhtml="false"> >> <w:html> >> <w:head title="PaySett Blogger"/> >> <w:body> >> <w:messageGroup /> >> <w:markup tag="h1">PaySett Blogger</w:markup><br/> >> <w:markup tag="div" >> styleClass="#{themeStyles.CONTENT_MARGIN}"> >> <w:form id ="loginForm"> >> Username123 : <w:textField id="tfUsername" >> text="#{LoginBean.username}" /><br/> >> Password : <w:passwordField >> id="tfPassword" text="#{LoginBean.password}" /><br/> >> <w:button id="cmbSubmit" >> action="#{LoginBean.doLogin}" >> primary="true" >> text="Login"/> >> <w:hiddenField id="isLoggedIn" >> value="#{LoginBean.isLoggedIn}"/> >> </w:form> >> </w:markup> >> </w:body> >> </w:html> >> </w:page> >> </f:view> >> >> Any ideas would be highly appreciated! >> >> >> Federico Vela >> >> >> >> Dan Labrecque wrote: >>> Actually, I meant to use a "return" statement like so: >>> >>> function init() { >>> var domNode = >>> document.getElementById("form1:dropDown1"); >>> if (domNode == null || typeof domNode.subscribe != >>> "function") { >>> return setTimeout('init();', 10); >>> } >>> domNode.subscribe(domNode.event.refresh.endTopic, >>> processEvents, "update"); >>> } >>> >>> If your alerts are not being executed, it may be that you have the >>> wrong id. >>> >>> Dan >>> >>> Ryan de Laplante wrote: >>>> The init function was causing hundreds of "dojo.event has no >>>> properties" errors. I think you intended for the subscribe to be >>>> in an else block, so I changed it to look like this: >>>> >>>> function init() { >>>> var domNode = document.getElementById('form1:dropDown1'); >>>> if (domNode == null || domNode.event == null) { >>>> setTimeout("init();", 10); >>>> } else { >>>> alert('before subscribe'); >>>> domNode.subscribe(domNode.event.refresh.endTopic, >>>> processEvents, "update"); >>>> alert('after subscribe'); >>>> } >>>> } >>>> >>>> I never see the alerts because it seems that domNode.event always >>>> == null. >>>> >>>> Thanks, >>>> Ryan >>>> >>>> >>>> Dan Labrecque wrote: >>>>> When are you calling the document.getElementById function? I >>>>> suspect you're calling this too early and the widget has not been >>>>> created, yet. In Woodstock 4.3 (next milestone), I've added an >>>>> onLoad attribute to the head tag. This will ensure your function >>>>> is executed after all widgets have been initialized. In the mean >>>>> time, you can use the approach below. >>>>> >>>>> <head> >>>>> <script type="text/javascript"> >>>>> var processEvents = { >>>>> update: function(props) { >>>>> >>>>> document.getElementById('form1:progressBar1').setProps({"visible":false}); >>>>> >>>>> } >>>>> } >>>>> function init() { >>>>> var domNode = document.getElementById("form1:dropDown1"); >>>>> if (domNode == null || domNode.event == null) { >>>>> setTimeout("init();", 10); >>>>> } >>>>> domNode.subscribe(domNode.event.refresh.endTopic, >>>>> processEvents, "update"); >>>>> } >>>>> </script> >>>>> </head> >>>>> <body onload="init();"> >>>>> ... >>>>> >>>>> Dan >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscribe@... >>>> For additional commands, e-mail: users-help@... >>>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@... >>> For additional commands, e-mail: users-help@... >>> >>> >>> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@... >> For additional commands, e-mail: users-help@... >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@... > For additional commands, e-mail: users-help@... > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic eventsI'm beginning to wonder if my projects are using different versions of
Woodstock. I'm on NetBeans 6.0.1 because of showstopper (for me) bugs in 6.1. My demo app that mostly works fine (except the dojo events) doesn't work when I move the bits into my real application. I get all kinds of weird behavior including the missing state element in AJAX responses, and UI widgets not being refreshed. The project has been around since NB 5.5 and continually upgraded as new versions of NB come out. I wonder if it somehow uses a different version of Woodstock than new projects use. I will investigate this further. My boss has given me permission to spend as much time necessary to make this work because it is important. Thanks, Ryan Dan Labrecque wrote: > I added your code verbatim and it works as expected. The only reason I > can see that "domNode" or its "event" property would be null is if the > wrong id were used. Or, there could be a JavaScript error somewhere in > the page. > > That said, I'm assuming you're using Woodstock 4.2 or later? If you're > using an earlier version, then you may be looking at the wrong TLD > examples. > > Dan > > Ryan de Laplante wrote: >> Thanks. I am certain that I have the right id: >> >> <webuijsf:form binding="#{Page1.form1}" id="*form1*"> >> <webuijsf:dropDown binding="#{Page1.dropDown1}" id="*dropDown1*" >> items="#{Page1.list1}" label="Proximity To Elevator" labelOnTop="true" >> onChange="dropDown1Changed(); return >> false;" style="left: 216px; top: 48px; position: absolute" >> valueChangeListenerExpression="#{Page1.dropDown1_processValueChange}"/> >> function init() { >> var domNode = document.getElementById('*form1:dropDown1*'); >> if (domNode == null || domNode.event == null) { >> return setTimeout("init();", 10); >> } >> alert('subscribing to dropDown1 endTopic'); >> domNode.subscribe(domNode.event.refresh.endTopic, processEvents, >> "update"); >> } >> >> <webuijsf:body binding="#{Page1.body1}" id="body1" onLoad="*init();*" >> style="-rave-layout: grid"> >> The alert in init() never happens. This is a new visual >> web project with very little code in it. You can get it to work? >> >> >> Thanks, >> Ryan >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@... |
|
|
Re: dojo endTopic events |