Weird classClassNotFoundException Was: Re: How to pass a reference of ASO to my SqueezeAdaptor
Thanks Barry, the squeezer now works, but now I am having problem passing the object to and from component on the page. Becouse the error is so weird, I conclude something is wrong with component parametrs not being properly handled. It works without the component. Page includes component component id=categoryBox type=CategoryBox binding name=category value=category/ binding name=children value=children/ binding name=listener value=listeners.onClickCategory/ /component The component gets a list (children) which are value objects registered for squeezing and their parent (category - also the same type) and should display a list of their names. When a child category is clicked the component sends a message through listener to the page that contains it to invoke public IPage onClickCategory(CategoryVO categoryVO) { WizardStep2 wizardStep2 = getWizardStep2Page(); wizardStep2.setCategory(categoryVO); return (IPage) wizardStep2; } which should display children's children, but instead I am getting the Could not load class com.package.ClassName from WebappClassLoader delegate: false repositories: /WEB-INF/classes/ -- Parent Classloader: [EMAIL PROTECTED] : com.package.ClassName In my public Collection getChildren() { logger.info(get children of + getCategory()); Collection children = getManager().getChildren(getCategory(), null); logger.info(= + children); return children; } page class method getCategory() returns null. The setter and getter are defined abstract public CategoryVO getCategory(); abstract public void setCategory(CategoryVO categoryVO); Advice appreciated! 2006/9/6, Barry Books [EMAIL PROTECTED]: Here is mine. Just add the state manager as a property and pull out what you need. public Object unsqueeze(DataSqueezer squeezer, String string) { try { Repository repository = (Repository) stateManager.get(repository); User user = (User) stateManager.get(user); return repository.select(user, new Long( string.substring(1))); } catch (NumberFormatException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } private ApplicationStateManager stateManager; public void setStateManager(ApplicationStateManager stateManager) { this.stateManager = stateManager; } } contribution configuration-id=tapestry.state.ApplicationObjects state-object name=user scope=session create-instance class=com.trsvax.mill.baseobject.party.User/ /state-object /contribution contribution configuration-id=tapestry.data.SqueezeAdaptors adaptor object=service:millSqueezer/ /contribution service-point interface=com.trsvax.mill.MillSqueezer id=millSqueezer invoke-factory construct class=com.trsvax.mill.MillSqueezer set-object property=stateManager value=infrastructure:applicationStateManager/ /construct /invoke-factory /service-point - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DatePicker not working after upgrading from 4.0.2 to 4.1
Hi, I recently upgraded from 4.0.2 to 4.1 and noticed that the datepicker doesnt work anymore. when the page is loaded i get this error: Could not load 'tapestry.form'; last tried '__package__.js' and when i click the calendar image i get: calendar_dueDate has no properties it has probably something to do with this http://issues.apache.org/jira/browse/TAPESTRY-1020?page=all as i´m developing on windows, but that issue seems to be resolved 21/7 and the 4.1jars i´ve downloaded from http://tapestry.apache.org/download.html looks like to be dated after that. what should i do to fix this?
Re: How to implement polling with @EventListener
Jesse, thanks for your tremendous efforts! Paying rent is always a good thing (TM). You are right of course. Polling is not the way to go (http://docs.codehaus.org/display/JETTY/Continuations), cometd is. Tomcat will have continuations some day. But we have to start somewhere... at least me :-) I'll add my tapestry pages to JIIRA, they expose some bugs (totally blows with Firefox 2.0), regardless of if polling is the way to go or not. I'll maybe do polling and keep some logic in the client to be able to send deltas. Cheers always looking forward for you new stuff :-) Jessek wrote: There ~will~ be more features like this soon, have been on the tail end of a rent paying project release and haven't had time for anything else... I'm not sure polling is the perfect answer (at least done this way.) You might check out cometd.org as well. The dojo + jetty guys have been working together to make this a lot easier for servlet based apps. One of many to dos I plan on adding to tapestry at some point..(probably a sub project, but will likely happen sooner than later as it seems lots of people want this) On 9/6/06, livelock [EMAIL PROTECTED] wrote: Yay, it works, thanks. It really looks like there should be a more elegant solution to this, but hey, it works. Now I am facing a different thing, using AJAX requests I only want to transfer deltas. For example if there are 11 rows on the screen and on the next update there is a new one, I don't want to transfer 12 rows then, only one and add it to the other rows. Is there an elegant way? Or do I have to create component instances dynamically? Regards Josh Long wrote: The following is contrived, but works. Mainly, I would create a proper dojo widget and have the event listener bind to that, but this works because of expando properties... In your body of a file called Test.html, I have div id =test/div script type=text/javascript dojo.require('dojo.lang.*'); dojo.require('dojo.event.*') var tst =dojo.byId('test'); tst.update=function() { dojo.debug ('running') dojo.lang.setTimeout( tst.update , 4000) ; // im sure ther animation package had //a proper way of scheduling something for repeating, but... }; dojo.addOnLoad(function(){ dojo.byId('test').update() ; // get the ball rolling }); /script div jwcid=[EMAIL PROTECTED] span jwcid=@Insert value = ognl: now the current time is /span /div then in Test.java, abstract public Date getNow() ; abstract public void setNow(Date now) ; @EventListener( elements =test, async = true , events =update) public void update (IRequestCycle cycle ) { setNow(new Date()) ; cycle.getResponseBuilder().updateComponent(status); } and boom! As you load hte page in javascript, test.update gets called which in turn causes the server side event listener to run. The event listener updates the clock (every 4 seconds because I was running this in devel mode and, and I mean nothing, pisses tapestry off more than running in devel mode) and the page reflects it without any refresh. Hope this helps, sort of... Josh On 9/3/06, livelock [EMAIL PROTECTED] wrote: Hi, Dojo got a polling mode ( http://archive.dojotoolkit.org/nightly/tests/io/test_ScriptSrcIO.html#CommonArgs ). How do I use that properly with Tapestry 4.1? The EventListener seems not have anything that ge I want a component that reads a property from a server all 4 seconds. For example for stock quotes or even a chat. Regards, André -- View this message in context: http://www.nabble.com/How-to-implement-polling-with-%40EventListener-tf2212501.html#a6127728 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] -- View this message in context: http://www.nabble.com/How-to-implement-polling-with-%40EventListener-tf2212501.html#a6170249 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
Strange component parameter issues with annotations
Hi I'm currently writing a Tapestry web application using Tapestry 4.0.2 under Tomcat 5.5.18 and JDK 1.5.0_08. The situation is: Page 1: Contains Iframe page 1 and Iframe page 2 as iframes. Iframe page 1: Contains Component 1 Iframe page 2: Contains Component 2 All these pages, iframes and components have been created by me by hand in Java with annotations. Each of the iframe pages render render fine if I ask for their links directly, but when I render Page 1, strange errors occur. Most of the errors reported seem to be problems with handling annotations on the included components and they state that I have declared the parameters multiple times. That is not the case here, and the exact Tapestry error also tells me that the place of wrong annotation is the same place where it is declared. An example: Caused by: ognl.OgnlException: historicCustomerPage [org.apache.hivemind.ApplicationRuntimeException: Error: An error occured processing annotation @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=, required=true, name=, aliases=) of public abstract java.text.DateFormat tapestry.pages.customer.CustomerComponent.getDateFormat(): Parameter dateFormat has already been declared (at Annotation @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=, required=true, name=, aliases=) of public abstract java.text.DateFormat tapestry.pages.customer.CustomerComponent.getDateFormat()). [Annotation @org.apache.tapestry.annotations.Parameter(cache=true, defaultValue=, required=true, name=, aliases=) of public abstract java.text.DateFormat tapestry.pages.customer.CustomerComponent.getDateFormat()] ] In my CustomerComponent class, the parameter has been declared with: /** * @return The parameter. */ @Parameter(required = true) public abstract DateFormat getDateFormat(); I this is not a lot of information to go by, but my application is quite big and this is what I have narrowed the problem down to. I have a feeling that this might be some sort of concurrency issue within Tapestry, mostly because each of the iframes render fine on their own, and I am almost sure there were no errors at the time we used XML files for page/component specs. Does anyone have an idea what the problem is and what I do work around it? It's really a show-stopper for me. Best wishes, Jan Nielsen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Strange component parameter issues with annotations
Jan Normann Nielsen skrev: Hi I'm currently writing a Tapestry web application using Tapestry 4.0.2 under Tomcat 5.5.18 and JDK 1.5.0_08. [bla-bla - snip] I this is not a lot of information to go by, but my application is quite big and this is what I have narrowed the problem down to. I have a feeling that this might be some sort of concurrency issue within Tapestry, mostly because each of the iframes render fine on their own, and I am almost sure there were no errors at the time we used XML files for page/component specs. Does anyone have an idea what the problem is and what I do work around it? It's really a show-stopper for me. Best wishes, Jan Nielsen I probably should have Googled for my problem before posting to this list, anyway I've found out what the problem is: It's issue 848 and by not running with disable-caching on seemed to fix the problem. Anyway, having to reload the application on every change slows down development speed, so it would be nice if anyone had a better solution. Are there any plans to work on this issue? Best wishes, Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Obtaining check box data from a form
Peter, Checkboxes are like any other field. HTML: html head title Allowable SAML Bindings /title link rel=stylesheet type=text/css media=screen href=../../images/style.css / /head body span jwcid=$content$ table class=interior tr td span jwcid=[EMAIL PROTECTED]:AnySubmitinput jwcid=artifactCheckbox type=checkbox//spanArtifact /td /tr span jwcid=showPost tr td input jwcid=postCheckbox type=checkbox/POST /td /tr /span span jwcid=showRedirect tr td input jwcid=redirectCheckbox type=checkbox/Redirect /td /tr /span span jwcid=showSoap tr td span jwcid=[EMAIL PROTECTED]:AnySubmitinput jwcid=soapCheckbox type=checkbox//spanSOAP /td /tr /span /table /span /body /html JWC: component id=artifactCheckbox type=Checkbox binding name=selected expression=page.visit.currentState.artifactBinding/ /component component id=postCheckbox type=Checkbox binding name=selected expression=page.visit.currentState.postBinding/ /component component id=showPost type=Conditional binding name=condition expression=page.visit.currentState.showPostChoice()/ /component component id=showRedirect type=Conditional binding name=condition expression=page.visit.currentState.showRedirectChoice()/ /component component id=redirectCheckbox type=Checkbox binding name=selected expression=page.visit.currentState.redirectBinding/ /component component id=showSoap type=Conditional binding name=condition expression=page.visit.currentState.showSoapChoice()/ /component component id=soapCheckbox type=Checkbox binding name=selected expression=page.visit.currentState.soapBinding/ /component JAVA: private boolean artifactBinding = true; private boolean postBinding = true; private boolean redirectBinding = true; private boolean soapBinding = true; public boolean isArtifactBinding() { return artifactBinding; } public void setArtifactBinding(boolean artifactBinding) { this.artifactBinding = artifactBinding; } public boolean isPostBinding() { return postBinding; } public void setPostBinding(boolean postBinding) { this.postBinding = postBinding; } public boolean isRedirectBinding() { return redirectBinding; } public void setRedirectBinding(boolean redirectBinding) { this.redirectBinding = redirectBinding; } public boolean isSoapBinding() { return soapBinding; } public void setSoapBinding(boolean soapBinding) { this.soapBinding = soapBinding; } All you have to do is put 1-n in an HTML template. I have mine declared in the .jwc, but you could just put it in the HTML. Then link them to some method in a java class somewhere. I have mine updating a visit object value currentState. Current State is the users current state. Pick a java object somewhere. The values of the boolean values will be displayed as checked or unchecked just as the data is in the java object. If the user checks or unchecks a checkbox and submits it then the java method is called. The end result is that the java boolean values are displayed and modifiable by your users. When submitted they automatically populate your java values. No different than a Text Input Field. hth, Mark Name: Mark J. Stang Title: Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: Peter Dawn [mailto:[EMAIL PROTECTED] Sent: Wed 9/6/2006 11:56 PM To: Tapestry users Subject: Re: Obtaining check box data from a form ok. the only other way for me to obtain a users selection would a radio button. might try that. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Retrieving Tapestry 4 components from outside Tapestry
Hi, I've searched high and low for a definitive answer to this, but so far no luck. I have a java class, a service class, that needs to retrieve a Tapestry Component. This service class is 'outside' of Tapestry in that it's not a page, not a component, nor does it extend any Tapestry base classes. My question is: how can my service class retrieve a tapestry component? If we change things slightly and make my Tapestry component a Page instead, then this problem has an easy solution: simply pass the IRequestCycle to the service method and use IRequestCycle.getPage(pagename), but it seems not possible to retrieve a Component in this way, or am I missing something?! Short of injecting the component into some page, retrieving that page in my service then using IPage.getComponent(), I can't see another way. (And I really don't want to do it that way!) Any help would be greatly appreciated. Thanks, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retrieving Tapestry 4 components from outside Tapestry
Hi, Thanks for responding! That's true, but my component is not part of any page - just an isolated component. In my original post I used the example of a page (instead of a component) to highlight how easy it is to do this if your 'component' is a page. But if your component is an actual component - and not injected into any page - retrieving it in a non-tapestry class becomes problematic. I'm a little confused (and still convinced I'm missing something obvious!) since I have understood throughout using Tapestry that everything is a component (including pages), which makes it confusing why pages are so easy to retrieve this way (via the requestcycle as you pointed out), but Components are not. Regards, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retrieving Tapestry 4 components from outside Tapestry
Hi Dan, Conceptually, component instances do not exist outside of pages. This is just how Tapestry works. If you want to access your component, you will need to place it on a dummy page and access it via that page as you suspect. Is there any particular reason why you don't want a dummy page? Cheers Richard Dan Williams wrote: Hi, Thanks for responding! That's true, but my component is not part of any page - just an isolated component. In my original post I used the example of a page (instead of a component) to highlight how easy it is to do this if your 'component' is a page. But if your component is an actual component - and not injected into any page - retrieving it in a non-tapestry class becomes problematic. I'm a little confused (and still convinced I'm missing something obvious!) since I have understood throughout using Tapestry that everything is a component (including pages), which makes it confusing why pages are so easy to retrieve this way (via the requestcycle as you pointed out), but Components are not. Regards, Dan - 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: Retrieving Tapestry 4 components from outside Tapestry
I have a Holder page that I store about 125 components. That page is never viewed. When I want to display one, I render it on a different page. However, the missing link might be that components are not like java components. They exist in a pool, 1-to-n of each kind. They are cycled into and out of the pool onto a page. While in the pool they have no values. Proper components are supposed to re-initialize themselves. When it doesn't happen correctly, you see the data of the last user of the component. So, components exist outside of pages, but they have no identity. Once you put them on a page then they have values and real existence. Kind of a metaphysical thing. So, unless you are displaying a component, there is no need to access it. Especially, since Tapestry controls which one will be displayed. Only at the time of rendering it in a page can you affect or access it. hth, Mark Name: Mark J. Stang Title: Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: Richard Kirby [mailto:[EMAIL PROTECTED] Sent: Thu 9/7/2006 10:56 AM To: Tapestry users Subject: Re: Retrieving Tapestry 4 components from outside Tapestry Hi Dan, Conceptually, component instances do not exist outside of pages. This is just how Tapestry works. If you want to access your component, you will need to place it on a dummy page and access it via that page as you suspect. Is there any particular reason why you don't want a dummy page? Cheers Richard Dan Williams wrote: Hi, Thanks for responding! That's true, but my component is not part of any page - just an isolated component. In my original post I used the example of a page (instead of a component) to highlight how easy it is to do this if your 'component' is a page. But if your component is an actual component - and not injected into any page - retrieving it in a non-tapestry class becomes problematic. I'm a little confused (and still convinced I'm missing something obvious!) since I have understood throughout using Tapestry that everything is a component (including pages), which makes it confusing why pages are so easy to retrieve this way (via the requestcycle as you pointed out), but Components are not. Regards, Dan - 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]
What's the more convenient way to add logging to a tapestry app?
Hello Tap gurus: I was searching about logging into webapps, but I'm now overhelming and confused about how I can implement a real well done logging for tapestry apps, here I found some answers (some use services others instanciate the Logger inside a page that after inherit this feature, some use hibernate to persist, others not), but not a concrete example, only parts for diverse needs and I'm a totallly dangerous ignorant about hivemind. AFAIK and read, I need to instanciate a Log object (via log4j maybe through commons-logging), using hivemind (because the app at last is a only one servlet), but how? I need an ASO (but the implementation)? or better a service to achieve that?, if I select a service (as I believe) then how is the way to configure it on my hivemodule file?, should be a singleton, threaded or pooled service? it depends if I want MDC or not? I need an interceptor?. The hivemind's logging interceptor isnt' enough, because I need more that a list of in/out of procedures log. Well as you can see I'm really confused and need a focus or better an hivemodule example to achieve that in the most properly way. Thanks JQ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Retrieving Tapestry 4 components from outside Tapestry
Thanks for your input guys. I appreciate your reasoning - I guess I just had a different conceptual idea of how Tapestry works! I had already implemented the dummy page solution, but just didn't really like it - it seemed a little messy against the backdrop of the rest of Tapestry. If you look through the Tapestry object graph both Pages and Components inherit from AbstractComponent, implementing both IComponent and IRender interfaces (amongst others). I just thought that given this, they were both intended to be 'components' yet indepentantly renderable and differ only in the sense that Pages are user accessible whereas Components are not, but instead are descrete, reusable parts. rgds, Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
What's the more convenient way to add logging to a tapestry app?
Hello Tap gurus: I was searching about logging into webapps, but I'm now overhelming and confused about how I can implement a real well done logging for tapestry apps, here I found some answers (some use services others instanciate the Logger inside a page that after inherit this feature, some use hibernate to persist, others not), but not a concrete example, only parts for diverse needs and I'm a totallly dangerous ignorant about hivemind. AFAIK and read, I need to instanciate a Log object (via log4j maybe through commons-logging), using hivemind (because the app at last is a only one servlet), but how? I need an ASO (but the implementation)? or better a service to achieve that?, if I select a service (as I believe) then how is the way to configure it on my hivemodule file?, should be a singleton, threaded or pooled service? it depends if I want MDC or not? I need an interceptor?. The hivemind's logging interceptor isnt' enough, because I need more that a list of in/out of procedures log. Well as you can see I'm really confused and need a focus or better an hivemodule example to achieve that in the most properly way. Thanks JQ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
@Component copy-of
I noticed that @Component has no copyOf parameter (like component id=... copy-of=.../) Is there a way to do something similar with annotations? I'm using the latest snapshot. Thanks, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What's the more convenient way to add logging to a tapestry app?
Hi Jorge, It seems to me that an ASO would be your best bet. Give it an application scope and you'll only create a single instance for the life of your app. If you need to do some funky configuration when starting, then you can create a StateObjectFactory wrapper. A service would really only be necessary if you were looking to write some sort of facade, and even then, I'm not sure it'd gain you a whole lot. If you're looking to do it a bit more dynamically, you could look into using aspectj to hook in as appropriate. Hope that helps. -- Kevin Jorge Quiroga wrote: Hello Tap gurus: I was searching about logging into webapps, but I'm now overhelming and confused about how I can implement a real well done logging for tapestry apps, here I found some answers (some use services others instanciate the Logger inside a page that after inherit this feature, some use hibernate to persist, others not), but not a concrete example, only parts for diverse needs and I'm a totallly dangerous ignorant about hivemind. AFAIK and read, I need to instanciate a Log object (via log4j maybe through commons-logging), using hivemind (because the app at last is a only one servlet), but how? I need an ASO (but the implementation)? or better a service to achieve that?, if I select a service (as I believe) then how is the way to configure it on my hivemodule file?, should be a singleton, threaded or pooled service? it depends if I want MDC or not? I need an interceptor?. The hivemind's logging interceptor isnt' enough, because I need more that a list of in/out of procedures log. Well as you can see I'm really confused and need a focus or better an hivemodule example to achieve that in the most properly way. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble with JSCookMenu
Hello Jacob: I used this component about a year and I'm not an expert in Tap related technologies so, some questions I cannot response and that I'm going to answer is based on my very little experience, the probability to find better solutions are big. Then: jake123 escribió: Hi, I am building my first application using tapestry 4 and I am trying to use the component JSCookMenu but I run into some issues. 1) When I build up my sub-menues I need 3 attributes in my directLink (Name, ItemType, IdValue). I tried this code: if (currentArticle != null) { BasicJSCookMenuItem currentSubMenu = new BasicJSCookMenuItem(new Object[] {currentArticle.getName(), ItemType.TYPE_ARTICLE, currentArticle.getArticleId()}); currentMenu.addItem(currentSubMenu); } from this I get a org.apache.tapestry.BindingException like this: Exception invoking listener method onNavigate of component defaultHome: No listener method named 'onNavigate' suitable for 3 listener parameters found in [EMAIL PROTECTED] and the following org.apache.hivemind.ApplicationRuntimeException : No listener method named 'onNavigate' suitable for 3 listener parameters found in [EMAIL PROTECTED] And my listener method look like this now: /** * This is called when one of the menu items is clicked */ public void onNavigate(IRequestCycle cycle, Object[] value){ System.out.println(HomeAction: MenuItem value = + value[0] + : + value[1] + : + value[2]); setDisplayedArticleId((Long) value[2]); } My html page with the component look like this: ... body jwcid=@Body class=branch span jwcid=@menu:JSCookMenu source=ognl:menuModel value=ognl:menuItem theme=SmartGreen position=hbr !-- I had to add the 'b' in the a href posting so the text could be displayed, so please ignore the 'b' -- ab href=# jwcid=[EMAIL PROTECTED] listener=listener:onNavigate parameters=ognl:menuItem.value span jwcid=@Insert value=ognl:menuItem.value/ /ab /span ... This was my HTML part, using the props jar (a library), but you can get the caption from JSCookMenuItem properties span jwcid=@menu:JSCookMenu source=ognl:menuModel value=ognl:menuItem theme=Office2003 contentRenderer=ognl:itemRenderer position=hbr a href=# jwcid=[EMAIL PROTECTED] listener=listener:onMenuAction parameters=ognl:menuItem.value span jwcid=[EMAIL PROTECTED] value=prop:captionMenu / /a /span I had something like this and I resolve it as in somewhere I read, this is the .java code I use related with that component @InjectState(model) public abstract ArrayListIJSCookMenuItem getModel(); /** * The menu model provided by the java code * must be an instance of IterableIJSCookMenuItem */ public IterableIJSCookMenuItem getMenuModel(){ return getModel(); } /** * The 'menuItem' property referenced in the bindings. It provides the actual * rendered item of the model */ public abstract IJSCookMenuItem getMenuItem(); /** * construct a IMenuItemRenderer instance that is used to choose the * renderer component for a given item * In this example the items value * is an Array of the items name (String) and the type (ItemType) * See the contruction of the model in the pageBeginRender method */ private IMenuItemRenderer itemRenderer = new IMenuItemRenderer(){ public IComponent render(IJSCookMenuItem item) { String value = ((TMenuItem)(((BasicJSCookMenuItem)item).getValue())).getCodAccion(); if (getUser().tienePermiso(value)){ return getValidContentRenderer(); } else return null; } }; The onNavigate event is: public void onMenuAction(IRequestCycle cycle, Object value){ if (((TMenuItem)value).getQryEntry() != null ((TMenuItem)value).getQryEntry() != ){ try{ setMenuAction(((TMenuItem)value).getQryEntry()); ... doing something } catch (Exception ex){ ValidationDelegate delegate = getDelegate(); delegate.setFormComponent(null); delegate.record(ex.getMessage(), null); } } else return; } this is how I build the Menu protected BasicJSCookMenuItem addMenuItem(String caption, IAsset icon){ BasicJSCookMenuItem MnuConsultas = new BasicJSCookMenuItem(caption, icon); return MnuConsultas; } protected void RenderJSMenu(){ if(getModel().size() == 0){ BasicJSCookMenuItem mnuConsultas = new BasicJSCookMenuItem(new TMenuItem(Consultas, 7000, null)); getModel().add(mnuConsultas); BasicJSCookMenuItem mnuConsultasPresupuesto = new BasicJSCookMenuItem(new TMenuItem(Presupuesto, 7001, null));
Re: What's the more convenient way to add logging to a tapestry app?
Hello Kevin: Thanks Kevin, so, now I put on my hivemodule file this contribution configuration-id=tapestry.state.ApplicationObjects state-object name=Logger scope=application create-instance class=org.apache.commons.logging.Log/ /state-object /contribution I has a doubt about the create-instance part because commons-logging has its own LogFactory, and other doubt is about how I can set the properties file maybe (follow the example) create-instance class=org.apache.commons.logging.Log, log4j.configuration=/WEB-INF/classes/log4jproperties.xml/? My .java parent page @InjectState(Logger) protected abstract Log getLogger(); But now, my app complaint and show this message on the child page (even if I inject directly on MainForm.java) Error at context:/WEB-INF/MainForm.page, line 5, column 50: Method 'protected abstract org.apache.commons.logging.Log com.pct.SIG.MainPadre.getLogger()' (declared in class com.pct.SIG.MainPadre) has no implementation in class com.pct.SIG.MainForm (or enhanced subclass $MainForm_22). location: context:/WEB-INF/MainForm.page, line 5, column 50 1 ?xml version=1.0 encoding=UTF-8? 2 !DOCTYPE page-specification PUBLIC 3 -//Apache Software Foundation//Tapestry Specification 4.0//EN 4 http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd; 5 page-specification class=com.pct.SIG.MainForm 6 What I'm doing wrong?, because I don't have enough experience managing hivemind Thanks Kevin Menard escribió: Hi Jorge, It seems to me that an ASO would be your best bet. Give it an application scope and you'll only create a single instance for the life of your app. If you need to do some funky configuration when starting, then you can create a StateObjectFactory wrapper. A service would really only be necessary if you were looking to write some sort of facade, and even then, I'm not sure it'd gain you a whole lot. If you're looking to do it a bit more dynamically, you could look into using aspectj to hook in as appropriate. Hope that helps. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What's the more convenient way to add logging to a tapestry app?
Jorge Quiroga wrote: I has a doubt about the create-instance part because commons-logging has its own LogFactory, and other doubt is about how I can set the properties file maybe (follow the example) create-instance class=org.apache.commons.logging.Log, log4j.configuration=/WEB-INF/classes/log4jproperties.xml/? If you need to do some configuration, I'd recommend using a StateObjectFactory and using invoke-factory rather than create-instance in your HiveMind registry. My .java parent page @InjectState(Logger) protected abstract Log getLogger(); But now, my app complaint and show this message on the child page (even if I inject directly on MainForm.java) Error at context:/WEB-INF/MainForm.page, line 5, column 50: Method 'protected abstract org.apache.commons.logging.Log com.pct.SIG.MainPadre.getLogger()' (declared in class com.pct.SIG.MainPadre) has no implementation in class com.pct.SIG.MainForm (or enhanced subclass $MainForm_22). I think only public abstract methods get enhanced. Try changing the access modifier. -- Kevin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble with JSCookMenu
Thank you for your quick answer... I have build my web site based on components that is stored in the database so my entire website is dynamic. I have no frames or Iframes in tha site, the different regions are made by div tags and css. When I want do display for example an article that is picked from the menu I am visioning that I only set the parameters (type and id) and relod the same page so the content change in region C but all the other components is the same. when I generates my menu I do this with data from the database som my menu with corresponding menuItems is dynamic and therefor I do not need to maintain the menu system... I simply reads it from the database... I still have not figured out how you manage to display the name correct. You mention that you use props library. Is that one of your own creation or is that a public one? I will try to solve my onNavigate method... I got some idears from you... thanks again Jacob -- View this message in context: http://www.nabble.com/Trouble-with-JSCookMenu-tf2234887.html#a6198585 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form action not
Hello, I'm going through the last part in Chapter 10 of Enjoying Web Development with Tapestry (for tap 4). When I put the javascript calling code into a separate component, the form action in the main page is not showing up in the component. It's hard to be more complete and concise than tapestry, so here is the code: Home.html html body jwcid=@Body form jwcid=@Form action=http://www.foo.com; input jwcid=[EMAIL PROTECTED] msg=Are you sure? type=submit value=Delete/ /form /body /html Home.page ?xml version=1.0? !DOCTYPE page-specification PUBLIC -//Apache Software Foundation//Tapestry Specification 4.0//EN http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd; page-specification /page-specification ConfirmButton.html html body jwcid=$content$ input jwcid=button type=submit/ span jwcid=insertConfirmScript/ /body /html ConfirmButton.jwc ?xml version=1.0? !DOCTYPE component-specification PUBLIC -//Apache Software Foundation//Tapestry Specification 4.0//EN http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd; component-specification allow-body=no allow-informal-parameters=yes parameter name=msg required=yes/ component id=insertConfirmScript type=Script binding name=script value=literal:Confirm.script/ binding name=msg value=msg/ binding name=button value=components.button/ /component component id=button type=Submit inherit-informal-parameters=yes/ /component-specification Confirm.script ?xml version=1.0 encoding=UTF-8? !DOCTYPE script PUBLIC -//Apache Software Foundation//Tapestry Script Specification 3.0//EN http://jakarta.apache.org/tapestry/dtd/Script_3_0.dtd; script input-symbol key=msg required=yes/ input-symbol key=button required=yes/ let key=funcName unique=yesgetConfirmation/let body function ${funcName}() { return confirm(${msg}); } /body initialization document.${button.form.name}.${button.name}.onclick=${funcName}; /initialization /script This is the resulting html source code with the button: html body script type=text/javascript src=/IEIS/app?digest=557f2081d45a7528f898e7e384717596amp;path=%2Forg%2Fapache%2Ftapestry%2Fform%2FForm.jsamp;service=asset/script script type=text/javascript!-- function getConfirmation() { return confirm(Are you sure?); } // --/script form method=post action=/IEIS/app name=Form id=Form div style=display:none;input type=hidden name=formids value=button/ input type=hidden name=component value=$Form/ input type=hidden name=page value=Home/ input type=hidden name=service value=direct/ input type=hidden name=submitmode value=/ input type=hidden name=submitname value=/ /div input type=submit name=button id=button value=Delete/ /form script language=JavaScript type=text/javascript!-- Tapestry.register_form('Form'); document.Form.button.onclick=getConfirmation; Tapestry.set_focus('button'); // --/script/body /html Notice that the action is now IEIS/app which is the root of my application. My intention is that it should be http://www.foo.com;, as stated in Home.html Any ideas? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Obtaining check box data from a form
Mark, so as per your example, if i am understanding it corrently, i can only retrieve the boolean value and not the corresponding string associated with the checkbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Obtaining check box data from a form
Pretty much. There may be a way, but it is coded in the HTML. However, I don't think you need to do so. Or rather I don't think you should need the values that were displayed, they should be hard-coded text in an HTML form. Why do you need the text that is in the HTML? Name: Mark J. Stang Title: Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: Peter Dawn [mailto:[EMAIL PROTECTED] Sent: Thu 9/7/2006 4:38 PM To: Tapestry users Subject: Re: Obtaining check box data from a form Mark, so as per your example, if i am understanding it corrently, i can only retrieve the boolean value and not the corresponding string associated with the checkbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Obtaining check box data from a form
The example in the Component Reference doesn't provide the simplest example... Name: Mark J. Stang Title: Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: Peter Dawn [mailto:[EMAIL PROTECTED] Sent: Thu 9/7/2006 4:38 PM To: Tapestry users Subject: Re: Obtaining check box data from a form Mark, so as per your example, if i am understanding it corrently, i can only retrieve the boolean value and not the corresponding string associated with the checkbox. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form upload and download
Try this: The Upload is a Tapestry Component. It expects a method with the signature like below. HTML: tr td width=150 Filename /td td input type=file jwcid=@Upload file=ognl:page.visit.currentState.certFile size=30/nbsp* /td /tr This is probably done as part of button submit, like upload. errorMessage = null; if (certFile != null certFile.getSize() 0) { InputStream stream = certFile.getStream(); // process the stream... } This is the method Tapestry will call: public void setCertFile(IUploadFile certFile) { this.certFile = certFile; } hth, Mark Name: Mark J. Stang Title: Senior Engineer/Architect office: +1 303.468.2900 mobile: +1 303.507.2833 Ping Identity -Original Message- From: Peter Dawn [mailto:[EMAIL PROTECTED] Sent: Thu 9/7/2006 6:34 PM To: tapestry-user@jakarta.apache.org Subject: Form upload and download guys, i have been trying to implement a page upload and download functionality within my webapp. the upload example in tap3 doc seems to be incompelete. can somebody provide the page file content for that example. i am getting an ExpressBinding [UploadPage listener.formSubmit] error. any help pls. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form upload and download
It should be ognl:listeners.formSubmit. Note that listeners ends in an s. Cheers, Nick. Peter Dawn wrote: thats good. but i am still trying to get the upload example to work from the documentation. i am still getting the unable to resolve expression 'listener.formSubmit for com.example.pageUpload error. can somebody help me out here. - 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: Form upload and download
cheers mate. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File copy - Access denied error
guys, i am trying to implement a file upload function within my web app. now i am allowing the user to select a file using a browse button and then when they click upload, i copy it to a set folder on my server. however when i try to implement it i am getting a Access is denied error. I am using standard fileoutstream. uploadData = new FileOutputStream(C:\Share\); any ideas. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @Component copy-of
If it's not there then I'd say it's a bug since it's supposed to be a one to one sort of thing functionality wise..,..Anyone want to jira this? On 9/7/06, Martin Strand [EMAIL PROTECTED] wrote: I noticed that @Component has no copyOf parameter (like component id=... copy-of=.../) Is there a way to do something similar with annotations? I'm using the latest snapshot. Thanks, Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com