Antwort: RE: T5 Decoupling a Template From its Component Class
service implementations contributed to the alias service will override the other service implementations. this is also true for implementations originally provided by tapestry the additional id is to distinguish multiple implementations of the same interface. in your case you should only need it twice: 1) to define your service 2) to contribute to the alias service then you can forget it :) g, kris Martin Grotzke [EMAIL PROTECTED] 02.07.2007 14:10 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema RE: T5 Decoupling a Template From its Component Class On Mon, 2007-07-02 at 11:03 +0200, Kristian Marinkovic wrote: hi martin, if you use the ServiceBinder to contribute a class that implements an already contributed interface you have to assign an id for your class by invoking withId, because the Interface is no longer sufficient to identifiy the service binder.bind(PageTemplateLocator.class, MyPageTemplateLocatorImpl.class).withId(myLocator); furthermore you have to contribute to the aliasOverrides Service to actually replace the old implementation: public static void contributeAliasOverrides( @InjectService(myLocator) PageTemplateLocator locator, ConfigurationAliasContribution configuration) { configuration.add( AliasContribution.create( PageTemplateLocator.class, locator)); Great, this works - thanx a lot! Just for clarification: the specified id has to be used anywhere else, right? E.g. for us the service in question is the MarkupWriterFactory, and previously we also had this in our AppModule: public static PageResponseRenderer decoratePageResponseRenderer( @InjectService(PageMarkupRenderer) final PageMarkupRenderer markupRenderer, @InjectService(MarkupWriterFactory) final MarkupWriterFactory markupWriterFactory, final Object delegate ) which we have to change to @InjectService(myMarkupWriterFactory) then. Is this the intended way? Is it guaranteed, that T5 does not reference the MarkupWriterFactory implementation by the id MarkupWriterFactory? Thanx cheers, Martin g, kris Martin Grotzke [EMAIL PROTECTED] 02.07.2007 10:00 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema RE: T5 Decoupling a Template From its Component Class Digging through the code I notice there is a PageTemplateLocator interface which seems like the appropriate service to override. What I have tried is to add the following method to my AppModule class public static void bind(ServiceBinder binder) { ServiceBindingOptions options = binder.bind( PageTemplateLocator.class, MyPageTemplateLocatorImpl.class ); } ...but I get the following exception at startup. java.lang.RuntimeException: Service id 'PageTemplateLocator' has already been defined by Did you solve this issue? I get the same exception with another Service that's defined in TapestryModule that I want to override in my AppModule with my custom implementation... Thx cheers, Martin On Wed, 2007-05-30 at 19:17 -0700, David Kendall wrote: From: Howard Lewis Ship [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 30, 2007 5:15 PM There are internal services that can be overridden to handle those kinds of situations. The goal is to create something that works amazingly well for all the more typical cases, then start going after these others. Often it will involve moving a private interface out into the public space .. Thanks Howard - I appreciate your prompt response. However - I am not clear if you are saying it cannot be done currently - or if you mean that it can be done - but that I would be treading on somewhat unstable ground given that the internal interfaces are subject to change. Digging through the code I notice there is a PageTemplateLocator interface which seems like the appropriate service to override. What I have tried is to add the following method to my AppModule class public static void bind(ServiceBinder binder) { ServiceBindingOptions options = binder.bind( PageTemplateLocator.class, MyPageTemplateLocatorImpl.class ); } ...but I get the following exception at startup. java.lang.RuntimeException: Service id 'PageTemplateLocator' has already been defined by org.apache.tapestry.internal.services.InternalModule.build(AssetFactory, ComponentClassResolver
Antwort: Messages and @inject
it should work as you've tried could you post the code from your AppModule where you return your service? Tina Umlandt [EMAIL PROTECTED] 26.06.2007 17:56 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Messages and @inject hi, I need my own implementation of the Messages interface. It works fine with the new binding in the HTML-templates. But I have a problem to use it as a field in a the class. I tried the following @Inject @Service ( myMessages ) Messages _message; I hoped the Injection would know that I use my own implementation but it is totally ignored. The tapestry messages are injected. I created a little workaround by implementing a mock interface which extends the Messages interface so that the injection work properly. @Inject MyMessages _message; But I don't really like it that way. The question that I have is: Is this effect wanted that the user cannot inject his own Messages implementation or is it something nobody thought of? Thanks and regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Antwort: Messages and @inject
before you inject a service you must tell the ioc container how to create it (in your AppModule). you can do this by using the ServiceBinder: public static void bind(ServiceBinder binder) { binder.bind(MyService.class,MyServiceImpl.class); } Or you can provide a builder method: public static Message buildMyMessage() { return new MyMessage(); } there's some information in the tapestry-ioc docs :) g, kris Tina Umlandt [EMAIL PROTECTED] 27.06.2007 13:50 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: Antwort: Messages and @inject Hej, I didn't add anything to my AppModule. Do I have to? Which method do you mean? Thx, Tina Kristian Marinkovic wrote: it should work as you've tried could you post the code from your AppModule where you return your service? Tina Umlandt [EMAIL PROTECTED] 26.06.2007 17:56 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Messages and @inject hi, I need my own implementation of the Messages interface. It works fine with the new binding in the HTML-templates. But I have a problem to use it as a field in a the class. I tried the following @Inject @Service ( myMessages ) Messages _message; I hoped the Injection would know that I use my own implementation but it is totally ignored. The tapestry messages are injected. I created a little workaround by implementing a mock interface which extends the Messages interface so that the injection work properly. @Inject MyMessages _message; But I don't really like it that way. The question that I have is: Is this effect wanted that the user cannot inject his own Messages implementation or is it something nobody thought of? Thanks and regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: getting list of assigned Mixins from component
hi all, how can i get a list of assigned mixins from a component? I've tried from within a mixin but getMixinClasses returns always an empty list: @InjectComponent private Component _component; @Environmental private JavascriptApi _jsAPI; public void afterRender() { ComponentResources _resources = _component.getComponentResources() .getComponentModel().getMixinClassNames(); from within a component i tried it too with: @Inject private ComponentResources resources; with no luck. From what i could see from the code i need a EmbeddedComponentModel instance but i did not succeed in obtaining one :) g kris.
RE: t5: i18 messages without different locale files
you could contribute an own BindingFactory for messagedb:... g kris Tina Umlandt [EMAIL PROTECTED] 20.06.2007 15:27 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema t5: i18 messages without different locale files Hi, I have the following issue. I want to internationalize my application without using the localed files. The administrator of my application should be able to write or change the texts for the template by himself. These texts are stored in a postgres db. Therefore i.e. I want to override the binding mechanism for message so that it uses instead of the default messages my own DBMessagesImpl. In the tapestry source code I found the line where the message is connected with the MessageBindingFactory but I see no way to interfere this mechanism and change it so that message is connected with another BindingFactory. Have you any suggestions? And thx for your help. Regards, Tina - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: t5: i18 messages without different locale files
hi tina, in your Module Class (AppModule, or WebappnameModule) you can contributeyour own BindingFactory with following method:public static void contributeBindingSource( MappedConfigurationString, BindingFactory configuration,) { configuration.add("messagedb", new MessagedbBindingFactory(db));}When tapestry recognizes your prefix it calls your factory to obtaina Binding instance. Beforeyou returnthe binding instance you of have to lookup the message key in your database. please take a look at theMessageBindingFactory class... this class does exactly what you need...except that you have to inject your db source :)g,kris-Tina Umlandt [EMAIL PROTECTED] schrieb: -An: users@tapestry.apache.orgVon: Tina Umlandt [EMAIL PROTECTED]Datum: 20.06.2007 04:51PMThema: RE: RE: t5: i18 messages without different locale filesHi,:-D ... thats what I want to do ..But can you tell me how I could do this? Where do I register a new BindingFactory for a new keyword?Thx,Tinayou could contribute an own BindingFactory for "messagedb:"...gkrisTina Umlandt [EMAIL PROTECTED]20.06.2007 15:27Bitte antworten an"Tapestry users" users@tapestry.apache.orgAnusers@tapestry.apache.orgKopieThemat5: i18 messages without different locale filesHi,I have the following issue.I want to internationalize my application without using the localed files.The administrator of my application should beable to write or change the texts for the template by himself. These textsare stored in a postgres db.Therefore i.e. I want to override the binding mechanism for "message" sothat it uses instead of the default messages myown DBMessagesImpl.In the tapestry source code I found the line where the "message" isconnected with the MessageBindingFactory but I seeno way to interfere this mechanism and change it so that "message" isconnected with another BindingFactory.Have you any suggestions? And thx for your help.Regards,Tina-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ASO Frustrations
just a guess. inject property=aso type=state object=sessionASO/ is within you .page file and not within your .html? Jonathan Barker [EMAIL PROTECTED] 14.06.2007 05:16 Bitte antworten an Tapestry users users@tapestry.apache.org An 'Tapestry users' users@tapestry.apache.org Kopie Thema RE: ASO Frustrations Chris, Nothing jumps out at me as *wrong*, but I've run into strange problems when I omit constructors. Try adding no-arg constructors to your factory and ASO classes. I lean more toward annotations, so I hardly ever use the inject method, so I wouldn't even know what I was missing there. Jonathan -Original Message- From: Chris Chiappone [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 13, 2007 12:14 PM To: Tapestry List Subject: ASO Frustrations Could someone take a quick look at this and see if i'm doing anything wrong. I am trying to use and session based ASO but it doesn't seem to be getting injected properly, i've looked at this code over and over and must be missing something. hivemodule.xml service-point id=SessionFactory interface=org.apache.tapestry.engine.state.StateObjectFactory invoke-factory construct class=application.aso.SessionASOFactory /construct /invoke-factory /service-point contribution configuration-id=tapestry.state.ApplicationObjects state-object name=globalASO scope=application invoke-factory object=service:GlobalFactory/ /state-object state-object name=sessionASO scope=session invoke-factory object=service:SessionFactory/ /state-object /contribution page.html contains: inject property=aso type=state object=sessionASO/ page.java contains: public abstract SessionASO getAso(); public Client getCurrentClient() { SessionASO aso = getAso(); if(aso == null){ logger.info(Why the hell is the aso null?); } } SessionASOFactory.java: public class SessionASOFactory implements StateObjectFactory { private static final Log logger = LogFactory.getLog(SessionASOFactory.class .getName()); public Object createStateObject() { SessionASO aso = new SessionASO(); logger.info(Createing a new sessionASO object from factory); return aso; } } SessionASO.java: public class SessionASO implements Serializable { private Client sessionClient; public Client getSessionClient() { return sessionClient; } public void setSessionClient(Client sessionClient) { this.sessionClient = sessionClient; } } Thanks for the help. -- ~chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: obtaining Link or InvocationTarget from Component
Hi, can someone help me to obtain a Link or InvocationTarget instance from a specific Component (ActionLink, PageLink). I'm trying to delegate this information to a service that generates the necessary javascript for my asynchronous invocations. First i thought the ComponentInvocationMap were the right place to look... but that was a dead end :) i try to do this from a Mixin class, so i think the ComponentResources should be my starting point. g, kris
RE: T5 tab-like component
Hi Erik, in T5 its very easy to create a tab component. Just create a component for every tab you have. Then add a Delegate to the page that should display the tab and bind the to parameter of the Delegate to a method. This method then returns the respective tab component example code: template: t:delegate to=selectedTab/ a t:id=tab1_linktab1/a a t:id=tab2_linktab2/a t:block div t:id=tab1 / div t:id=tab2 / /t:block java class: // dont forget getter methods @Component private Tab tab1_link @Component private Tab tab2_link // because of redirect @Persist(flash) private int selectedComponent; public void onActionFromTab1_link() { selectedComponent = 1;} public void onActionFromTab2_link() { selectedComponent = 2;} public Object selectedTab() { if(selectedComponent == 1) return tab1; if(selectedComponent == 2) return tab2; return tab1; } g, kris Erik Vullings [EMAIL PROTECTED] 10.06.2007 11:54 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 tab-like component Hi all, Since there does not seem to be a T5 tab component, should I use the Dojo one? Furthermore, what's the best way to use it for offering multiple views on the same object. For example, when choosing a user in a list, I would like to use a tab-like view to show business details, personal details, etc. However, I would like to separate the development of these views as much as possible, and would prefer not to put everything in one view/page, i.e. I would prefer not to create one page, and have something like t:if Tab1Generate tab 1 content/t:if t:if Tab2Generate tab 2 content/t:if etc. What would be the best way to achieve this separation of concern? Thanks Erik
Re: How to use the third-party T5 Component in another T5 project
i think you have to deploy the jar (make it available in the classpath) and add the new package path to the tapestry.app-package parameter in web.xml g kris Allen Guo [EMAIL PROTECTED] 08.06.2007 12:47 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: How to use the third-party T5 Component in another T5 project Nobody answer me ? :( Hi All, I use T5.0.4. I packaged some common components to common.jar. You know, in T3/4, we may add a configuration like contrib to .application file. But how can I use it in my another project base on T5? Thanks Allen Guo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use the third-party T5 Component in another T5 project
just forget what i said before you can use a LibraryMapping to add other component libraries. therefore you have to contribute your library (that contains a prefix and the root package) to a tapestry ioc service: in you AppModule class public static void contributeComponentClassResolver(ConfigurationLibraryMapping configuration) { configuration.add(new LibraryMapping(whatever, org.whatever.mycomponents)); } g kris 蝈蝈龙 [EMAIL PROTECTED] 08.06.2007 13:31 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: How to use the third-party T5 Component in another T5 project But I can only a tapestry.app-package in web.xml And another question is , if the component have the same name with the component in my project, what should I do? 2007/6/8, Kristian Marinkovic [EMAIL PROTECTED]: i think you have to deploy the jar (make it available in the classpath) and add the new package path to the tapestry.app-package parameter in web.xml g kris Allen Guo [EMAIL PROTECTED] 08.06.2007 12:47 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: How to use the third-party T5 Component in another T5 project Nobody answer me ? :( Hi All, I use T5.0.4. I packaged some common components to common.jar. You know, in T3/4, we may add a configuration like contrib to .application file. But how can I use it in my another project base on T5? Thanks Allen Guo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use the third-party T5 Component in another T5 project
try opend/Radio ... :) 蝈蝈龙 [EMAIL PROTECTED] 08.06.2007 13:56 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: How to use the third-party T5 Component in another T5 project I added the code to AppModule.class onfiguration.add(new LibraryMapping(opend,org.opend.corelib)); Then refer to the component in html template like this span t:type=opend:Radio / Am I right? It always throw the exception below Unable to resolve component type 'opend:Radio' to a component class name. Available component types: FlatImg, Layout, core/ActionLink, core/Any, core/BeanEditForm, core/Checkbo 2007/6/8, Kristian Marinkovic [EMAIL PROTECTED]: just forget what i said before you can use a LibraryMapping to add other component libraries. therefore you have to contribute your library (that contains a prefix and the root package) to a tapestry ioc service: in you AppModule class public static void contributeComponentClassResolver(ConfigurationLibraryMapping configuration) { configuration.add(new LibraryMapping(whatever, org.whatever.mycomponents)); } g kris 蝈蝈龙 [EMAIL PROTECTED] 08.06.2007 13:31 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: How to use the third-party T5 Component in another T5 project But I can only a tapestry.app-package in web.xml And another question is , if the component have the same name with the component in my project, what should I do? 2007/6/8, Kristian Marinkovic [EMAIL PROTECTED]: i think you have to deploy the jar (make it available in the classpath) and add the new package path to the tapestry.app-package parameter in web.xml g kris Allen Guo [EMAIL PROTECTED] 08.06.2007 12:47 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: How to use the third-party T5 Component in another T5 project Nobody answer me ? :( Hi All, I use T5.0.4. I packaged some common components to common.jar. You know, in T3/4, we may add a configuration like contrib to .application file. But how can I use it in my another project base on T5? Thanks Allen Guo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] renderInformalParameters call redundant in ActionLink ?
hi, is there any reason for the ActionLink component to call resources.renderInformalParameters(writer) although it has the RenderInformals Mixin attached? g, kris
Re: T5 - Service injection and ioc
i assume you have used the tapestry archetype :) with the SubModule annotation you can have other module classes loaded with the AppModule without putting them into the manifest. as an alternative you can put your module into your manifest as well (comma separated) plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-jar-plugin/artifactId configuration archive manifestEntries Tapestry-Module-Classes com.poi.tapestry5.ioc.test.module.AppModule,com.poi.tapestry5.ioc.test.module.MyModule /Tapestry-Module-Classes /manifestEntries /archive /configuration /plugin Tapestry-Module-Classes: com.poi.tapestry5.ioc.test.module.AppModule, com.poi.tapestry5.ioc.test.module.MyModule Blackwings [EMAIL PROTECTED] 01.06.2007 11:14 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5 - Service injection and ioc /cry... Does Howard confirm this? 2007/6/1, Joshua Jackson [EMAIL PROTECTED]: I think you can only have one Module loaded by Filter (CMIIW). Last time I tried I only can load AppModule, and the other Module entries are ignored. On 6/1/07, Blackwings [EMAIL PROTECTED] wrote: So, I created my own Module in the same package than AppModule, following the naming convention : public final class UserModule { public UserService buildUserService() { return new UserServiceImpl(); } } And I still have the error, the same others have, No service implements the interface papo.ioc.services.UserService. So, how can I declare the Module? :) 2007/6/1, Joshua Jackson [EMAIL PROTECTED]: Of course you can create your own Module, but AppModule it the ones automatically loaded because it is configured in your web.xml On 6/1/07, Blackwings [EMAIL PROTECTED] wrote: Still the same question... Are we force to use only the AppModule? Can we create our own module? This is the question. I think we know how to implement, inject and create a Service. I achieved to make it works only when finally I declared my service builder in AppModule but we still don't know how to create our own hand made Module. -- YM!: thejavafreak Blog: http://www.nagasakti.or.id/roller/joshua/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michael Bernagou Java Developper -- YM!: thejavafreak Blog: http://www.nagasakti.or.id/roller/joshua/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Michael Bernagou Java Developper
[T5] proposal for a java api for adding javascript = tapestry-javascript
hi all, wouldn't it be nice to have a java api in tapestry that could be used to add certain javascript functionality to a page? preferable independent from a javascript library? like: jsApi.addEventListener(Page page, Component comp, String eventType); or: jsApi.addAsynchronousLink(Page page, ActionLink action) which would be called by a mixin that was applied to a ActionLink component @Component @MixinClasses(AsynchronousLink.class) ActionLink checkDate this way you could provide (contribute) custom implementations for several libraries like dojo, prototye, yahoo ui,... T4 is very dojo centric and makes it almost impossible to replace dojo... except you replace any component with dojo specific script code :) the basic services offered by this api would be for: - communication (ajax, json) - (a)synchronous calls - adding/removing event listener (see T4) (- effects) ... i'd be grateful to some other thoughts and comments on this idea g, kris
RE: T5 Script component [WAS: Re: T5 page lifecycle]
hi martin, instead of resolving the path to your resource manually you can use the asset service (useful when thinking of portlets) i wrote a stylesheet component myself that works like your script component :) ... and i enjoyed writing it. public class Script { @Inject private AssetSource assetSource; @BeginRender boolean renderMessage( MarkupWriter writer ) { Asset script = assetSource.findAsset(null, _src, null); writer.element( script, type, _type, src, script.toClientUrl()) } @Component(parameters={src=context:js/mainFunction.js}) Script script; g, kris Martin Grotzke [EMAIL PROTECTED] 26.05.2007 14:40 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 Script component [WAS: Re: T5 page lifecycle] thanx, good to know that. Although, I prefer having a template that can be further developed by page designers, so I wrote a Script component that can be used like this: script type=text/javascript t:type=script src=js/main_functions.js/ The script component class: public class Script { @Inject private Request _request; @Parameter(required = true, defaultPrefix=literal) private String _type; @Parameter(required = true, defaultPrefix=literal) private String _src; @BeginRender boolean renderMessage( MarkupWriter writer ) { writer.element( script, type, _type, src, _request.getContextPath() + / + _src ); writer.end(); return false; } } Is there anything that could be improved? Btw: I really love how easy it is to write a component in T5, you just have to do what you want, nothing more - really, really nice!! Cheers, Martin On Fri, 2007-05-25 at 10:13 -0700, Howard Lewis Ship wrote: Yes, you can. The AssetSource service is public, so you can ask it for a dynamically determined service. In 5.0.5 snapshot, you can do the following: @Inject private Request _request; public Request getRequest() { return _request; } public String getLibraryPath() { return ... } And in the template ... body script type=text/javascript src=${request.contextPath}/${libraryPath}/ ... 5.0.5-SNAPSHOT supports expansions inside attributes, even of non-component elements, and you can do some simple string-assembly inline. What this doesn't do is ensure that the library exists, or handle localization of the library (perhaps more relevant for an image than a JavaScript library). On 5/25/07, Martin Grotzke [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 07:54 -0700, Howard Lewis Ship wrote: There isn't a component, but you can in your page or component class: @Inject @Path(context:js/main_functions.js) private Asset _library; is it possible to set the js/main_functions.js dynamically via java, or retrieve it from a properties file (setting it via java would be preferred)? thx cheers, martin @Environmental private PageRenderSupport _renderSupport; void beginRender() { _renderSupport.addScriptLink(_library); } ... yes this can/should be wrapped up into a more convienient component. I've also added a JIRA suggestion for an annotation to take care of this as well. On 5/25/07, Martin Grotzke [EMAIL PROTECTED] wrote: On Thu, 2007-05-24 at 16:36 -0700, Howard Lewis Ship wrote: Need an ls -lR of src/main/webapp I suspect you have a link to a .js file that doesn't exist. If it did exist, the request would be passed off to the servlet container. Since it doesn't, and it looks like a Tapestry page request, it's being passed into Tapestry. Howard, that was the case. The url was /myapp/search/ipod (page Search) and the template contained script type=text/javascript src=js/main_functions.js/script Changing this to script type=text/javascript src=/myapp/js/main_functions.js/script fixes the problem. Is there a component that can produce this script tag with a correctly prefixed src attribute? Thx cheers, Martin On 5/24/07, Martin Grotzke [EMAIL PROTECTED] wrote: On Thu, 2007-05-24 at 10:42 -0700, Howard Lewis Ship wrote: I suspect there's a conflict between your page name, and a folder of your web application. How about an ls -lR of your context folder? Is the context folder what is specified with the context-param tapestry.app-package? Then here it is: === [EMAIL PROTECTED] stealthshop-tapestry5]$ ls -lR src/main/java/org/company/app/ src/main/java/org/company/app/: total 24 drwxrwxr-x 3 grotzke grotzke 4096 May 22 01:17
Re: T5 selective rendering
i did some partial page rendering (PPR) myself ... but i don't know it is the tapestry 5 way of doing it... rendering a component from any page @Inject private RequestPageCache _cache; @Inject private MarkupWriterFactory mwf; @Inject private PageRenderInitializer initializer; public Object doPPR() { MarkupWriter markupWriter = mwf.newMarkupWriter(); initializer.setup(markupWriter); Page page = _cache.get(anypage); ComponentPageElement element = page.getRootElement().getEmbeddedElement(anycomponent); RenderQueueImpl queue = new RenderQueueImpl(page.getLog()); queue.push(element); queue.run(markupWriter); initializer.cleanup(markupWriter); return new TextStreamResponse(text/html,markupWriter.toString()); } Alexandru Dragomir [EMAIL PROTECTED] 25.05.2007 19:15 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: T5 selective rendering sorry , pressed wrong button: boolean beginRender() { return false; } And the doc is here : http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html On 5/25/07, Alexandru Dragomir [EMAIL PROTECTED] wrote: As simple as it can get : @Inject private ComponentResources resources; Component setupRender() { return resources.getEmbeddedComponent(yourComponent); } boolean beginRender() { } On 5/25/07, Janko Muzykant [EMAIL PROTECTED] wrote: hi all, is anyone able to give me a hint how could I render only one component from whole the tree of all components that given page consists of? I did such a thing a few month ago for T4 and it worked exactly like this: * there was a Border component wrapping all the children * there was a special component (let's name it @AjaxContainer) * in case a special id was found in session/request, @Border was replacing current MarkupWriter with NullMarkupWriter and passed the control down to the children. * every component which was not an @AjaxContainer was obviously not rendered in such a case * @AjaxContainer was rendering its contents using original MarkupWriter. as a result i got only contents of my @AjaxContainer. The question is, how to achieve this functionality in T5? The first problem for me was lack of NullMarkupWriter, secondly I don't know how to pass replaced writer to the children components. I guess it may be achieved somehow easier using MarkupWriterFactory, but how? regards, umrzyk
RE: T5 Script component [WAS: Re: T5 page lifecycle]
caching is one advantage of using assets another advantage is the possibility to let tapestry decide how your assets are delivered: plain or compressed the asset service will determine browser and type of asset to decide whether it can use compression. (if gzip is accepted :)) jesse did a great job implementing this in Tapestry 4. Its just a matter of time till its ported to Tapestry 5 :) see org.apache.tapestry.asset.AssetService in Tapestry 4 g, kris Martin Grotzke [EMAIL PROTECTED] 29.05.2007 11:17 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema RE: T5 Script component [WAS: Re: T5 page lifecycle] On Tue, 2007-05-29 at 09:36 +0200, Kristian Marinkovic wrote: instead of resolving the path to your resource manually you can use the asset service (useful when thinking of portlets) What exactly is the advantage of using the AssetSource? Is it e.g. caching or s.th. else? In respect to the Request that I used I suppose for a portlet environment it should only be necessary to provide another (portlet specific) implementation. Cheers, Martin i wrote a stylesheet component myself that works like your script component :) ... and i enjoyed writing it. public class Script { @Inject private AssetSource assetSource; @BeginRender boolean renderMessage( MarkupWriter writer ) { Asset script = assetSource.findAsset(null, _src, null); writer.element( script, type, _type, src, script.toClientUrl()) } @Component(parameters={src=context:js/mainFunction.js}) Script script; g, kris Martin Grotzke [EMAIL PROTECTED] 26.05.2007 14:40 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5 Script component [WAS: Re: T5 page lifecycle] thanx, good to know that. Although, I prefer having a template that can be further developed by page designers, so I wrote a Script component that can be used like this: script type=text/javascript t:type=script src=js/main_functions.js/ The script component class: public class Script { @Inject private Request _request; @Parameter(required = true, defaultPrefix=literal) private String _type; @Parameter(required = true, defaultPrefix=literal) private String _src; @BeginRender boolean renderMessage( MarkupWriter writer ) { writer.element( script, type, _type, src, _request.getContextPath() + / + _src ); writer.end(); return false; } } Is there anything that could be improved? Btw: I really love how easy it is to write a component in T5, you just have to do what you want, nothing more - really, really nice!! Cheers, Martin On Fri, 2007-05-25 at 10:13 -0700, Howard Lewis Ship wrote: Yes, you can. The AssetSource service is public, so you can ask it for a dynamically determined service. In 5.0.5 snapshot, you can do the following: @Inject private Request _request; public Request getRequest() { return _request; } public String getLibraryPath() { return ... } And in the template ... body script type=text/javascript src=${request.contextPath}/${libraryPath}/ ... 5.0.5-SNAPSHOT supports expansions inside attributes, even of non-component elements, and you can do some simple string-assembly inline. What this doesn't do is ensure that the library exists, or handle localization of the library (perhaps more relevant for an image than a JavaScript library). On 5/25/07, Martin Grotzke [EMAIL PROTECTED] wrote: On Fri, 2007-05-25 at 07:54 -0700, Howard Lewis Ship wrote: There isn't a component, but you can in your page or component class: @Inject @Path(context:js/main_functions.js) private Asset _library; is it possible to set the js/main_functions.js dynamically via java, or retrieve it from a properties file (setting it via java would be preferred)? thx cheers, martin @Environmental private PageRenderSupport _renderSupport; void beginRender() { _renderSupport.addScriptLink(_library); } ... yes this can/should be wrapped up into a more convienient component. I've also added a JIRA suggestion for an annotation to take care of this as well. On 5/25/07, Martin Grotzke [EMAIL PROTECTED] wrote: On Thu, 2007-05-24 at 16:36 -0700, Howard Lewis Ship wrote: Need an ls -lR of src/main/webapp I suspect you have a link to a .js file that doesn't exist. If it did exist, the request would be passed off to the servlet container. Since it doesn't
[T5] Question about invisible instrumentation with t:id
hi, i created a stylesheet component that does not allow informal parameters. i include my stylesheet component by using invisible instrumentation with t:id like below: link t:id=stylesheet href=style.css / Because T5 converts this to an Any component (see documentation) it tries to evaluate style.css as a prop: binding and as there is no style object with a css property in my page i get an exception. is there a way to prevent this behaviour so T5 does not try to evaluate the (dummy text) parameters when using a component that does not allow informal parameters? Invisible instrumentation with t:id is my preferred way to declare components in my templates because it is the most friendly way for designer and developer as the designer cannot change any parameters :) and everything is configured in the page class using annotations. when i get such an exception automatic resource reloading for templates and classes does not work anymore. g, kris
Re: [T5] Question about invisible instrumentation with t:id
hi massimo, it does work with literal: but i'd like to avoid that designers know more about Tapestry than t:id :). especially when they want to preview the template with a real stylesheet without tapestry. I've not looked deep enough into T5 template parsing but i expected it will ignore every parameter if it recognizes it is a component that is defined using t:id and assume there are just informal parameters or discard them if the component does not support them or maybe evaluate the parameters only if the parameters are not set within the @Component annotation :) ... (just a thought) g, kris Massimo Lusetti [EMAIL PROTECTED] 21.05.2007 10:37 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: [T5] Question about invisible instrumentation with t:id On 5/21/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: is there a way to prevent this behaviour so T5 does not try to evaluate the (dummy text) parameters when using a component that does not allow informal parameters? Did you try literal prefix? -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Re: [T5] Question about invisible instrumentation with t:id
hi massimo, i already have: public class Stylesheet { @Inject private AssetSource assetSource; @Parameter private String href; . i think that was my problem i used the parameter name i defined in my template (href) as a component parameter. when i rename my component parameter to lets say paramhref everything works as expected. maybe there should be some checks.. thank you for your help g, kris Massimo Lusetti [EMAIL PROTECTED] 21.05.2007 12:15 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: [T5] Question about invisible instrumentation with t:id On 5/21/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: it does work with literal: but i'd like to avoid that designers know more about Tapestry than t:id :). especially when they want to preview the template with a real stylesheet without tapestry. Specify it in the class file as component parameter. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: Since update from 5.03 to 5.04 class not found
hi sabine, have you tried to clean install everything? from the stack you can see it is trying to call the OnEventWorker.extractComponentIds method that does not exist anymore (since 13.3.2007). The correct name now would be extractComponentId. I suppose at least your Tapestry Core library is not up to date. g, kris Sabine K. [EMAIL PROTECTED] 08.05.2007 11:04 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema T5: Since update from 5.03 to 5.04 class not found Hello Guys! ive updatet with maven and now i got this error. Ive got no idea how to solve it? Best regards Sabine An unexpected application exception has occurred. * java.lang.RuntimeException java.lang.ClassNotFoundException: caught an exception while obtaining a class file for org.firma.tool.pages.Start * java.lang.ClassNotFoundException caught an exception while obtaining a class file for org.firma.tool.pages.Start exception java.lang.ClassCastException: java.lang.String incompatible with [Ljava.lang.String; Stack trace * org.apache.tapestry.internal.services.OnEventWorker.extractComponentIds(OnEventWorker.java:153) * org.apache.tapestry.internal.services.OnEventWorker.addCodeForMethod(OnEventWorker.java:107) * org.apache.tapestry.internal.services.OnEventWorker.transform(OnEventWorker.java:66) * org.apache.tapestry.internal.services.ComponentClassTransformerImpl.transformComponentClass(ComponentClassTransformerImpl.java:131) * org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl.onLoad(ComponentInstantiatorSourceImpl.java:177) * javassist.Loader.findClass(Loader.java:340) * org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl$PackageAwareLoader.findClass(ComponentInstantiatorSourceImpl.java:85) * javassist.Loader.loadClass(Loader.java:311) * java.lang.ClassLoader.loadClass(ClassLoader.java:568) * org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl.findClass(ComponentInstantiatorSourceImpl.java:254) * org.apache.tapestry.internal.services.ComponentInstantiatorSourceImpl.findInstantiator(ComponentInstantiatorSourceImpl.java:240) * org.apache.tapestry.internal.services.PageElementFactoryImpl.newRootComponentElement(PageElementFactoryImpl.java:188) * org.apache.tapestry.internal.services.PageLoaderProcessor.loadRootComponent(PageLoaderProcessor.java:345) * org.apache.tapestry.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:330) * org.apache.tapestry.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:62) * org.apache.tapestry.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:63) * org.apache.tapestry.internal.services.RequestPageCacheImpl.getByClassName(RequestPageCacheImpl.java:58) * org.apache.tapestry.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:49) * org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:57) * org.apache.tapestry.internal.services.PageLinkHandlerImpl.handle(PageLinkHandlerImpl.java:49) * org.apache.tapestry.internal.services.RootPathDispatcher.dispatch(RootPathDispatcher.java:76) * org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:1201) * org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:43) * org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java:736) * org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:63) * org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:91) * org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:82) * org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77) * org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:104) * org.apache.tapestry.services.TapestryModule$11.service(TapestryModule.java:1179) * org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:115) * org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) * org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) * org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) * org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) * org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) * org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) * org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) *
[T5] Improving exception message when using @Environmental
hi, i pushed an own helper class (ParentHelper) into the Environment instance to make it usable in one of my nested components using @Environmental. But instead i got the following exception although i used the correct class: No object of type com.poi.tapestry5.experiment.components.ParentHelper is available from the Environment. Available types are com.poi.tapestry5.experiment.components.ParentHelper, org.apache.tapestry.MarkupWriter, ... org.apache.tapestry.services.Heartbeat. After thinking twice (and after 2h of testing) i realized that the location of my helper class was within the component package and everything in there would get enhanced. Moving it to another package solved the problem. I was wondering whether it were possible to mark enhanced classes in a way they could be easily distinguisehd from non-enhanced classes so the above exception would be easier to understand. At least from the exceptions messages g, kris
Re: Can I replace Spring IoC with T5 IoC?
hi, you could use Hivemind 2 ... uses Annotations too! And there is the Spring JavaConfig project that provides Spring annotations (never used myself) the problem you face when using Tapestry IoC or Hivemind 2 is that you will not find the rich integration with other frameworks nor the abstractions ... like Spring does (e.g. mail api, session). ... of course you can reimplement it :) If you don't need it you can go with Tapestry IoC or Hivemind 2 (both in alpha stage!). I'm using Hivemind 1.1.1 for a couple of projects myself with no problems. IMHO from a pure DI/IOC point of view there are only few to no differences (e.g. Spring does not have contributions). Maybe there are some performance issues but i never had any nor looked for them :) ... just my two cents :) g, kris Joshua Jackson [EMAIL PROTECTED] 08.05.2007 14:24 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema Can I replace Spring IoC with T5 IoC? Dear all, I've been analyzing whether Tapestry 5 is suitable for my next project. One question that arised when I take a look at Tapestry is whether I can replace Spring IoC with Tapestry IoC. This replacement is of course to use T5 IoC to bind other frameworks like JPA and Acegi. One thing I really dislike about Spring is the XML configurations. And the way I see it, T5 IoC has less fuss about XML configs. Has anyone done this before? Regards, joshua -- YM!: thejavafreak Blog: http://www.nagasakti.or.id/roller/joshua/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: How to inject a service into a component?
hi michael, it should work with just @Inject. You can take a look at the BeanEditForm component... it uses a bunch of @Injects. (T5.0.4) g, kris Michael Maier [EMAIL PROTECTED] 04.05.2007 11:37 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema T5: How to inject a service into a component? Hi List, I'm trying to inject via @Inject annotation a service (internal service RequestPageCache) into a component: public class Menu { @Inject(RequestPageCache) RequestPageCache requestPageCache; public String getPageName() { ComponentResources pageResources= resources.getPage ().getComponentResources(); String pageClassName= pageResources.getCompleteId(); Page page= requestPageCache.getByClassName(pageClassName); return page.getName(); } } so...while rendering the page with the menu component div id=leftside div id=menu ul li ${pageName} /li /ul /div /div a null pointer exception occures, because requestPageCache is null. What is getting wrong? Is RequestPageCache not injectable? What I want: I just try to get the page of the component. Then the menu component should highlight by providing a special css-class the corresponding menu item of the ulli-list for the active page. Therefore the menu component must know the current page that is rendered. In Tapestry 3 is just call the method getPage of the component. Now every component has no parent class... While we are talking about injection: the docs are a little bit confusing: @Inject @Service(xxx) (which did not work with 5.0.3, because Service annotation does not exist) or @Inject(xxx) or @Inject( service:xxx ) (what kind of prefixes (service:) exists and what meaning have they?) sometimes: @Inject (alias:request )...is there somewhere a list with all objects that are able to be injected from tapestry-core? thanks for any help cheers Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5]: rendering component with nested component with @Component annotation
hi howard, i switched to normal inheritance having Stylesheet extend RelationshipLink. Now i experience some troubles with @Parameter overrides (redefining a property with another @Parameter). Can you tell me how this works? What rules are applied to it? following override works correct and outputs stylesheet: public Stylesheet extends RelationshipLink { @Parameter(value=stylesheet,defaultPrefix=literal) private String rel; public RelationshipLink { @Parameter private String rel; but this does not; instead returns a toString of my Stylesheet instance: public Stylesheet extends RelationshipLink { @Parameter(value=literal:stylesheet) private String rel; public RelationshipLink { @Parameter private String rel; neither works public Stylesheet extends RelationshipLink { @Parameter(value=stylesheet) private String rel; public RelationshipLink { @Parameter(defaultPrefix=literal) private String rel; thanks in advance g, kris Howard Lewis Ship [EMAIL PROTECTED] 03.05.2007 17:59 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: [T5]: rendering component with nested component with @Component annotation Sub-components have no meaning unless there's a template. It is the elements in the template that drive the creation of sub-components. This should be more explicit in the documentation, and perhaps there should be a check for components in classes without a template. On 5/3/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi, does anyone know how to render a Tapestry 5 component that itself contains a component with the @Component annotation? What i did so far is to define a template for the first component that contains the second component as a embedded component (code below). I'm trying to write a Stylesheet component that depends on a RelationshipLink (... actually the link tag :)) (please comment on whether you consider this component to be useful/reasonable or not). anyway, is this the right approach for writing (nested) components? should i use component inheritance instead? then i do not need the template. g, kris example code: public class Stylesheet { @Parameter(required=true) private Asset href; @Parameter private String media; @Parameter private String rel; @Parameter(value=text/css,defaultPrefix=literal) private String type; @Component(id=relationshipLink,parameters={href=href,media=media,rel=rel,type=type}) private RelationshipLink relationshipLink; public RelationshipLink getRelationshipLink() { return relationshipLink; } Stylesheet.html link t:id=relationshipLink xmlns:t=http://tapestry..; / //see http://www.w3.org/TR/html4/struct/links.html for more details on link public class RelationshipLink { /* * As the only valid location for lt;linkgt; is within lt;headgt it will * not check the location */ ... void beginRender(MarkupWriter writer) { writer.element(link, href,href, charSet,charSet, hrefLang, hrefLang,media,media,rel,rel,rev,rev, target,target,type,type); writer.end(); } -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com
Re: Tapestry 5 and Template Reloading
did you use the target/ directories to configure jetty?the target directory is refreshed only after a new build. make sure jetty points to src/main/webapp/ and not tptarget/webapp...-bjornharvold [EMAIL PROTECTED] schrieb: -An: users@tapestry.apache.orgVon: bjornharvold [EMAIL PROTECTED]Datum: 01.05.2007 05:37PMThema: Re: Tapestry 5 and Template ReloadingThanks for the emails:I am am using the same case on both my java class and html file (Start.java/ Start.html). My directory structure is the maven 2 default one(src/main/java / src/main/resources). I did watch the screencast and didexactly the same. I actually did install jetty 4 first as that was whatHoward had in his demo, but it didn't like hot deploy and complained when Isaved a java file. The hot deploy worked when I installed jetty 5.1. Thestrange thing about this is that changes don't even occur on the templateeven if I restart!! I edit the template, save it, restart, and changes STILLdon't come up. I have to CLEAN in order for it to update which leaves me tobelieve this is some caching issue on jetty or eclipse. Problem still not solved :-(thxbjornbjornharvold wrote: I can't seem to get template reloading to work. Classes reload just fine. I installed the latest Eclipse with JettyRunner and jetty 5.1. Anyone have the same problem or better yet, the solution? thx bjorn -- View this message in context: http://www.nabble.com/Tapestry-5-and-Template-Reloading-tf3671362.html#a10271041Sent from the Tapestry - User mailing list archive at Nabble.com.-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [T5] IOC: services without interface do not work
hi, found my problem... in order to have a service that does not have an interface you have to use the ServiceBinder. Shouldn't it be possible to have these kind of services returned by a builder method as well? IMHO this way it'd feel more consistent g, kris Kristian Marinkovic [EMAIL PROTECTED] 27.04.2007 14:27 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema [T5] IOC: services without interface do not work hi all, when i try to return a service in my module that does not have an interface i get a No service implements the interface... exception. The recent blog entry suggests that it should work now .. http://tapestryjava.blogspot.com/2007/04/pleasing-crowds-improving-ioc-extending.html My module code is below. Am i missing something? Or maybe i'm just too eager to use it... :) I'm using the latest sources from the repository. MyModule.java public class MyModule { public static SimpleServiceImpl build() { return new SimpleServiceImpl(); } } g, kris btw. anyone tried to build tapestry 5 with java 1.6
RE: T5 - Unable to resolve component type 'comp' to a component class name
t:comp is not supported anymore. now its t:loop... t:component_type look into the Tapestry 5 tutorial pdf... examples there are up to date :) g,kris winlaw [EMAIL PROTECTED] 30.04.2007 14:54 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema T5 - Unable to resolve component type 'comp' to a component class name I am trying to copy the example demonstarted in the Screencast but get the following error when I fire up the browser: Unable to resolve component type 'comp' to a component class name. Available component types: core/ActionLink, core/Any, core/BeanEditForm, core/Checkbox, core/ComponentMessages, core/Delegate, core/Errors, core/Form, core/FormSupportImpl, core/Grid, core/GridCell, core/GridColumns, core/GridPager, core/GridRows, core/If, core/Img, core/Label, core/Loop, core/Output, core/OutputRaw, core/PageLink, core/PasswordField, core/RenderObject, core/Select, core/Submit, core/TextArea, core/TextField. The code which appears to cause is: p t:comp type=Loop source=prop:1..10 value=prop:index ${index} /t:comp /p Libs include: tapestry-ioc-5.0.3.jar tapestry-core-5.0.3.jar javaassist-3.4.ga.jar commons-logging-1.0.4.jar Many thanks for your help. Jim -- View this message in context: http://www.nabble.com/T5---Unable-to-resolve-component-type-%27comp%27-to-a-component-class-name-tf3669522.html#a10252977 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Tapestry 5 and Template Reloading
hi bjorn,it works fine for me... where did you put your templates?do you get any exceptions? Have you tried the tutorial?you can put your templates into the WEB-INF/ folder or into the respective package... eg. my directory structure main/java/com/whatever/pages/Start.javamain/resources/com/whatever/pages/start.htmlg,kris-bjornharvold [EMAIL PROTECTED] schrieb: -An: users@tapestry.apache.orgVon: bjornharvold [EMAIL PROTECTED]Datum: 30.04.2007 09:06PMThema: Tapestry 5 and Template ReloadingI can't seem to get template reloading to work. Classes reload just fine. Iinstalled the latest Eclipse with JettyRunner and jetty 5.1. Anyone have thesame problem or better yet, the solution?thxbjorn-- View this message in context: http://www.nabble.com/Tapestry-5-and-Template-Reloading-tf3671362.html#a10258922Sent from the Tapestry - User mailing list archive at Nabble.com.-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[T5] IOC: services without interface do not work
hi all, when i try to return a service in my module that does not have an interface i get a No service implements the interface... exception. The recent blog entry suggests that it should work now .. http://tapestryjava.blogspot.com/2007/04/pleasing-crowds-improving-ioc-extending.html My module code is below. Am i missing something? Or maybe i'm just too eager to use it... :) I'm using the latest sources from the repository. MyModule.java public class MyModule { public static SimpleServiceImpl build() { return new SimpleServiceImpl(); } } g, kris btw. anyone tried to build tapestry 5 with java 1.6
Antwort: T5: How to acces to an array from loop?
the loop component provides an index parameter that contains the current iteration... t:loop source=1..16 index=row_count tr t:loop source=1..4 index=column_count td${value}/td /t:loop /tr /t:loop public Object getValue() { return _information[row_count][column_count]; } g, kris Sabine K. [EMAIL PROTECTED] 18.04.2007 10:40 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema T5: How to acces to an array from loop? Hello, i have this: table t:form t:id=form t:loop source=1.16 value=row tr t:loop source=1..4 value=column td${column} ${row}/td /t:loop /tr /t:loop /t:form /table In the class there is an array: _information[4][16]. How can i get the values out of the array in the right rows and columns? Best regards, Sabine -- View this message in context: http://www.nabble.com/T5%3A-How-to-acces-to-an-array-from-loop--tf3599642.html#a10054552 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: StackMapTable format error: bad class index
hi all, i get the above error message when i link from my home page to another page with exactly one component. i have no clue what's missing... (i'm using the latest classes from SVN) g, kris Home Page: public class Start { @InjectPage(guess) private Guess guessPage; public Object onAction() { return guessPage; } } Target Page: public class Guess { @Component(parameters={page=home},id=startPage) private PageLink startPage; public PageLink getStartPage() { return startPage; } } target template: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleGuess/title /head body div style=position:absolute;left:200px;top:50px; a href=# t:id=startPageGo back .../a
RE: T5: StackMapTable format error: bad class index
found my mistake the name of my home page is start and not home ... force of habit g kris Kristian Marinkovic [EMAIL PROTECTED] 18.04.2007 11:14 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie Thema T5: StackMapTable format error: bad class index hi all, i get the above error message when i link from my home page to another page with exactly one component. i have no clue what's missing... (i'm using the latest classes from SVN) g, kris Home Page: public class Start { @InjectPage(guess) private Guess guessPage; public Object onAction() { return guessPage; } } Target Page: public class Guess { @Component(parameters={page=home},id=startPage) private PageLink startPage; public PageLink getStartPage() { return startPage; } } target template: html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; head titleGuess/title /head body div style=position:absolute;left:200px;top:50px; a href=# t:id=startPageGo back .../a
Antwort: Event bubbling in IE doesn't work
hi diego, the EventListener is transfering the id of the surrounding div because the event does not reference the checkbox directly. it could be that the user clicked on a label element with a for attribute... technically the label element would trigger the event and not the checkbox thus referencing the dom node of the label. .. or maybe there is a node between input and /input ... maybe ff and ie handle this scenario differently... i'll test it and report my results on monday :) another solution would be to have a small script in place (onclick) that checks the incoming events on the div node and triggers the eventlistener (script) method only if it could determine it really originates from the checkbox... thats what i do for my bubbling events :) g, kris Diego [EMAIL PROTECTED] 13.04.2007 09:43 Bitte antworten an Tapestry users [EMAIL PROTECTED] An Tapestry users [EMAIL PROTECTED] Kopie Thema Event bubbling in IE doesn't work Hello, I want to use event bubbling to find out what checkbox is click with an Ajax call. To do this I attach the EventListener to a div surrounding the checkboxes. This works in firefox, the id of the checkbox is returned. But in IE the id of the surrounding div is returned. Is there a way to get the id of the clicked checkbox? Regards, Diego
T5: Loop with @Component does not work
hi, could someone help me to apply a T5 Loop with the @Component annotation? The following code does not work all the necessary getter/setter methods are in place (modification of T5 tutorial). ... or maybe the Loop is not meant to be used this way :) g, kris span t:id=looping a t:type=actionlink context=index${index}/a /span @Component(parameters={source=range,value=index}) public Loop looping; private static ListString range = new ArrayListString(); static { range.add(1); range.add(2); range.add(3); }
RE: T5: Loop with @Component does not work
hi all, sorry for my previous post of course it works!! my failure was that i had the Loop as public property without a getter method... if you do so you get an Error message in your log you should read :) g, kris Kristian Marinkovic [EMAIL PROTECTED] 13.04.2007 12:09 Bitte antworten an Tapestry users [EMAIL PROTECTED] An Tapestry users [EMAIL PROTECTED] Kopie Thema T5: Loop with @Component does not work hi, could someone help me to apply a T5 Loop with the @Component annotation? The following code does not work all the necessary getter/setter methods are in place (modification of T5 tutorial). ... or maybe the Loop is not meant to be used this way :) g, kris span t:id=looping a t:type=actionlink context=index${index}/a /span @Component(parameters={source=range,value=index}) public Loop looping; private static ListString range = new ArrayListString(); static { range.add(1); range.add(2); range.add(3); }
RE: What goes from Tapestry in Perm Gen Space? (Problem with tacos4-beta-2-lib and tapestry 4.0.2)
hi, the JVM uses the PermGenSpace to store the classes meta-information (eg. needed for reflection). Current JVMs do not support gc of the PermGenSpace. Everytime Tapestry enhances a class (filling the abstract classes and methods with life:)) a new class is generated and thus its meta-information get persisted into the PermGenSpace. This is true for any framework that does class enhancements like Hibernate, ... if your PermGenSpace keeps growing you might have Tapestry caching deactivated. This means Tapestry is enhancing the page classes on every action thus filling the PermGenSpace. It is also possible another framework is causing the problem :) g, kris ramona [EMAIL PROTECTED] 12.04.2007 10:59 Bitte antworten an Tapestry users [EMAIL PROTECTED] An [EMAIL PROTECTED] Kopie Thema What goes from Tapestry in Perm Gen Space? (Problem with tacos4-beta-2-lib and tapestry 4.0.2) Hi, I'm new to Tapestry. I have an web application and I'm using Spring, Hibernate3 and it works with ajax using tacos4-beta-2-lib. My application uses one page and in this page many componentes are loaded with tacos. I have one ASO that contains all. My problem is that I looked to jvmstat via visualgc and the PermGenSpace memory becomes greater almost to each action that I do in the application. I serch about this problem on the internet and I found out that in PermGenSpace are store Classes and String.intern. So my questions for the moment are: What goes from Tapestry in Perm Gen Space? Can gc clear the PermGenSpace? On logout ?service=restart why PermGenSpace doesn't been clear? Please help! Thanks in advance! -- View this message in context: http://www.nabble.com/What-goes-from-Tapestry-in-Perm-Gen-Space--%28Problem-with-tacos4-beta-2-lib-and-tapestry-4.0.2%29-tf3564252.html#a9955548 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: help injecting tate objects
hi, this happens because you access the Person object before it is instantiated. the easiest thing is to add a if before your input to check whether the object is null in tapestry 4.1 theres is the InjectStateFlag annotation that returns true if your ASO is instantiated or you can instantiate your Person object during the init phase of your page by accessing it once g, kris Andrea Chiumenti [EMAIL PROTECTED] 12.04.2007 15:01 Bitte antworten an Tapestry users [EMAIL PROTECTED] An Tapestry users [EMAIL PROTECTED] Kopie Thema help injecting tate objects hello I've the following problem: hivemodule.xml . contribution configuration-id=tapestry.state.ApplicationObjects state-object name=wizardPerson scope=session create-instance class=org.jfly.demo.edittable.vo.Person / /state-object /contribution page template: ... inject property=person type=state object=wizardPerson/ ... html template: . input jwcid=@Insert value=ognl:person.name/ . The exception thrown when I access the page is: log ognl.OgnlException: person [java.lang.IllegalStateException: Cannot create a session after the response has been committed] at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1046) at ognl.ObjectPropertyAccessor.getPossibleProperty( ObjectPropertyAccessor.java:60) at ognl.ObjectPropertyAccessor.getProperty( ObjectPropertyAccessor.java:134) .. page: Unable to parse OGNL expression 'person.name': Error compiling expression on object [EMAIL PROTECTED] with expression node person.name getter body: null setter body: null How can I solve this ?
Antwort: Re: help injecting tate objects
to instantiate your object implement the PageBeginRenderListener interface and invoke the abstract method that returns the ASO (Person) and it will be created :) g, kris ps.: i think there was some talk about eager loading ASOs some weeks or month ago i'm not sure Kristian Marinkovic [EMAIL PROTECTED] 12.04.2007 15:35 Bitte antworten an Tapestry users [EMAIL PROTECTED] An Tapestry users [EMAIL PROTECTED] Kopie Thema Antwort: Re: help injecting tate objects hi andrea, not exactly... the Person object (ASO) is persisted in the session when it is accessed the first time... if there is no session, it will create a new one :) g, kris Andrea Chiumenti [EMAIL PROTECTED] 12.04.2007 15:27 Bitte antworten an Tapestry users [EMAIL PROTECTED] An Tapestry users [EMAIL PROTECTED] Kopie Thema Re: help injecting tate objects Thx Kristian, but I'm using jdk 1.4 so I can't use InjectStateFlag, so isn't possible to initiate the object via configuration file ? doesn't state-object name=wizardPerson scope=session create-instance class=org.jfly.demo.edittable.vo.Person / /state-object create an instance of Person when Session is first created ? On 4/12/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi, this happens because you access the Person object before it is instantiated. the easiest thing is to add a if before your input to check whether the object is null in tapestry 4.1 theres is the InjectStateFlag annotation that returns true if your ASO is instantiated or you can instantiate your Person object during the init phase of your page by accessing it once g, kris Andrea Chiumenti [EMAIL PROTECTED] 12.04.2007 15:01 Bitte antworten an Tapestry users [EMAIL PROTECTED] An Tapestry users [EMAIL PROTECTED] Kopie Thema help injecting tate objects hello I've the following problem: hivemodule.xml . contribution configuration-id=tapestry.state.ApplicationObjects state-object name=wizardPerson scope=session create-instance class=org.jfly.demo.edittable.vo.Person / /state-object /contribution page template: ... inject property=person type=state object=wizardPerson/ ... html template: . input jwcid=@Insert value=ognl:person.name/ . The exception thrown when I access the page is: log ognl.OgnlException: person [java.lang.IllegalStateException: Cannot create a session after the response has been committed] at ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:1046) at ognl.ObjectPropertyAccessor.getPossibleProperty( ObjectPropertyAccessor.java:60) at ognl.ObjectPropertyAccessor.getProperty( ObjectPropertyAccessor.java:134) .. page: Unable to parse OGNL expression 'person.name': Error compiling expression on object [EMAIL PROTECTED] with expression node person.name getter body: null setter body: null How can I solve this ?
Antwort: Re: Session
i think a better strategy is to reduce the sesion-timeout in the web.xml to lets say 2mins and to implement a javascript function that issues periodic keep-alive requests every 1.5mins or so. thus preventing the session from expiring... and when someone closes his browser the session will not stay in memory for too long :) g, kris Tim Sawyer [EMAIL PROTECTED] 22.03.2007 11:10 Bitte antworten an Tapestry users users@tapestry.apache.org An users@tapestry.apache.org Kopie James Sherwood [EMAIL PROTECTED] Thema Re: Session I believe the timeout for this is configured through web.xml session-config session-timeout30/session-timeout !-- minutes -- /session-config Tim. On Tuesday 20 March 2007 17:16, James Sherwood wrote: Hello, We have an admin side with a user login etc. The problem is, the session times out after soo many minutes(we run under tomcat) of being idle and they user has to log back in. Is there any way to make this indefinate and if so, is there any impact on resources etc? Thanks, James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Eclipse is very Slow - What do i have to do be more fast the developing?
use the jetty plugin; its a small servlet container that starts VERY quickly! my startup times dropped from 15sec to 2sec!! Bruno Mignoni [EMAIL PROTECTED] 12.03.2007 13:55 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Eclipse is very Slow - What do i have to do be more fast the developing? I am developing with Eclipse + WTP + TomCat 5.5 + Tapestry 4.0.2 . That was confired using Wiki (link: http://wiki.apache.org/tapestry/HowToSetupEclipseWtp?highlight=%28Eclipse%29 ) I have Pentium 4 3.40 Ghz + 1 GB Ram and is running correctly. The developing is very slow, each modification that I do, i need to restart Tomcat ( 30 s ) to work. What do i have to do be more fast the developing? -- __ Bruno Mignoni [EMAIL PROTECTED]
Re: Re: Eclipse is very Slow - What do i have to do be more fast the developing?
hls wrote a good tutorial in his T5 tutorial: http://tapestry.apache.org/tapestry5/t5-tutorial.pdf jetty setup is not different for T4 g, kris Bruno Mignoni [EMAIL PROTECTED] 12.03.2007 14:25 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Re: Eclipse is very Slow - What do i have to do be more fast the developing? Do you Have a Tutorial to install and configure? I use Windows XP + Eclipse + WTP + Tomcat 5.5 + Tapestry 4.0.2. Jetty and Tomcat works at the same time in my project in Eclipse? Jetty 5 or Jetty 6 ? ;-) Bruno Mignoni On 3/12/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: use the jetty plugin; its a small servlet container that starts VERY quickly! my startup times dropped from 15sec to 2sec!! Bruno Mignoni [EMAIL PROTECTED] 12.03.2007 13:55 Bitte antworten an Tapestry users users@tapestry.apache.org An Tapestry users users@tapestry.apache.org Kopie Thema Eclipse is very Slow - What do i have to do be more fast the developing? I am developing with Eclipse + WTP + TomCat 5.5 + Tapestry 4.0.2 . That was confired using Wiki (link: http://wiki.apache.org/tapestry/HowToSetupEclipseWtp?highlight=%28Eclipse%29 ) I have Pentium 4 3.40 Ghz + 1 GB Ram and is running correctly. The developing is very slow, each modification that I do, i need to restart Tomcat ( 30 s ) to work. What do i have to do be more fast the developing? -- __ Bruno Mignoni [EMAIL PROTECTED] -- __ Bruno Mignoni [EMAIL PROTECTED]
Antwort: Re: method name of listener
definining a listener for my component looks sth like this (Tap standard): component id=asyncOrder type=cross:AsyncListenerCaller binding name=listener value=listener:contactOrder / ... /component in my component i have a method returning a IActionListener: public abstract IActionListener getListener(); now i want to generate a js function with the same name and i dont know how to get it from IActionListener (at least i found no public methods:)). My workaround is to add another component parameter that contains the name of the listener as a literal. ... i hope this does not sound that stupid :) Jesse Kuhnert [EMAIL PROTECTED] omAn Tapestry users 06.03.2007 05:01 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: method name of listener Tapestry users [EMAIL PROTECTED] pache.org Isn't the name of a listener known by the very definition? I mean, when ~don't~ you know the name of it? On 2/19/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi all, is there a way to obtain the method name of a listener? I need it to generate a javascript function with the same name. calling this js function will trigger an asynchronous XHR call (Tapestry.bind) that triggers the corresponding listener. The js method also accepts parameters that get send to the page. in case anyone else needs this very, very simple component i'll post it somewhere. g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4: render empty Ajax response
hi, how do i render an empty ajax response? i'm sending an ajax request to synchronize the model with the view but i do not need any information back except an acknowledgement that my request was received and processed. g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T4: AJAX request from a page with a dojo editor causes exception
hi all, when i try to send data via tapestry.bind to my Tapestry page from a page with a dojo editor (editor2) i get following javascript exception: [exception] DEBUG: [Exception... Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.open] nsresult: 0x80004005 (NS_ERROR_FAILURE) location: JS frame :: http://localhost:8080/gp/js/dojo.js.uncompressed.js :: anonymous :: line 10642 data: no] when calling onKeyPress$joinpoint$method on [Widget dojo:editor2, dojo_Editor2_0] with arguments [object Object] FATAL exception raised: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIXMLHttpRequest.open] [/exception] i set up a maven project where i can reproduce this anytime but i dont know what is causing this exception. When i view the raw html template in FF (... the not generated html ) everything works fine. i hope someone can give me a hint. is it related to the keyhandlers of the editor? why does it matter if do a ajax call? please help my code looks like this: editor.js var editor = null; function startEdit(e) { editor = dojo.widget.createWidget(Editor2, { toolbarTemplatePath:null }, dojo.byId(edit)); var k = dojo.event.browser.keys; // listen to key events editor.addKeyHandler(k.KEY_ESCAPE,null,listenESC); editor.addKeyHandler(k.KEY_ENTER ,null,listenENTER); } function initEditor() { dojo.event.connect(dojo.byId(edit), ondblclick, startEdit); } function listenESC() {} function listenENTER() { ... asyncListenerDoSave(data); ... } asyncCaller component: dojo.require(dojo.dom); dojo.require(dojo.dnd.*); dojo.require(dojo.event.*); dojo.require(dojo.widget.*); dojo.require(dojo.widget.Editor2); dojo.require(tapestry.event); function asyncListenerDoSave(data) { tapestry.bind(/gp/app?component=asyncpage=Editorservice=direct, data, false); } g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: client side interception of responce to 'updateComponent()'
will be called after any ajax resoibse has been received dojo.event.connect(tapestry,load,function(e) { alert(loaded);} ); g, kris Alexander Haritonov Alexander.Harito An [EMAIL PROTECTED]users@tapestry.apache.org Gesendet von: Kopie news [EMAIL PROTECTED] Thema rgclient side interception of responce to 'updateComponent()' 21.02.2007 16:42 Bitte antworten an Tapestry users [EMAIL PROTECTED] pache.org i'd like to trigger a javascript-function after a Tapestry-component is updated with 'cycle.getResponseBuilder().updateComponent()' Does somebody know, how one can do it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: User submit confirmation
hi marcos, in case you use the EventListener with the elements attribute (dom nodes) kind of [EMAIL PROTECTED](events={onclick},elements=domNode) you can see that the dom node has an event listener attached for onclick. using dojo it is possible to add a function to this dom node that gets executed before the onclick using a before advice. (plain old javascript is possible too, but not that elegant:)) please use the following link to see how. http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book12 .. should work for any other Tapestry component too. you just have to identify the dom node. g, kris Marcos Chicote [EMAIL PROTECTED] nologies.com.ar An Tapestry users 22.02.2007 15:19 users@tapestry.apache.org Kopie Bitte antwortenThema an User submit confirmation Tapestry users [EMAIL PROTECTED] pache.org Hi! I'm using Tapestry 4.1 and I can't get a async form submit to work as I would like. What I want is that when the user clicks on the submit button a javascript confirm window pops up and the user confirms his decision to submit the form or not. If he clicks the Cancel button I don't want any kind of submit to occur. Only if he confirms the submit should take place. Here is the html for my submit button. span jwcid=boton value=Boton Submit id=submit1/ script type=text/javascript dojo.event.connect(dojo.byId(submit1), onclick, function(e) { if (!confirm('Are you sure?')) { e.cancel_handlers=true; return false; } return true; }); /script But this doesn't work. Can anybody tell me how to do this? Or at least an idea of what I need to read to do this? Thanks Marcos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with including static javascript file
hi all, i'm not able to include a static javascript file into my page. could someone point me the right way how can i include a static javascript file into my page when using the @Body and @Shell component? thats what i have so far: .script file located at WEB-INF/web: script include-script resource-path=static.js / body /body initialization myinit(); /initialization /script static.js is located : WEB-INF/web/static.js the rendered page has following url: script type=text/javascript src=/gp/WEB-INF/web/static.js/script i even tried to put into the classpath but with no success. the path of static.js always gets the web prefix (folder of my .script file ) thanks kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Creating AbstractComponent with .script
Hi all, maybe a dumb question... but how do i force an AbstractComponent to render the injected script? I could not figure out how to obtain the instances required to call getScript.execute(..objects?..). this is what i have so far: @InjectScript(CompWithScript.script) public abstract IScript getScript(); @Override protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { writer.begin(div); // stuff writer.end(); // produces NPE //getScript().execute(this, cycle, new DefaultResponseBuilder(writer), java.util.Collections.EMPTY_MAP); } g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Creating AbstractComponent with .script
thank you very much... g, kris Shing Hing Man [EMAIL PROTECTED] An Tapestry users 19.02.2007 11:42 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: Creating AbstractComponent Tapestry users with .script [EMAIL PROTECTED] pache.org Try to put something like the following at end of your rendercomponent method. PageRenderSupport pageRenderSupport = TapestryUtils .getPageRenderSupport(cycle, this); Map symbols = new HashMap(); symbols.put(colorPicker, this); _script.execute(cycle, pageRenderSupport, symbols); Shing --- Kristian Marinkovic [EMAIL PROTECTED] wrote: Hi all, maybe a dumb question... but how do i force an AbstractComponent to render the injected script? I could not figure out how to obtain the instances required to call getScript.execute(..objects?..). this is what i have so far: @InjectScript(CompWithScript.script) public abstract IScript getScript(); @Override protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { writer.begin(div); // stuff writer.end(); // produces NPE //getScript().execute(this, cycle, new DefaultResponseBuilder(writer), java.util.Collections.EMPTY_MAP); } g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Home page : http://uk.geocities.com/matmsh/index.html ___ New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the Yahoo! Mail Championships. Plus: play games and win prizes. http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
method name of listener
hi all, is there a way to obtain the method name of a listener? I need it to generate a javascript function with the same name. calling this js function will trigger an asynchronous XHR call (Tapestry.bind) that triggers the corresponding listener. The js method also accepts parameters that get send to the page. in case anyone else needs this very, very simple component i'll post it somewhere. g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
@EventListener: adding custom data to map in BrowserEvent
hi all, is it possible to add some custom data to a call produced by a @EventListener so it appears in the map of the BrowserEvent class? or the other way around :)... does anyone else consider this an useful feature? so why do i need it: i have some drag-n-drop elements in two lists that can be dragged and dropped form one list to another. Now i want to send the elements ids back to the page in order to reflect the changes on my client in the backing data ... using an async. call. the only other way of doing this is to generate an input hidden element with the elemetns ids (in order) that is being submitted to the server when the submitForm parameter of the EventListener is used. g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @EventListener: adding custom data to map in BrowserEvent
thank you ... i just just found https://issues.apache.org/jira/browse/TAPESTRY-1202 ... stupid me ... at least i voted for it :) kris Alexandru Dragomir [EMAIL PROTECTED] An ail.com Tapestry users users@tapestry.apache.org 16.02.2007 12:30Kopie Thema Bitte antworten Re: @EventListener: adding custom an data to map in BrowserEvent Tapestry users [EMAIL PROTECTED] pache.org As far as i know this is not possible yet. There is a jira request registered for it. In the mean time you might use directly the js function provided by tapestry linkOnClick which does the job very well. I think you can find an example of how to use it in the autocompleter component. Alex On 2/16/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi all, is it possible to add some custom data to a call produced by a @EventListener so it appears in the map of the BrowserEvent class? or the other way around :)... does anyone else consider this an useful feature? so why do i need it: i have some drag-n-drop elements in two lists that can be dragged and dropped form one list to another. Now i want to send the elements ids back to the page in order to reflect the changes on my client in the backing data ... using an async. call. the only other way of doing this is to generate an input hidden element with the elemetns ids (in order) that is being submitted to the server when the submitForm parameter of the EventListener is used. g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: For loop with checkboxes that use ajax
hi diego, the simplest way is to add an EventListener to the parent node of the checkboxes add to take advantage of the javascript event model (event bubbling, event delegation). ... lets say you are enclosing your checkboxes with a DIV tag div id=checkboxes //for loop for checkboxes /div in your page class you write something like this: @EventListener(events = { onclick }, targets=checkboxes) public void doSometing(BrowserEvent event) { } Any time the checkboxes are clicked on (onclick) the event will bubble up the DOM tree and notify every node of its occurance. If the node contains an onclick event listener it will be called. An Event object will be passed over to the event listener (in IE its a bit different:)). This object knows what event occured and exactly on which node (... in this case the checkboxes) The EventListener javacript code analyses this event and passes it through the EventTarget object to the page class. The EventTarget is contained within the BrowserEvent object. As we cannot send the DOM node it will send us the id of the DOM node (if present) back to the page class where we can use it to trigger a action. it is important to check if the sent id really originates from the checkboxes (id prefix) because other nodes within the div may send onclick events too. i hope this helps this technique may also be used to add EventListener to elemetns within a loop! read more on Events as www.quirksmode.org greetings, kris Diego [EMAIL PROTECTED] com An Tapestry users 12.02.2007 16:23 users@tapestry.apache.org Kopie Bitte antwortenThema an For loop with checkboxes that use Tapestry users ajax [EMAIL PROTECTED] pache.org Hello, I am starting to use Tapestry 4.1.1 and want to build a filter with checkboxes that filters a result list. The checkboxes are being generated from a list and when a checkbox is checked a list is filtered by means of a Ajax call. After that the results in the div with id=SearchResults is updated. Is there someway to use the @EventListener for this? Because beforehand don't know how many check boxes there will be. Below is an example template: SPAN jwcid=@For source=ognl:listCheckBoxes value=ognl:checkId input jwcid=@Checkbox id=ognl:checkId value=ognl:checkboxValue/ /SPAN div class=SearchResults id=SearchResults table tr jwcid=[EMAIL PROTECTED] source=ognl:foundList value=ognl:foundItem element=tr td table tr td span jwcid=@Insert value=ognl:concept/ /td /tr /table /td /tr /table /div Regards, Diego - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Re: For loop with checkboxes that use ajax
please try the project i uploaded with following bug https://issues.apache.org/jira/browse/TAPESTRY-1241 when you click on a list item it will trigger an event should work to with form elements too greetings kris Diego [EMAIL PROTECTED] com An Tapestry users 13.02.2007 15:29 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: For loop with checkboxes that Tapestry users use ajax [EMAIL PROTECTED] pache.org Hello Kris, Thank for you answer. I tried what you suggested but I couldn't get it to work. When a checkbox is clicked it look like there is a HTTPXMLRequest but the listener in Tapestry is not fired. But I did get it to work by changing the EventListener: @EventListener(elements = conceptFilter, events = {onchange}, submitForm=testForm, async=true) public void watchText(BrowserEvent event) { //do things } And the id's of the checkboxes should start with the same id as the surrounding DIV for it to work. Don't know why it works like this, magic? span jwcid=[EMAIL PROTECTED] div id=checkboxes SPAN jwcid=@For source=ognl:listCheckBoxes value=ognl:checkId input jwcid=@Checkbox id=ognl:'checkboxes_'+checkId value=ognl:checkboxValue/ /SPAN /div /span Regards, Diego On 2/13/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi diego, the simplest way is to add an EventListener to the parent node of the checkboxes add to take advantage of the javascript event model (event bubbling, event delegation). ... lets say you are enclosing your checkboxes with a DIV tag div id=checkboxes //for loop for checkboxes /div in your page class you write something like this: @EventListener(events = { onclick }, targets=checkboxes) public void doSometing(BrowserEvent event) { } Any time the checkboxes are clicked on (onclick) the event will bubble up the DOM tree and notify every node of its occurance. If the node contains an onclick event listener it will be called. An Event object will be passed over to the event listener (in IE its a bit different:)). This object knows what event occured and exactly on which node (... in this case the checkboxes) The EventListener javacript code analyses this event and passes it through the EventTarget object to the page class. The EventTarget is contained within the BrowserEvent object. As we cannot send the DOM node it will send us the id of the DOM node (if present) back to the page class where we can use it to trigger a action. it is important to check if the sent id really originates from the checkboxes (id prefix) because other nodes within the div may send onclick events too. i hope this helps this technique may also be used to add EventListener to elemetns within a loop! read more on Events as www.quirksmode.org greetings, kris Diego [EMAIL PROTECTED] com An Tapestry users 12.02.2007 16:23 users@tapestry.apache.org Kopie Bitte antworten Thema an For loop with checkboxes that use Tapestry users ajax [EMAIL PROTECTED] pache.org Hello, I am starting to use Tapestry 4.1.1 and want to build a filter with checkboxes that filters a result list. The checkboxes are being generated from a list and when a checkbox is checked a list is filtered by means of a Ajax call. After that the results in the div with id=SearchResults is updated. Is there someway to use the @EventListener for this? Because beforehand don't know how many check boxes there will be. Below is an example template: SPAN jwcid=@For source=ognl:listCheckBoxes value=ognl:checkId input jwcid=@Checkbox id=ognl:checkId value=ognl:checkboxValue/ /SPAN
AW: Multiple method calls per page request (HivemindTapestry)
hi tobias, is there any reason you create the DomainManager with model=threaded? Have you thought of creating an ASO (session) where you inject your DomainSource object? g, kris Tobias Marx [EMAIL PROTECTED] An 09.02.2007 12:34 users@tapestry.apache.org Kopie Bitte antwortenThema an Multiple method calls per page Tapestry users request (HivemindTapestry) [EMAIL PROTECTED] pache.org Hi there! I am using Hivemind to generate a Map of Domain name related objects as a singleton on startup, called HibernateDomainSource. Then I am constructing a threaded services that uses this data together with the servletRequest. This service is called DomainManager. I am now injecting the DomainManager into my base component in order to access a domain object from the HibernateDomainSource that corresponds to the domain name from the servlet Request. service-point id=HibernateDomainSource interface=tm.framework.services.interfaces.IDomainSource invoke-factory model=singleton construct class=tm.framework.services.HibernateDomainSource set-service property=templatePersistenceService service-id=TemplatePersistenceService/ /construct /invoke-factory /service-point service-point id=DomainManager interface=tm.framework.services.interfaces.DomainManager invoke-factory model=threaded construct class=tm.framework.services.DomainManagerImpl set-service property=domainSource service-id=HibernateDomainSource/ set-service property=servletRequest service-id=tapestry.globals.HttpServletRequest / /construct /invoke-factory /service-point The problem now is, that the DomainManager method that fetches the domain object from the map is called several times during a single page request. Is there a way to force it to only fetch it once per page request? Thanks! Toby - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: LinkSubmit and null parameters
hi jesse, this bug is filed as https://issues.apache.org/jira/browse/TAPESTRY-1240 greetings kris Jesse Kuhnert [EMAIL PROTECTED] omAn Tapestry users 05.02.2007 05:30 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: LinkSubmit and null parameters Tapestry users [EMAIL PROTECTED] pache.org Sounds like a possible bug. As with all issues, creating a JIRA issue is the best hope anyone has of having something fixed. On 1/23/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi all, i just noticed that if an LinkSubmit component with a parameters binding to a TextField causes an exception (on submit) if that input field remains empty (null). The reason is that the listener bound to the LinkSubmit requires exactly one parameter. And if the TextField remains empty Tapestry tries to resolve a listener with no parameters that does not exist. This exception happens even if the TextField has a required validator assigned to. Is that an expected behaviour? component id=lnk_read type=LinkSubmit binding name=listener value=listener:readGPList / binding name=parameters value=searchFieldValue / /component component id=txtSearchField type=TextField binding name=value value=searchFieldValue / binding name=validators value=validators:required,min=2 / /component property name=searchFieldValue / g, kris P.S. i'm using Tapestry 4.1.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: LinkSubmit and null parameters
i will try as you propose :) but what bothers me is that i have a validator applied to the TextField. Shouldn't Tapestry check the validators before it proceeds to execute the listeners? I'm must admit, i'm not aware at which point of the request processing lifecycle validation is done. i was always expecting validators are always evalutated before anything else. can you give me some hints/clarifications? g, kris andyhot [EMAIL PROTECTED] r An Gesendet von: Tapestry users andreas a users@tapestry.apache.org [EMAIL PROTECTED] Kopie om Thema Re: LinkSubmit and null parameters 06.02.2007 10:48 Bitte antworten an Tapestry users [EMAIL PROTECTED] pache.org The parameter of your LinkSumbit will always by null because when the link is constructed (at render time) that's what the value of searchFieldValue is. Now regarding listeners and null values, I think it was discussed a year ago and that this behaviour is the expected one. If you want to be able to check for nulls, you can: - Make the method accept the RequestCycle parameter and use that to get the parameters - or, use binding name=parameters value={searchFieldValue} / (it should work) So, i feel that TAPESTRY-1240 is invalid Kristian Marinkovic wrote: hi all, i just noticed that if an LinkSubmit component with a parameters binding to a TextField causes an exception (on submit) if that input field remains empty (null). The reason is that the listener bound to the LinkSubmit requires exactly one parameter. And if the TextField remains empty Tapestry tries to resolve a listener with no parameters that does not exist. This exception happens even if the TextField has a required validator assigned to. Is that an expected behaviour? component id=lnk_read type=LinkSubmit binding name=listener value=listener:readGPList / binding name=parameters value=searchFieldValue / /component component id=txtSearchField type=TextField binding name=value value=searchFieldValue / binding name=validators value=validators:required,min=2 / /component property name=searchFieldValue / g, kris P.S. i'm using Tapestry 4.1.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: LinkSubmit and null parameters
this where my considerations: - i have a listener with useful parameter names/types - i do not have to define any abstract properties thus keeping my controller class simpler and cleaner (.. and less code in .page :)) andyhot [EMAIL PROTECTED] r An Gesendet von: Tapestry users andreas a users@tapestry.apache.org [EMAIL PROTECTED] Kopie om Thema Re: LinkSubmit and null parameters 06.02.2007 11:27 Bitte antworten an Tapestry users [EMAIL PROTECTED] pache.org ok, let's see... if you have a form that includes a (validated) TextField, and a LinkSubmit for that form, why use a parameter? Kristian Marinkovic wrote: i will try as you propose :) but what bothers me is that i have a validator applied to the TextField. Shouldn't Tapestry check the validators before it proceeds to execute the listeners? I'm must admit, i'm not aware at which point of the request processing lifecycle validation is done. i was always expecting validators are always evalutated before anything else. can you give me some hints/clarifications? g, kris andyhot [EMAIL PROTECTED] r An Gesendet von: Tapestry users andreas a users@tapestry.apache.org [EMAIL PROTECTED] Kopie om Thema Re: LinkSubmit and null parameters 06.02.2007 10:48 Bitte antworten an Tapestry users [EMAIL PROTECTED] pache.org The parameter of your LinkSumbit will always by null because when the link is constructed (at render time) that's what the value of searchFieldValue is. Now regarding listeners and null values, I think it was discussed a year ago and that this behaviour is the expected one. If you want to be able to check for nulls, you can: - Make the method accept the RequestCycle parameter and use that to get the parameters - or, use binding name=parameters value={searchFieldValue} / (it should work) So, i feel that TAPESTRY-1240 is invalid Kristian Marinkovic wrote: hi all, i just noticed that if an LinkSubmit component with a parameters binding to a TextField causes an exception (on submit) if that input field remains empty (null). The reason is that the listener bound to the LinkSubmit requires exactly one parameter. And if the TextField remains empty Tapestry tries to resolve a listener with no parameters that does not exist. This exception happens even if the TextField has a required validator assigned to. Is that an expected behaviour? component id=lnk_read type=LinkSubmit binding name=listener value=listener:readGPList / binding name=parameters value=searchFieldValue / /component component id=txtSearchField type=TextField binding name=value value=searchFieldValue / binding name=validators value=validators:required,min=2 / /component property name=searchFieldValue / g, kris P.S. i'm using Tapestry 4.1.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr Tapestry / Tacos developer Open Source / J2EE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Antwort: Re: multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)
hi jesse, bug is filed under: https://issues.apache.org/jira/browse/TAPESTRY-1241 it contains a maven project and instructions to reproduce the bug g, kris Jesse Kuhnert [EMAIL PROTECTED] omAn Tapestry users 05.02.2007 05:37 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: multiple events fired on Tapestry users @EventListener although it should [EMAIL PROTECTED] fire once (Tapestry 4.1.1 pache.org /4.1.2-20070121) Need more information probably, or a jira issue with some sort of reasonable test case. The situation you are describing sounds almost identical to : http://opencomponentry.com:8080/timetracker/LocaleList.htm Maybe there is something different for you? JIRA . On 1/24/07, Kristian Marinkovic [EMAIL PROTECTED] wrote: [update] i just discovered that the Javascript code gets generated again for every iteration of the For component... but the event reaches the java class at most twice. hope this helps Kristian Marinkovic kristian.marinko An [EMAIL PROTECTED] Tapestry users users@tapestry.apache.org Kopie 24.01.2007 15:21 Thema multiple events fired on Bitte antworten @EventListener although it should an fire once (Tapestry 4.1.1 Tapestry users /4.1.2-20070121) [EMAIL PROTECTED] pache.org Hi, the DIV element within the For component has an @EventListener attached. When i click on it my listener method SOMETIMES gets invoked more than once!!! (twice) This happens in 4.1.1 and 4.1.2-SNAPSHOT (20070121). From the generated HTML page i can see that the Javascript code for attaching the events gets generated twice... but only sometimes :) Anyone experienced the same problem? Is it a bug? Any workaround would be appreciated. html file li jwcid=list_gp div jwcid=[EMAIL PROTECTED] class=ognl:classForGP p span jwcid=list_gp_infolastname, firstname, zip city/span /p /div /li page file component id=list_gp type=For binding name=source value=ognl:GPList / binding name=value value=gpObject / /component java file @EventListener(events={onclick},targets=gpdiv) public void doClick(BrowserEvent event) { System.out.println(click: + event.getTarget().get(id)); } greetings kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)
[update] i created a jira entry with a maven2 project to reproduce the bug https://issues.apache.org/jira/browse/TAPESTRY-1241 i hope this problem gets resolved soon as it poses a severe problem of the @EventListener g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: WANTED: Tapestry Success Stories
I met Oliver Tigges on a german java conference in 2006. He told me he has a Tapestry 3 + XTiles application with several hundred concurrent users runnig. This applications is internal for a bank. He works at BV Risk Solutions i think ... you could contact him for more details or maybe he is reading this post :) g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple events fired on @EventListener although it should fire once (Tapestry 4.1.1/4.1.2-20070121)
Hi, the DIV element within the For component has an @EventListener attached. When i click on it my listener method SOMETIMES gets invoked more than once!!! (twice) This happens in 4.1.1 and 4.1.2-SNAPSHOT (20070121). From the generated HTML page i can see that the Javascript code for attaching the events gets generated twice... but only sometimes :) Anyone experienced the same problem? Is it a bug? Any workaround would be appreciated. html file li jwcid=list_gp div jwcid=[EMAIL PROTECTED] class=ognl:classForGP p span jwcid=list_gp_infolastname, firstname, zip city/span /p /div /li page file component id=list_gp type=For binding name=source value=ognl:GPList / binding name=value value=gpObject / /component java file @EventListener(events={onclick},targets=gpdiv) public void doClick(BrowserEvent event) { System.out.println(click: + event.getTarget().get(id)); } greetings kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] web framework poll
hi tapestry user, there is a poll by a german java magazine to determine the usage of certain web frameworks in current projects (http://www.javamagazin.de in the middle of the page). Maybe you could vote too :) g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: JSR-168/268 support and Tapestry 5.0
hi konstantin,IMHO portlets are going to get more and more important. if you lookat the new portlets 2.0 spec you will see AJAX defined to reload portletcontent, an event mechanism to notify one or more portlets, a new interportlet communication protocol, central session handling aso. With this spec (still in public review) it will be possible to write portals that behavelike "web 2.0" sites but in fact are composed of different web apps.Portlets serve as THE integration API to combine different web applicationsinto a single one. A scenario may be in a big company that already uses 2 (or several) web applications to cover their processes (written in different frameworks). They may conclude that the processes could by better supported if the users had parts of both applications configured into one workbench to see dependencies and impacts immediatly. Thats where portlets 2.0 comes into play :)so i think an integration of Tapestry 5 with portlet 2.0 is necessary )g,krisAn: Tapestry users users@tapestry.apache.orgVon: Konstantin Ignatyev [EMAIL PROTECTED]Datum: 29.12.2006 10:15PMThema: Re: JSR-168/268 support and Tapestry 5.0does it make sense at all to support portals? Doespeople still use and develop portals?I mean that with the AJAX proliferation it looks like "Clientlets" make much more sense than Portlets andtherefore Portals in a sense of JSR-168 are headed tooblivion.What is the peoples' experience and opinion?--- Howard Lewis Ship [EMAIL PROTECTED] wrote: That should be "action" requests and "render" requests. The fact that servlet Tapestry 5 differentiates between the two will make it easier, or at least make it more consistent, for portlet Tapestry 5. On 12/29/06, Jan Vissers [EMAIL PROTECTED] wrote: Konstantin IgnatyevPS: If this is a typical day on planet earth, humans will add fifteen million tons of carbon to the atmosphere, destroy 115 square miles of tropical rainforest, create seventy-two miles of desert, eliminate between forty to one hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of CFCs to the stratosphere, and increase their population by 263,000Bowers, C.A. The Culture of Denial: Why the Environmental Movement Needs a Strategy for Reforming Universities and Public Schools. New York: State University of New York Press, 1997: (4) (5) (p.206)-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Image localization with css
Hi, you could generated a CSS with a @Import statement that depends on language and style kind of: main.css: /* all default rules that apply to all styles */ /* if lang=en */ @IMPORT url(lang_en.css); /* else */ @IMPORT url(lang_default.css) /*end */ lang_en.css: /* just the rules that are different (background-image,) */ g, kris Denis McCarthy [EMAIL PROTECTED] letech.comAn Tapestry users 03.11.2006 12:52 users@tapestry.apache.org Kopie Bitte antwortenThema an Image localization with css Tapestry users [EMAIL PROTECTED] pache.org Hi, I need to support both localized images and images with several css styles. For example, say I've 2 css files, CSS1 and CSS2, and need to support 2 languages, EN and ES. What I'd like to support is 4 images like this: img_CSS1_EN img_CSS1_ES img_CSS2_EN img_CSS2_ES , each one appearing according to the style and locale selection It's possible to localize the images using the @Image component, but I'm not sure whether its possible to get this to play well with multiple stylesheets (css doesn't seem to allow the definition of the src attribute for img classes). My only solution I have at the moment is the rather awkward one of having a css file per locale per style - I'd prefer to only have a css file per style and let tapestry look after the localization - including the images. Has anyone had this requirement before, and how did they solve it? Thanks Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Image localization with css
of course you could move this @Import statement into your HTML template :) Kristian Marinkovic kristian.marinko An [EMAIL PROTECTED] Tapestry users users@tapestry.apache.org Kopie 03.11.2006 13:02 Thema RE: Image localization with css Bitte antworten an Tapestry users [EMAIL PROTECTED] pache.org Hi, you could generated a CSS with a @Import statement that depends on language and style kind of: main.css: /* all default rules that apply to all styles */ /* if lang=en */ @IMPORT url(lang_en.css); /* else */ @IMPORT url(lang_default.css) /*end */ lang_en.css: /* just the rules that are different (background-image,) */ g, kris Denis McCarthy [EMAIL PROTECTED] letech.comAn Tapestry users 03.11.2006 12:52 users@tapestry.apache.org Kopie Bitte antwortenThema an Image localization with css Tapestry users [EMAIL PROTECTED] pache.org Hi, I need to support both localized images and images with several css styles. For example, say I've 2 css files, CSS1 and CSS2, and need to support 2 languages, EN and ES. What I'd like to support is 4 images like this: img_CSS1_EN img_CSS1_ES img_CSS2_EN img_CSS2_ES , each one appearing according to the style and locale selection It's possible to localize the images using the @Image component, but I'm not sure whether its possible to get this to play well with multiple stylesheets (css doesn't seem to allow the definition of the src attribute for img classes). My only solution I have at the moment is the rather awkward one of having a css file per locale per style - I'd prefer to only have a css file per style and let tapestry look after the localization - including the images. Has anyone had this requirement before, and how did they solve it? Thanks Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Opening several database connections on the same registry
Hi, could you post the exception. Is there a object with a object.setDataSource(javax.sql.DataSource ds) method? if so hivemind won't be able to resolve the right object because there are 3 objects with the same interface available. you will have to specify the desired pool by its service-point id. If you have only one pool you don't have to specify it :) g, kris Rui Pacheco [EMAIL PROTECTED] l.com An Tapestry users 15.09.2006 16:31 users@tapestry.apache.org, Tapestry users tapestry-user@jakarta.apache.org Bitte antwortenKopie an Tapestry usersThema [EMAIL PROTECTED] Opening several database pache.org connections on the same registry Hi all Can you help me with my hivemind registry? I'm trying to configure several connection pools to the same server, only the database name changes. When I had one pool, this worked like a charm, now that I have several Tapestry is complaining about the creation of the ASO. I think this is my syntax that. Could you give me a hand finding out whats wrong? The xml is below: ?xml version=1.0? module id=dbcp version=1.0.0 service-point id=GeneralPool interface=javax.sql.DataSource invoke-factory construct class=org.apache.commons.dbcp.BasicDataSource set property=driverClassName value=com.mysql.jdbc.Driver / set property=url value=jdbc:mysql://localhost/Universal?zeroDateTimeBehavior=convertToNull/ set property=username value=webmaster/ set property=password value=webmaster/ set property=removeAbandoned value=true/ /construct /invoke-factory /service-point service-point id=DicIP interface=javax.sql.DataSource invoke-factory construct class=org.apache.commons.dbcp.BasicDataSource set property=driverClassName value=com.mysql.jdbc.Driver / set property=url value=jdbc:mysql://localhost/DicIP?zeroDateTimeBehavior=convertToNull/ set property=username value=webmaster/ set property=password value=webmaster/ set property=removeAbandoned value=true/ /construct /invoke-factory /service-point service-point id=DicPI interface=javax.sql.DataSource invoke-factory construct class=org.apache.commons.dbcp.BasicDataSource set property=driverClassName value=com.mysql.jdbc.Driver / set property=url value=jdbc:mysql://localhost/DicPI?zeroDateTimeBehavior=convertToNull/ set property=username value=webmaster/ set property=password value=webmaster/ set property=removeAbandoned value=true/ /construct /invoke-factory /service-point service-point id=DicPP interface=javax.sql.DataSource invoke-factory construct class=org.apache.commons.dbcp.BasicDataSource set property=driverClassName value=com.mysql.jdbc.Driver / set property=url value=jdbc:mysql://localhost/DicPP?zeroDateTimeBehavior=convertToNull/ set property=username value=webmaster/ set property=password value=webmaster/ set property=removeAbandoned value=true/ /construct /invoke-factory /service-point contribution configuration-id=tapestry.state.ApplicationObjects state-object name=User scope=session create-instance class=pt.te.universal.agc.backend.models.User / /state-object /contribution contribution configuration-id=tapestry.url.ServiceEncoders page-service-encoder id=page extension=html service=page/ /contribution contribution configuration-id=tapestry.url.ServiceEncoders extension-encoder id=extension extension=do
RE: Best Practise for Web Application Development
Hi, if you look for some good references for ui in general, web design (html, css), design and best practices (for html) you could take a look at: www.alistapart.com the ui of a web app doesn't have anything to do with tapestry. tapestry allows you to design your templates as you want it. g, kris Peter Dawn [EMAIL PROTECTED] omAn tapestry-user@jakarta.apache.org 08.08.2006 06:49Kopie Thema Bitte antworten Best Practise for Web Application an Development Tapestry users [EMAIL PROTECTED] pache.org hi guys, i bring you the ultimate question, Whats the best practise for tapestry web development? What I am implying is, how do we convince our boses that web applications are like web sites and follow the same rules as web sites. For example, the best font for a tapestry web app would be in my humble opinion verdana. Now how can I prove this? Have others come across this issue too. Is there some best practise for UI for tapestry web applications. thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: [Hivemind] Inject Registry into service
thank you, g, kris Martin Strand [EMAIL PROTECTED] tcap.se An Tapestry users 08.08.2006 11:52 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: [Hivemind] Inject Registry Tapestry users into service [EMAIL PROTECTED] pache.org We recently discussed this, check this thread: http://www.mail-archive.com/user@hivemind.apache.org/msg00092.html There's no api for it, but you can hack your way around the problem. Martin On Tue, 08 Aug 2006 11:24:36 +0200, Kristian Marinkovic [EMAIL PROTECTED] wrote: hi, is it possible to inject the Hivemind Registry into a service? I have several users from different partners (in different countries). I want to have a factory (service obtained by Hivemind) that, when called with a certain user object, retrieves a more specific service from Hivemind depending on the user, partner, country, So a user from partner AAA gets service A and another user from partner BBB gets service B. The only difference between A and B is their configuration based on the user object (port, servername,) the only other way i see to solve this is to implement a real factory with a Hivemind Registry. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: I want my HTML *that* way
hi, you could try to check your html templates by using the HTML Validator add-on for Firefox. It will show you exactly where the unclosed tags are. i know it's not exactly what you are looking for :) but it could help reduce the number of hours you spend on correcting your templates. maybe you could force your designers to use it :) g, kris Rui Pacheco [EMAIL PROTECTED] l.com An Tapestry users 04.08.2006 16:05 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: I want my HTML *that* way Tapestry users [EMAIL PROTECTED] pache.org My experience tells me they have to match, also. You can't just close them anywhere, you have to pick that messy html generated by some application and ident it. Thats the part where I lose hours of work. On 8/4/06, Martin Strand [EMAIL PROTECTED] wrote: If you leave open br, td or p tags around, Tapestry can't parse the template properly since it's no longer an xml document. Just close all tags, it doesn't really have to be valid HTML. Martin On Fri, 04 Aug 2006 13:10:50 +0200, Rui Pacheco [EMAIL PROTECTED] wrote: This is a possible solution.. On 8/4/06, Detlef Schulze [EMAIL PROTECTED] wrote: You could try to use a tool for cleaning your html. There are many tools out there for this (i.e. htmltidy http://www.w3.org/People/Raggett/tidy/) Cheers, detlef -Original Message- From: Rui Pacheco [mailto:[EMAIL PROTECTED] Sent: Freitag, 4. August 2006 12:58 To: Tapestry users Subject: Re: I want my HTML *that* way Well, I don't have that luxury. Once a design is out of their department, it won't go in. This is really a huge time waster. Right now I'm fixing another snippet, looking for stray tags. On 8/4/06, Ron Piterman [EMAIL PROTECTED] wrote: train your designers to produce clean html - after all nowadays its not out of the cloudes.. Cheers, Ron Rui Pacheco wrote: Its not the first time that Tapestry's HTML parser throws an exception because a piece of HTML is not well formed. If I have a table that isn't closed properly, or a span tag that isn't opened correctly, then its impossible to continue, for example. My problem is, I'm creating my component's templates from snippets of code designed with DreamWeaver by other people (designers). The HTML renders correctly on any browser, but is not understood by Tapestry. The thing is, I can't afford to correct every piece of HTML that is sent my way, its just too time consuming. I'll try to send you an example, but it would be hard now - I've corrected all the HTML I found :) On 8/4/06, hv @ Fashion Content [EMAIL PROTECTED] wrote: I never had that problem could you be a bit more specific Rui Pacheco [EMAIL PROTECTED] skrev i en meddelelse news:[EMAIL PROTECTED] ... Hi all I have a template, designed under DreamWeaver with loads of randomly placed HTML tags, and Tapestry won't parse it. It chockes on tags that don't open, it chockes on form tags placed at the same level as tables, etc. Is there a way to tell Tapestry's HTML parser to be a bit more relaxed? I mean, I still have a couple of pages to go through, and its going to be hell if he complains about every bit of malformed HTML. -- Cumprimentos, Rui Pacheco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cumprimentos, Rui Pacheco - To unsubscribe,
RE: opening up a new windown onclick
if you use HTML 4.01 or XHTML 1.0 Transitional you could define a target attribute a target=_blank/a pure html :) g, kris zqzuk [EMAIL PROTECTED] il.comAn users@tapestry.apache.org 02.08.2006 14:08Kopie Thema Bitte antworten opening up a new windown onclick an Tapestry users [EMAIL PROTECTED] pache.org Hi, how can i enable a directlink to open up a separate window on click, rather than opening in itself? thanks -- View this message in context: http://www.nabble.com/opening-up-a-new-windown-onclick-tf2039446.html#a5612506 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Hivemind: creating a pooled service
hi james, the error message does not occur any more. But the objects are still not being pooled. my testcode looks like this: public class PoolTest implements Runnable { public static Registry registry = null; public static void main(String[] args) throws InterruptedException { registry = RegistryBuilder.constructDefaultRegistry(); Thread[] a = new Thread[10]; for(int i=0;ia.length;i++) a[i] = new Thread(new PoolTest()); for(Thread t: a) t.start(); for(Thread t: a) t.join(); for(int i=0;ia.length;i++) a[i] = new Thread(new PoolTest()); for(Thread t: a) t.start(); for(Thread t: a) t.join(); public void run() { IPooledObject o = (IPooledObject) registry .getService(cross.pooledObject,IPooledObject.class); System.out.println(ObjectID: + o.getValue()); } I'm getting 20 different object ids. i'd except to have less than 20 different object ids :) g, kris James Carman [EMAIL PROTECTED] ulting.comAn 'Tapestry users' 28.07.2006 13:32 users@tapestry.apache.org Kopie Bitte antwortenThema an RE: Hivemind: creating a pooled Tapestry users service [EMAIL PROTECTED] pache.org FYI, the HiveMind mailing lists have been moved. We are moving to an Apache top-level project, but we haven't moved the website yet. Anyway, have you tried this: service-point id=pooledObjectProvider interface=org.apache.hivemind.ServiceImplementationFactory paramaters-occurs=none / This tells HiveMind that your implementation factory doesn't expect any parameters. -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 6:28 AM To: Tapestry users Subject: Hivemind: creating a pooled service hi, could someone tell me howto configure hivemind to get me a object with a pooled lifecycle which, if the pool is empty, uses a own factory or provider to generate it? my configuration doesn't pool the object and returns a Parameters to service implementation factory pooledObjectProvider contains no contributions but expects exactly one contribution. error message service-point id=pooledObject interface=pool.IPooledObject / service-point id=pooledObjectProvider interface=org.apache.hivemind.ServiceImplementationFactory / implementation service-id=pooledObjectProvider invoke-factory model=singleton construct class=pool.PooledObjectProvider / /invoke-factory /implementation implementation service-id=pooledObject invoke-factory model=pooled service-id=pooledObjectProvider / /implementation g, kris P.S. i always get a failure notive when i try to subscribe to the hivemind mailinglist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: RE: Hivemind: creating a pooled service
ok, now i get it in order to put an object back to the pool i have to release it somehow my mistake i've seen it in org.apache.tapestry.ApplicationServlet but had no clue what it was for :) it works fine now thank you James Carman [EMAIL PROTECTED] ulting.comAn 'Tapestry users' 28.07.2006 14:12 users@tapestry.apache.org Kopie Bitte antwortenThema an RE: RE: Hivemind: creating a Tapestry users pooled service [EMAIL PROTECTED] pache.org Try this: public void run() { IPooledObject o = (IPooledObject) registry .getService(cross.pooledObject,IPooledObject.class); System.out.println(ObjectID: + o.getValue()); registry.cleanupThread(); } See what you get. The pooled lifecycle model doesn't know when to release stuff if you don't clean up your current thread. -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 8:09 AM To: Tapestry users Subject: RE: RE: Hivemind: creating a pooled service hi james, the error message does not occur any more. But the objects are still not being pooled. my testcode looks like this: public class PoolTest implements Runnable { public static Registry registry = null; public static void main(String[] args) throws InterruptedException { registry = RegistryBuilder.constructDefaultRegistry(); Thread[] a = new Thread[10]; for(int i=0;ia.length;i++) a[i] = new Thread(new PoolTest()); for(Thread t: a) t.start(); for(Thread t: a) t.join(); for(int i=0;ia.length;i++) a[i] = new Thread(new PoolTest()); for(Thread t: a) t.start(); for(Thread t: a) t.join(); public void run() { IPooledObject o = (IPooledObject) registry .getService(cross.pooledObject,IPooledObject.class); System.out.println(ObjectID: + o.getValue()); } I'm getting 20 different object ids. i'd except to have less than 20 different object ids :) g, kris James Carman [EMAIL PROTECTED] ulting.comAn 'Tapestry users' 28.07.2006 13:32 users@tapestry.apache.org Kopie Bitte antwortenThema an RE: Hivemind: creating a pooled Tapestry users service [EMAIL PROTECTED] pache.org FYI, the HiveMind mailing lists have been moved. We are moving to an Apache top-level project, but we haven't moved the website yet. Anyway, have you tried this: service-point id=pooledObjectProvider interface=org.apache.hivemind.ServiceImplementationFactory paramaters-occurs=none / This tells HiveMind that your implementation factory doesn't expect any parameters. -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: Friday, July 28, 2006 6:28 AM To: Tapestry users Subject: Hivemind: creating a pooled service hi, could someone tell me howto configure hivemind to get me a object with a pooled lifecycle which, if the pool is empty, uses a own factory or provider to generate it? my configuration doesn't pool the object and returns a Parameters to service implementation factory pooledObjectProvider contains no contributions but expects exactly one contribution. error message service-point id=pooledObject interface=pool.IPooledObject / service-point id=pooledObjectProvider interface=org.apache.hivemind.ServiceImplementationFactory / implementation service-id=pooledObjectProvider invoke-factory model=singleton construct class=pool.PooledObjectProvider / /invoke-factory /implementation implementation service-id=pooledObject invoke-factory
RE: global hivemind service
if you declare a service as model=threaded a new instance will be created for every request of a new thread. so every thread has its individual instance. i think model=singleton (default model) is what you are looking for. you could also define a application state object with application scope: http://tapestry.apache.org/tapestry4/UsersGuide/state.html#state.aso g, kris xVik [EMAIL PROTECTED] An 26.07.2006 14:06 users@tapestry.apache.org Kopie Bitte antwortenThema an global hivemind service Tapestry users [EMAIL PROTECTED] pache.org i need to have global hivemind service (the only for all threads (and all users)) im not shure that treaded model is what i need more dataily: data generated by this service (sitemap for example, stored in some collection) should be accessible by all working threads (and not recalculating for each user) am i right threaded is what i need? -- View this message in context: http://www.nabble.com/global-hivemind-service-tf2003454.html#a5501986 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Hivemind: Difference between invoke-factory and create-instance
Hi, can somebody explain to me the difference between invoke-factory and create-instance? Is there any difference in behaviour as long as the class referenced by invoke-factory does not implement ServiceImplementationFactory? Or am i completely wrong :) I'm not sure how to use them. Thanks in advance g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Hivemind: Difference between invoke-factory and create-instance
Hi James, i did a few tests and i understand now :) Thank you! g, kris James Carman [EMAIL PROTECTED] ulting.comAn 'Tapestry users' 24.07.2006 16:50 users@tapestry.apache.org Kopie Bitte antwortenThema an RE: Hivemind: Difference between Tapestry users invoke-factory and [EMAIL PROTECTED] create-instance pache.org Kris, The create-instance is a very simplistic mechanism. All it does is instantiate that class. It does no configuration or wiring of the instantiated object. If you want dependency injection, use invoke-factory instead, which by default uses the BuilderFactory to instantiate and configure your implementation object. James -Original Message- From: Kristian Marinkovic [mailto:[EMAIL PROTECTED] Sent: Monday, July 24, 2006 10:44 AM To: Tapestry users Subject: Hivemind: Difference between invoke-factory and create-instance Hi, can somebody explain to me the difference between invoke-factory and create-instance? Is there any difference in behaviour as long as the class referenced by invoke-factory does not implement ServiceImplementationFactory? Or am i completely wrong :) I'm not sure how to use them. Thanks in advance g, kris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Template header DOCTYPE
hi, that's true... but it's only the template... it is more important how your generated page looks like. the spans disappear in the generated page. g, kries Blackwings [EMAIL PROTECTED] mail.com An Tapestry users 17.07.2006 11:13 users@tapestry.apache.org Kopie Bitte antwortenThema an Template header DOCTYPE Tapestry users [EMAIL PROTECTED] pache.org Hi, I noticed something interresting about DOCTYPE. In fact, if a designer give me a XHTML1.0 transitional compliant html template, when I mark the tag and add some tags span the html is not anymore compliant : select jwcid=[EMAIL PROTECTED] id=searchCriteria.requester name= searchCriteria.requester size=1 tabindex=6 class=comboBox9pt span jwcid=@Foreach source=ognl:requesters value=ognl: searchCriteria.requester option value=1 jwcid=@Option label=ognl:requesters.requesterCode elem1/option option value=2 jwcid=$remove$elem2/option option value=3 jwcid=$remove$elem3/option option value=4 jwcid=$remove$elem4/option /span /select The span cannot be place after a select and this is warned. I have the same problem when I want to mark a bloc of tr, not all, in a table. I have to put a span tag between to a /tr and a tr that is not permit by the DOCTYPE definition, normally. Is there another DOCTYPE that manage Tapestry template or do we have to let the warn like that? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Generic application wide formats
this could help: http://www.nabble.com/Dynamic-translators-tf1229928.html#a3255867 define your formatter as a bean and define the pattern using message:date_pattern greetings, kris Shing Hing Man [EMAIL PROTECTED] An Tapestry users 17.07.2006 15:59 users@tapestry.apache.org Kopie Bitte antwortenThema an Re: Generic application wide Tapestry users formats [EMAIL PROTECTED] pache.org It is not very pretty. You could try the following. component id=dateField type=Insert binding name=value value=myclass.mydate/ binding name=format ognl:new java.text.SimpleDateFormat(getMessages().getMessage('format_date')) /binding /component Shing --- Murray Collingwood [EMAIL PROTECTED] wrote: Hi all I'm a little new to Tapestry so I may be missing something, happy for anybody to point me in the right direction. I'm currently running Tapestry 4.0.2 I want to standardise my date format for the entire application to dd/MM/. I decided that the best place to do this while allowing for internationalisation is to add it to my app.properties file. I added a few other formats while I was there, so I had something like the following: # Generic formats format_date=dd/MM/ format_time=HH:mm format_pct0=##0% format_pct2=##0.##% format_currency=$#,###,##0.00 Then I found that in order to display a date in this format I was writing 7 lines of java code for each page where a date was displayed (most of them)...along with 1 more line in the .page file for each date to be displayed. When I wanted to edit a date again using this format I had 4 lines per page and 1 line per field. This only provides the most basic of editing (I haven't allowed for any error processing yet) and while the number of lines is not large it did seem to me that there were different methods being employed to format the date for display and others for edit and validation. As I began, I may have missed something but it does seem a little messy at the moment. Does anybody have a better method of achieving this generic formating? Wouldn't it be nice ifI could specify formats in my message catalogue and then simply apply them to my components with a single line of code? eg a) displaying a date value: component id=dateField type=Insert binding name=value value=myclass.mydate/ binding name=format value=message:format_date/ /component b) editing a date value: component id=dateField type=DatePicker binding name=displayName value=message:mydate_label/ binding name=value value=myclass.mydate/ binding name=format value=message:format_date/ binding name=validators value=validators:required/ /component Is this possible? FOCUS Computing - web design Mob: 0415 24 26 24 [EMAIL PROTECTED] http://www.focus-computing.com.au -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.1/389 - Release Date: 14/07/2006 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Home page : http://uk.geocities.com/matmsh/index.html ___ All new Yahoo! Mail The new Interface is stunning in its simplicity and ease of use. - PC Magazine http://uk.docs.yahoo.com/nowyoucan.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Antwort: Can you find the typo
i found it :) span jwicd=assessorRows should be span jwcid=assessorRows kris Chris Chiappone [EMAIL PROTECTED] com An Tapestry List 13.07.2006 16:39 users@tapestry.apache.org Kopie Bitte antwortenThema an Can you find the typo Tapestry users [EMAIL PROTECTED] pache.org Ok I have been staring at this code for hours now and can't seem to find what is wrong. I am trying to create a Table using TableView but I get this exception: 'The component assessorValues must be contained within an ITableRowSource component, such as TableRows' here is my html: table class=TapTable jwcid=assessmentTable span jwcid=tablePages/ span jwcid=assessorColumns/ span jwicd=assessorRows span jwcid=[EMAIL PROTECTED]:TableValues/ /span /table And here is my components annotations: @Bean(EvenOdd.class) public abstract EvenOdd getEvenOdd(); @Component(id=assessmentTable, type=contrib:TableView, bindings={ source=assessments, pageSize=literal:20, columns=literal:user.mycompany.name, status, certdate, certexdate }) public abstract TableView getAssessmentTable(); @Component(id=tablePages, type=contrib:TablePages) public abstract TablePages getTablePages(); @Component(id=assessorColumns, type=contrib:TableColumns, bindings={ class=literal:columnheader }) public abstract TableColumns getAssessorColumns(); @Component(id=assessorRows, type=contrib:TableRows, bindings={ class=beans.evenOdd.next }) public abstract TableRows getAssessorRows(); Can anyone tell me what I'm missing here. Thanks. -- ~chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE: Does Tapestry work with XHTML?
+1 for XHTML and standards. btw. there is a firefox extension for validating pages on the fly: HTML Validator: https://addons.mozilla.org/firefox/249/ IMHO every web developer should use it :) best regards, kris Townson, Chris [EMAIL PROTECTED] .com An Tapestry users 31.05.2006 11:33 users@tapestry.apache.org Kopie Bitte antwortenThema an RE: Does Tapestry work with XHTML? Tapestry users [EMAIL PROTECTED] pache.org Please don't give up on the XHTML thing. Alex Russell is completely wrong in the article Jesse referred to. His condemnation of so-called academics (Alex's label) smacks of narrow-mindedness, lack of forethought and wilful unawareness of the very history of web development he briefly covers (i.e. tag soup et al) Yes, he's correct that implementing some standards can be testing and that an overly pedantic approach to them can be debilitating (as one commenter points out in that article: they are recommendations, not edicts). However, that doesn't mean that one should ditch them: the development of standards will, by definition, _always_ be in advance of practice. The idea is that one should always be working _towards_ the fullest possible implementation of relevant standards within the constraints of pragmatism ... for Tapestry, one of those standards _has_ to be XHTML because, in combination with other standards - such as CSS, it is the _only_ solution which offers the possibility of a consistent interface with the client-side - with the added benefit of a transparent incorporation of multi-format documents (e.g. XHTML + SVG + MathML etc) Whilst there is a degree of dissent about the relative merits of standards for client-side technologies at present (caused, in large part, by the failure of a certain leading browser manufacturer to propery implement them), this situation is only exacerbated by developer abandonment. As for Tapestry components that aren't able to produce valid XHTML ... they really should be able to by now and I think it's a bit weak that they don't. But, saying that, it is open source and you would be free to hack these components to produce the required XHTML. Chris -Original Message- From: Galam [mailto:[EMAIL PROTECTED] Sent: 30 May 2006 17:10 To: Tapestry users Subject: Re: Does Tapestry work with XHTML? Thanks everyone for the tips and advices. I'll stick with HTML then. On 5/29/06, Todd Orr [EMAIL PROTECTED] wrote: Yet, not all of Tapestry's components produce compliant xhtml, so you may be wasting your time going through these measures. On 5/29/06, Paul Cantrell [EMAIL PROTECTED] wrote: Right. And just to be clear: the .xhtml is not necessary for XHTML, not just for Tapestry, but in *any* content -- and I don't think the text/xml mime type is necessary either. It's the DOCTYPE that has the last word. Use the W3C validator when in doubt! Use it when not in doubt, too. Cheers, Paul On May 29, 2006, at 2:11 AM, Kristian Marinkovic wrote: hi, to use XHTML it is NOT necessary to rename the .html file to .xhtml. all you have to do is to add the dtd and the ?xml. the only reason i could imagine you want to rename it to .xhtml is because you could configure your webserver to set the correct mime-type (text/xml). but if you do so IE6 (and before) won't be able to display your document correctly. btw. if you put ?xml version=1.0 encoding=UTF-8? into your document IE6 will run in quirksmode and not in standard compliant mode! this may cause some misbehaviours when using css :) (boxmodel...) although it is not absolutly correct you may omit ?xml version=1.0 encoding=UTF-8? completly (or you generate it depending on the current browser :)). regards, kris Galam [EMAIL PROTECTED] om
RE: licensing q.
i think this link might help: http://people.apache.org/~cliffs/3party.html regards, kris Norbert Sándor [EMAIL PROTECTED] s.com An Tapestry users 26.05.2006 08:48 users@tapestry.apache.org, hivemind-user@jakarta.apache.org Kopie Bitte antworten an Thema Tapestry users licensing q. [EMAIL PROTECTED] pache.org Hello, My question: with what conditions is it allowed for a GLP licensed software to use the ASL licensed Hivemind and Tapestry? Could you please point me a resource which answers this question? Thanks in advance, Norbi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]