Re: Rendering cache
Hi, one of my simple implementation, hope it helps. public abstract class StaticCacheComponent { private final static int CACHE_EXPIRED = 60; @Inject private ComponentResources componentResources; @Inject private CacheService cacheService; @Inject private TypeCoercer typeCoercer; private Element fakeElement = null; private String cacheId = null; final boolean beginRender(MarkupWriter writer) { InternalComponentResourcesImpl resourcesImpl = (InternalComponentResourcesImpl)componentResources; StringBuilder builder = new StringBuilder(this.getClass().getSimpleName()); for (String parameterName : resourcesImpl.getComponentModel().getParameterNames()) { boolean isBound = resourcesImpl.isBound(parameterName); String parameterValueStr = null; if (isBound) { parameterValueStr = typeCoercer.coerce(resourcesImpl.getBinding(parameterName).get(), String.class); } builder.append(parameterName).append(_).append(parameterValueStr).append(_); } cacheId = builder.toString(); String staticCache = cacheService.getCache(cacheId, getCacheExpired()); if (staticCache != null) { writer.writeRaw(staticCache); return false; } else { fakeElement = writer.element(span); return true; } } final void afterRenderTemplate(MarkupWriter writer) { writer.end(); // must call before removing String innerHTMl = fakeElement.getChildMarkup(); fakeElement.remove(); writer.writeRaw(innerHTMl); cacheService.saveCache(cacheId, getCacheExpired(), innerHTMl); } protected int getCacheExpired() { return CACHE_EXPIRED; } } 2012/7/28 Jens Breitenstein mailingl...@j-b-s.de Hi T5'ers we have some performance issues and started thinking about caching our pages (lets say parts of them to be precise). Due to the fact we are showing user related information along with public information on a page, we can not make use of a simple web proxy caching. Therefore we are thinking about a component rendering result cache. Assume we have several independent components to show an overview of items (and we have a lot of items rendered in a loop) and we want to cache the rendering result of one of these particular components for several seconds before rendering it again (to reflect new items or changes). I am aware this means we are showing stale data for some seconds, but honestly this is not an issue because after rendering and displaying it in the browser data is considerably old anyway :-) What might be a good place to intercept the rendering and store the output from a component and on the other hand use outputraw for sending cached data? Does anyone tried this before? Any idea or comment is appreciated, thanks in advance Jens --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Howto render a block and put it into a JSON reply?
Hi, To render block as html markup, I did like this: public String renderMarkup(RenderCommand renderCommand) { MarkupWriter markupWriter = new MarkupWriterImpl(); // validation track ValidationDecorator decorator = new DefaultValidationDecorator(environment, assetSource.getExpandedAsset(${tapestry.spacer-image}), markupWriter); environment.push(ValidationDecorator.class, decorator); RenderQueueImpl renderQueue = new RenderQueueImpl(logger); renderQueue.push(renderCommand); renderQueue.run(markupWriter); environment.pop(ValidationDecorator.class); return markupWriter.toString().replaceAll(^\\n+, ).replaceAll(\\n+$, ); } and call renderMarkup((RenderCommand )block). Not sure whether it is better than yours, hope it helps. 2012/2/16 Christian Riedel cr.ml...@googlemail.com Hi there, I'm trying to improve the tapestry5-jquery DataTable component, which is able to respond paged results in JSON. Unfortunately the component is a bit limited in terms of what can be returned. I want to add support for the Grid-style p:propertyCell block-parameter-notation. I'm looking for the most elegant way to do it. Currently I'm trying it with faked zone updates (ajaxResponseRenderer.addRender) and a filter (ajaxResponseRenderer.addFilter) that should modify the JSON reply object. It feels very clumsy and I thought if someone on the list could point me to a more elegant solution. More Abstract: We've got - an Ajax callback: void onData() { ... } - PropertyOverrides, having block parameters - a working data source that is able to fetch data by the current page We need - loop over all rows of the current page and - render each cell's content or its override into a row-json-array and - put each row-json-array into a data json-array Is there another way than using ajaxResponseRenderer.addRender / addFilter? Cheers Christian - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.1 locale switch back to default english after navigate to other page
Hi, If you switch locale by PersistentLocale service, I think the locale will be persisted. Thanks, DH 2011/11/18 wesleywj2 wesley...@yahoo.co.uk hi there, i successfully switch the locale between english and chinese zh_CN within a page, but encountered a problem where once i switch to chinese and navigate to other pages with actionlink,submit etc, the other page switched back to default english. how do i keep the locale persisted for all pages after locale switching? please advice, wesleywj2 -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-1-locale-switch-back-to-default-english-after-navigate-to-other-page-tp5002303p5002303.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: [ANNOUNCE] Apache Tapestry preview 5.3-rc-1
Me too where tml contains Chinese words. Should be caused by the html5 doc type changes? Caused by: java.io.UTFDataFormatException: Invalid byte 3 of 3-byte UTF-8 sequence. at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source) at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.scanLiteral(Unknown Source) at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.tapestry5.internal.services.XMLTokenStream.parse(XMLTokenStream.java:306) at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:163) 2011/11/1 Donyee xyw888...@gmail.com Both rc-1 and rc-2, I got this Invalid byte 1 of 1-byte UTF-8 sequence. but works fine with beta-26 is there any new changes?? 2011/11/1 Howard Lewis Ship hls...@gmail.com Uh, yes. It's been a trying afternoon. On Mon, Oct 31, 2011 at 3:26 PM, Muhammad Gelbana m.gelb...@gmail.com wrote: You mean 5.3-rc-2 I suppose. On Mon, Oct 31, 2011 at 11:32 PM, Howard Lewis Ship hls...@gmail.com wrote: FYI: I found a minor problem in Tapestry 5.2-rc-1 and am building/uploading Tapestry 5.2-rc-2 right now. On Mon, Oct 31, 2011 at 11:05 AM, Howard Lewis Ship hls...@gmail.com wrote: We are very pleased to announce the first release candidate preview of Tapestry 5.3. Tapestry 5.3 is significantly faster than Tapestry 5.2, and is more memory efficient ... a long with tons of significant new features, improvements, and bug fixes. Details here: http://tapestry.apache.org/2011/10/31/tapestry-53-release-candidate.html This is still a preview release, but we encourage the Tapestry community to upgrade to this release. With positive feedback (and no show-stopping negative feedback) we should progress to a final release of 5.3 in a few weeks. For most users, the upgrade path is simply changing the version number, and performing a clean compile. Note that with each new release, we get a slew of panicked messages that Tapestry is broken in bizarre ways. These ALMOST ALWAYS turn out to be prior-release JARs still on the classpath, either in the developer's working directory, or in a servlet container deployment directory. Please carefully clean up your environment as part of the upgrade! There are some cases where Tapestry 5.3 performs more rigorous checks than Tapestry 5.2; for example, 5.3 ensures that event handler methods that reference a component id (onSuccessFromLogin) correspond to an actual component (login); in Tapestry 5.2, this was not checked for, and the event handler method would never fire ... it likely has a typo in its name, or is related to a component that was removed from the template. This particular check can be disabled: http://tapestry.apache.org/configuration.html#Configuration-tapestry.compatibility.unknowncomponentidcheck . .. It would be wise to start up your application under 5.3, then use the new PageCatalog page (http://localhost:8080/pagecatalog) and click the load all link, to force all pages to be loaded. This will quickly identify any coding problems in your application. -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- *Regards,* *Muhammad Gelbana Java Developer* -- Howard M. Lewis Ship Creator of
Re: [ANNOUNCE] Apache Tapestry preview 5.3-rc-1
A pleasure! Done. https://issues.apache.org/jira/browse/TAP5-1741 Thanks, DH 2011/11/1 Howard Lewis Ship hls...@gmail.com It is possible, can you open up a JIRA issue and attach your template? On Tue, Nov 1, 2011 at 3:01 AM, dh ning ningd...@gmail.com wrote: Me too where tml contains Chinese words. Should be caused by the html5 doc type changes? Caused by: java.io.UTFDataFormatException: Invalid byte 3 of 3-byte UTF-8 sequence. at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source) at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source) at org.apache.xerces.impl.XMLEntityScanner.scanLiteral(Unknown Source) at org.apache.xerces.impl.XMLScanner.scanAttributeValue(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.tapestry5.internal.services.XMLTokenStream.parse(XMLTokenStream.java:306) at org.apache.tapestry5.internal.services.SaxTemplateParser.parse(SaxTemplateParser.java:163) 2011/11/1 Donyee xyw888...@gmail.com Both rc-1 and rc-2, I got this Invalid byte 1 of 1-byte UTF-8 sequence. but works fine with beta-26 is there any new changes?? 2011/11/1 Howard Lewis Ship hls...@gmail.com Uh, yes. It's been a trying afternoon. On Mon, Oct 31, 2011 at 3:26 PM, Muhammad Gelbana m.gelb...@gmail.com wrote: You mean 5.3-rc-2 I suppose.
回复: Re: Deadlock issue in 5.3-beta-5 ?
I think it is not fixed yet. https://issues.apache.org/jira/browse/TAP5-1650 2011-09-23 DH 发件人: Chris Poulsen mailingl...@nesluop.dk 发送时间: 2011-09-23 17:08 主 题: Re: Deadlock issue in 5.3-beta-5 ? 收件人: Tapestry users users@tapestry.apache.org There have been some work related to synchronization in more recent betas. Why are you still on beta-5? -- Chris 2011/9/23 Dávið Klein Sundsskarð d...@amc.dk Hi, I am experiencing deadlock issues in Tap 5.3-beta-5. I don't know if it only is related to live class reloading, but it happens very often while developing. The page is making ajax calls to eventhandlers every second and when editing and saving a class some of the requests deadlock. I'm hoping it will go away in production mode. Maybe someone else is experiencing the same or am I doing something wrong? See stacktraces below. /David -- Thread 1 --- Name: http-8030-33 - /main.layout.refreshinfopanelinecount. State: BLOCKED on org.apache.tapestry5.internal.plastic.PlasticClassLoader@2cec33 owned by: http-8030-34 - /main.layout.refreshinfopanelinecount Total blocked: 78 Total waited: 4 Stack trace: java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:247) org.apache.tapestry5.internal.plastic.PlasticInternalUtils.toClass(PlasticInternalUtils.java:318) org.apache.tapestry5.internal.services.ComponentClassCacheImpl.lookupClassForType(ComponentClassCacheImpl.java:78) org.apache.tapestry5.internal.services.ComponentClassCacheImpl.forName(ComponentClassCacheImpl.java:65) $ComponentClassCache_c639cd1eb0ed.forName(Unknown Source) org.apache.tapestry5.internal.services.DefaultInjectionProvider.provideInjection(DefaultInjectionProvider.java:65) $InjectionProvider2_c639cd1eb179.provideInjection(Unknown Source) $InjectionProvider2_c639cd1eb165.provideInjection(Unknown Source) org.apache.tapestry5.internal.transform.InjectWorker$2.run(InjectWorker.java:73) org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:51) org.apache.tapestry5.ioc.internal.OperationTrackerImpl$1.invoke(OperationTrackerImpl.java:48) org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74) org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47) org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:56) org.apache.tapestry5.ioc.internal.RegistryImpl.run(RegistryImpl.java:1077) org.apache.tapestry5.internal.transform.InjectWorker.transform(InjectWorker.java:67) $ComponentClassTransformWorker2_c639cd1eb169.transform(Unknown Source) $ComponentClassTransformWorker2_c639cd1eb15f.transform(Unknown Source) org.apache.tapestry5.internal.services.ComponentInstantiatorSourceImpl$3.run(ComponentInstantiatorSourceImpl.java:320) -- Thread 2 --- Name: http-8030-34 - /main.layout.refreshinfopanelinecount State: BLOCKED on org.apache.tapestry5.internal.plastic.PlasticClassLoader@6e4109 owned by: http-8030-33 - /main.layout.refreshinfopanelinecount Total blocked: 163 Total waited: 5 Stack trace: org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:31) java.lang.ClassLoader.loadClass(ClassLoader.java:295) - locked org.apache.tapestry5.internal.plastic.PlasticClassLoader@2cec33 org.apache.tapestry5.internal.plastic.PlasticClassLoader.loadClass(PlasticClassLoader.java:47) - locked org.apache.tapestry5.internal.plastic.PlasticClassLoader@2cec33 java.lang.ClassLoader.loadClass(ClassLoader.java:247) org.apache.tapestry5.internal.plastic.PlasticClassPool.createAnnotationAccess(PlasticClassPool.java:191) org.apache.tapestry5.internal.plastic.PlasticClassImpl.init(PlasticClassImpl.java:191) org.apache.tapestry5.internal.plastic.PlasticClassPool.createTransformation(PlasticClassPool.java:371) org.apache.tapestry5.internal.plastic.PlasticClassPool.createTransformation(PlasticClassPool.java:408) org.apache.tapestry5.plastic.PlasticManager.createProxyTransformation(PlasticManager.java:260) org.apache.tapestry5.plastic.PlasticManager.createProxy(PlasticManager.java:233) org.apache.tapestry5.ioc.internal.services.PlasticProxyFactoryImpl.createProxy(PlasticProxyFactoryImpl.java:57) $PlasticProxyFactory_c639cd1eb16b.createProxy(Unknown Source) $PlasticProxyFactory_c639cd1eb16a.createProxy(Unknown Source) org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.build(PropertyConduitSourceImpl.java:1372) org.apache.tapestry5.internal.services.PropertyConduitSourceImpl.create(PropertyConduitSourceImpl.java:1274) $PropertyConduitSource_c639cd1eb1be.create(Unknown Source) org.apache.tapestry5.internal.bindings.PropBindingFactory.newBinding(PropBindingFactory.java:49
Re: Directory listing error
Please have a look at your jetty log, there must be some error message when deploying your t5 application. DH - Original Message - From: Mite mitemeis...@gmail.com To: users@tapestry.apache.org Sent: Friday, March 19, 2010 9:38 AM Subject: Directory listing error I have created a project few hours ago with the quickstart archetype. I was able to start it and it was running OK. I created some model classes and annotated them with hibernate to connect them to my database. Now I try to run the application (http://localhost:8081/)and all I get is a directory listing. When I click some of the files it says: HTTP ERROR: 403 URI /Index.tml may not be accessed remotely. I am using Jetty and Eclipse. I know it is a small chance, but does anyone has an idea what is the problem? Thank you -- View this message in context: http://old.nabble.com/Directory-listing-error-tp27950872p27950872.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: Error in tapestry.js in IE 8
Prototype 1.6.0 in T5.1 has such issue on IE8. You can upgrade prototype.js to 1.6.1 or use tapx lib. DH - Original Message - From: LiborGMC l.pre...@gmc.net To: users@tapestry.apache.org Sent: Monday, March 15, 2010 3:51 PM Subject: Re: Error in tapestry.js in IE 8 Hi, I'm still facing this issue. I cannot use Tapestry 5 on IE8! Am I only one who face to this problem? Or Tapestry cannot be used on IE8? Could anybody answer me, plese? Please help! Libor -- View this message in context: http://old.nabble.com/Error-in-tapestry.js-in-IE-8-tp27714386p27901196.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: message catalog and generated labels from property name
If it is boolean, better way is to define the label in properties. propertyname.true=Yes propertyname.false=No DH - Original Message - From: Thiago H. de Paula Figueiredo thiag...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, January 26, 2010 11:07 PM Subject: Re: message catalog and generated labels from property name On Tue, 26 Jan 2010 12:07:13 -0200, kamiseq kami...@gmail.com wrote: oh, one more thing can I map values in components like grid to some other names. so if in cell I have false or true, can I map this to something like yes / no Not out of the box, but you can use p: blocks (formerly t:parameter name= blocks) to override how a property will be output. This is documented at the Grid componente reference: http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: page generic problem
I think T5 doens't support generic well in page class, I got some unexpected exceptions too. DH - Original Message - From: Jun Tsai jun.t...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, January 11, 2010 11:44 AM Subject: page generic problem hi,all I had meet some problem about generic type PageAT{ public T getEntity(){ } public T setEntity(T entity){ } . } PageB extends PageAMember{ . } When I access ${entity.name} in tml ,PageB works fine.Then I create PageC PageC extends PageB{ } When I access ${entity.name} in tml of PageC,Exception was thrown: Class java.lang.Object does not contain a property named 'name' (within property expression 'entity.name). Available properties: class. - org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.infoForPropertyNode(PropertyConduitSourceImpl.java:942) - org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.infoForPropertyOrMethod(PropertyConduitSourceImpl.java:932) - org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createGetterAndSetter(PropertyConduitSourceImpl.java:421) - org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createAccessors(PropertyConduitSourceImpl.java:407) - org.apache.tapestry5.internal.services.PropertyConduitSourceImpl$PropertyConduitBuilder.createInstance(PropertyConduitSourceImpl.java:260) What's wrong with it? thanks. -- regards, Jun Tsai
Re: Best practice for initializing page to default context
Of course, but since I am not very good at javassit, my implementation may be ugly and a bit long. Anyone please consummate it. Like PageActivationContext, I introduce an PageActivationUnitWorker. The key part is to collect the param fields and add the param map to page class in runtime. onActivate and onPassivate would use this map to set value or retrieve value. 1. For annotation: @Target(FIELD) @Documented @Retention(RUNTIME) public @interface PageActivationUnit { String value() default ; } 2. For worker: public class PageActivationUnitWorker implements ComponentClassTransformWorker { private TypeCoercer _typeCoercer; public PageActivationUnitWorker(TypeCoercer typeCoercer) { this._typeCoercer = typeCoercer; } public void transform(ClassTransformation transformation, MutableComponentModel model) { ListString fieldNames = transformation.findFieldsWithAnnotation(PageActivationUnit.class); if (fieldNames != null fieldNames.size() 0) { MapString, String fieldParamMap = new HashMapString, String(); for (String fieldName : fieldNames) { PageActivationUnit annotation = transformation.getFieldAnnotation(fieldName, PageActivationUnit.class); fieldParamMap.put(fieldName, getParameterName(fieldName, annotation.value())); } String typeCoercer = transformation.addInjectedField(TypeCoercer.class, typeCoercer, _typeCoercer); TransformMethodSignature activate = new TransformMethodSignature(Modifier.PROTECTED | Modifier.FINAL, boolean, onActivate, new String[] {EventContext.class.getName()}, null); TransformMethodSignature passivate = new TransformMethodSignature(Modifier.PROTECTED | Modifier.FINAL, java.lang.Object[], onPassivate, null, null); BodyBuilder activeBuilder = new BodyBuilder().begin(); activeBuilder.addln(java.util.Map keyValueMap = new java.util.HashMap();); activeBuilder.add(for (int i = 0; i $1.getCount(); i++)); activeBuilder.begin(); activeBuilder.addln(String []keyValue = ((String)$1.get(String.class, i)).split(\-\);); activeBuilder.addln(String key = keyValue[0];); activeBuilder.addln(String value = (keyValue.length 1) ? keyValue[1] : null;); activeBuilder.addln(keyValueMap.put(key, value);); activeBuilder.end(); // end for for (int i = 0, size = fieldNames.size(); i size; i++) { String fieldName = fieldNames.get(i); String fieldType = transformation.getFieldType(fieldName); activeBuilder.addln(String fieldValue=(String)keyValueMap.get(\%s\);, fieldParamMap.get(fieldName)); activeBuilder.addln(if (fieldValue != null) {); activeBuilder.addln(%s=(%s)%s.coerce(fieldValue, Class.forName(\%s\));, fieldName, fieldType, typeCoercer, fieldType); activeBuilder.addln(}); } activeBuilder.addln(return true;); // end method body activeBuilder.end(); BodyBuilder deactiveBuilder = new BodyBuilder().begin(); for (int i = 0, size = fieldNames.size(); i size; i++) { String fieldName = fieldNames.get(i); if (i == size - 1) { deactiveBuilder.add(\%s-\ + (%s != null ? (String)%s.coerce(%s, String.class) : \\), fieldParamMap.get(fieldName), fieldName, typeCoercer, fieldName); } else { deactiveBuilder.add(\%s-\ + (%s != null ? (String)%s.coerce(%s, String.class) : \\),, fieldParamMap.get(fieldName), fieldName, typeCoercer, fieldName); } } deactiveBuilder.end(); transformation.addTransformedMethod(activate, activeBuilder.toString()); transformation.addTransformedMethod(passivate, return new Object[] + deactiveBuilder.toString() + ;); } } private String getParameterName(String fieldName, String annotatedName) { if (InternalUtils.isNonBlank(annotatedName)) return annotatedName; return InternalUtils.stripMemberName(fieldName); } } 3. In app module public static void contributeComponentClassTransformWorker( OrderedConfigurationComponentClassTransformWorker configuration, TypeCoercer typeCoercer) { configuration.add(PageActivationUnit, new PageActivationUnitWorker(typeCoercer), before:OnEvent); } That's all. One disadvantage is that you can't use primitive type for param field, so use Integer instead of int. DH http://www.gaonline.com.cn - Original Message - From: Inge Solvoll To: Tapestry users users@tapestry.apache.org Sent: Tuesday, December 08, 2009 4:14 PM Subject: Re: Best practice for initializing page to default context Would it be possible for you to share that code with us? I don't necessarily want to use that approach, but it would be very helpful to see how you implemented it. Inge On Tue, Dec 8, 2009 at 9:10 AM, DH ningd...@gmail.com wrote: Once I found it difficult too, and I never used EventContext because I think
Re: zone id as property expression ?
t:zone t:id=static name id=${zoneName} t:update=show Finally id in the Dom would be the one 'id'. DH http://www.gaonline.com.cn - Original Message - From: Gunnar Eketrapp To: Tapestry users users@tapestry.apache.org Sent: Monday, December 07, 2009 4:43 PM Subject: zone id as property expression ? Hi! I would like to do the following .. t:zone t:id=${zoneName} t:update=show ... but T5 doesnt seem to like property expressions in the id attriute. Anyone?
Re: t5 Environment property
http://tapestry.apache.org/tapestry5.1/guide/env.html DH http://www.gaonline.com.cn - Original Message - From: kamiseq To: users@tapestry.apache.org Sent: Tuesday, December 08, 2009 7:54 AM Subject: t5 Environment property hi, I really cant find any proper explanation of Environment and Environmental. From javadoc I understand that children components are provided with Environmental service set by their parents so there is a way of passing data around but I really dont get the stack idea of Environment service. And then If I have 3 components such A B C /A and then A sets some data by Environment interface then B and C can access the data. But I tried and set some data in B and then accessed it in C component that is sibling of B and not its child. - Of course you can access if component B doesn't pop the data after it is rendered, but I would suggest you don't do that and always pop the data after component is rendered. You should make component B and C decouple well. So just set data in Component A is ok. What if I enclose compoennts like A id=aa A id=ab B C /A B C /A will A.ab override the data that A.aa set just before?? Yes, it would overwrite the data. can somebody point me to any information/tutorial/example about Environment and Environmental thanks -- pozdrawiam Paweł Kamiński kami...@gmail.com pkaminski@gmail.com __
Re: t5 handling events by components, event handling sequence
In your case, I think the best practice is to handle the event in the page but not the component. Or you can handle event in the component to perform common logic, then trigger another event and carry relevant data, so for the page, it can handle the second event to do somehing to change its activation context. DH http://www.gaonline.com.cn - Original Message - From: kamiseq To: users@tapestry.apache.org Sent: Tuesday, December 08, 2009 7:38 AM Subject: t5 handling events by components, event handling sequence hi, I ve wrote simple component that renders link and handles event triggered by the link then it sets some value and should render that value. the problem is that I get the value but then the value is lost as tapestry redirects to a page that holds the component Tabs is the page that renders TabNavigation component [DEBUG] pages.Tabs @PageAttached [DEBUG] components.TabNavigation got panel3 [INFO] AppModule.TimingFilter Request time: 18 ms [DEBUG] pages.Tabs @PageDetached 127.0.0.1 - - [07/gru/2009:23:20:18 +] GET /generator/tabs.tabnavigation.tabselect/panel3 HTTP/1.1 302 0 http://localhost:8080/generator/tabs... [DEBUG] pages.Tabs @PageAttached [DEBUG] components.TabContainer @beginRender sets enivromental [DEBUG] components.TabContainer @BeforeRenderTemplate idtabcontainer [DEBUG] components.TabNavigation used null [DEBUG] components.TabPane tabp...@setuprender fancy=sfssf [DEBUG] components.TabPane tabp...@setuprender fancy=sfssf [DEBUG] components.TabPane tabp...@setuprender fancy=sfssf [DEBUG] components.TabContainer @AfterRenderTemplate [INFO] AppModule.TimingFilter Request time: 19 ms [DEBUG] pages.Tabs @PageDetached 127.0.0.1 - - [07/gru/2009:23:20:18 +] GET /generator/tabs HTTP/1.1 200 611 http://localhost:8080/generator/tabs; Mozilla/5.0 ... why is so and how can design my component to fix that. Of course I can annotate the value field as @Persist-ent but I really would like to avoid session as much as possible. Maybe I could set actionLink to point to Tabs page instead of TabNavigation component and then assign value to TabNavigation that will render correctly or some better way to sort that out. thanks for any advise cheers pozdrawiam Paweł Kamiński kami...@gmail.com pkaminski@gmail.com __
Re: Access the Tapestry IoC from another servlet
ServletContext context = FilterConfig.getServletContext(); context.getAttribute(TapestryFilter.REGISTRY_CONTEXT_NAME); See TapestryFilter, hope that helps. DH http://www.gaonline.com.cn - Original Message - From: Mike Leonardo To: users@tapestry.apache.org Sent: Monday, December 07, 2009 2:08 PM Subject: Access the Tapestry IoC from another servlet Hello! I'm writing an application that has both a T5 web app and also a Restlet servlet in the same project. So T5 is the servlet-filter and the Restlet is an actual servlet. To allow both to co-exist I've configured the T5 AppModule to ignore anything with /rest/ at the beginning of the request - and that all works fine. The issue is that I would really like to use the Tapestry IoC from the web app in my Restlet servlets. Is there anyway to do this? I tried following the instructions for non-web registry creation (added the code to the restlet initialization) and got the message: [ERROR] internal.SerializationSupport Setting a new service proxy provider when there's already an existing provider. may indicate that you have multiple IoC Registries. So I think the Restlet actually sees the registry from the web app running. Is that true - and if so can I get access to it? Sorry, I'm a bit new to all this configuration. Thanks for any help! Michael Leonardo - iFactory Software Engineer - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: missing key for localized resources on Linux
Please check whether the properties file name is the same as the filter name in web.xml (case sensitive) . I made such mistake before. DH http://www.gaonline.com.cn - Original Message - From: Ilya Obshadko To: Tapestry users users@tapestry.apache.org Sent: Monday, November 23, 2009 6:07 PM Subject: missing key for localized resources on Linux I've started deploying my project on staging server and encountered a very strange issue. Running my JAR (I'm using embedded Jetty configuration) on Linux machine results in missing key messages instead of all localized strings. Running exactly the same JAR with same classpath on Mac OS X works normally. Does anybody have an idea? -- Ilya Obshadko
Re: Pass params to pager of grid component
It seems that Grid doesn't support 'context' parameter. But why don't you add the keyword to the page's activation context? DH http://www.gaonline.com.cn - Original Message - From: Xuan Tran Le To: Tapestry users users@tapestry.apache.org Sent: Wednesday, November 11, 2009 12:45 PM Subject: Pass params to pager of grid component I have a problem with the pager of grid component. I want to pass some params to the pager link. For example, I have a page support searching. It contains a text field, a submit button, and a grid component. When I enter the value to the text and click on submit button, it show the result in the grid. There are so many result, so there is a grid pager. When I click on the pager link to the page 2, then the value of the text is not remembered, so it's empty now. So I wanna remember/pass some params to the pager link. How can I do it?
Re: beaneditform question
I never had this issue before. I just test and everything works right, can you share the whole stack trace? DH http://www.gaonline.com.cn - Original Message - From: Jonhy Pear To: Tapestry users users@tapestry.apache.org Sent: Tuesday, November 10, 2009 3:27 AM Subject: Re: beaneditform question I'm experimenting your code but I'm blocked :( I have in my page.java @Property private String password; @Property private String confirmPassword; in my tml: form t:id=userRegistrationForm t:type=beaneditform object=user add=password, confirmPassword exclude=id, active p:passsword t:label for=password / t:passwordfield t:id=password validate=required / /p:passsword p:confirmPassword t:label for=confirmPassword / t:passwordfield t:id=confirmPassword validate=required / /p:confirmPassword /form But I get this error: Render queue error in BeginRender[user/New:userregistrationform.editor.propertyeditor]: The data type for property 'password' of org.code.sandbox.model.u...@d9973a is null. * * *Can you help me?* On Mon, Nov 9, 2009 at 4:13 PM, ningdh ningd...@gmail.com wrote: I am sorry that Object onValidate should be Object onValidateForm. DH - Original Message - From: João Pereira To: Tapestry users users@tapestry.apache.org Sent: Monday, November 09, 2009 11:53 PM Subject: Re: beaneditform question Thank you. On Mon, Nov 9, 2009 at 1:50 AM, DH ningd...@gmail.com wrote: Hi Simple sample(t5.1): In tml: form t:id=regForm t:type=beaneditform object=user include=nick,firstName,lastName add=password,retypePassword p:password t:label for=password/ t:passwordfield t:id=password validate=required /p:password p:retypePassword t:label for=retypePassword/ t:passwordfield t:id=retypePassword validate=required /p:retypePassword /form In java: @Component private BeanEditForm regForm; @Property private User user; // your user entity @Property private String password; @Property private String retypePassword; Object onValidate() { if (!password.equals(retypePassword)) { regForm.recordError(password and retypepassword must be == ); return this; // meaning validation failed } return null; // validation successfully. } Object onSuccess() { user.setPassword(encodeutil.encode(password)); service.save(user); return successpage or other; } DH http://www.gaonline.com.cn
Re: beaneditform question
Hi Simple sample(t5.1): In tml: form t:id=regForm t:type=beaneditform object=user include=nick,firstName,lastName add=password,retypePassword p:password t:label for=password/ t:passwordfield t:id=password validate=required /p:password p:retypePassword t:label for=retypePassword/ t:passwordfield t:id=retypePassword validate=required /p:retypePassword /form In java: @Component private BeanEditForm regForm; @Property private User user; // your user entity @Property private String password; @Property private String retypePassword; Object onValidate() { if (!password.equals(retypePassword)) { regForm.recordError(password and retypepassword must be == ); return this; // meaning validation failed } return null; // validation successfully. } Object onSuccess() { user.setPassword(encodeutil.encode(password)); service.save(user); return successpage or other; } DH http://www.gaonline.com.cn - Original Message - From: Jonhy Pear To: users@tapestry.apache.org Sent: Monday, November 09, 2009 9:21 AM Subject: Re: beaneditform question Sorry, I mean beaneditform, not beaneditform On Mon, Nov 9, 2009 at 1:05 AM, Jonhy Pear jonhy.p...@gmail.com wrote: Hello all, This is my first message to the list. I'm new to tapestry and I'm evaluating it and looking for some guidance. Let's say I have a java bean with: String nick; String firstName; String lastName; String hashPassword; I want to use beaneditform to create a new user but I want to add new fields: password retypePassword and validade the presence of both and their equality. You know, that typical registration process. When user submit the new data I want to validate the equality of both password and confirmPassword and set a hash based on password in the field hashPassword in the bean. Does anybody have a sample code that I can use to know what is the best way to achieve this with tapestry? thank you -- João Miguel Pereira http://jpereira.eu LinkedIn: http://www.linkedin.com/in/joaomiguelpereira joaomiguel.pere...@gmail.com (351) 96 275 68 58
Re: T5 Random Issue
I got this issue with gzip enabled and tomcat6, tomcat5 has no problem. So I had to disable gzip in tapestry. DH http://www.gaonline.com.cn - Original Message - From: Norman Franke To: Tapestry users users@tapestry.apache.org Sent: Tuesday, November 03, 2009 12:31 AM Subject: T5 Random Issue Periodically, users get pages full of unicode or something like this the attached. It displays as boxed question marks in safari. This happens in both Safari and Firefox. Refreshing generally displays the page properly. What causes this? It's using Tapestry 5.1.0.5 and Tomcat. ���v7���)bxf��V $��ՃK�n� $ � � d � W � � ` 2D � �̤ � B � � 5 t ^ � � � vd � � X��h�]e�*�Jf`_�occOӋ�U���xX�n? L���z���V~�����.�/ vg�n0�ڪ�l�[[ggg�gjs9�z�|�- ���l�?��?�߸w�p4��� � � ⱍ { � {�6���q;k��x4kG�o7f���}�bp�L�� s5�ڟ���˯���I�^�� 45 � f � � ^ � � ų � xz � f � b � H � � � x �̺ � � ���;�nG�q���Q{~6��O�k�; Norman Franke Answering Service for Directors, Inc. www.myasd.com
Re: Problem with ActionLinks inside Zone
Never got this issue. Since the action link is linked to the zone, in the ajax response, the action link will be linked to the zone again (script in the response will be executed), so the next time it is still an ajax request. Maybe post some code that we can help you. DH http://www.gaonline.com.cn - Original Message - From: Andrey Larionov To: Tapestry users users@tapestry.apache.org Sent: Sunday, November 01, 2009 11:52 PM Subject: Problem with ActionLinks inside Zone I have two loops, which renders some elements (active and inactive). Both loops are inside Zone. For every element i have one of two action link (depends on state of element). ActionLink is linked to update Zone which contains whis loops. When page rendered first all is ok. Action triggered and return Block (it contains newly rendered two loops). But in returned Block, there is no more AJAX support. Clicking on links produce simple (not AJAX) Event request, but handler is return block, and this situation produces Exception. Any advice? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: how can i construct external url with querystring???
Don't understand your problem well. Doesn't [a href=${fwdLink}login/a] fit your need? DH http://www.gaonline.com.cn - Original Message - From: sameerkhare To: users@tapestry.apache.org Sent: Wednesday, October 28, 2009 12:47 PM Subject: how can i construct external url with querystring??? I want to construct a URL as below and forward to that external URL through tapestry 5. My tml file contains link as below ${fwdLink} login and correspoinding java file contains getter method for it. public String getFwdLink() { return fwdLink= Http://www.mysite.com?userId=abcpass=ab; } My problem is that how can i construct url with querystring??? Please let me know if any one has any idea on it. Thanks Sameer -- View this message in context: http://www.nabble.com/how-can-i-construct-external-url-with-querystringtp26089334p26089334.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: how can i construct external url with querystring???
I think there isn't any difference between Tapestry and other framewords here. Or did I misunderstand? You have defined the 'getFwdLink' in your java class, then just construct the url and assign this property in tml: public String getFwdLink() { return String.format(http://www.mysite.com?userId=%spass=%s, userId, ab); // you can use any way you like } In tml, a href=${fwdLink}login/a. DH http://www.gaonline.com.cn - Original Message - From: sameerkhare To: users@tapestry.apache.org Sent: Wednesday, October 28, 2009 2:08 PM Subject: Re: how can i construct external url with querystring??? Then how can i construct the external URL with query string in tapestry. My Problem is that, I have a link on my tml page. and i need to construct URL with querystring and assign it to the link in tml page. Please suggest me, that how can i implement it. sameer DH-14 wrote: Don't understand your problem well. Doesn't [ ${fwdLink} login ] fit your need? DH http://www.gaonline.com.cn - Original Message - From: sameerkhare To: users@tapestry.apache.org Sent: Wednesday, October 28, 2009 12:47 PM Subject: how can i construct external url with querystring??? I want to construct a URL as below and forward to that external URL through tapestry 5. My tml file contains link as below ${fwdLink} login and correspoinding java file contains getter method for it. public String getFwdLink() { return fwdLink= Http://www.mysite.com?userId=abcpass=ab; } My problem is that how can i construct url with querystring??? Please let me know if any one has any idea on it. Thanks Sameer
Re: how can i construct external url with querystring???
But what you want is external link, createPageRender() is to create internal link, you need provide your app internal page name. DH http://www.gaonline.com.cn - Original Message - From: sameerkhare To: users@tapestry.apache.org Sent: Wednesday, October 28, 2009 5:29 PM Subject: Re: how can i construct external url with querystring??? Is it the good way to construct the url by this way. I think it is not. I am trying to use Link tapestry class with createPageRender() method. but no luck.. DH-14 wrote: I think there isn't any difference between Tapestry and other framewords here. Or did I misunderstand? You have defined the 'getFwdLink' in your java class, then just construct the url and assign this property in tml: public String getFwdLink() { return String.format(http://www.mysite.com?userId=%spass=%s, userId, ab); // you can use any way you like } In tml, ${fwdLink} login . DH http://www.gaonline.com.cn - Original Message - From: sameerkhare To: users@tapestry.apache.org Sent: Wednesday, October 28, 2009 2:08 PM Subject: Re: how can i construct external url with querystring??? Then how can i construct the external URL with query string in tapestry. My Problem is that, I have a link on my tml page. and i need to construct URL with querystring and assign it to the link in tml page. Please suggest me, that how can i implement it. sameer DH-14 wrote: Don't understand your problem well. Doesn't [ ${fwdLink} login ] fit your need? DH http://www.gaonline.com.cn - Original Message - From: sameerkhare To: users@tapestry.apache.org Sent: Wednesday, October 28, 2009 12:47 PM Subject: how can i construct external url with querystring??? I want to construct a URL as below and forward to that external URL through tapestry 5. My tml file contains link as below ${fwdLink} login and correspoinding java file contains getter method for it. public String getFwdLink() { return fwdLink= Http://www.mysite.com?userId=abcpass=ab; } My problem is that how can i construct url with querystring??? Please let me know if any one has any idea on it. Thanks Sameer -- View this message in context: http://www.nabble.com/how-can-i-construct-external-url-with-querystringtp26089334p26091675.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: Login page - passing context between pages
In that case, the context is only useful for Login page, but not the following page, so only returning logic name of source page would not carry the context. Try PageRenderLinkSource#createPageRenderLinkWithContext(String pageName, Object... context) and return that link. DH http://www.gaonline.com.cn - Original Message - From: shymon shym...@poczta.onet.pl To: users@tapestry.apache.org Sent: Thursday, October 15, 2009 7:35 PM Subject: Login page - passing context between pages Some pages of my app are available only to authorized users. When user enters such a page and is not logged in, appropriate message is shown with link to login page. After logon user should return to the same page he came from to login page. So I pass logical name of restricted page and it's context through context parameter of pageLink. In login page I use onActivate and onPassivate to maintain source page context. It works great, but when login is successful I return source page logical name which causes redirect, but rest of the page context is null. Simply onPassivate called after onSuccess returns array of nulls. (Inside onSuccess all variables are correctly set). How can I store source page context through logon process? -- View this message in context: http://www.nabble.com/Login-page---passing-context-between-pages-tp25907016p25907016.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: calling action link from a javascript
updateItem()? I think should be ${updateItem()}. DH http://www.gaonline.com.cn - Original Message - From: Angelo Chen angelochen...@yahoo.com.hk To: users@tapestry.apache.org Sent: Monday, October 12, 2009 9:40 AM Subject: t5: calling action link from a javascript Hi, I'm trying to call an actionlink from a javascript, but i'm getting: Remote server closed the connection before sending response header and I never see the pop up dialog in the javascript, any idea how to avoid errors like this? Thanks. A.C. sample code: in java: public String getUpdateItem() { return resources.createActionLink(updateItem, false).toURI() } Object onUpdateItem() { return new TextStreamResponse(text/html, ok); } in javascript: jQuery.post(updateItem(), { item_no : ino }, function(data){ alert(Data Loaded: + data); }); -- View this message in context: http://www.nabble.com/t5%3A-calling-action-link-from-a-javascript-tp25849523p25849523.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: eclipse / mvn / run-jetty-run
I just use the maven archetype and directly run mvn jetty:run mvnDebug jetty:run. If mvn jetty:run, all changes in page/component classes are reloaded, but not for other classes. If mvnDebug and in eclipse to debug it, all changes in page/component classes and other classes are immediately reloaded, but for adding new method, I still need restart mvnDebug. DH http://www.gaonline.com.cn - Original Message - From: Gunnar Eketrapp To: Tapestry users users@tapestry.apache.org Sent: Tuesday, September 29, 2009 6:22 PM Subject: eclipse / mvn / run-jetty-run Hi! A newbie question! I managed to install all of the above and can now start/debug my webapp code. But I still have to execute ... mvn war:war ... to update my webapp files each time before launching a jetty run/debug session. How do you folks do this? I.e. how do I execute this mvn task from within eclipse and is it possible to do it automatically? Thanks in advance, Gunnar Eketrapp, Cold North (Stockholm)
Re: How to display Blob byte array image?
Maybe this is feasible: Create an event link and get the url, put the url to the img src and return the stream response in the event handler. DH http://www.gaonline.com.cn - Original Message - From: Jun Tsai To: Tapestry users users@tapestry.apache.org Sent: Monday, September 21, 2009 8:49 AM Subject: Re: How to display Blob byte array image? Thank your quick reply.I had seen it.But How to code image element in .tml file? 2009/9/21 Thiago H. de Paula Figueiredo thiag...@gmail.com Em Sun, 20 Sep 2009 21:36:30 -0300, Jun Tsai jun.t...@gmail.com escreveu: hi, I had stored my image to database using byte array.How to display it? I couldn't find any image component. In any event handler method, return a StreamResponse. One example: the ImagePage and JPEGAttachment classes in http://wiki.apache.org/tapestry/Tapestry5HowToStreamAnExistingBinaryFile. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- regards, Jun Tsai
Re: T5:can we nest a bean's property value in message resource?
Currently no such solution, but you can create new binding prefix for your requirement. But maybe a bit complicated. Another simpler way is using Messages#get in your page class. DH http://www.gaonline.com.cn - Original Message - From: cleverpig To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 3:29 PM Subject: T5:can we nest a bean's property value in message resource? hi,all! thank everyone for help me! i get a new problem~can we nest a bean property value in ${message:}? for example: A class's property: foo(string type),it's value: start. can i use this foo's value in this way: ${message:prop:foo} or ${message: ${prop:foo} } i mean it should equal with ${message:start} ? it's a unusually usage?do you meet? -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5:how to use rowIndex in Grid component?
If you want to show the row num in front of each row, take an user (with bean property lastname and firstname) list for example, I assume your data source 'userSource' is prepared. table t:type=grid t:source=userSource add=rowNumber reorder=rowNumber rowIndex=var:rowIndex p:rowNumber ${var:rowIndex} /p:rowNumber /table Note: It begins from 0. And I haven't test it at all but should almost work. DH http://www.gaonline.com.cn - Original Message - From: cleverpig greatclever...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 8:57 AM Subject: Re: T5:how to use rowIndex in Grid component? anyone have idea on this? On Wed, Sep 16, 2009 at 8:06 PM, cleverpig greatclever...@gmail.com wrote: I got this define from tapestry5's guide document: http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html rowIndex:Optional output parameter (only set during rendering) that identifies the current row index. This is the index on the page (i.e., always numbered from zero) as opposed to the row index inside the GridDataSource. I think this is a row number property that can be used to display row number in front of each row. but i can't find what's useful example code for developer. Newbie need help now! and i will help other with my best!~ -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5:how to use rowIndex in Grid component?
Hey, do it yourself^_^ It was introduced in T5.1. html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter /html DH http://www.gaonline.com.cn - Original Message - From: cleverpig To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 11:08 AM Subject: Re: T5:how to use rowIndex in Grid component? oh,thank DH! but there is a wrong:Undeclared namespace prefix p..your example code would be mistake..:( On Thu, Sep 17, 2009 at 9:50 AM, DH ningd...@gmail.com wrote: If you want to show the row num in front of each row, take an user (with bean property lastname and firstname) list for example, I assume your data source 'userSource' is prepared. table t:type=grid t:source=userSource add=rowNumber reorder=rowNumber rowIndex=var:rowIndex p:rowNumber ${var:rowIndex} /p:rowNumber /table Note: It begins from 0. And I haven't test it at all but should almost work. DH http://www.gaonline.com.cn - Original Message - From: cleverpig greatclever...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 8:57 AM Subject: Re: T5:how to use rowIndex in Grid component? anyone have idea on this? On Wed, Sep 16, 2009 at 8:06 PM, cleverpig greatclever...@gmail.com wrote: I got this define from tapestry5's guide document: http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html rowIndex:Optional output parameter (only set during rendering) that identifies the current row index. This is the index on the page (i.e., always numbered from zero) as opposed to the row index inside the GridDataSource. I think this is a row number property that can be used to display row number in front of each row. but i can't find what's useful example code for developer. Newbie need help now! and i will help other with my best!~ -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5:how to use rowIndex in Grid component?
yes. I am sorry that I gave the wrong example. p:rowNumber should be p:rowNumberCell. Append the 'Cell' and will work. DH http://www.gaonline.com.cn - Original Message - From: cleverpig greatclever...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 11:38 AM Subject: Re: T5:how to use rowIndex in Grid component? To HD: namespace p is only the t:parameter 's shortcut? so i can use t:parameter to replace p:.. On Thu, Sep 17, 2009 at 11:26 AM, cleverpig greatclever...@gmail.com wrote: oh,i'd added this description. namespace p works now! so i ran app,found this rowNumber Column was empty...it didn't display the value:${var:rowIndex}... :( 2009/9/17 DH ningd...@gmail.com: Hey, do it yourself^_^ It was introduced in T5.1. html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter /html DH http://www.gaonline.com.cn - Original Message - From: cleverpig To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 11:08 AM Subject: Re: T5:how to use rowIndex in Grid component? oh,thank DH! but there is a wrong:Undeclared namespace prefix p..your example code would be mistake..:( On Thu, Sep 17, 2009 at 9:50 AM, DH ningd...@gmail.com wrote: If you want to show the row num in front of each row, take an user (with bean property lastname and firstname) list for example, I assume your data source 'userSource' is prepared. table t:type=grid t:source=userSource add=rowNumber reorder=rowNumber rowIndex=var:rowIndex p:rowNumber ${var:rowIndex} /p:rowNumber /table Note: It begins from 0. And I haven't test it at all but should almost work. DH http://www.gaonline.com.cn - Original Message - From: cleverpig greatclever...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Thursday, September 17, 2009 8:57 AM Subject: Re: T5:how to use rowIndex in Grid component? anyone have idea on this? On Wed, Sep 16, 2009 at 8:06 PM, cleverpig greatclever...@gmail.com wrote: I got this define from tapestry5's guide document: http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Grid.html rowIndex:Optional output parameter (only set during rendering) that identifies the current row index. This is the index on the page (i.e., always numbered from zero) as opposed to the row index inside the GridDataSource. I think this is a row number property that can be used to display row number in front of each row. but i can't find what's useful example code for developer. Newbie need help now! and i will help other with my best!~ -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode: 100031 MSN: great_liu...@hotmail.com QQ: 149291732 Skype: cleverpigatmatrix Facebook ID:cleverpig Blog: www.cleverpig.name Tags: del.icio.us/cleverpig Twitter: twitter.com/cleverpig 新浪微博: t.sina.com.cn/cleverpig Organization: www.beijing-open-party.org or...@facebook: http://www.facebook.com/group.php?gid=8159558294 -- cleverpig(Dan) Location: Beijing Address: Room 4018,No.A2 South Avenue Fuxingmen Beijing,P.R.China Zipcode
Re: How to .tml template access a class's static variable
One question is how you expect to access the variable/method in the template and why you prefer to show/access so many static variable in the template? DH http://www.gaonline.com.cn - Original Message - From: Xuan Tran Le To: Tapestry users users@tapestry.apache.org Sent: Friday, September 11, 2009 1:27 PM Subject: Re: How to .tml template access a class's static variable Because I have so many methods On Fri, Sep 11, 2009 at 9:27 AM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: Em Thu, 10 Sep 2009 23:19:57 -0300, Xuan Tran Le lexuanttk...@gmail.com escreveu: Thank you. But A have so many method, so I can't do that. Why not? -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: New Tapestry tutorial to replace the quickstart tutorial
I can help on Chinese. DH http://www.gaonline.com.cn - Original Message - From: Komiwes Robin robin.komi...@atosorigin.com To: Tapestry users users@tapestry.apache.org Sent: Wednesday, September 09, 2009 5:28 PM Subject: RE: New Tapestry tutorial to replace the quickstart tutorial I can help to translate it in French! -Message d'origine- De : akira [mailto:wilsonaik...@gmail.com] Envoyé : mercredi 9 septembre 2009 11:18 À : Tapestry users Objet : Re: New Tapestry tutorial to replace the quickstart tutorial On Sep 9, 2009, at 2:06 PM, users-digest-h...@tapestry.apache.org wrote: I can help translating it to japanese, just one problem? The whole Tapestry site apparently is encoded in ISO-8859-1, thus no support for 2 byte character sets (japanese, chinese, korean) or hebrew, greek, russian...Anyway, i would like to help. From: Sebastian Hennebrueder use...@laliluna.de Date: September 9, 2009 7:31:45 AM GMT+09:00 To: Tapestry users users@tapestry.apache.org Subject: New Tapestry tutorial to replace the quickstart tutorial Hello, before continuing to evaluate JSF 2, I would like to help out to improve the Tapestry documentation. This is something, I have quite some experience with. I would like to update the quick start documentation and defined the following goals: - setup with and without Maven - stable Maven setup (possibly fall back to old archetype configuration) - the sample application should look smart - Expect a minimum of Java and IDE knowhow but take care that everything is explained in details - Always explain first, what we are going to do, show diagrams or screen shots and then go forward step by step - Provide enough 'power functionality' like mixins or self made components and explain the usefulness - Provide a helpful outlook, where to go next after the tutorial. I would like to publish the tutorial on my website and in addition give it under Apache licence to the Tapestry project. In my opinion this should live either on the normal Tapestry website or in the Tapestry Wiki area. Are you interested in this effort and is this likely to be accepted? (A question to be answered by commiters.) I started to write the tutorial and prepared some chapters. You can find the current state at the end of this mail. I would appreciate your comments. Which functionality should be included in addition? What do you think about taking the effort to translate this tutorial? Keep in mind that this comes with a lot of effort as we have continuously translate all changes into all support languages. We would probably need to have 2-3 people per language, to have enough fall backs to keep this in sync. -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis. This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to .tml template access a class's static variable
I think we can't and should delegate in B class DH http://www.gaonline.com.cn - Original Message - From: Xuan Tran Le To: Tapestry users users@tapestry.apache.org Sent: Tuesday, September 08, 2009 11:17 AM Subject: How to .tml template access a class's static variable I want to from B.tml access a static variable/method of A class but I don't know how to... Help me please
Re: Marker for required fields on bean editor
I've finished something like that before. First create a mixin 'FieldDecorator', then need contribute to the BeanBlockOverrideSource. Here is the sample code: 1. @MixinAfter public class FieldDecorator { @InjectContainer private AbstractField field; @Inject private ComponentResources resources; void cleanupRender(MarkupWriter writer) { if (field.isRequired()) { writer.element(font, color, red); writer.writeRaw(nbsp;*nbsp;); writer.end(); } } 2. Contribution, override the default edit block in page PropertyEditBlocks.java. public static void contributeBeanBlockOverrideSource(ConfigurationBeanBlockContribution configuration) { configuration.add(new BeanBlockContribution(text, CustomEditBlocks, text, true)); } You need write your own CustomEditBlocks.java and CustomEditBlocks.tml to do something like PropertyEditBlocks.java and PropertyEditBlocks.tml, then just put the mixin 'FieldDecorator' there. DH http://www.gaonline.com.cn - Original Message - From: Juan E. Maya maya.j...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, September 04, 2009 1:56 AM Subject: Re: Marker for required fields on bean editor Sorry Sebastian, i was not clear enough. I want to change the markup of the label when the field has a required validator. For example i want to add a CSS class required to the label of the required field. or i want to add a * next to the label. Thanks for ur answer :) On Thu, Sep 3, 2009 at 7:40 PM, Sebastian Hennebruederuse...@laliluna.de wrote: Juan E. Maya schrieb: Hi all! Is it possible to mark the required fields inside a beaneditor form as valid? I know i could override the field declaration and put the marker there but i would like to create something more generic. I was thinking that a Mixin may get the beaneditor's form to get all the components in the form, iterate over the validators and add the js or mark to the ones with a required validator but i am not sure how to accomplish this. Is it possible at all? Has anybody done such thing? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org You are aware of @Validate? http://tapestry.apache.org/tapestry5/guide/validation.html -- Best Regards / Viele Grüße Sebastian Hennebrueder - Software Developer and Trainer for Hibernate / Java Persistence http://www.laliluna.de - 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: Create actionlinks in components with page context
Sure, there must be a passivate method. Action link in tmeplate is fairly simple: a href=# t:type=actionlink t:id=englishEnglish/a. DH http://www.gaonline.com.cn - Original Message - From: Erik Putrycz To: users@tapestry.apache.org Sent: Wednesday, August 26, 2009 4:44 AM Subject: Re: Create actionlinks in components with page context How is your template looking like for the action link? I just looked at the action link code and there doesn't seem to be any magic to add the current page context. And does your page class has a passivate method?
Re: Create actionlinks in components with page context
I don't quite understand your case. The page activation context has been handled by Tapestry itself, we don't need handle it in our action link. I have finished something similar to your case. I just set the correct locale to PersistentLocale and everything works perfectly. Like: public void onActionFromEnglish() { persistentLocale.set(Locale.ENGLISH); } DH http://www.gaonline.com.cn - Original Message - From: Erik Putrycz e...@apption.com To: users@tapestry.apache.org Sent: Tuesday, August 25, 2009 5:21 AM Subject: Create actionlinks in components with page context I started an app based on trails and T5.1. On my layout component, I want to have a button to toggle the locale from french to english for any page. This works fine, however if the page has a context, that context is lost for the action link. Is there any way to access the page context, or create action links with the current context? Erik. - Apption Software -- View this message in context: http://www.nabble.com/Create-actionlinks-in-components-with-page-context-tp25123666p25123666.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: Create actionlinks in components with page context
Since my action handler returns Void, so in my case T5 will return current page(with context) and redirects, here T5 will carry the context again without any work of mine. What about your action handler? DH http://www.gaonline.com.cn - Original Message - From: Erik Putrycz e...@apption.com To: users@tapestry.apache.org Sent: Tuesday, August 25, 2009 11:19 AM Subject: Re: Create actionlinks in components with page context DH-14 wrote: I don't quite understand your case. The page activation context has been handled by Tapestry itself, we don't need handle it in our action link. I have finished something similar to your case. I just set the correct locale to PersistentLocale and everything works perfectly. when I have a page with a url like http://localhost:8080/myapp/modules/1 (1 is the context), the actionlink doesn't carry the 1 and the action id is lost after clicking on my actionlink. The action in the code happens but after it tries to redirect to http://localhost:8080/myapp/modules which doesn't work because it requires an activation parameter. Is this working differently for you? - Apption Software -- View this message in context: http://www.nabble.com/Create-actionlinks-in-components-with-page-context-tp25123666p25127643.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: Log remote IP address with MDC class?
Hi, Have a try with public RequestFilter buildRequestLoggingFilter(RequestGlobals requestGlobals){ } , requestGlobals has the HttpServletRequest. DH http://www.gaonline.com.cn - Original Message - From: learningtapestry satish...@yahoo.com To: users@tapestry.apache.org Sent: Thursday, July 16, 2009 9:33 AM Subject: Log remote IP address with MDC class? Is there any way to log the remote IP address using the log4j MDC. If I contribute to RequestHandler inside my AppModule, I have a way of getting a hold of the org.apache.tapestry5.services.Request, but from this Request, there isn't no way of getting the IP address of the remote machine. I don't want to add this my pages/components for various reasons. public RequestFilter buildRequestLoggingFilter(){ return new RequestFilter(){ public boolean service(Request request, Response response, RequestHandler handler) throws IOException { MDC.put(remoteIP, ); return handler.service(request, response); } }; } -- View this message in context: http://www.nabble.com/Log-remote-IP-address-with-MDC-class--tp24508725p24508725.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: locales supported
Hi, They are en,it,es,zh_CN,pt_PT,de,ru,hr,fi_FI,sv_SE,fr_FR,da,pt_BR,ja,el. DH http://www.gaonline.com.cn - Original Message - From: Angelo Chen angelochen...@yahoo.com.hk To: users@tapestry.apache.org Sent: Monday, July 06, 2009 6:54 AM Subject: t5: locales supported Hi, What are the locales officially supported in T5? I know there are: en, de, zh_CN, how about others? Thanks, Angelo -- View this message in context: http://www.nabble.com/t5%3A-locales-supported-tp24347732p24347732.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: Accessing parameter of container from mixin
One way is using the internal API, which is not recommended. I don't know whether there is a better one. @Inject private ComponentResources componentResources; public String getZone() { InternalComponentResourcesImpl containerResources = (InternalComponentResourcesImpl)componentResources.getContainerResources(); String zone= (String)containerResources.getBinding(zone).get(); return zone; } DH http://www.gaonline.com.cn - Original Message - From: Alfie Kirkpatrick To: Tapestry users users@tapestry.apache.org Sent: Thursday, July 02, 2009 4:08 PM Subject: Accessing parameter of container from mixin Hi, I am writing a mixin that can be used with submit, actionlink, linksubmit and other things that support a zone parameter. I need to know the zone name from the container. I can add a zone parameter to my mixin but it's 'namespaced', ie. doesn't pick up the zone parameter of the container. I would like to write a defaultZone method but cannot see an obvious way to get the parameter from the container. I am injecting the container fine but the zone field is private with annotation rather than exposed with a getter. The workaround is to duplicate the attribute, eg: t:actionlink t:mixins=overlay zone=x overlay.zone=x.../t:actionlink This works fine but is not quite as elegant as I'd like! Any ideas? Thanks, Alfie.
Re: T5 Grid Error
Is the data source 'displayedCompanies' volatile? Error comes out in ajax request? DH http://www.gaonline.com.cn - Original Message - From: haipeng du haipen...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Wednesday, July 01, 2009 11:54 AM Subject: T5 Grid Error I have one grid which take list of object as source. Most time, it works great. But sometimes I got following erros: DefaultRequestExceptionHandler.handleRequestException(62) | Processing of request failed with uncaught exception: Index: 1, Size: 1 org.apache.tapestry5.runtime.ComponentEventException: Index: 1, Size: 1 [at context:app/appAdmin/CompaniesList.tml, line 9] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12233f25a7c.handle($ComponentEventRequestHandler_12233f25a7c.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12233f25a7e.handle($ComponentEventRequestHandler_12233f25a7e.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12233f25a7e.handle($ComponentEventRequestHandler_12233f25a7e.java) at $ComponentEventRequestHandler_12233f259fb.handle($ComponentEventRequestHandler_12233f259fb.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at $ComponentRequestHandler_12233f259ef.handleComponentEvent($ComponentRequestHandler_12233f259ef.java) at org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) at $Dispatcher_12233f259f1.dispatch($Dispatcher_12233f259f1.java) at $Dispatcher_12233f259e8.dispatch($Dispatcher_12233f259e8.java) at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_12233f259e9.service($RequestHandler_12233f259e9.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) at $RequestHandler_12233f259e9.service($RequestHandler_12233f259e9.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) at $RequestHandler_12233f259e9.service($RequestHandler_12233f259e9.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_12233f259e9.service($RequestHandler_12233f259e9.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_12233f259e9.service($RequestHandler_12233f259e9.java) at $RequestHandler_12233f259df.service($RequestHandler_12233f259df.java) at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197) at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) at $HttpServletRequestHandler_12233f259e1.service($HttpServletRequestHandler_12233f259e1.java) at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_12233f259de.service($HttpServletRequestFilter_12233f259de.java) at $HttpServletRequestHandler_12233f259e1.service($HttpServletRequestHandler_12233f259e1.java) at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726) at $HttpServletRequestHandler_12233f259e1.service($HttpServletRequestHandler_12233f259e1.java) at $HttpServletRequestHandler_12233f259dc.service($HttpServletRequestHandler_12233f259dc.java) at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112) at com.dosalestrack.webapp.filters.SecurityFilter.doFilter(SecurityFilter.java:73) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) at org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle
Re: Problem with form inside div
Hi, Don't ever have such issue, I always put form inside div too. What about the generated html source code? Is it right? DH http://www.gaonline.com.cn - Original Message - From: Andrew Nguyen To: users@tapestry.apache.org Sent: Thursday, July 02, 2009 10:16 AM Subject: Problem with form inside div I have the following snippet of code in my tml file: div id=categorypopup_div_${headline.id} class=popup long nbsp; form t:id=categoryform input type=hidden name=headlineId id=headlineId value=$ {headline.id}/ select t:id=category t:type=select t:model=allCategoriesModel t:encoder=allCategoriesModel t:blankOption=ALWAYS t:blankLabel=Choose new cat/ br/br/ input type=submit id=save value=Save class=popup_closebox/nbsp;nbsp;nbsp; span class=popup_link popup_closeboxCancel/span /form /div When the page is accessed via Firefox (with Firebug), it is rendered as: div... / form /form where the form is outside of the div... Any ideas? I am very new to Tapestry development... Thanks, Andrew
Re: RenderSupport in pages?
sure, you can use directly in page. @Environmental private RenderSupport renderSupport; Why to extend page from component, page itself is the top root component. DH http://www.gaonline.com.cn - Original Message - From: Piero Sartini To: Tapestry users users@tapestry.apache.org Sent: Friday, June 19, 2009 6:29 PM Subject: RenderSupport in pages? Is it possible to get the RenderSupport in pages? I need to add some stylesheet... What works is to extend my Page from some Component... but I am not sure that is the way to go?! Piero - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: RenderSupport in pages?
I am sure that exception comes out in ajax request, right? RenderSupport is not available in ajax request. DH http://www.gaonline.com.cn - Original Message - From: Piero Sartini To: Tapestry users users@tapestry.apache.org Sent: Friday, June 19, 2009 7:03 PM Subject: Re: RenderSupport in pages? Am Freitag, 19. Juni 2009 12:43:23 schrieb DH: sure, you can use directly in page. @Environmental private RenderSupport renderSupport; Why to extend page from component, page itself is the top root component. Ups - that was too early. It does not work: No object of type org.apache.tapestry5.RenderSupport is available from the Environment Piero - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: @AfterRender in AJAX requests
Hi, Thiago Not sure about how special your case is, but I can confirm that @AfterRender is invoked in my ajax request. Maybe share more about the code and let us help you kind man. DH http://www.gaonline.com.cn - Original Message - From: Thiago H. de Paula Figueiredo thiag...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Thursday, June 18, 2009 10:50 PM Subject: @AfterRender in AJAX requests Hi! I'm trying to execute some Javascript code to hook up some events to some TextFields in a page. Thus, I need their clientIds. When in an AJAX request, the TextFields are rendered again with other clientIds, so I need to generate the Javascript event hooking again.I created a method annotated with @AfterRender and use RenderSupport to generate the event hooking code. In a full page request, my method is called and everything is fine. But, in an AJAX request, my @AfterRender method is not invoked and my @BeginRender is invoked (it returns void). I cannot use @BeginRender in this case because the fields client ids are only defined during rendering. What am I missing? -- Thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: How to render a page as JSON-formatted AJAX response?
Isn't the Zone/MultiZoneUpdate/Block way suitable for your case? It is very simple enough to deal with most ajax cases. DH - Original Message - From: Renger Wilde To: users@tapestry.apache.org Sent: Thursday, June 18, 2009 4:42 AM Subject: How to render a page as JSON-formatted AJAX response? On my client, I have a tabview. When the user navigates to one of the tabs on the tabview, I trigger an AJAX request to obtain the content of that tab. The AJAX request is sent to a Tapestry component event handler. I want that event handler to invoke some other page or component, and cause the rendered output of that other page/component to be captured into a JSON-array, and sent back to the client as the reply to the AJAX request. What is the best way to do this? thanks. Renger -- View this message in context: http://www.nabble.com/How-to-render-a-page-as-JSON-formatted-AJAX-response--tp24081692p24081692.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: best book for T5
Waiting for it too. DH - Original Message - From: Peter Stavrinides Sent: Monday, June 15, 2009 2:59 PM Subject: Re: best book for T5 Yes of course I am interested. Peter -- If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Please visit http://www.albourne.com/email.html for important additional terms relating to this e-mail. - Original Message - From: Igor Drobiazko Sent: Monday, 15 June, 2009 09:33:35 GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: best book for T5 Well, this community can help to make the publisher's decision easier. If somebody of you is interested in a book translation, just comment here. I will forward this thread to the publisher. The more interests available the more likely they will do it. So give the publisher the impression how big is the market for the translated book. P.S: Cover is really awful. I love it. On Fri, Jun 12, 2009 at 10:03 PM, Blower, Andy andy.blo...@proquest.co.ukwrote: I meant Igor's book translated to English Thiago... there must be a bigger market for an English version IMO, so his publishers would be crazy not to do one surely, and I hope to see it soon. :-D Not that I wouldn't welcome another of course. -Original Message- From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com] Sent: 12 June 2009 21:00 To: Tapestry users Subject: Re: best book for T5 Em Fri, 12 Jun 2009 16:52:46 -0300, Blower, Andy andy.blo...@proquest.co.uk escreveu: I can't believe that there wouldn't be an even bigger market for a well written T5 book in English, so I hope to see it soon! I would love to be a co-author in a Tapestry 5 book, but I don't have the resources nor I want to do this alone. Love that cover, awesome. One of the most beautiful ones I've seen in a technical book. :) -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - 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 -- Best regards, Igor Drobiazko - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: more actionlink's context values in *.tml directly
If 5.1, like context=[param1,param2] If 5.0, refer to list binding of t5component project. DH - Original Message - From: Radek Terber To: Tapestry users users@tapestry.apache.org Sent: Monday, June 15, 2009 3:49 PM Subject: more actionlink's context values in *.tml directly Hi all. Is there any way to put more than one context parameter (for actionlink, pagelink and similar components) directly into tml file (for example param1 and param2 to generate URL in form http://urBase/param1/param2;, something like this: t:actionlink t:id= t:context={param1,param2} ... ) ? I can do it using ComponentResources's method createEventLink..., but I dont know how to do it directly in tml. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: File upload and AJAXized forms
I remembered it seems that file uploading is not supported by XHR. DH - Original Message - From: Hugo Palma Sent: Monday, June 08, 2009 2:46 AM Subject: Re: File upload and AJAXized forms I've created an issue for this ( https://issues.apache.org/jira/browse/TAP5-638) You can vote for it if you want it fixed. 2009/6/7 grabarz umrzy...@gazeta.pl hi, is it possible to use tapestry-upload with form submitted by XHR? i was trying to use uploading in such a form, but no success. deeper digging pointed me to MultipartServletRequestFilter. in the following code: public boolean service(HttpServletRequest request, HttpServletResponse response, HttpServletRequestHandler handler) throws IOException { HttpServletRequest newRequest = ServletFileUpload.isMultipartContent(request) ? decoder.decode(request) : request; return handler.service(newRequest, response); } the condition ServletFileUpload.isMultipartContent(request) is false each time. is there anything i should do more to make my request a multiparted one? thanks, m. -- Mess with the best, die like a rest! - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T 5.1] Problem with: Block parameters are only allowed directly within component elements
Refer https://issues.apache.org/jira/browse/TAP5-571. I've put my comment on this fixing too. I think the fixing is not so perfect. DH - Original Message - From: Stefan Esterer Sent: Thursday, June 04, 2009 4:04 PM Subject: [T 5.1] Problem with: Block parameters are only allowed directly within component elements Hi List... I just switched from Tapestry 5.0.18 to Tapestry 5.1.0.5 and I'm experiencing a problem with the IF component. I'm not quite sure if this is a bug or feature, so please enlighten me *g* For demonstration I just use the tutorial IF example (http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/If.html). It looks like this t:if test=user Welcome back, ${user.firstName} p:else t:pagelink name=loginLogin/t:pagelink / t:pagelink name=registerRegister/t:pagelink /p:else /t:if This works perfectly fine. Only if I add a additional div I get a problem. t:if test=user Welcome back, ${user.firstName} div p:else t:pagelink name=loginLogin/t:pagelink / t:pagelink name=registerRegister/t:pagelink /p:else /div /t:if Using the template with the additional div I get this exception: java.lang.RuntimeException Block parameters are only allowed directly within component elements. Is this a design decision or a bug? Thx for your help Stefan Esterer -- View this message in context: http://www.nabble.com/-T-5.1--Problem-with%3A-Block-parameters-are-only-allowed-directly-within-component-elements-tp23865519p23865519.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: overriding dateeditor
BeanBlockSourceImpl call BeanBlockOverrideSource first to find the display/edit block, so contribute to BeanBlockOverrideSource give you the chance to overwrite the default. DH - Original Message - From: Moritz Gmelin Sent: Thursday, June 04, 2009 4:01 AM Subject: Re: overriding dateeditor Wow, found a strange solution: calling the method contributeBeanBlockOverrideSource instead of contributeBeanBlockSource fixes it. My method is called after tapestrys'. I got this from tapx-datefield where the method has this name. Can anyone explain this? M. Am 03.06.2009 um 21:36 schrieb Moritz Gmelin: Well yes, I'm using 5.1.0.5 too. Your example is working for the DataTypeAnalyzer whicht takes an ordered List. BeanBlockContribution unfortunately only takes an unorderedList. M. Am 03.06.2009 um 21:29 schrieb Thiago H. de Paula Figueiredo: Em Wed, 03 Jun 2009 16:16:19 -0300, Moritz Gmelin moritz.gme...@gmx.de escreveu: Sorry, does not work. org.apache.tapestry5.ioc.internal.OperationException Service 'BeanBlockSource' is configured using org.apache.tapestry5.ioc.Configuration, not org.apache.tapestry5.ioc.OrderedConfiguration. What Tapestry version are you using? The example I gave you is for Tapestry 5.1.0.5. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5: Very strange issue getting unreadable code on Tomca
Forget to mention that T5's gzip is enabled. If gzip is disabled, tomcat6 is ok too. Summary: If tomat 5.x, everything is ok whether gzip is enabled or not. If tomcat6.x (we have tested on 6.0.18 too), gzip disabled, OK; Gzip enabled, all failed. DH - Original Message - From: Borut Bolčina I would try 6.0.18 first. 2009/5/19 dh ning ningd...@gmail.com Hi, One of my friend's T5 application run into a strange issue when running in Tomcat6.0.16 (not test in other tomcat yet, but is ok in Jetty 6.1.17): In browser(IE and Firefox) customers can sometimes (5%) see unreadable code, especially when they access the first time. For developer, if you install web developer plugin in Firefox and check 'disable cache' option, and rapidly refresh the page(F5), you will see unreadable code up to 50%. Server environment: Windows Server 2003, Simplified Chinese language, Tomcat6.0.16. You can have a test here: http://www.56114.net.cn:8081/xinxi3.1/test. It is really a simple page to print 'A simple page'. We are not sure what causes the issue, maybe Tomcat, T5 or others. Is there someone got this issue before? Or some experienced user (Tomcat and T5) here can give some advices on how to fix it? Thanks, DH
Re: t5: use image for submit
Another option: input type=image src= / DH - Original Message - From: Ulrich Stärk u...@spielviel.de To: Tapestry users users@tapestry.apache.org Sent: Thursday, May 07, 2009 6:01 PM Subject: Re: t5: use image for submit Am 07.05.2009 11:57 schrieb Angelo Chen: Hi, Is there a way to use image for submit? seems, we have only input t:type=submit value=111/ a t:type=linksubmit t:id=somethingimg src=path/to/image alt=image //a - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] How to listen/trigger event in componentA from component B ?
In my understanding, there should be no way. Events can only be listened in itself or its parents. DH - Original Message - From: CG learn@gmail.com To: users@tapestry.apache.org Sent: Monday, May 04, 2009 11:57 PM Subject: Re: [T5] How to listen/trigger event in componentA from component B ? Hi , anybody can give some hints? thanks CG On Sat, May 2, 2009 at 1:39 AM, CG learn@gmail.com wrote: Hi all, I have been using T5 in my project for 1 year , and thanks for the great framework. I am neither an expert in Tapestry nor Java, therefore, would like to seek some help from all of you to assist on my problem . By checking the Grid source code , I know that TriggerEvent can used to trigger event from a component to it's container component. Nevertheless, I would like to know whether in T5 , we can do the same thing between 2 components that in the same container. To be more specific, I have a Toolbar component, and another component which contain several fields (named as component X) in the same page, when user click on an icon in toolbar , I would like the component X do some action , for example, refresh the fields , submit or etc. How should I code to archive that ? Which function/API should I use , any source code that I can refer to ? Thanks in advanced for any hints or guidance . Cheers :) CG - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: AjaxFormLoop Exception on 5.1.0.2 upgrade
Hi, Zack I just tried your example, but nothing wrong. Mine is 5.1.0.3. DH - Original Message - From: zack1403 zack.mann...@gmail.com To: users@tapestry.apache.org Sent: Wednesday, April 29, 2009 2:56 PM Subject: Re: AjaxFormLoop Exception on 5.1.0.2 upgrade Alright this is the simplest setup I could do. This is way simpler than even the example thats in the nightly docs. I am getting the same error. If someone could please help me out as to what I am missing here I would be eternally grateful. This is the complete source, there is no other source involved in this except what I am pasting. Tml: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; t:form t:ajaxformloop source=strings value=currentString t:textfield t:id=thefield value=currentString/ t:removeRowLinkBye!/t:removeRowLink /t:ajaxformloop /t:form /html Page: import java.util.ArrayList; import java.util.List; import org.apache.tapestry5.annotations.Component; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.corelib.components.TextField; public class Test { @Property private ListString strings; @Property private String currentString; @Component private TextField theField; void onActivate() { strings = new ArrayListString(); strings.add(Hello); strings.add(Heres a tester); } String onAddRow() { return Added!; } void onRemoveRow(String toRemove) { strings.remove(toRemove); } } Sorry to be posting so much, I've just been pulling out my hair on this and (as I'm sure you all understand) we have a very tight deadline to meet. Thank you all again for all the help! Zack -- View this message in context: http://www.nabble.com/AjaxFormLoop-Exception-on-5.1.0.2-upgrade-tp23175801p23291616.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: Getting a zone id when inside another zone
What about giving the static id to the innerZone, like following: div t:type=zone t:id=innerZone id=innerZone /div DH - Original Message - From: Hugo Palma To: Tapestry users users@tapestry.apache.org Sent: Monday, April 27, 2009 11:38 PM Subject: Getting a zone id when inside another zone I have a template that looks something like this: div t:type=zone t:id=outerZone form t:type=form t:zone=innerZone /form div t:type=zone t:id=innerZone /div /div The problem is figuring out the id of the innerZone in order to pass it to the form. Because the innerZone is itself inside a zone once the outerZone gets updated a new id is generated to the innerZone making the id i passed to the form an invalid one. I also tried something like: form t:type=form t:zone=prop:innerZone.clientId but it doesn't work either. Any ideas on how i could make this work ? Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 how to execute javascript after zone update?
1. If your return is Block or Zone, just put script.../script inside the block or zone. 2. If return is JSONObject, can do like this: JSONObject response = new JSONObject(); response.put(script, alert('ff');); return response; Thanks, DH - Original Message - From: grabarz umrzy...@gazeta.pl To: users@tapestry.apache.org Sent: Wednesday, April 15, 2009 5:37 AM Subject: T5 how to execute javascript after zone update? is there any way to execute custom piece of javascript after zone update? inside tapestry.js i found: loadScriptsInReply : function(reply, callback) * Passed the JSON content of a Tapestry partial markup response, extracts * the script and stylesheet information. JavaScript libraries and stylesheets are loaded, * then the callback is invoked. and indeed it tries to evaluate passed script: if (reply.script) eval(reply.script); the question is, how to inject my javascript into reply? cheers, m. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 how to execute javascript after zone update?
I remember @Inject RenderSupport is not available in ajax action request even though in latest snapshot, I just tried several days ago and got error. Thanks DH - Original Message - From: Fernando Padilla To: Tapestry users users@tapestry.apache.org Sent: Wednesday, April 15, 2009 10:16 AM Subject: Re: T5 how to execute javascript after zone update? You use the normal RenderSupport.addScript(..) method. And tapestry adds it to the json response, and it gets executed by loadScriptsInReply... DH wrote: 1. If your return is Block or Zone, just put script.../script inside the block or zone. 2. If return is JSONObject, can do like this: JSONObject response = new JSONObject(); response.put(script, alert('ff');); return response; Thanks, DH - Original Message - From: grabarz umrzy...@gazeta.pl To: users@tapestry.apache.org Sent: Wednesday, April 15, 2009 5:37 AM Subject: T5 how to execute javascript after zone update? is there any way to execute custom piece of javascript after zone update? inside tapestry.js i found: loadScriptsInReply : function(reply, callback) * Passed the JSON content of a Tapestry partial markup response, extracts * the script and stylesheet information. JavaScript libraries and stylesheets are loaded, * then the callback is invoked. and indeed it tries to evaluate passed script: if (reply.script) eval(reply.script); the question is, how to inject my javascript into reply? cheers, m. - 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: T5 how to execute javascript after zone update?
Not yet, thanks for remind, I will try soon. If so, cool. Thanks, DH - Original Message - From: Fernando Padilla f...@alum.mit.edu To: Tapestry users users@tapestry.apache.org Sent: Wednesday, April 15, 2009 11:19 AM Subject: Re: T5 how to execute javascript after zone update? did you try @Environmental? DH wrote: I remember @Inject RenderSupport is not available in ajax action request even though in latest snapshot, I just tried several days ago and got error. Thanks DH - Original Message - From: Fernando Padilla To: Tapestry users users@tapestry.apache.org Sent: Wednesday, April 15, 2009 10:16 AM Subject: Re: T5 how to execute javascript after zone update? You use the normal RenderSupport.addScript(..) method. And tapestry adds it to the json response, and it gets executed by loadScriptsInReply... DH wrote: 1. If your return is Block or Zone, just put script.../script inside the block or zone. 2. If return is JSONObject, can do like this: JSONObject response = new JSONObject(); response.put(script, alert('ff');); return response; Thanks, DH - Original Message - From: grabarz umrzy...@gazeta.pl To: users@tapestry.apache.org Sent: Wednesday, April 15, 2009 5:37 AM Subject: T5 how to execute javascript after zone update? is there any way to execute custom piece of javascript after zone update? inside tapestry.js i found: loadScriptsInReply : function(reply, callback) * Passed the JSON content of a Tapestry partial markup response, extracts * the script and stylesheet information. JavaScript libraries and stylesheets are loaded, * then the callback is invoked. and indeed it tries to evaluate passed script: if (reply.script) eval(reply.script); the question is, how to inject my javascript into reply? cheers, m. - 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 - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: usability: javascript focus on input fields
Try to set autofocus=false to your form component. Thanks, DH - Original Message - From: Sergey Didenko To: Tapestry users users@tapestry.apache.org Sent: Monday, April 13, 2009 5:32 PM Subject: usability: javascript focus on input fields Hi, I'm going through examples (jumpstart) and see the bad impact of javascript focus on usability. As I understand in Tapestry 5.0.18 javascript makes an input field focused by default even when there was no validation yet. That is very uncomfortable when a user has already scrolled down text far from the input and after that javascript focus happens. So page jumps back to the input. Is it possible to alter this behavior? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Index page URL generation
I don't have this issue, 5.1.0.3-snapshot. Thanks, DH - Original Message - From: Blower, Andy To: 'Tapestry users' users@tapestry.apache.org Sent: Tuesday, April 07, 2009 5:33 PM Subject: Index page URL generation I'm still working through the migration from 5.0.18 to 5.1.0.2 and the latest issue I've found is that in 5.0.18 a page link to an index page would be optimized to / whereas with 5.1 this is not happening. So my site's homepage is http://whatever/ and this works, but any link generated to the home page is index in the HTML and gives a URL of http://whatever/index which is not what I want. Has anyone else experienced this when upgrading to 5.1? I've searched the list and couldn't find anything, but I can't be the only one surely? Thanks, Andy.
Re: Inherited properties
It is possible, just think displayMessage is a property of B like in java world, and can use ${displayMessage} and others to reference it. Thanks, DH - Original Message - From: Peter Stavrinides To: Tapestry Mailing List users@tapestry.apache.org Sent: Tuesday, April 07, 2009 3:55 PM Subject: Inherited properties Hi, If PageClass B extends BaseClass A, and BaseClass A contains a property displayMessage, how do I reference the displayMessage property from PageClass B's .tml file? I would prefer to do this directly in the tml if possible. Thanks, Peter - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: multiple parameters in PageLink's context?
In 5.1, use like context=[param1,param2] Thanks DH - Original Message - From: Angelo Chen Sent: Monday, March 30, 2009 2:25 PM Subject: t5: multiple parameters in PageLink's context? Hi, Is there a way to specify multiple parameters in the PageLink's context, example: this works: t:pageLink page=SendPurchaseOrder context=buyer.codeSend Order/t:pageLink this fails: t:pageLink page=SendPurchaseOrder context=buyer.code/'US'Send Order/t:pageLink what I'm doing now is, return the combined paramter from java and put it in the context, hints? -- View this message in context: http://www.nabble.com/t5%3A-multiple-parameters-in-PageLink%27s-context--tp22777039p22777039.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-Spring-Security and Tapestry 5.1.0.x
Maybe caused by MutableComponentModel#addRenderPhase? I don't use T-S-S, but have another role annotation based solution. I can work before 5.0.18 too but fail when upgrade to 5.1.0.0. I need call MutableComponentModel#addRenderPhase to make it work at the end of the security transformerworker. Thanks, DH - Original Message - From: Thiago H. de Paula Figueiredo To: Tapestry users users@tapestry.apache.org Sent: Wednesday, March 25, 2009 10:23 AM Subject: Tapestry-Spring-Security and Tapestry 5.1.0.x Hi! Is it just me or Tapestry-Spring-Security doesn't work with Tapestry 5.1.0.x? I tried to use the @Secured annotation in a class, using a non-existent role, and the page was rendered normally when it should redirect to the login page. Changing to T5.0.18 makes everything work as expected. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: component specific action event
2 ways: 1. Use eventlink instead of actionlink: Give event 'first' to the first link and 'secodn' to the second one. Then in page implement 2 handlers: onFirst() and onSecond(). 2. Handle event in Border and trigger different events to the parent (Page): ComponentResources#triggerEvent. Thanks DH - Original Message - From: Reinhold Gruber Sent: Thursday, March 26, 2009 5:36 AM Subject: RE: component specific action event Ok, I see. The method must be named onActionFromTest. Thanks for that. But does that mean, that in the following structure: Page |_ Border |_Comp1 (contains ActionLink with integer context) |_Comp2 (contains ActionLink with integer context) it is not possible for the page class to find out what happened? What is best practice for that case? I could supply an additional dispensable param und define 2 onActionFromBorder methods but this seems an ugly solution. Regards Reinhold
Re: Template Inheritance and Overriding - How to Do It?
Here: http://tapestry.formos.com/nightly/tapestry5/guide/templates.html Template Inheritance Thanks DH - Original Message - From: Dragan Djuric To: users@tapestry.apache.org Sent: Monday, March 23, 2009 3:44 PM Subject: Template Inheritance and Overriding - How to Do It? Howard mentioned in the announcement of 5.1.0.1 that it is now possible to override a part of the template of the inherited component. I've tried to find some more info on how to actually do it but I couldn't find anything. The question is simple: How to do that overriding? -- View this message in context: http://www.nabble.com/Template-Inheritance-and-Overriding---How-to-Do-It--tp22655490p22655490.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: OnEvent no response
I would suggest you to look at the source of onevent mixin (not onevent annotation) in t5commons project. Thanks, DH - Original Message - From: Zenberg Ding To: Tapestry users users@tapestry.apache.org Sent: Monday, March 16, 2009 2:00 PM Subject: Re: OnEvent no response It's realy helpful, I'll look into it, thank you :) How can I link js tree's internal envent (onSelect(itemIdList) onDblClick(itemId)) with t5 xtree's component when I use createEventLink? Or write js code to encapsulate the original js tree events? Does tapestry5 has some internal mechanisms linking client to backgroud? Any further information on event topic is welcome. Use ComponentResources.createEventLink to get the url of relevant events. If you put the xtree component in login page,in your xtree component, componentResources.createEventLink(click, {11,22}) would produce like http://localhost/login.xtree:click/11/22. First to understand url of tapestry: http://localhost/login.xtree:click/11/22 login is the page, xtree is the component, click means the event name, 11/22 means values. so you can generate the base url in xtree component:componentResources.createEventLink(click) to get http://localhost/login.xtree:click, and append the value 11/22 by js code. Hope it helps. Thanks, DH
Re: ActionLink button called twice when onclick.
Hi, I am not sure whether it is produced by button nested in a. What about replacing buttonConvert/button with 'Convert' and have a try? Thanks, DH - Original Message - From: Tan cyb...@n quesoft.cyber...@gmail.com To: Tapestry users users@tapestry.apache.org Sent: Monday, March 16, 2009 5:20 PM Subject: ActionLink button called twice when onclick. Hi, I have a problem on my ActionLink button. it call twice onActionFrom after i have clicked on it. below are my coding. is anyone have any idea on it? Thank you. Regards, tan TML: t:GRID t:id=grid t:source=Materials t:Model=MaterialModel t:row=Material t:rowsPerPage=10 t:pagerPosition=both t:inPlace=literal:true t:parameter name=Cell t:if t:test=SoConvert t:actionlink t:id=select t:mixins=confirm t:message=Are you sure you want to Convert? t:context=Material.id buttonConvert/button /t:actionlink /t:if /t:parameter /t:GRID class file: void onActionFromSelect(Long id) { try { System.out.println(clicked); } catch (Exception e) { System.out.println(error); } } Console message : clicked clicked
Re: OnEvent no response
How do you fire the 'click' event in your xtree component? This 'click' is not the one 'click' in html dom. Thanks, DH - Original Message - From: Ding Zenberg To: users@tapestry.apache.org Sent: Monday, March 16, 2009 10:11 AM Subject: OnEvent no response Hi all, Here is the case, I put one component named xtree on start page, then I wrote on method to receive events from this component. div t:id=treebox t:type=t5/SidePanel style=height:600px div t:type=xtree/ /div @OnEvent(value=click, component=xtree) void onTreeClick() { System.out.println(tree clicked ...); } but there is no output expected. I want to know where's problem. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5ï¼s getting new Hibernate session in a lengthy thread
Sorry, my fault. If code don't call any method of HibernateSessionManager, it won't create a session. Thanks, DH - Original Message - From: Angelo Chen To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 1:55 PM Subject: Re: T5ï¼s getting new Hibernate session in a lengthy thread that will be a thread trigger by Quartz, create the session, close the session repeat this until thread is over, i don't know any impact from Tapestry-Hibernate. dh ning wrote: I haven't tried it yet because now my application is out of tapestry-hibernate. But from source code of tapestry-hibernate, it should be doable. But I still doubt how you close the session created by HibernateSessionManager (thread scope). If you don't close it manually, the session still last fro the whole request process. If close manually, maybe 'session has closed' exception is thrown by tapestry-hibernate because at the end tapestry would try to close the session of HibernateSessionManager, but it has been closed manually. Thanks, DH - Original Message - From: Angelo Chen To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 1:17 PM Subject: Re: T5ï¼s getting new Hibernate session in a lengthy thread Hi DH, That sounds doable, we will inject the HibernateSessionSource then call create() to obtain the session? Angelo dh ning wrote: Maybe you can directly use HibernateSessionSource service instead of HibernateSessionManager. HibernateSessionSource.create() creates a new session always, and do remember to commit and close the session by yourself. Thanks, DH - Original Message - From: Angelo Chen angelochen...@yahoo.com.hk To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 11:16 AM Subject: T5ï¼s getting new Hibernate session in a lengthy thread Hi, I need to run a lengthy thread where some database update happens, is there a way to minimize the time when a Hibernate Session is used? something similar to: do while not done // do some processing here obtain a session use the session release the session enddo If I use HibernateSessionManager, it seems there is no way to release and obtain a new session, any idea? -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448134.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 -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448992.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 -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22449240.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: T5ï¼s getting new Hibernate session in a lengthy thread
Hi, Yes, I think so. HibernateSessionSource is top of HibernateSessionManager. DH - Original Message - From: Angelo Chen To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 2:08 PM Subject: Re: T5ï¼s getting new Hibernate session in a lengthy thread Hi, HibernateSessionManagerImpl uses HibernateSessionSource to create a session, if we use HibernateSessionSource service in code as suggested by you, then seems ok, right? dh ning wrote: Sorry, my fault. If code don't call any method of HibernateSessionManager, it won't create a session. Thanks, DH - Original Message - From: Angelo Chen To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 1:55 PM Subject: Re: T5ï¼s getting new Hibernate session in a lengthy thread that will be a thread trigger by Quartz, create the session, close the session repeat this until thread is over, i don't know any impact from Tapestry-Hibernate. dh ning wrote: I haven't tried it yet because now my application is out of tapestry-hibernate. But from source code of tapestry-hibernate, it should be doable. But I still doubt how you close the session created by HibernateSessionManager (thread scope). If you don't close it manually, the session still last fro the whole request process. If close manually, maybe 'session has closed' exception is thrown by tapestry-hibernate because at the end tapestry would try to close the session of HibernateSessionManager, but it has been closed manually. Thanks, DH - Original Message - From: Angelo Chen To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 1:17 PM Subject: Re: T5ï¼s getting new Hibernate session in a lengthy thread Hi DH, That sounds doable, we will inject the HibernateSessionSource then call create() to obtain the session? Angelo dh ning wrote: Maybe you can directly use HibernateSessionSource service instead of HibernateSessionManager. HibernateSessionSource.create() creates a new session always, and do remember to commit and close the session by yourself. Thanks, DH - Original Message - From: Angelo Chen angelochen...@yahoo.com.hk To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 11:16 AM Subject: T5ï¼s getting new Hibernate session in a lengthy thread Hi, I need to run a lengthy thread where some database update happens, is there a way to minimize the time when a Hibernate Session is used? something similar to: do while not done // do some processing here obtain a session use the session release the session enddo If I use HibernateSessionManager, it seems there is no way to release and obtain a new session, any idea? -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448134.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 -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448992.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 -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22449240.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 -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22449328.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: actionlink pass combobox value.
Yes, that's it. I always learn from jumpstart. Thanks DH - Original Message - From: Tan cyb...@n Sent: Tuesday, March 10, 2009 8:11 PM Subject: Re: actionlink pass combobox value. http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/input/linksubmits1 On Tue, Mar 10, 2009 at 8:04 PM, Tan cyb...@n quesoft.cyber...@gmail.comwrote: hi DH, Do you have any example? Thank you Regards, Tan On Tue, Mar 10, 2009 at 7:50 PM, DH ningd...@gmail.com wrote: If you are not limited on actionlink, have a try with LinkSubmit component, it can post form. Or else you need js to help post the value back. Thanks DH Sent: Tuesday, March 10, 2009 4:47 PM Subject: actionlink pass combobox value. Hi all, I have my a combo box. getCombovalue() always get null value when i clicked on actionlink button. ( This is due to the form no post back that cause it retrieved a null value.) *remark this is using zone and block. @injectpage private SecondPage secondpage; Object onActionFrombtnClick() { secondpage.setHeaderID(my combo value); return secondpage } how am i going to get the combobox value when i click on actionlink button without post back the form? Thank you. Regards, Tan
Re: T5ï¼s getting new Hibernate session in a lengthy t hread
Maybe you can directly use HibernateSessionSource service instead of HibernateSessionManager. HibernateSessionSource.create() creates a new session always, and do remember to commit and close the session by yourself. Thanks, DH - Original Message - From: Angelo Chen angelochen...@yahoo.com.hk To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 11:16 AM Subject: T5ï¼s getting new Hibernate session in a lengthy thread Hi, I need to run a lengthy thread where some database update happens, is there a way to minimize the time when a Hibernate Session is used? something similar to: do while not done // do some processing here obtain a session use the session release the session enddo If I use HibernateSessionManager, it seems there is no way to release and obtain a new session, any idea? -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448134.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: T5ï¼s getting new Hibernate session in a lengthy thread
I haven't tried it yet because now my application is out of tapestry-hibernate. But from source code of tapestry-hibernate, it should be doable. But I still doubt how you close the session created by HibernateSessionManager (thread scope). If you don't close it manually, the session still last fro the whole request process. If close manually, maybe 'session has closed' exception is thrown by tapestry-hibernate because at the end tapestry would try to close the session of HibernateSessionManager, but it has been closed manually. Thanks, DH - Original Message - From: Angelo Chen To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 1:17 PM Subject: Re: T5ï¼s getting new Hibernate session in a lengthy thread Hi DH, That sounds doable, we will inject the HibernateSessionSource then call create() to obtain the session? Angelo dh ning wrote: Maybe you can directly use HibernateSessionSource service instead of HibernateSessionManager. HibernateSessionSource.create() creates a new session always, and do remember to commit and close the session by yourself. Thanks, DH - Original Message - From: Angelo Chen angelochen...@yahoo.com.hk To: users@tapestry.apache.org Sent: Wednesday, March 11, 2009 11:16 AM Subject: T5ï¼s getting new Hibernate session in a lengthy thread Hi, I need to run a lengthy thread where some database update happens, is there a way to minimize the time when a Hibernate Session is used? something similar to: do while not done // do some processing here obtain a session use the session release the session enddo If I use HibernateSessionManager, it seems there is no way to release and obtain a new session, any idea? -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448134.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 -- View this message in context: http://www.nabble.com/T5%EF%BC%9A-getting-new-Hibernate-session-in-a-lengthy-thread-tp22448134p22448992.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: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0
Hi, In your case, why not have a try on AjaxFormLoop component, but I haven't tried this component yet and don't have much experience. Loop component in form is a bit tricky. Set volatile='true' means you need have your source object unchanged. But you have deleted one row during process, so exception happens. Thanks DH - Original Message - From: Joost Schouten (mailing lists) joost...@jsportal.com To: Tapestry users users@tapestry.apache.org Sent: Tuesday, March 10, 2009 11:13 AM Subject: Re: [T5.1.0.0] Loop in Form problem introduced in T5.1.0.0 Dear DH, Thanks for you quick response. I added the param but now get a new Exception (see below). The exception still only happens when elements are removed from the Loop through AJAX, adding all works fine. This whole volatile concept is a bit fuzzy to me and scanning the source of the Loop component does not clear things up to me. Do you have any further pointers? Cheers, Joost --- the new Exception -- Caused by: java.util.NoSuchElementException at java.util.AbstractList$Itr.next(AbstractList.java:427) at org.apache.tapestry5.corelib.components.Loop.advanceVolatile(Loop.java:335) at org.apache.tapestry5.corelib.components.Loop.access$200(Loop.java:41) at org.apache.tapestry5.corelib.components.Loop$3.execute(Loop.java:92) at org.apache.tapestry5.corelib.components.Loop$3.execute(Loop.java:96) at org.apache.tapestry5.corelib.components.Form.executeStoredActions(Form.java:471) ... 81 more
T5: Critial security of t:formdata
Hi, These days I always think of security of t:formdata, just now I have a test to hack the t:formdata and find there is some serious damages. 1. First I change source code of Form component and store a component action in Form and build my own tapestry-core.jar. static final ComponentActionForm TEST_ACTION = new ComponentActionForm() { private static final long serialVersionUID = 0L; public void execute(Form component) { for (int i = 0; i 1000; i++) { System.out.println(-run + i); } } @Override public String toString() { return TEST_ACTION; } }; 2. Jetty:run the application with my own jar and access one page (/login) that contains form, then get the t:formdata from html source code. 3. Revert offical jar, and new a AbstractIntegrationTestSuite test case: open(login); type(t:formdata, copy the form data from 2nd); clickAndWait(submit); Test result: I can see -run 0 to -run 1000 loged. So in my understanding, doesn't it mean that website based on tapestry5 is not very secured and can be attacked by any experienced t5 programmer? Thanks, DH
Re: Page navigation passed value not displayed (@InjectPage style)
Even though same page instance is used for requests, page field value is set to default value when it is released to pagepool (after every request), so email are always null after redirect-aftre-post . Use persist or activate/passivate pattern, please refer to http://tapestry.apache.org/tapestry5/guide/pagenav.html # Page Navigation Patterns Thanks DH - Original Message - From: Andy Pahne andy.pa...@googlemail.com To: Tapestry users users@tapestry.apache.org Sent: Friday, March 06, 2009 10:33 AM Subject: Re: Page navigation passed value not displayed (@InjectPage style) I usually do it a little differnet and it works for me: class YourPage{ @InjectPage private DestinationPage destinationPage; Object onAction(String emailAddress){ return destinationPage.startEdit(emailAddress); } } class DestinationPagePage{ @Property @Persist String emailAddress; Object startEdit(String emailAddress){ this.emailAddress = emailAddress; return this; } } Hope that helps, Andy manuel aldana schrieb: thanks, but same issue. Anyway I think with the InjectPage pattern and returning an Object you have control which page-instance is passed. I debugged an the same page instance is used to retrieve the value. But further debugging shows that the setter is called, but when displaying the page the email field is reset to 'null' (which I wouldn't expect from the lifecycle when using the InjectPage + returnPage pattern). Luther Baker schrieb: Try adding @Persist to the destination class ... otherwise, I'm not sure you're guaranteed which page instance will get rendered. public class SendingActivationEmail { @Persist private String email; -Luther On Thu, Mar 5, 2009 at 7:10 PM, manuel aldana ald...@gmx.de wrote: Hi, I want to pass one value to one page with the InjectPage pattern ( http://tapestry.apache.org/tapestry5/guide/pagenav.html). But below code does not work (email does not get displayed on other page). public class Registration { @Property private String email; @InjectPage private SendingActivationEmail sendingActivationEmail; @OnEvent(value = submit, component = newUser) Object newUser() { //WHEN DEBUGGING VALUE GETS PASSED CORRECTLY sendingActivationEmail.setEmail(email); return sendingActivationEmail; } } --- public class SendingActivationEmail { private String email; public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } } --- SendingActivationMail.tml (I would not see email printed here): t:layout xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; We send an email to your registrated email ${email}. check it out. /t:layout -- manuel aldana ald...@gmx.de software-engineering blog: http://www.aldana-online.de - 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
Why Grid component fetches data one more time in form submit
Hi, When Grid is in a form, even though 'volatile' parameter is set to 'false' (by default), I can see the datasource provider method is called during form submit. My understanding is that, if 'volatile' is false, it should not be called in form submitted, am I missing something? Object setupRender() { if (formSupport != null) formSupport.store(this, SETUP_DATA_SOURCE); ... } From the source code of Grid.java, if Grid is in form, the SETUP_DATA_SOURCE componentaction is always called after form submitted. I think 'volatile' should be here to prevent it from calling during submit. Unfortunately 'volatile' parameter is now declared as publishParameters of GridRows component. How do you handle grid component in a form? Thanks, DH
stylesheet processing in ajax response doesn't work in firefox3.0
Hi, Environment: tapestry 5.0.18, firefox3.0, maven jetty:run Whenever there is new stylesheet link in ajax response in firefox3.0 (both 3.0.53.0.6), then there is an ajax error shown in top of page Client exception processing response: TypeError: existing is null. But IE 67, firefox 2.0 work well. Major code of test case like following: Page.tml a t:type=actionlink t:zone=abcZone t:id=link/ div t:type=zone t:id=abcZone t:AjaxWindow/ /div Page.java @Component private Zone abcZone; public Object onActionFromLink() { return abcZone; } AjaxWindow.java @IncludeStylesheet(value = {context:css/themes/default.css}) public class WindowPanel { } If I remove @IncludeStylesheet annotation, then it works well in firefox3.0 too. Is it a known issue of firefox3.0 or tapestry.js code issue? Any workaround for this? Thanks, DH
Re: [T5] 5.0.16 Spanish special characters
That's true, native2ascii is unnecessarily any more. Try to locate the issue whether it is caused at server side or by html page encoding. What's that value in tapestry page.java level? If it is correct, then this should be the html encoding problem. 2008/12/4 Thiago H. de Paula Figueiredo [EMAIL PROTECTED] Em Wed, 03 Dec 2008 14:58:39 -0300, Imants Firsts [EMAIL PROTECTED] escreveu: Hi Ray! The properties files should be in ascii encoding and the unicode characters should be escaped with \u, for example \u0161 for scaron; character. JDK comes with native2ascii tool that does the conversion. That's not correct anymore. Since some Tapestry version I don't recall, the property files need to be UTF-8 encoded, so no conversion needs to be done. From http://tapestry.apache.org/tapestry5/guide/localization.html: Properties File Charset Tapestry uses the UTF-8 charset when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool. -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor Consultor, desenvolvedor e instrutor em Java http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] Page naigation using submit
You don't want the component rely on page, but you do (rely on outer form, right?), so if you want your component handle event independently, set the form in the component is a must. btw, onSelect's signature should only be Void type. DH 2008/10/17 Ville Virtanen [EMAIL PROTECTED] Yep, that's exactly the case. The component can't rely on any code in the page, so solution number 1 is out of the question. Solution number 2 throws exception: Event 'selected' from FinancePlan:dynamicfromcont. received an event handler method return value of [EMAIL PROTECTED] This type of event does not support return values from event handler methods. - Ville dhning-2 wrote: From your former mail, my understanding on your case (correct me if I am wrong): your page has a form, and the form contains your component, and your component template has multiple submit buttons (it must be submit component if you want to handle select event). I think there are two ways: 1. Inside the page java, handle the onAction/onSuccess event. (You can not see the onSelect event here) 2. Inside your component java, handle the onSelect event (I am not sure whether it is right, I haven't tried before) Thanks! DH - Original Message - From: Ville Virtanen [EMAIL PROTECTED] To: users@tapestry.apache.org Sent: Friday, October 17, 2008 8:08 PM Subject: Re: [T5] Page naigation using submit Yes it must be, otherwise it won't work. The submit event that is triggered by the form in the page does not bubble to my component and I can't use the selected event triggered by the button in my component because that event does not support return type of page class. - Ville dhning-2 wrote: But your component must be enclosed by an outer form component, right? Or else, how can you put textfield in your component? Thanks! DH - Original Message - From: Ville Virtanen [EMAIL PROTECTED] To: users@tapestry.apache.org Sent: Friday, October 17, 2008 7:01 PM Subject: [T5] Page naigation using submit Hi, This must be discussed before, but I could not find anything using search and I seem to be having total brain freeze here so: I have a case where I have to let user enter rows to a view and there must be an Edit function at the end of each of these rows. The edit functionality MUST SUBMIT before redirecting to detail edit as every row in the view are editable, and user may edit the rows, after which she/he/it clicks the edit button to edit the details of a row. So, how can I use submit to redirect to the detail page. As this is a component, I cannot do the normal onSuccess redirect, as my component does not define form and hence it doesn't receive the on submit event. I think it is pretty standard to have a button to redirect to another page after submit. Am I missing something totally obvious? - Ville -- View this message in context: http://www.nabble.com/-T5--Page-naigation-using-submit-tp20031177p20031177.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-T5--Page-naigation-using-submit-tp20031177p20032020.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-T5--Page-naigation-using-submit-tp20031177p20032647.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
An exception at jetty starts up while using classNameLocator
Hi, I got an exception when Jetty starts up after my maven repository updates to the latest tapestry 5.0.15-snapshot(I haven't update my repository for about 3 weeks), the latest 5.0.14-snapshot can't work too. The exception is: [ERROR] ClassNameLocator Construction of service ClassNameLocator failed: Error invoking constructor org.apache.tapestry5.ioc.internal.services.ClassNameLocatorImpl(ClasspathURLConverter) (at ClassNameLocatorImpl.java:61) (for service 'ClassNameLocator'): Exception constructing service 'Alias': Construction of service 'Alias' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:207) for references to another service that is itself dependent on service 'Alias'. I find the cause is the usage of ClassNameLocator in my AppModule.java. It is very simple. public class AppModule { public static void contributeTypeCoercer( ConfigurationCoercionTuple configuration, final ClassNameLocator classNameLocator) { classNameLocator.locateClassNames(com.mycompany.entities); other codes } } If I comment classNameLocator.locateClassNames(com.mycompany.entities), then everything works and Jetty starts up. Please help on solving the problem. It blocks me for several days. Thanks. DH
Re: Problem wuth internacionalization
Hi, What's your tapestry version? If is the latest version, you should not put the start.tml, start.properties in WEB-INF. They should be in parent level of WEB-INF(src/main/webapp/) or in /src/main/resources/com/igno/bookStore/pages/. And for app.properties, it should be always in WEB-INF. Thanks! DH 2008/5/13, Igoor [EMAIL PROTECTED]: when i make files Start.properties and Start_de.properties and put them into WEB-INF, or when i make com.igor.bookStore.pages and put these files into this root my application doesen't work... But when I make files app.properties and app_de.properties into WEB-INF whit same content like Start.properties and Start_de.properties my application work. What i need to do in order to make my application work with Start.properties and Start_de.properties -- View this message in context: http://www.nabble.com/Problem-wuth-internacionalization-tp17190006p17190006.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is it possible to prevent the render method in parent component from being invoked?
Hi, First I know it is a feature that parent method is prior to child's. I need to extend GridPager component because the action link in GridPager doesn't have a context parameter, so the context info of the link is very limited(only the page No.). And I don't like to persist context in session. The case is that in a user list page with search function and Grid component, user input keyword username, role and so on, and then click 'search' button, the relevant result will be shown in a Grid's page 1, but when user clicks page 2, the search keyword is missing, then the result is wrong which is not expected. So I extend GridPager to provide context to actionlink, but because it (as parent) implements a method beginRender() which is always invoked by Tapestry5 ahead of my GridPager's beginRender(), so now there would be two pager generated in list page. So is there a way to prevent the render method in parent from being invoked? And how? And what's the best practice here dealing with search funcion with Grid? Anyone please share your experience. Thanks in advance. DH