T5.3.6 Fade-out/in a zone via Event/ActionLink by use of custom developed mixins
Hallo guys, I am trying to fade-out/in a zone via link. So developed a mixins like the triggerFragement, which fades out a formfragment by checking a checkBox or radioButton. On runtime the mixins behaviour is not as expected. Clicking the link, it shortly fades out the zone and then it appears normal. Debugging this on client-side and server-side shows me that the persistent boolean flag 'showMe' alternates and the fired event are catched up the right way I suppose something is still wrong in JavaScript of my mixins, maybe the extension of the initialization of the component (in this case the zone). Or am I on the wrong box fading a component via mixins? The source code of mixins java part TriggerElement.java : @Import(library = { scripts/triggerelement.js }) public class TriggerElement { // injects the component to which the mixin is attached. @InjectContainer private ClientElement triggerElement; /** * The {@link org.apache.tapestry5.corelib.components.FormFragment} instance to make dynamically visible or hidden. */ @Parameter(required = true, defaultPrefix = BindingConstants.COMPONENT, allowNull = false) private ClientElement element; @Persist private boolean showMe; @Environmental private JavaScriptSupport javascriptSupport; @HeartbeatDeferred void beginRender() { // alternate value on click -- hold the state in the session showMe= !showMe; JSONObject spec = new JSONObject(triggerElementId, triggerElement.getClientId(), elementId, element.getClientId()).put(showMe, showMe); javascriptSupport.addInitializerCall(linkTriggerToElement, spec); } } Source of triggerelement.js: T5.extendInitializers(function() { function init(spec) { var element = $(spec.element); function updateUI(makeVisible) { if(makeVisible){ element.style.display = block; element.className = t-zone; } else { element.style.display = none; element.className = t-invisible; } element.visible = makeVisible; return effect(element); } element.observe(Tapestry.ZONE_UPDATED_EVENT, function(event) { // Since events propagate up, you have to call event.stop() // here to prevent hiding/revealing any container elements. event.stop(); var makeVisible = event.memo.visible; updateUI(makeVisible); }); } /** * Links a ClientElement (in this case a zone) to a trigger (also ClientElement in this case a link), such * that clicking the trigger will hide or show the zone. * */ function linker(spec) { var trigger = $(spec.triggerElementId); function update() { var makeVisible =!spec.showMe; $(spec.elementId).fire(Tapestry.ZONE_UPDATED_EVENT, { visible : makeVisible }, true); } // Normal trigger is a ClientElement; listen just to it. trigger.observe(click, update); } return { zone : init, linkTriggerToElement : linker }; }); And now the way I use it in the TML: a t:type=eventlink t:event=refreshZone href=# t:mixins=triggerelement element=theZoneShow the zone/a t:zone t:id=theZone id=theZone t:hide=fade !-- some elements to render -- /t:zone If you need further information don't hesitate to geet in contact with me. Cheers Sven
Re: T5.3.6 AfterRenderTemplate getElement returns element of parent component
This is expected behavior. MarkupWriter.getElement() returns the current XML element on the stack that has not been closed (ie markupWriter.end() has not been called for the element). Since all TML templates are well formed XML and hence end() every element thus popping it off of the stack. What you are witnessing is also the cause of this issue https://issues.apache.org/jira/browse/TAP5-1918 The jira provides a solution to find the lastChild of MarkupWriter.getElement(). This will be the element rendered by your template. -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-3-6-AfterRenderTemplate-getElement-returns-element-of-parent-component-tp5718513p5718515.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
Tapestry generated urls
Greetings, We've ran into a problem with tapestry. One of our customers has a strong interest in SEO optimization. Currently our tapestry application (tapestry 5.1) is mounted to /shop/*. This application provides multiple eCommerce stores. Likewise the url for our german store is /shop/de_DE/*, the austrian store can be found at /shop/de_AT/, and yet another store is located at /shop/en_BX/. Now our customer would like to turn around the mapping, so the german store shall be located at /de_DE/shop/ etc. My first idea was to mount tapestry to /* but I need to keep the /shop/ part in the url. Most components build their URLs like /{contextpath}/{locale}/component... Is there any easy way to change that? I couldn't find anything. Mit freundlichen Grüßen Mark Fugmann ZYRES digital media systems GmbH Eschersheimer Landstr. 5-7 60322 Frankfurt am Main Phone +49 (0)69 98 55 99 - 23 Fax +49 (0)69 98 55 99 - 11 http://www.zyres.com Firmensitz: Eschersheimer Landstr. 5-7 60322 Frankfurt am Main Registergericht: Amtsgericht Frankfurt am Main, HRB 76374 Geschäftsführer: Sebastian Schirmer - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry generated urls
You could put all your pages under the shop package and tapestry will do what you want out of the box. eg com.mypackage.pages.shop.Page1 com.mypackage.pages.shop.Page2 If you want more control, you can decorate the ComponentEventLinkEncoder to do whatever you want. https://github.com/uklance/tapestry-sandbox/blob/master/src/main/java/com/github/uklance/mode/ModeComponentEventLinkEncoder.java https://github.com/uklance/tapestry-sandbox/blob/master/src/main/java/com/github/uklance/services/AppModule.java#L133 Here is an example of a ModeComponentEventLinkEncoder which uses a regex to remove a section of the URL (the mode) and store it in an environmental before the normal tapestry URL handling takes place. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-generated-urls-tp5718516p5718517.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: Tapestry generated urls
On Thu, 06 Dec 2012 07:14:34 -0200, Mark Fugmann m...@zyres.com wrote: Greetings, Hi! Most components build their URLs like /{contextpath}/{locale}/component... Is there any easy way to change that? I couldn't find anything. As you're still using T5.1, take a look at the URL rewriting support. -- 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: date and time picker (resolved)
It wasn't clear in the tapx DateField docs, but adding the code below fixed the issue... configuration.add(JQuerySymbolConstants.JQUERY_ALIAS, $T); - Original Message - From: John To: Tapestry users Sent: Thursday, November 29, 2012 2:19 PM Subject: Re: date and time picker I tried tapx-datefield 1.2-SNAPSHOT which at least runs but then the the js is missing? Webpage error details User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; MDDR; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; .NET4.0C; .NET4.0E; BRI/2) Timestamp: Thu, 29 Nov 2012 14:16:58 UTC Message: Object expected Line: 21 Char: 5 Code: 0 URI: http://localhost:8080/AuditManager/assets/1.0-SNAPSHOT-DEV/tapx/tapx-datefield.js - Original Message - From: John To: Tapestry users Sent: Thursday, November 29, 2012 1:56 PM Subject: Re: date and time picker I just tried the tapx component and that blew up... java.lang.RuntimeException: Service id 'DynamicTemplateParser' has already been defined by com.howardlewisship.tapx.core.services.CoreModule.buildDynamicTemplat eParser(DynamicTemplateParserImpl, UpdateListenerHub) (at CoreModule.java:127) a nd may not be redefined by org.apache.tapestry5.internal.dynamic.DynamicTemplate ParserImpl(ClasspathURLConverter, BindingSource, PageSource, TemplateParser) (at DynamicTemplateParserImpl.java:45) via org.apache.tapestry5.services.TapestryMo dule.bind(ServiceBinder) (at TapestryModule.java:308). You should rename one of the service builder methods. at org.apache.tapestry5.ioc.internal.RegistryImpl.init(RegistryImpl.ja va:183) at org.apache.tapestry5.ioc.RegistryBuilder.build(RegistryBuilder.java:1 77) at org.apache.tapestry5.internal.TapestryAppInitializer.createRegistry(T apestryAppInitializer.java:200) at org.apache.tapestry5.TapestryFilter.init(TapestryFilter.java:109) at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97) - Original Message - From: John To: Tapestry users Sent: Thursday, November 29, 2012 1:32 PM Subject: Re: date and time picker It's rumoured there's one in tapx, but I can't find docs on that? I'm looking for a month view plus hour/minute drop down. - Original Message - From: Chris Cureau To: Tapestry users Sent: Thursday, November 29, 2012 1:25 PM Subject: Re: date and time picker I haven't found a ready-made tapestry component, but building up a component isn't too hard. Mobiscroll (http://mobiscroll.com) is a good option, as is jQuery TIme Entry (http://keith-wood.name/timeEntry.html) depending on your needs. On Thu, Nov 29, 2012 at 7:03 AM, John j...@quivinco.com wrote: Hi, Is there any tapestry component that is both a date and time picker? TIA John
Re: New to tapestry- please help
http://tapestry.apache.org/getting-started.html On 6 December 2012 09:04, Emmanuel Sowah eso...@gmail.com wrote: Hi guys, I'm new to tapestry. Could someone please point me to some simple to follow tutorials to get me up and running quickly? Thanks, Emmanuel
Re: New to tapestry- please help
Or get the book http://www.tapestry5book.com/ On 06-12-12 15:04, Emmanuel Sowah wrote: Hi guys, I'm new to tapestry. Could someone please point me to some simple to follow tutorials to get me up and running quickly? Thanks, Emmanuel - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
RE: New to tapestry- please help
http://jumpstart.doublenegative.com.au/jumpstart/ Enjoy :-) -Original Message- From: Emmanuel Sowah [mailto:eso...@gmail.com] Sent: Thursday, December 06, 2012 7:34 PM To: users@tapestry.apache.org Subject: New to tapestry- please help Hi guys, I'm new to tapestry. Could someone please point me to some simple to follow tutorials to get me up and running quickly? Thanks, Emmanuel - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tapestry-TestNG with selenium reusable helper methods.
Hello, I'm very new to the automated testing world and have a couple questions. I'm wondering what the best practice for setting up reusable helper methods for testing. Should I be extending SeleniumTestCase with my own test methods, or should I be using a service? If the best way to do this is with a service, how would I get Tapestry services to work with Tapestry-TestNG and selenium. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-TestNG-with-selenium-reusable-helper-methods-tp5718524.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: [5.3.6] Tapestry's minimal dependencies
Thank you all for your help and suggestions :) On Thu, Dec 6, 2012 at 12:06 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Wed, 05 Dec 2012 19:01:11 -0200, Michael Prescott michael.r.presc...@gmail.com wrote: If you've used maven for that much, you're nearly there. All you have to do is declare the jars you need as dependency in the pom.xml, and then 'mvn install' will produce you a .war file with all the jars in it. Yep! You can use command 'mvn eclipse:eclipse' to create the project's .classpath file, so you don't need to maintain the Eclipse build path yourself. Please don't do that. Just use m2e (the Maven plugin for Eclipse, which is bundled into Eclipse itself for at least a couple of versions yet). It will automatically update your project configuration when you change your pom.xml. The plugin was quite bad in the past, but it's now very good. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Tapestry-TestNG with selenium reusable helper methods.
George, you should be extending SeleniumTestCase and just using plan object-oriented principles to manage your code (e.g you could have some utility clases with utility methods, possibly classes to encapsulate page specific contents, etc). Trying to put your functional test related code into services sounds like a bad idea (e.g. your test infrastructure will be depending on the stuff you're testing). Cheers - Alex K On Thu, Dec 6, 2012 at 12:00 PM, George Christman gchrist...@cardaddy.comwrote: Hello, I'm very new to the automated testing world and have a couple questions. I'm wondering what the best practice for setting up reusable helper methods for testing. Should I be extending SeleniumTestCase with my own test methods, or should I be using a service? If the best way to do this is with a service, how would I get Tapestry services to work with Tapestry-TestNG and selenium. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-TestNG-with-selenium-reusable-helper-methods-tp5718524.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: Tapestry-TestNG with selenium reusable helper methods.
Thanks Alex, I extended the Selenium class as suggested. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-TestNG-with-selenium-reusable-helper-methods-tp5718524p5718528.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