Re: Component that displays additional containing Page markup
Grid is much more powerful than I knew. Thank you guys for nudge in the right direction. I will be sticking with my component for this particular page, but I am replacing allot of other code with Grid. t:body/ did the trick and works like a charm. Cannot believe I didn't see it earlier. Thanks again, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718742.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Looks like you're doing the same thing as my gallery component with rows=2 and columns=4. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718743.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
I've written a simple gallery component which displays a list of items in a grid with prev and next links to go through pages. You pass it a block to display each item. Code: https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/components/Gallery.java https://github.com/uklance/tapestry-stitch/blob/master/src/main/resources/org/lazan/t5/stitch/components/Gallery.tml Demo: https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/resources/org/lazan/t5/stitch/demo/pages/GalleryDemo.tml https://github.com/uklance/tapestry-stitch-demo/blob/master/src/main/java/org/lazan/t5/stitch/demo/pages/GalleryDemo.java -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718673.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Pagination is the reason for not using the Grid component. I want to paginate my results without holding anything in memory (session). For Grid I will select the entire set, @Persist it and then display portions on the page. What I am doing is a bit different. I always select the (number of tokens I need to display) +1 by using SQL Limit A,B. If I have NumberOfTokensToDisplay +1 in the list it means there is another page, if not, well not :). The only thing I need to compute is nextPage number, which I put as context to Next eventLink. Much cleaner in terms or resources then holding an entire list of results in memory, and no cleanup required when I'm done. Thank you Lance, I'll have a look at your demo. Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718682.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
On Thu, 13 Dec 2012 14:19:22 -0200, bogdan_cm bogdan.iva...@rbccm.com wrote: Pagination is the reason for not using the Grid component. I want to paginate my results without holding anything in memory (session). For Grid I will select the entire set, @Persist it and then display portions on the page. What I am doing is a bit different. I always select the (number of tokens I need to display) +1 by using SQL Limit A,B. If I have NumberOfTokensToDisplay +1 in the list it means there is another page, if not, well not :). The only thing I need to compute is nextPage number, which I put as context to Next eventLink. Much cleaner in terms or resources then holding an entire list of results in memory, and no cleanup required when I'm done. You know Grid actually supports what you want without using @Persist? Just implement a GridDataSource and pass it to the Grid's source parameter. If I got it right, you're basically rewriting Grid for doing what it already does. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
As Thiago has said, the Grid component actually accepts a parameter of type GridDataSource so does not require the entire list in memory at once. Tapestry provides a coercion from List to GridDataSource so you can also pass a List to the Grid. http://tapestry.apache.org/typecoercer-service.html#TypeCoercerService-ListofCoercions -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718684.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
I will have a closer look at the Grid component. Thanks very much for the reply. Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718688.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
On Thu, 13 Dec 2012 16:12:57 -0200, bogdan_cm bogdan.iva...@rbccm.com wrote: I will have a closer look at the Grid component. Thanks very much for the reply. Actually, you need to take a look at the GridDataSource interface. ;) -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
The other limiting thing I remember about the Grid component was that I could only display one Object' per row. I could not do: Object1.Name Object2.NameObject3.NameObject4.Name Object5.Name Object6.NameObject7.NameObject8.Name As you can tell, I did not look at the Grid component for a long time now. I'm at work and cannot test it out. Can't wait to get home :))). Believe it or not, I am working on a legacy Struts application for a client. Painful stuff. XML is hell! -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718693.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
On Thu, 13 Dec 2012 16:37:46 -0200, bogdan_cm bogdan.iva...@rbccm.com wrote: The other limiting thing I remember about the Grid component was that I could only display one Object' per row. I could not do: Object1.Name Object2.NameObject3.NameObject4.Name Object5.Name Object6.NameObject7.NameObject8.Name Well, that's not something that Grid does, but you can try using Grid and some CSS to be able to do that. As Howard said, the BeanModel-based components (Grid, BeanEditor, etc) are not supposed to do everything, but to do something specifically and well. As you can tell, I did not look at the Grid component for a long time now. I'm at work and cannot test it out. Can't wait to get home :))). :D Believe it or not, I am working on a legacy Struts application for a client. Painful stuff. XML is hell! XML itself isn't hell, but many uses of it are, Struts included. Struts sucks way too hard. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
We use GridDataSource for paging large sets too. getAvailableRows is the total number of entries prepare tells you the slice to be rendered depending on grids rows per page setting. Simply load the whole slice in prepare and return the single row entity by getRowValue Jens Sent from my iPhone On 13.12.2012, at 19:12, bogdan_cm bogdan.iva...@rbccm.com wrote: I will have a closer look at the Grid component. Thanks very much for the reply. Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718688.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Hi! From an Object oriented aspect you are coupling components to particular pages, when I understand you correctly. This is for my personal opinion a wrong design. Can't you not just pass the additional info as parameter from your page to your component (as Taha suggested it)? Or are you displaying commen/shared info? Maybe tapestry's layout might be a solution for you? Jens Sent from my iPhone On 12.12.2012, at 06:00, Taha Siddiqi tawus.tapes...@gmail.com wrote: Hi Bogdan No sure if I understand you question correctly. From what I understand you can use block parameters or t:body/ regards Taha On Dec 12, 2012, at 10:22 AM, bogdan_cm wrote: Hello everyone, How can I allow Page information to be part of the component markup output? Take for example the zone component: t:zone t:id=someId id=pageId -- component this is the time on day ${timeOfDay} - this value comes from the Page containing the component /t:zone When I write my own component, how can I pass additional data to be included in the rendering of this component? I would like to write: t:myComponent maybe a loop here that would read a list in the Page containing the component, and display it. /t:myComponent Thank you, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
This may help: http://jumpstart.doublenegative.com.au/jumpstart/examples/component/combiningcomponents Cheers, Geoff On 12/12/2012, at 4:00 PM, Taha Siddiqi wrote: Hi Bogdan No sure if I understand you question correctly. From what I understand you can use block parameters or t:body/ regards Taha On Dec 12, 2012, at 10:22 AM, bogdan_cm wrote: Hello everyone, How can I allow Page information to be part of the component markup output? Take for example the zone component: t:zone t:id=someId id=pageId -- component this is the time on day ${timeOfDay} - this value comes from the Page containing the component /t:zone When I write my own component, how can I pass additional data to be included in the rendering of this component? I would like to write: t:myComponent maybe a loop here that would read a list in the Page containing the component, and display it. /t:myComponent Thank you, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Thank you both for replying. Now that I read it after a day, my question is not very clear. Here is a more to the point explanation. My custom component will take care of pagination. This means I need my component to wrap around a Loop in the main page. The Loop will be iterating over a List of results. The code I am hoping for is: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; -- tapestry Page t:myPaginationComponent params= (will tie pagination variables from page to component params) loop ... html that displays list entries /loop /t:myPaginationComponent /html I will explore the block suggestion. Thanks very much, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718645.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Hi Bogdan! Any reason why you can not use tapestry's grid component? Jens Sent from my iPhone On 12.12.2012, at 15:43, bogdan_cm bogdan.iva...@rbccm.com wrote: Thank you both for replying. Now that I read it after a day, my question is not very clear. Here is a more to the point explanation. My custom component will take care of pagination. This means I need my component to wrap around a Loop in the main page. The Loop will be iterating over a List of results. The code I am hoping for is: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_3.xsd; -- tapestry Page t:myPaginationComponent params= (will tie pagination variables from page to component params) loop ... html that displays list entries /loop /t:myPaginationComponent /html I will explore the block suggestion. Thanks very much, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622p5718645.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Component that displays additional containing Page markup
Hello everyone, How can I allow Page information to be part of the component markup output? Take for example the zone component: t:zone t:id=someId id=pageId -- component this is the time on day ${timeOfDay} - this value comes from the Page containing the component /t:zone When I write my own component, how can I pass additional data to be included in the rendering of this component? I would like to write: t:myComponent maybe a loop here that would read a list in the Page containing the component, and display it. /t:myComponent Thank you, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Component that displays additional containing Page markup
Hi Bogdan No sure if I understand you question correctly. From what I understand you can use block parameters or t:body/ regards Taha On Dec 12, 2012, at 10:22 AM, bogdan_cm wrote: Hello everyone, How can I allow Page information to be part of the component markup output? Take for example the zone component: t:zone t:id=someId id=pageId -- component this is the time on day ${timeOfDay} - this value comes from the Page containing the component /t:zone When I write my own component, how can I pass additional data to be included in the rendering of this component? I would like to write: t:myComponent maybe a loop here that would read a list in the Page containing the component, and display it. /t:myComponent Thank you, Bogdan. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Component-that-displays-additional-containing-Page-markup-tp5718622.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org