[T5.1] No recursive component - Howto render Beaneditor in code?
Hi, we have noted that T5 doesn't allow recursive components[1], so we are currently doing something like this: We reference our component in an arbritrary tml like this: t:MyComponent source=root currentNode=currentNode /t:MyComponent The code stub of the component: boolean setupRender(MarkupWriter writer) { // write some opening div } void beforeRenderBody(MarkupWriter writer) { processRoot(source, writer); } void cleanupRender(MarkupWriter writer) { // close some opened div's } This works fine (#processRoot calls itself recursively for its children), but now we want to display a bean editor in a Node (in processRoot()). Is it possible to reference a component (like a bean editor) in a component being written in Java? Are there any examples how to achieve this? TIA, Oliver [1] [https://issues.apache.org/jira/browse/TAP5-739] ___ Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5.1] No recursive component - Howto render Beaneditor in code?
Hi Ville, thanks for your answer, but i didn't see how to do it. I will try to explain my problem more in detail (sorry for my bad english): We are using a component that is similar to [1] with the main difference that we don't use a getTreeNodes, we use a getTreeRoot (e.g. single element, not all elements of the tree) and doing our rendering inside the java-component (we don't have a tml for our component) via the MarkupWriter. The TreeDemo.tml from [1] allows to use a component 'Tree' like follows: t:Tree treeid='literal:demo' source=treeNodes currentNode=node t:actionlink t:id=tree context=node.identifier ${node.name} /t:actionlink /t:Tree We can't use an actionlink because we only have a root node and iterate it inside our java class (recursively via the processRoot method). Normally we would like to do something like the following (TreeNode.tml): div id=someid t:if test=identifierEqualsX t:beaneditor object=current/ p:else current.name /p:else /t:if t:loop source=current.children value=child t:TreeNode element=child/ /t:loop /div but thats not allowed, e.g The template for component.. is recursive... This is not supported so we are trying to do this inside a java class (without a tml). Now we want to render a beaneditor for a specific identifier inside the java class, something like the following would be nice. void processRoot(Node current, MarkupWriter writer) { // open div if (current.getIdentifier().equals(X)) { ---writer.renderBeaneditor(editor); --- } else { // display some informations of the node } for (Node child : current.getChildren()) { processRoot(child, writer); } // close div } but i don't know how to add/declare/instanciate the beaneditor? Thanks for any hints! Oliver [1] http://wiki.apache.org/tapestry/Tapestry5TreeComponent -Ursprüngliche Nachricht- Von: Ville Virtanen ville.virta...@cerion.fi Gesendet: 27.07.2010 09:15:31 An: users@tapestry.apache.org Betreff: Re: [T5.1] No recursive component - Howto render Beaneditor in code? Hi, @InjectComponent injects the component defined in tml, @Component injects instance that is configured by the annotation itself (and the associated tml if it is defined there also). http://tapestry.apache.org/tapestry5.1/apidocs/org/apache/tapestry5/annotations/Component.html - Ville Oliver Bauer wrote: Hi, we have noted that T5 doesn't allow recursive components[1], so we are currently doing something like this: We reference our component in an arbritrary tml like this: t:MyComponent source=root currentNode=currentNode /t:MyComponent The code stub of the component: boolean setupRender(MarkupWriter writer) { // write some opening div } void beforeRenderBody(MarkupWriter writer) { processRoot(source, writer); } void cleanupRender(MarkupWriter writer) { // close some opened div's } This works fine (#processRoot calls itself recursively for its children), but now we want to display a bean editor in a Node (in processRoot()). Is it possible to reference a component (like a bean editor) in a component being written in Java? Are there any examples how to achieve this? TIA, Oliver [1] [https://issues.apache.org/jira/browse/TAP5-739] ___ Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- View this message in context: http://old.nabble.com/-T5.1--No-recursive-component--%3E-Howto-render-Beaneditor-in-code--tp29273576p29273645.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 ___ WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und 50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5.1 (Event)Context in a grid with additional column of checkboxes
Hi, i would like to to pass a context to a pagelink like a t:type=pagelink t:page=MyPage t:context=myContext but this only works if the returned values of myContext does not change after the page has loaded. More precisely i want to do something like jumpstarts Grid With Delete Column without a huge onSuccess method that passes values to a lot of @InjectPage annotated pages. Each of my pages already uses onActivate(EventContext eventContext) so i would prefer to use this way, but i don't know how. Is there a easy way to achieve this? Thanks, Oliver __ GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT! Jetzt freischalten unter http://movieflat.web.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
kein Betreff
Hello, i have some problems with the submit component and the parameter t:image. The following works fine with T5.1.0.5 form t:type=form t:id=myform input type=submit t:type=submit t:id=viewselection title=View/ /form and as expected the following methods are called @OnEvent(component=viewselection, value = EventConstants.SELECTED) void someMethodName() { logger.debug(With EventConstants); } void onSelectedFromViewselection() { logger.debug(With onSelectedFromId); } @OnEvent(value = selected, component = viewselection) void someOtherMethodName() { logger.debug(With @OnEvent); } but if i want to use an image for the submit none of those methods are called (the image will be rendered correctly). I've used each of the following input type=submit t:type=submit t:id=viewselection title=View t:image=context:images/view.png/ input type=submit t:type=submit t:id=viewselection title=View t:image=context:images/view.png/ t:submit t:id=viewselection title=view t:image=context:images/view.png/ Whats wrong? TIA, Oliver Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/ - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
T5.1.0.5 Submit with image (was Re: kein Betreff)
Sorry for the missing subject Hello, i have some problems with the submit component and the parameter t:image. The following works fine with T5.1.0.5 form t:type=form t:id=myform input type=submit t:type=submit t:id=viewselection title=View/ /form and as expected the following methods are called @OnEvent(component=viewselection, value = EventConstants.SELECTED) void someMethodName() { logger.debug(With EventConstants); } void onSelectedFromViewselection() { logger.debug(With onSelectedFromId); } @OnEvent(value = selected, component = viewselection) void someOtherMethodName() { logger.debug(With @OnEvent); } but if i want to use an image for the submit none of those methods are called (the image will be rendered correctly). I've used each of the following input type=submit t:type=submit t:id=viewselection title=View t:image=context:images/view.png/ input type=submit t:type=submit t:id=viewselection title=View t:image=context:images/view.png/ t:submit t:id=viewselection title=view t:image=context:images/view.png/ Whats wrong? TIA, Oliver Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/ - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org __ GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT! Jetzt freischalten unter http://movieflat.web.de - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org