@Block, accessing the caller's properties
Hello, Can a Block-component access the page/component that's calling RenderBlock? Assume page C contains this call: jwcid=@RenderBlock block=ognl:someBlock Can someBlock access page C's properties? Thanks for your time! /Firas
Re: @Block, accessing the caller's properties
Check out Block's getInvoker() method. Try blockComponent.getInvoker().getPage().getSomePageProperty() Regards, Norbi Firas Adiler wrote: Hello, Can a Block-component access the page/component that's calling RenderBlock? Assume page C contains this call: jwcid=@RenderBlock block=ognl:someBlock Can someBlock access page C's properties? Thanks for your time! /Firas No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date: 2006.08.09. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation
I have a page which has mandatory validation on some of the fields. If I leave mandatory values blank, and change the value in other fields, when the form is submitted the changed values seem to be updated in the model even when errors are shown for the mandatory values. If I then leave my screen using a cancel button, the model has been updated for the values that were changed. Is this expected behaviour? Ideally the behaviour required is for none or all of the fields on the form to be updated, i.e. none if there is an error, or all if there is none. Can I get this behaviour? Cheers, Tim. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation
this is how tapestry works. field-level validations of one field are not known to other fields. we have a similar situation where we wanted to avoid DTOs and use Domain Objects (the exposed domain pattern). we find that the underlying objects can get dirtied in a number of ways. validation is just one such scenario. tacos ajax submits also cause transient values to be set. it's something you've to live with. just ensure your data does not make its way to the DB :-) On 8/10/06, Tim Sawyer [EMAIL PROTECTED] wrote: I have a page which has mandatory validation on some of the fields. If I leave mandatory values blank, and change the value in other fields, when the form is submitted the changed values seem to be updated in the model even when errors are shown for the mandatory values. If I then leave my screen using a cancel button, the model has been updated for the values that were changed. Is this expected behaviour? Ideally the behaviour required is for none or all of the fields on the form to be updated, i.e. none if there is an error, or all if there is none. Can I get this behaviour? Cheers, Tim. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks, Karthik
Re: new submitType parameter
It is required with a default value, so no one actually ever needs to specify it if they don't want to. On 8/10/06, Bernard Lange [EMAIL PROTECTED] wrote: Jesse Kuhnert wrote: I've added a new submitType parameter to all of the form submission components. ( http://tapestry.apache.org/tapestry4.1/components/Submit.html) I see it is a required parameter. Please do update the enclosed example accordingly, as now it does not use this param. Regards, Bernard - 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.
how to get the session id
Hello, I need to retrieve the session ID (JSESSIONID) from IRequestCycle. Is there way to do that ? Would be nice if someone have the solution of this non-urgent problem. Cheers, Didier
Re: how to get the session id
Hi! You can get the Session id like this: cycle.getInfrastructure().getRequest().getSession(true).getId(); Cheers, Mika Tapestry User List wrote: Hello, I need to retrieve the session ID (JSESSIONID) from IRequestCycle. Is there way to do that ? Would be nice if someone have the solution of this non-urgent problem. Cheers, Didier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Component Design questions
Hello there! First, I'm sorry about the previous e-mail, I really thought that the name was being duplicated :(. Sorry for the spam I got stuck into a problem here. I'm building my datetime component. First I thought using a template for it, but later I figured that I needed to extend AbstractFormComponent, and this can not have a template right? This is how my component looks like: component-specification class=com.synos.pbh.chat.view.components.DateTime allow-body=yes allow-informal-parameters=yes description Simple Date and Time Component /description parameter name=displayName description The name of the field, which may be used by a FieldLabel. /description /parameter parameter name=validators/ parameter name=style required=no default-value=literal:input/parameter parameter name=value required=yes/parameter component id=days type=PropertySelection binding name=model value=daysInMonth/binding binding name=value value=selectedDay/binding binding name=name value=ognl:getNestedName('days')/binding /component component id=months type=PropertySelection binding name=model value=months/binding binding name=value value=selectedMonth/binding /component component id=years type=PropertySelection binding name=model value=years/binding binding name=value value=selectedYear/binding /component component id=hours type=TextField binding name=value value=inputHour/binding /component component id=minutes type=TextField binding name=value value=inputMinute/binding /component inject property=validatableFieldSupport object=service:tapestry.form.ValidatableFieldSupport/ inject property=translatedFieldSupport object=service:tapestry.form.TranslatedFieldSupport/ /component-specification Ok, as you can see my component is composed of 4 other components, I thought that would be easier than write them all using IRequestWriter (mostly the PropertySelection ones :P ) But that was working fine for a component with a template, I've faced some problems with this new approach, the first is the way I render the component: protected void renderFormComponent(IMarkupWriter writer, IRequestCycle cycle) { if(getValue() != null){ assignValues(); } Iterator it = getComponents().keySet().iterator(); while(it.hasNext()){ IComponent component = (IComponent)getComponents().get(it.next()); component.render(writer, cycle); } } Well it does render the components, but I'd like to add some informal parameters for each (like style, size, min/max lengths) So here goes the first question, how do I do this? Second is regarding the rewindFormComponent phase: protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle) { GregorianCalendar cal = new GregorianCalendar(Integer.parseInt(getSelectedYear()),Integer.parseInt(getSelectedMonth()),Integer.parseInt(getSelectedDay()),Integer.parseInt(getInputHour()),Integer.parseInt(getInputMinute())); setValue(cal); } Well, this does not work, I was expecting the abstract getters to be filled by my component, of course I was wrong, misunderstood the whole component life-cycle (again :P ). Now I'm facing another huge problem (at least on my point of view) I've changed the method to this: protected void rewindFormComponent(IMarkupWriter writer, IRequestCycle cycle) { String day = cycle.getParameter(getComponent(days).getId()); String month = cycle.getParameter(getComponent(months).getId()); String year = cycle.getParameter(getComponent(months).getId()); String hour = cycle.getParameter(getComponent(hours).getId()); String minute = cycle.getParameter(getComponent(minutes).getId()); } Having two of this components on my pages gives me twice nested components like (days, days_0, months, months_0 and so on). So I tried the method above hopping that for each component, I could set the correct value. Once again I was wrong, What I get now is: Rewind of form cadastrarEvento/cadastroForm expected allocated id #7 to be 'days', but was 'dataTermino' (requested by component cadastrarEvento/dataTermino). Well, to explain, my dateTime component (I have two on the page, the first is called dataInicio and the second DataTermino) I guess I had a problem when trying to rewind the second component, it seems that my nested components got the ID that the parent had. So this is the second question, how do I solve this? Please any directions would be mostly appreciated Best regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Ajax in Tap 4.1
Hi, Still playing around with Tapestry 4.1 it seems I just can't get Ajax to work in any case. I created the following simple example which doesn't do Ajax. It just makes a regular request: My html: a href=# jwcid=[EMAIL PROTECTED] listener=listener:listen updateComponents=ognl:{'testajax'}Hello!/a span jwcid=[EMAIL PROTECTED] value=ognl:toggle id=testajax/ My class: public void listen(IRequestCycle cycle) { setToggle(!getToggle()); } The html produced: a href=/test/app?component=linkamp;page=Homeamp;service=directamp;session= T id=linkHello world!/a Is there something missing that I'm just not seeing? Is there something Tap 4.1 needs to activate ajax? I''m using ajaxEnabled=ognl:true on my @Shell component just to be safe. When using Tacos it was expected that anytime the Ajax* components where used, the request should be an Ajax request, I'm not sure how to do that in Tap 4.1. I assume it knows either because of the updateComponents parameter or because of an attatched @EventListener annotation. I also tried using @EventListener (with a onmouseover event) with no success. It does generate the appropriate javascript (dojo.event.connect(dojo.byId(link), onMouseOver, function(e). ) but nothing happens when I try to use it. I appreciate any help. Denis Souza
Re: [OT] tomcat not letting my app serve up templates
Check your web.xml to make sure you configured Tapestry to handle that particular extension. On 8/10/06, Dan Adams [EMAIL PROTECTED] wrote: Ok, when I run the app in jetty this works fine and I don't remember having this problem with other tomcat installs. When I request a path that is a file that exists on the filesystem, like /admin/Home.html, then tomcat will server up the template and tapestry never gets to intepret it. but when i request a short url that is rewritten, like /article/2, then the app gets to handle it like normal. any ideas? -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cumprimentos, Rui Pacheco
Re: [OT] tomcat not letting my app serve up templates
I have this: servlet-mapping servlet-nameapp/servlet-name url-pattern*.html/url-pattern /servlet-mapping On 8/10/06, Dan Adams [EMAIL PROTECTED] wrote: Ok, when I run the app in jetty this works fine and I don't remember having this problem with other tomcat installs. When I request a path that is a file that exists on the filesystem, like /admin/Home.html, then tomcat will server up the template and tapestry never gets to intepret it. but when i request a short url that is rewritten, like /article/2, then the app gets to handle it like normal. any ideas? -- Dan Adams Senior Software Engineer Interactive Factory 617.235.5857 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Cumprimentos, Rui Pacheco
Hidden fields in multiple forms don't have unique ids.
Not sure if this is a bug or how it was intended. I'm using Tap 4.0.2. I have a component that has a Form and some Hidden components within it. I'm using the id of the hidden components to update the field in javascript on the client side. My problem is, on a page that has more than one of these components, the hidden fields are not getting unique ids. Hidden.jwc uses the id parameter to set clientId directly without guaranteeing it is unique. Was there a design reason for this or is this a bug? Thanks, Andrew Ofisher
RE: Ajax in Tap 4.1
Yes, that's it! Don't know how I could have missed that. Thank you! Denis Souza -Original Message- From: Norbert Sándor [mailto:[EMAIL PROTECTED] Sent: quinta-feira, 10 de agosto de 2006 13:26 To: Tapestry users Subject: Re: Ajax in Tap 4.1 I didn't try but maybe parameter async=true should be specified on the DirectLink. It is false by default. Regards, Norbi Denis Souza wrote: Hi, Still playing around with Tapestry 4.1 it seems I just can't get Ajax to work in any case. I created the following simple example which doesn't do Ajax. It just makes a regular request: My html: a href=# jwcid=[EMAIL PROTECTED] listener=listener:listen updateComponents=ognl:{'testajax'}Hello!/a span jwcid=[EMAIL PROTECTED] value=ognl:toggle id=testajax/ My class: public void listen(IRequestCycle cycle) { setToggle(!getToggle()); } The html produced: a href=/test/app?component=linkamp;page=Homeamp;service=directamp;session= T id=linkHello world!/a Is there something missing that I'm just not seeing? Is there something Tap 4.1 needs to activate ajax? I''m using ajaxEnabled=ognl:true on my @Shell component just to be safe. When using Tacos it was expected that anytime the Ajax* components where used, the request should be an Ajax request, I'm not sure how to do that in Tap 4.1. I assume it knows either because of the updateComponents parameter or because of an attatched @EventListener annotation. I also tried using @EventListener (with a onmouseover event) with no success. It does generate the appropriate javascript (dojo.event.connect(dojo.byId(link), onMouseOver, function(e). ) but nothing happens when I try to use it. I appreciate any help. Denis Souza No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date: 2006.08.09. - 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]
tapernate anonymous svn access?
I'm having problems getting to Tapernate's SVN repository without a username and password (the url from the webpage is: http://svn.javaforge.com/svn/tapestry/tapernate/trunk). Is anyone else having problems or have I done something silly? Thanks, Danny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question about validation
Hello there! I'm having problems with validators... First, my page is not validating required fields anymore (at least not when I set a new ValidationDelegate): public class CustomDelegate extends ValidationDelegate { public void writeAttributes(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component, IValidator validator) { if(isInError()){ writer.attribute(style, border:thin;border-color:#FF;); } } } bean name=customDelegate class=*.*.*.CustomDelegate/bean component id=cadastroForm type=Form binding name=delegate value=bean:customDelegate/binding /component Also, I'm recording an error on my custom component using: getForm().getDelegate().record(this, getPage().getMessages().getMessage(error.invalid.time)); And on my Page listener method I use: alidationDelegate delegate = (ValidationDelegate) getBeans().getBean(customDelegate); if(delegate.isInError()){ return null; } But delegate.isInError() is returning false. All my fields are required, and even if I don't write anything on them, I still can't get an error. Any ideas? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry4.1 TimeTracker source code
Could someone please let me know where I can download the source code for Tapestry4.1 TimeTracker demo ? Shing Home page : http://uk.geocities.com/matmsh/index.html ___ Copy addresses and emails from any email account to Yahoo! Mail - quick, easy and free. http://uk.docs.yahoo.com/trueswitch2.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: @Block, accessing the caller's properties
Hello Norbi, I used this ognl expression: components.MyBlock.invoker.page.someProperty and it worked like a charm. Thank you! /Firas -Original Message- From: Norbert Sándor [mailto:[EMAIL PROTECTED] Sent: Thursday, August 10, 2006 11:46 AM To: Tapestry users Subject: Re: @Block, accessing the caller's properties Check out Block's getInvoker() method. Try blockComponent.getInvoker().getPage().getSomePageProperty() Regards, Norbi Firas Adiler wrote: Hello, Can a Block-component access the page/component that's calling RenderBlock? Assume page C contains this call: jwcid=@RenderBlock block=ognl:someBlock Can someBlock access page C's properties? Thanks for your time! /Firas -- -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.394 / Virus Database: 268.10.8/414 - Release Date: 2006.08.09. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hidden fields in multiple forms don't have unique ids.
I could be wrong, but I don't think you'll have this problem in 4.1. (Specifically it would be better to use the latest 4.1.1-SNAPSHOT build. ) On 8/10/06, Andrew Ofisher [EMAIL PROTECTED] wrote: Not sure if this is a bug or how it was intended. I'm using Tap 4.0.2. I have a component that has a Form and some Hidden components within it. I'm using the id of the hidden components to update the field in javascript on the client side. My problem is, on a page that has more than one of these components, the hidden fields are not getting unique ids. Hidden.jwc uses the id parameter to set clientId directly without guaranteeing it is unique. Was there a design reason for this or is this a bug? Thanks, Andrew Ofisher -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
Contrib:Table problems with layout
Hello there! *I've seen some discussions regarding this topic but didn't find one that could help* I was having problems with the layout of my table, but I was ignoring, thinking that might have been a tag opened that I left open. Today I look it closer and found out that seems to be a bug. My page uses a template with renderbody/renderblock, it's something like this., really simple: html @shell body @body table tr td//header goes here/td /tr tr tdspan [EMAIL PROTECTED]//td /tr /table That's it for the template. The page I insert the table has a table and a form: span jwcid=@MyLayout span @Form table .../table br table jwcid=contribTable/table /span /span What's happening is that the contrib table is being displayed totally out of place, on the right side of the page. I've replaced the dynamic generated table by a static one, and It is laid on the correct place. Any ideas? PS:Hope get some answers on this post (after so many empty :( ) :P - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Checkbox inside contrib:table (again)
Sorry taking so long, I was busy with my datetime component, almost ready, hope post it here soon :) That did not work, could you post a more clear explanation? maybe a full example if its not asking much On 8/8/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: table jwcid=[EMAIL PROTECTED]:Table columns=foo,bar,baz row=ognl:currRow/ span jwcid=[EMAIL PROTECTED] labelinput type=checkbox jwcid=@Checkbox selected=ognl:currRow.baz / Baz/label /span Robert Hello there! I've searched the list I got very surprised on how many questions about this subject, and how many psychedelic answers. Is there an easy (hack free) way to add a checkbox to a table component? Is there a good example? Would there be a good soul to give it, maybe contribute to wiki? Best regards - 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: Contrib:Table problems with layout
This sounds like an HTML issue. Tapestry components are added into standard HTML, they do not generate any different HTML than you have already specified. For example, you say the contribTable appears at the right of the page, perhaps you are specifying widths on your static tables - maybe you need to add the width parameter to your contribTable. Cheers mc On 10 Aug 2006 at 18:48, Vinicius Carvalho wrote: Hello there! *I've seen some discussions regarding this topic but didn't find one that could help* I was having problems with the layout of my table, but I was ignoring, thinking that might have been a tag opened that I left open. Today I look it closer and found out that seems to be a bug. My page uses a template with renderbody/renderblock, it's something like this., really simple: html @shell body @body table tr td//header goes here/td /tr tr tdspan [EMAIL PROTECTED]//td /tr /table That's it for the template. The page I insert the table has a table and a form: span jwcid=@MyLayout span @Form table .../table br table jwcid=contribTable/table /span /span What's happening is that the contrib table is being displayed totally out of place, on the right side of the page. I've replaced the dynamic generated table by a static one, and It is laid on the correct place. Any ideas? PS:Hope get some answers on this post (after so many empty :( ) :P - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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.405 / Virus Database: 268.10.8/415 - Release Date: 9/08/2006 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Checkbox inside contrib:table (again)
On Fri, Aug 11, 2006 at 08:26:51AM +1000, Murray Collingwood wrote: When you are using the contrib:Table you specify the columns parameter for each column to appear in your table. I think you understand this but you haven't mentioned much detail. So, in Robert's example there are 3 columns defined. By default each column will be populated with data from that property as each row is processed. Is this working for you. You haven't mentioned but I will again assume this is working. Next, you want to add or replace a column with a checkbox. You then code the span jwcid=[EMAIL PROTECTED]Something else/span to specify the replacement column value for this property (that is the property is no longer displayed and in it's place something else is inserted). Robert's example closed the table too early, however that it easily corrected and we can expand it to include some other parameters. Something like: 2 notes here: 1) I forgot to put the source attribute in my example, as you noticed. :) 2) The block's don't have to be enclosed within the table component. They can come before the table, or after it, or wherever. :) Robert table jwcid=[EMAIL PROTECTED]:Table columns=foo,bar,baz source=ognl:myCollectionOfValues row=ognl:currRow span jwcid=[EMAIL PROTECTED] labelinput type=checkbox jwcid=@Checkbox selected=ognl:currRow.baz / Baz/label /span /table Maybe this will work for you. Cheers mc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Properties file export
guys, is there a way for me to export all my properties file content into another file. or if i need to backup my content is there a way for me to somehow export this content into another file and then store it somewhere. i hope i make sense :-) thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hidden fields in multiple forms don't have unique ids.
I'd be happy to use 4.1 when it becomes stable (I'm not sure it is production quality yet? Am I wrong?). Meanwhile I just threw together my own component to generate a hidden field with a unique id. Andrew On 8/10/06, Jesse Kuhnert [EMAIL PROTECTED] wrote: I could be wrong, but I don't think you'll have this problem in 4.1. (Specifically it would be better to use the latest 4.1.1-SNAPSHOT build. ) On 8/10/06, Andrew Ofisher [EMAIL PROTECTED] wrote: Not sure if this is a bug or how it was intended. I'm using Tap 4.0.2 . I have a component that has a Form and some Hidden components within it. I'm using the id of the hidden components to update the field in javascript on the client side. My problem is, on a page that has more than one of these components, the hidden fields are not getting unique ids. Hidden.jwc uses the id parameter to set clientId directly without guaranteeing it is unique. Was there a design reason for this or is this a bug? Thanks, Andrew Ofisher -- Jesse Kuhnert Tapestry/Dojo/(and a dash of TestNG), team member/developer Open source based consulting work centered around dojo/tapestry/tacos/hivemind.
Colour Picker and XY co-ordinates
guys, i am trying to create a sort of colour picker. what i want to do is, i want to load an image and then when the user moves their mouse over the image, i want to display the RGB values at the mouse tooltip (and possibly also the X and Y co-ord). has anyone done something like this before. thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to store the query parameters in a Table component?
use persist=client 2006/8/8, Gurps [EMAIL PROTECTED]: Hi, this is exactly my problem too. Have you found the solution? many thanks -- View this message in context: http://www.nabble.com/How-to-store-the-query-parameters-in-a-Table-component--tf1685056.html#a5701412 Sent from the Tapestry - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Welcome to China Java Users Group(CNJUG). http://cnjug.dev.java.net