Re: How to implement polling with @EventListener
Yay, it works, thanks. It really looks like there should be a more elegant solution to this, but hey, it works. Now I am facing a different thing, using AJAX requests I only want to transfer deltas. For example if there are 11 rows on the screen and on the next update there is a new one, I don't want to transfer 12 rows then, only one and add it to the other rows. Is there an elegant way? Or do I have to create component instances dynamically? Regards Josh Long wrote: The following is contrived, but works. Mainly, I would create a proper dojo widget and have the event listener bind to that, but this works because of expando properties... In your body of a file called Test.html, I have div id =test/div script type=text/javascript dojo.require('dojo.lang.*'); dojo.require('dojo.event.*') var tst =dojo.byId('test'); tst.update=function() { dojo.debug ('running') dojo.lang.setTimeout( tst.update , 4000) ; // im sure ther animation package had //a proper way of scheduling something for repeating, but... }; dojo.addOnLoad(function(){ dojo.byId('test').update() ; // get the ball rolling }); /script div jwcid=[EMAIL PROTECTED] span jwcid=@Insert value = ognl: now the current time is /span /div then in Test.java, abstract public Date getNow() ; abstract public void setNow(Date now) ; @EventListener( elements =test, async = true , events =update) public void update (IRequestCycle cycle ) { setNow(new Date()) ; cycle.getResponseBuilder().updateComponent(status); } and boom! As you load hte page in javascript, test.update gets called which in turn causes the server side event listener to run. The event listener updates the clock (every 4 seconds because I was running this in devel mode and, and I mean nothing, pisses tapestry off more than running in devel mode) and the page reflects it without any refresh. Hope this helps, sort of... Josh On 9/3/06, livelock [EMAIL PROTECTED] wrote: Hi, Dojo got a polling mode (http://archive.dojotoolkit.org/nightly/tests/io/test_ScriptSrcIO.html#CommonArgs). How do I use that properly with Tapestry 4.1? The EventListener seems not have anything that ge I want a component that reads a property from a server all 4 seconds. For example for stock quotes or even a chat. Regards, André -- View this message in context: http://www.nabble.com/How-to-implement-polling-with-%40EventListener-tf2212501.html#a6127728 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/How-to-implement-polling-with-%40EventListener-tf2212501.html#a6170249 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic Link
hi, I need to add dynamic link to Tapestry Page, which should open in a pop-up window. can any one please let me know how can i do this? Thanks A lot -- View this message in context: http://www.nabble.com/Dynamic-Link-tf2226663.html#a6170388 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic Link
Hi Nielsh, You can use a special renderer on DirectLink, PageLink, ExternalLink and so on..: bean name=popupRenderer class=org.apache.tapestry.contrib.link.PopupLinkRenderer set name=windowName value='disclaimer'/ set name=features value='width=300, height=500, scrollbars=yes, resizable=no'/ /bean On template: a href=# jwcid=@DirectLink page=ognl:page renderer=ognl:beans.popupRendererspan jwcid=@Insert value=ognl:linkTitleLink/span/a Don't forget to use the @Body component, becouse of the generated javascript See the documentation for more details about features and so on... Mael Caldas On 9/6/06, Nilesh [EMAIL PROTECTED] wrote: hi, I need to add dynamic link to Tapestry Page, which should open in a pop-up window. can any one please let me know how can i do this? Thanks A lot -- View this message in context: http://www.nabble.com/Dynamic- Link-tf2226663.html#a6170388 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass a reference of ASO to my SqueezeAdaptor
Here is mine. Just add the state manager as a property and pull out what you need. public Object unsqueeze(DataSqueezer squeezer, String string) { try { Repository repository = (Repository) stateManager.get(repository); User user = (User) stateManager.get(user); return repository.select(user, new Long(string.substring(1))); } catch (NumberFormatException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } private ApplicationStateManager stateManager; public void setStateManager(ApplicationStateManager stateManager) { this.stateManager = stateManager; } } contribution configuration-id=tapestry.state.ApplicationObjects state-object name=user scope=session create-instance class=com.trsvax.mill.baseobject.party.User/ /state-object /contribution contribution configuration-id=tapestry.data.SqueezeAdaptors adaptor object=service:millSqueezer/ /contribution service-point interface=com.trsvax.mill.MillSqueezer id=millSqueezer invoke-factory construct class=com.trsvax.mill.MillSqueezer set-object property=stateManager value=infrastructure:applicationStateManager/ /construct /invoke-factory /service-point - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Trace clients actions
I'm experiencing some strange bugs and I can't figure out how our customers browsing our website cause these problems. How could I trace the actions people do on the website in order to be able to reproduce them? (and also without killing the log files) -- Henri Dupre Actualis Center
How to link from item list to item detail
I'm writing an application where logged in users can create items. User can then list their items and by following a link (DirectLink) they will reach the item details page where the selected item can be edited. This is a typical scenario which I imagine occurs in many apps. I have implemented the link with a DirectLink which has the item ID as parameter. In the listener I will create the page, set the ID on the page object and the return the page object. It works fine! The thing is that a user can reach other users items by editing the URL for the detail page - the URL ends with i.e. ...sp=3 where 3 is the item ID. This means I will have to check on the details page that the item to be shown is indeed owned by the current user. OK, I can do that, but is there maybe a better way to perform the link? /Malin
RE: How to pass a reference of ASO to my SqueezeAdaptor
Ohhh. . . .this is *so* close to what I need! I have a stand-alone HttpSessionListener impl class in my Tap 4 project that needs access to an ASO. As a hivemodule noob, how can I get access to the ApplicationStateManager like shown in Barry's awesome example below? I *assume* I can't define my HttpSessionListener as a 'service point' or 'contribution' or 'purple elephant' or any other hivemodule glyph, which is why I'm posting here. Thanks in advance! Tom -Original Message- From: Barry Books [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 06, 2006 10:50 AM To: Tapestry users Subject: Re: How to pass a reference of ASO to my SqueezeAdaptor Here is mine. Just add the state manager as a property and pull out what you need. public Object unsqueeze(DataSqueezer squeezer, String string) { try { Repository repository = (Repository) stateManager.get(repository); User user = (User) stateManager.get(user); return repository.select(user, new Long(string.substring(1))); } catch (NumberFormatException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } private ApplicationStateManager stateManager; public void setStateManager(ApplicationStateManager stateManager) { this.stateManager = stateManager; } } contribution configuration-id=tapestry.state.ApplicationObjects state-object name=user scope=session create-instance class=com.trsvax.mill.baseobject.party.User/ /state-object /contribution contribution configuration-id=tapestry.data.SqueezeAdaptors adaptor object=service:millSqueezer/ /contribution service-point interface=com.trsvax.mill.MillSqueezer id=millSqueezer invoke-factory construct class=com.trsvax.mill.MillSqueezer set-object property=stateManager value=infrastructure:applicationStateManager/ /construct /invoke-factory /service-point - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trace clients actions
I know one of the logging packages has a feature that allows you to bind logging output to a particular user associated with a particular servlet session. I'd probably go that route. The syntax in the logger involved something along the lines of %u I think. On 9/6/06, Henri Dupre [EMAIL PROTECTED] wrote: I'm experiencing some strange bugs and I can't figure out how our customers browsing our website cause these problems. How could I trace the actions people do on the website in order to be able to reproduce them? (and also without killing the log files) -- Henri Dupre Actualis Center -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: Trace clients actions
I guess, you are speaking of the MDC (Mapped Diagnostic Context) feature in log4j. This is somehow a j.u.Map context that can be used in log statements. You are the one responsible for correction populating the context map. Regards, Jérôme. On 9/6/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: I know one of the logging packages has a feature that allows you to bind logging output to a particular user associated with a particular servlet session. I'd probably go that route. The syntax in the logger involved something along the lines of %u I think. On 9/6/06, Henri Dupre [EMAIL PROTECTED] wrote: I'm experiencing some strange bugs and I can't figure out how our customers browsing our website cause these problems. How could I trace the actions people do on the website in order to be able to reproduce them? (and also without killing the log files) -- Henri Dupre Actualis Center -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com -- Jérôme BERNARD, Kalixia, SARL. http://weblog.kalixia.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: external form submissions
Chapter 8 of the book Tapestry in Action discussed (also relevant to Tap4) a way of submitting an 'external' form to a Tapetsry page. (I think you can download the example source code of the book for free from Manning's web site.) Briefly, you set up a Tapestry page whose java class extends BasePage (as usual) and also implements the interface IExternalPage. http://tapestry.apache.org/tapestry4/tapestry/apidocs/index.html The interface IExternalPage has a method activateExternalPage(java.lang.Object[] parameters, IRequestCycle cycle) . You submit your form to the above Tapestry page and you retreive the submitted parameters from the form in the method activateExternalPage. Shing --- Payne, Matthew [EMAIL PROTECTED] wrote: Can tapestry accept a form submissions from another application(a logon page in this case)? e.g. input page is not a tapestry template or under its control. It must redirect back. Anyone have an example? Matt This message, including any attachments, is intended only for the recipient(s) named above. It may contain confidential and privileged information. If you have received this communication in error, please notify the sender immediately and destroy or delete the original message. Also, please be aware that if you are not the intended recipient, any review, disclosure, copying, distribution or any action or reliance based on this message is prohibited by law. Home page : http://uk.geocities.com/matmsh/index.html ___ The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trace clients actions
Right... that's been working well for us. I have a request listener method in a POJO: import org.apache.log4j.MDC; public class EventListener implements ServletRequestListener // among others { public void requestInitialized(ServletRequestEvent sre) { HttpServletRequest req = (HttpServletRequest) sre.getServletRequest(); HttpSession session = req.getSession(); if (session != null) { // Get the userName stored in session at login. String userName = (String) session.getAttribute(USERNAME_KEY); MDC.put(user, userName); } } } Then my log4j configuration has a ConversionPattern: ... (%X{user}) ... Jérôme BERNARD wrote: I guess, you are speaking of the MDC (Mapped Diagnostic Context) feature in log4j. This is somehow a j.u.Map context that can be used in log statements. You are the one responsible for correction populating the context map. Regards, Jérôme. On 9/6/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: I know one of the logging packages has a feature that allows you to bind logging output to a particular user associated with a particular servlet session. I'd probably go that route. The syntax in the logger involved something along the lines of %u I think. On 9/6/06, Henri Dupre [EMAIL PROTECTED] wrote: I'm experiencing some strange bugs and I can't figure out how our customers browsing our website cause these problems. How could I trace the actions people do on the website in order to be able to reproduce them? (and also without killing the log files) -- Henri Dupre Actualis Center -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Obtaining check box data from a form
Does this help? http://tapestry.apache.org/tapestry3/doc/ComponentReference/Checkbox.html On 9/7/06, Peter Dawn [EMAIL PROTECTED] wrote: guys, i am trying to implement a big form within my web app. in the form the user is able to select through checkboxes what information they want viewed. now each checkbox has a corresponding value associated with it. now when the user clicks on the submit button, i want to pass on the values of all checked checkboxes to my java code (the value of unchecked boxes should not be passed). I have been working on it all morning now. can somebody help me out with this. i am using tap3. thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: Obtaining check box data from a form
may be i should put everything within a span and then pass on values of checked checkboxes. but how do i group them together. if they were radio buttons i would have selected RadioGroup. any help guys. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Obtaining check box data from a form
Most of the time a checkbox - by definition - is more of a boolean operation than value...But far be it from me to argue with semantics that do work.. If you want to just get past the problem and move on you can always call IRequestCycle.getParameterValues(thenameyou gaveallofyourcheckboxes); On 9/7/06, Peter Dawn [EMAIL PROTECTED] wrote: just to clarify again, i want to gather the underlying value of each checkbox and not its label. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
Re: Obtaining check box data from a form
ok. the only other way for me to obtain a users selection would a radio button. might try that. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]