Re: Use Jumpstart tools to create a fresh project
Ok, I got where the problem is. When you use the tools to create a new project, everything seems to be set correctly, except the following two files: BusinessIntegrationTestSuite.java and the BusinessUnitTestSuite.java. They for some reason still use the default package: com.acme.yourapp.business instead of the correct package according to your following settings in tools.properties fresh.project.package= after correct that, the eclipse complaints went away and everything seems to be working great. Thanks :-):working: faye alaska wrote: > > Did anyone try the "create fresh project" in the jumpstart? > I just did it and it was great to use! > I only have one problem -- I get the "Errors in workspace" window saying > "errors exists in project myapps, proceed with launch?" when "run > configuration". However, if I proceed, I can actually access all the pages > from http://localhost:8080/myapps. I even used the openejb.3.1.2. -- I am > wondering if this is the cause since this is the only variable from the > jumpstart that I tried earlier. > Before I switch back to openejb.3.1.1, I am wondering if this behavior is > to be expected. > Anyways, it is so very cool! > Faye > -- View this message in context: http://old.nabble.com/Use-Jumpstart-tools-to-create-a-fresh-project-tp27412498p27415802.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: problem with component
I should add that > SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, > link.toAbsoluteURI()); comes from ComponentEventLinkEncoderMethodAdvice#rewriteIfNeeded On Mon, Feb 1, 2010 at 9:20 PM, Josh Canfield wrote: > Ok, I found the problem. > The form action is created like so: > void beginRender(MarkupWriter writer) > { > Link link = > resources.createFormEventLink(EventConstants.ACTION, context); > > It then pulls the query parameters from the link and sticks them into > hidden fields. The problem is that when you rewrite a url the first > thing it does is converts the link toAbsoluteURI > > SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, > link.toAbsoluteURI()); > > which drops the containing the page context (t:ac) because it's in the > links parameters, and the link is for a form. > From LinkImpl: > private String buildURI() > { > if (forForm || parameters == null) > return absoluteURI; > ... > > > So, the form is built without the page context... > > Seems mildly suspicious that the link knows it's for a form. The > javadoc says: "Query parameters are never added to a forForm link." > But I'm not coming up with a good reason why... if the form want's to > treat the query params special then shouldn't it strip them off? > > Josh > > > > On Sun, Jan 31, 2010 at 5:45 AM, Jan Jirout wrote: >> Hi, >> >> This is really code that I'm running. I really hope that I'm not wrong about >> that. Code that I posted shouldn't affected result of filter. I'm using >> tapestry version 5.1.0.5. I added simple project demonstrating the problem. >> >> In attachment is example application demonstrating that SimpleRequestWrapper >> in my case somehow change the request. >> >> Let me closely describe used use case. I have component Discussion, this >> discussion is used at different king of pages. In object Discussion there >> should be inject object implementing ActionRemote. When user submit new >> comment is called ActionRemote.onAction(CommentForm form). Injecting of >> concrete ActionRemote implementation is done in main page (User) during >> executing onActivate phase. >> >> In attached example, there are two ways how to demonstrate problem: >> * start application by "mvn jetty:run" and then access User page and >> submit filled form. And you'll see exception saying that page context is >> missing. >> * try to run test case UserTest.testSubmitForm() and you'll see same >> exception >> >> I hope, that attached example will works in yours environment. Please try to >> look at my example, it's possible that I doing something wrong. >> >> Jan >> >> Josh Canfield wrote: I tried to use following code: public Request process(Request request, URLRewriteContext context) { return new SimpleRequestWrapper(request, request.getPath()); } When I use this code then context of component event is even lost. I didn't find way how to create SimpleRequestWrapper with component even context. >>> >>> This is surprising. I hate to ask, but are you really sure this is the >>> code that is running? What you have here should be the equivalent to >>> doing nothing. What version of tapestry are you using? >>> >>> >>> Josh >>> >>> On Sat, Jan 30, 2010 at 2:56 PM, Jan Jirout wrote: >>> Hi, thanks for answer. In my real application I change just pieces of path but it didn't work. I tried to use following code: public Request process(Request request, URLRewriteContext context) { return new SimpleRequestWrapper(request, request.getPath()); } When I use this code then context of component event is even lost. I didn't find way how to create SimpleRequestWrapper with component even context. Just in case when I call "return request;" from "process" method is component event context correctly passed. If you would like to see example application I can send it to conference. regards Jan Thiago H. de Paula Figueiredo wrote: > > On Sat, 30 Jan 2010 19:58:34 -0200, Jan Jirout > wrote: > > >> >> Hi All, >> > > Hi! > > >> >> I have strange problem with URL rewriting. I'm changing path name in >> URLRewriterRule. In following way: >> >> public Request process(Request request, URLRewriteContext context) >> { >> return new SimpleRequestWrapper(request, "somePath"); >> } >> > > The above rule rewrites *all* URLs to "somePath", losing any context or > query parameters. You should use string manipulation to extract the > original > page name and then replace it with the new page name. > > If a request to "/original/1 arrives", your should rewrite it to > "/new/1". > You can use path.replace("/original/", "/new/") to do that,
Re: problem with component
Ok, I found the problem. The form action is created like so: void beginRender(MarkupWriter writer) { Link link = resources.createFormEventLink(EventConstants.ACTION, context); It then pulls the query parameters from the link and sticks them into hidden fields. The problem is that when you rewrite a url the first thing it does is converts the link toAbsoluteURI SimpleRequestWrapper fakeRequest = new SimpleRequestWrapper(request, link.toAbsoluteURI()); which drops the containing the page context (t:ac) because it's in the links parameters, and the link is for a form. >From LinkImpl: private String buildURI() { if (forForm || parameters == null) return absoluteURI; ... So, the form is built without the page context... Seems mildly suspicious that the link knows it's for a form. The javadoc says: "Query parameters are never added to a forForm link." But I'm not coming up with a good reason why... if the form want's to treat the query params special then shouldn't it strip them off? Josh On Sun, Jan 31, 2010 at 5:45 AM, Jan Jirout wrote: > Hi, > > This is really code that I'm running. I really hope that I'm not wrong about > that. Code that I posted shouldn't affected result of filter. I'm using > tapestry version 5.1.0.5. I added simple project demonstrating the problem. > > In attachment is example application demonstrating that SimpleRequestWrapper > in my case somehow change the request. > > Let me closely describe used use case. I have component Discussion, this > discussion is used at different king of pages. In object Discussion there > should be inject object implementing ActionRemote. When user submit new > comment is called ActionRemote.onAction(CommentForm form). Injecting of > concrete ActionRemote implementation is done in main page (User) during > executing onActivate phase. > > In attached example, there are two ways how to demonstrate problem: > * start application by "mvn jetty:run" and then access User page and > submit filled form. And you'll see exception saying that page context is > missing. > * try to run test case UserTest.testSubmitForm() and you'll see same > exception > > I hope, that attached example will works in yours environment. Please try to > look at my example, it's possible that I doing something wrong. > > Jan > > Josh Canfield wrote: >>> >>> I tried to use following code: >>> >>> public Request process(Request request, URLRewriteContext context) { >>> return new SimpleRequestWrapper(request, request.getPath()); >>> } >>> >>> When I use this code then context of component event is even lost. I >>> didn't >>> find way how to create SimpleRequestWrapper with component even context. >>> >> >> This is surprising. I hate to ask, but are you really sure this is the >> code that is running? What you have here should be the equivalent to >> doing nothing. What version of tapestry are you using? >> >> >> Josh >> >> On Sat, Jan 30, 2010 at 2:56 PM, Jan Jirout wrote: >> >>> >>> Hi, >>> >>> thanks for answer. >>> >>> In my real application I change just pieces of path but it didn't work. >>> >>> I tried to use following code: >>> >>> public Request process(Request request, URLRewriteContext context) { >>> return new SimpleRequestWrapper(request, request.getPath()); >>> } >>> >>> When I use this code then context of component event is even lost. I >>> didn't >>> find way how to create SimpleRequestWrapper with component even context. >>> >>> Just in case when I call "return request;" from "process" method is >>> component event context correctly passed. >>> >>> If you would like to see example application I can send it to conference. >>> >>> regards >>> >>> Jan >>> >>> >>> Thiago H. de Paula Figueiredo wrote: >>> On Sat, 30 Jan 2010 19:58:34 -0200, Jan Jirout wrote: > > Hi All, > Hi! > > I have strange problem with URL rewriting. I'm changing path name in > URLRewriterRule. In following way: > > public Request process(Request request, URLRewriteContext context) > { > return new SimpleRequestWrapper(request, "somePath"); > } > The above rule rewrites *all* URLs to "somePath", losing any context or query parameters. You should use string manipulation to extract the original page name and then replace it with the new page name. If a request to "/original/1 arrives", your should rewrite it to "/new/1". You can use path.replace("/original/", "/new/") to do that, for example. >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >> >> >> >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
Re: getLogicalPageName for index page
On Mon, 01 Feb 2010 23:44:09 -0200, Jonhy Pear wrote: Hi again, Hi! Component page = componentSource.getComponent(pageName); Try using getPage() instead of getComponent(). -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
getLogicalPageName for index page
Hi again, I'm trying to intercept the pages that are requested in order to add some security has explained by Howard here: http://markmail.org/search/?q=tapestry%20authorization#query:tapestry%20authorization+page:1+mid:pyjcj7coe253bkcd+state:results However I'm getting an IllegalArgumentException Parameter completeId was null or contained only whitespace. in the following line: Component page = componentSource.getComponent(pageName); My code is the following: public void handlePageRender(PageRenderRequestParameters parameters, ComponentRequestHandler handler) throws IOException { if (dispatchToLoginPage(parameters.getLogicalPageName())) { return; } handler.handlePageRender(parameters); } private boolean dispatchToLoginPage(String pageName) { Component page = componentSource.getComponent(pageName); >Exception is raise here if (page.getClass().isAnnotationPresent(DontRequireLogin.class)) { return true; } return false; } This only happens when I use the root context of webapp, i.e. http://localhost:8080/webapp/ If I use http://localhost:8080/webapp/index it does not give the error. I guess that this is happening because there is no page associated with root (/)? How can I get the correct page? Sorry, if this is a silly question, but I'm learning :) Thank you, Jp
Re: log4j configuration
Thank you Thiago and Howard for the quick responses. @Thiago, I just though to customize things to have the name of the application, but I don't really have a good reason to change the name. Regards, JP On Tue, Feb 2, 2010 at 12:21 AM, Howard Lewis Ship wrote: > The archetype generates a log4j.properties configuration file as well. > I can't think of why renaming the filter would change things, though > it would prevent your AppModule from being loaded (you have to rename > it to match the filter) ... perhaps you are missing some of the > logging there, rather than in your components. > > On Mon, Feb 1, 2010 at 4:09 PM, Jonhy Pear wrote: > > Hi, > > > > I started a T5.1 app with maven archetype. I can use the Logger just as > > expected : > > > > private static final Logger LOG = > LoggerFactory.getLogger(AppModule.class); > > > > LOG.debug("Something") > > ... > > > > The logs get into the console of jetty as expected. > > > > But if I change the name of the filter in Web.xml from "app" to > > "anythingApp" like this: > > > > > >anythingApp > >org.apache.tapestry5.TapestryFilter > > > > > >anythingApp > >/* > > > > > > > > The logs just stop work and don't show up anymore... > > > > I'm just starting to digg into T5, and if you can give me some details > why > > this happening, then great. > > > > Thank you, > > > > JP > > > > > > -- > Howard M. Lewis Ship > > Creator of Apache Tapestry > > The source for Tapestry training, mentoring and support. Contact me to > learn how I can get you up and productive in Tapestry fast! > > (971) 678-5210 > http://howardlewisship.com > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: log4j configuration
The archetype generates a log4j.properties configuration file as well. I can't think of why renaming the filter would change things, though it would prevent your AppModule from being loaded (you have to rename it to match the filter) ... perhaps you are missing some of the logging there, rather than in your components. On Mon, Feb 1, 2010 at 4:09 PM, Jonhy Pear wrote: > Hi, > > I started a T5.1 app with maven archetype. I can use the Logger just as > expected : > > private static final Logger LOG = LoggerFactory.getLogger(AppModule.class); > > LOG.debug("Something") > ... > > The logs get into the console of jetty as expected. > > But if I change the name of the filter in Web.xml from "app" to > "anythingApp" like this: > > > anythingApp > org.apache.tapestry5.TapestryFilter > > > anythingApp > /* > > > > The logs just stop work and don't show up anymore... > > I'm just starting to digg into T5, and if you can give me some details why > this happening, then great. > > Thank you, > > JP > -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: log4j configuration
On Mon, 01 Feb 2010 22:09:01 -0200, Jonhy Pear wrote: Hi, Hi! anythingApp org.apache.tapestry5.TapestryFilter anythingApp /* The default module name is based on the filter name. You should rename AppModule to AnythingAppModule for it to work. Or, better yet, just use app as the filter name. Is there any reason to change it? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
log4j configuration
Hi, I started a T5.1 app with maven archetype. I can use the Logger just as expected : private static final Logger LOG = LoggerFactory.getLogger(AppModule.class); LOG.debug("Something") ... The logs get into the console of jetty as expected. But if I change the name of the filter in Web.xml from "app" to "anythingApp" like this: anythingApp org.apache.tapestry5.TapestryFilter anythingApp /* The logs just stop work and don't show up anymore... I'm just starting to digg into T5, and if you can give me some details why this happening, then great. Thank you, JP
Use Jumpstart tools to create a fresh project
Did anyone try the "create fresh project" in the jumpstart? I just did it and it was great to use! I only have one problem -- I get the "Errors in workspace" window saying "errors exists in project myapps, proceed with launch?" when "run configuration". However, if I proceed, I can actually access all the pages from http://localhost:8080/myapps. I even used the openejb.3.1.2. -- I am wondering if this is the cause since this is the only variable from the jumpstart that I tried earlier. Before I switch back to openejb.3.1.1, I am wondering if this behavior is to be expected. Anyways, it is so very cool! Faye -- View this message in context: http://old.nabble.com/Use-Jumpstart-tools-to-create-a-fresh-project-tp27412498p27412498.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Need help regarding Bean Edit Form
You can also override the element's editor by adding a name="yourElementName"> and then conditionalizing whether to have an input field or a display field. I use this technique for editors that allow only some people to edit some fields. Norman Franke Answering Service for Directors, Inc. www.myasd.com On Feb 1, 2010, at 12:01 PM, Thiago H. de Paula Figueiredo wrote: On Mon, 01 Feb 2010 14:54:16 -0200, Jagadesh Paladugula > wrote: But I couldn't find solution for Bean Edit Form customization for which I posted the query. Help me with a good example which solves a complex customization use case of Bean Edit Form. Provide the BeanModel (model parameter) yourself. Inject the BeanModelSource, use its methods to get a BeanModel, then use the BeanModel methods to shape it like you want. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: IE6 and inPlace Grid
Just for the record: This is related to IE6 in Wine not being installed with ActiveX by default. If you use ies4linux to install IE6 in Wine on linux, all the AJAX stuff works again. Regards Moritz Am 01.02.2010 um 13:53 schrieb Moritz Gmelin: > Hi, > > I just discovered that the standard InPlace Grid seems to be broken with IE 6 > (T5.1.05) > > http://tapestry-test.appspot.com/inplacegriddemo > > Well at least with my IE6 that I run on Linux with Wine to test our > application compatibility. > Is this an issue with IE6 in Wine or is it a known problem that InPlace Grids > and other Ajax Stuff does not work in IE6 at all? > > Regards > > Moritz > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Need help regarding Bean Edit Form
On Mon, 01 Feb 2010 14:54:16 -0200, Jagadesh Paladugula wrote: But I couldn't find solution for Bean Edit Form customization for which I posted the query. Help me with a good example which solves a complex customization use case of Bean Edit Form. Provide the BeanModel (model parameter) yourself. Inject the BeanModelSource, use its methods to get a BeanModel, then use the BeanModel methods to shape it like you want. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Need help regarding Bean Edit Form
Thanks a lot. This link has good set of examples Good one to start with. But I couldn't find solution for Bean Edit Form customization for which I posted the query. Help me with a good example which solves a complex customization use case of Bean Edit Form. Thanks in advance. Regards, Jagadesh On Mon, Feb 1, 2010 at 6:24 PM, Alexander Muthmann wrote: > Hi Jagadesh, > > on this webpage > http://tapestry.apache.org/tapestry5/guide/beaneditform.html you can find > some simple examples for a beaneditform. > There is also one point about using a custom model or modifing the > exisiting, that's what you need. > > Another great source for examples is this one: > http://jumpstart.doublenegative.com.au:8080/jumpstart/theapp > > Greetings > > > On 01.02.2010 13:43, Jagadesh Paladugula wrote: > >> Want to add one more simple use case >> >> Want to disable some fields in edit mode and enable in create mode >> >> Regards, >> Jagadesh >> >> On Mon, Feb 1, 2010 at 6:11 PM, Jagadesh Paladugula< >> jagadeshpaladug...@gmail.com> wrote: >> >> >> >>> Hi Everyon >>> >>> I have started using Tapestry5 recently in our project. I need help >>> regarding Bean Edit Form. >>> >>> I have a use case where I want to show some fields in create mode and >>> hide >>> the same fields in edit mode (this just for an example). >>> >>> I have fulfilled the requirement with out use of Bean Edit Form, using >>> standalone forms. But In my project I have lot of forms. If some common >>> layout thing changes in future I have to change in many places if I go >>> with >>> standalone form. >>> >>> I want to use Bean Edit Form for complex requirements. >>> >>> Please help me with some examples on Bean Edit Form with complex >>> requirements >>> >>> Thanks in advance. >>> >>> -- >>> Regards >>> Jagadesh >>> >>> >>> >> >> >> >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Regards Jagadesh
Re: [T5] Component Param in a Mixin
On Mon, 01 Feb 2010 14:30:17 -0200, Matt78 wrote: Hy, Hi! I'm writing a mixin which schould copy the text inside one component to another component on a page unsing javascript. My question: How can I use a component as a parameter, because i need from both comopnents the id. You can inject the component at which you're using the mixin with @InjectComponent. A component can be a parameter as any other, just make sure you're using the component binding: component:. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
[T5] Component Param in a Mixin
Hy, I'm writing a mixin which schould copy the text inside one component to another component on a page unsing javascript. My question: How can I use a component as a parameter, because i need from both comopnents the id. Both components exists in different zones. thx -- View this message in context: http://n2.nabble.com/T5-Component-Param-in-a-Mixin-tp4495265p4495265.html Sent from the Tapestry Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Form and Zone inside a loop
Hi, You have to find what is failing on the client side. If a submit action refreshes the whole page, this means that the zone has not been initialized. So i guess firebug or any other tool should help you. Also, you may use class="t-zone-update" on the element that must be refreshed by the zone, the structure will look like this : Regards, Christophe Developer of wooki @wookicentral.com 2010/2/1 lebenski > > Yes, this is what I have: > > > > >public String getZoneId() { >return draftPick.getPackNumber() + "_" + > draftPick.getPickNumber() + > "Zone"; >} > > Giving all of my zones id's like this 1_7Zone > > > I've also tried removing the t: prefix from the zone parameter, this seems > to make no difference. > > > Ulrich Stärk wrote: > > > > Normally that happens when zone and form aren't set up correctly on the > > client side, e.g. due to > > inconsistent IDs. > > > > Did you try as Christophe suggested? Replace t:zone="${zoneId}" with > > t:zone="prop:zoneId" (same for > > the id parameter of zone). Does that help? > > > > Uli > > > > On 01.02.2010 12:15 schrieb lebenski: > >> > >> Ah! this seems to have got to the root of the problem. Request.isXHR() > >> is > >> returning false. I understand that this method is looking for the > >> presence > >> of an Http Header called X-Requested-With with the value XMLHttpRequest. > >> Snooping the request I notice that this has not been set. How does this > >> header get set, and what in my example could cause this not to be > getting > >> set? > >> > >> > >> Ulrich Stärk wrote: > >>> > >>> You should @InjectComponent private Zone otherCommentsZone and return > >>> otherCommentsZone.getBody() > >>> from your onSuccess handler method after checking whether this is a XHR > >>> request (@Inject Request and > >>> do request.isXHR()). > >>> > >>> Uli > >>> > >>> On 01.02.2010 09:29 schrieb lebenski: > > I have a loop that contains a form and a zone. In each iteration of > the > loop, submission of that form should update it's relevant zone: > > > t:zone="${zoneId}"> > ... > > > > > ... > > > > > Object onSuccessFromPickCommentForm(DraftPick draftPick) { > createPickComment(draft.get(draftPick.getPackNumber(), > draftPick.getPickNumber())); > > loadDraft(); > > return otherCommentsZone; > } > > So i'm binding the zone parameter of the form to the generated client > id > (not the component id) as suggested in the documentation here: > > > http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html > > After I submit the form the page refreshes rather that updating the > zone. > The loop runs 45 times so I end up with 45 micro forms and 45 zones on > my > page. Can anyone see what I'm doing wrong here? > >>> > >>> - > >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > >>> For additional commands, e-mail: users-h...@tapestry.apache.org > >>> > >>> > >>> > >> > > > > - > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > > For additional commands, e-mail: users-h...@tapestry.apache.org > > > > > > > > -- > View this message in context: > http://old.nabble.com/-T5--Form-and-Zone-inside-a-loop-tp27400993p27403412.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
Re: Need help regarding Bean Edit Form
Hi Jagadesh, on this webpage http://tapestry.apache.org/tapestry5/guide/beaneditform.html you can find some simple examples for a beaneditform. There is also one point about using a custom model or modifing the exisiting, that's what you need. Another great source for examples is this one: http://jumpstart.doublenegative.com.au:8080/jumpstart/theapp Greetings On 01.02.2010 13:43, Jagadesh Paladugula wrote: Want to add one more simple use case Want to disable some fields in edit mode and enable in create mode Regards, Jagadesh On Mon, Feb 1, 2010 at 6:11 PM, Jagadesh Paladugula< jagadeshpaladug...@gmail.com> wrote: Hi Everyon I have started using Tapestry5 recently in our project. I need help regarding Bean Edit Form. I have a use case where I want to show some fields in create mode and hide the same fields in edit mode (this just for an example). I have fulfilled the requirement with out use of Bean Edit Form, using standalone forms. But In my project I have lot of forms. If some common layout thing changes in future I have to change in many places if I go with standalone form. I want to use Bean Edit Form for complex requirements. Please help me with some examples on Bean Edit Form with complex requirements Thanks in advance. -- Regards Jagadesh - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
IE6 and inPlace Grid
Hi, I just discovered that the standard InPlace Grid seems to be broken with IE 6 (T5.1.05) http://tapestry-test.appspot.com/inplacegriddemo Well at least with my IE6 that I run on Linux with Wine to test our application compatibility. Is this an issue with IE6 in Wine or is it a known problem that InPlace Grids and other Ajax Stuff does not work in IE6 at all? Regards Moritz - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Need help regarding Bean Edit Form
Want to add one more simple use case Want to disable some fields in edit mode and enable in create mode Regards, Jagadesh On Mon, Feb 1, 2010 at 6:11 PM, Jagadesh Paladugula < jagadeshpaladug...@gmail.com> wrote: > Hi Everyon > > I have started using Tapestry5 recently in our project. I need help > regarding Bean Edit Form. > > I have a use case where I want to show some fields in create mode and hide > the same fields in edit mode (this just for an example). > > I have fulfilled the requirement with out use of Bean Edit Form, using > standalone forms. But In my project I have lot of forms. If some common > layout thing changes in future I have to change in many places if I go with > standalone form. > > I want to use Bean Edit Form for complex requirements. > > Please help me with some examples on Bean Edit Form with complex > requirements > > Thanks in advance. > > -- > Regards > Jagadesh > -- Regards Jagadesh
Need help regarding Bean Edit Form
Hi Everyon I have started using Tapestry5 recently in our project. I need help regarding Bean Edit Form. I have a use case where I want to show some fields in create mode and hide the same fields in edit mode (this just for an example). I have fulfilled the requirement with out use of Bean Edit Form, using standalone forms. But In my project I have lot of forms. If some common layout thing changes in future I have to change in many places if I go with standalone form. I want to use Bean Edit Form for complex requirements. Please help me with some examples on Bean Edit Form with complex requirements Thanks in advance. -- Regards Jagadesh
Re: [T5] Form and Zone inside a loop
Yes, this is what I have: public String getZoneId() { return draftPick.getPackNumber() + "_" + draftPick.getPickNumber() + "Zone"; } Giving all of my zones id's like this 1_7Zone I've also tried removing the t: prefix from the zone parameter, this seems to make no difference. Ulrich Stärk wrote: > > Normally that happens when zone and form aren't set up correctly on the > client side, e.g. due to > inconsistent IDs. > > Did you try as Christophe suggested? Replace t:zone="${zoneId}" with > t:zone="prop:zoneId" (same for > the id parameter of zone). Does that help? > > Uli > > On 01.02.2010 12:15 schrieb lebenski: >> >> Ah! this seems to have got to the root of the problem. Request.isXHR() >> is >> returning false. I understand that this method is looking for the >> presence >> of an Http Header called X-Requested-With with the value XMLHttpRequest. >> Snooping the request I notice that this has not been set. How does this >> header get set, and what in my example could cause this not to be getting >> set? >> >> >> Ulrich Stärk wrote: >>> >>> You should @InjectComponent private Zone otherCommentsZone and return >>> otherCommentsZone.getBody() >>> from your onSuccess handler method after checking whether this is a XHR >>> request (@Inject Request and >>> do request.isXHR()). >>> >>> Uli >>> >>> On 01.02.2010 09:29 schrieb lebenski: I have a loop that contains a form and a zone. In each iteration of the loop, submission of that form should update it's relevant zone: >>> t:zone="${zoneId}"> ... ... Object onSuccessFromPickCommentForm(DraftPick draftPick) { createPickComment(draft.get(draftPick.getPackNumber(), draftPick.getPickNumber())); loadDraft(); return otherCommentsZone; } So i'm binding the zone parameter of the form to the generated client id (not the component id) as suggested in the documentation here: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html After I submit the form the page refreshes rather that updating the zone. The loop runs 45 times so I end up with 45 micro forms and 45 zones on my page. Can anyone see what I'm doing wrong here? >>> >>> - >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >> > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/-T5--Form-and-Zone-inside-a-loop-tp27400993p27403412.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Form and Zone inside a loop
Normally that happens when zone and form aren't set up correctly on the client side, e.g. due to inconsistent IDs. Did you try as Christophe suggested? Replace t:zone="${zoneId}" with t:zone="prop:zoneId" (same for the id parameter of zone). Does that help? Uli On 01.02.2010 12:15 schrieb lebenski: Ah! this seems to have got to the root of the problem. Request.isXHR() is returning false. I understand that this method is looking for the presence of an Http Header called X-Requested-With with the value XMLHttpRequest. Snooping the request I notice that this has not been set. How does this header get set, and what in my example could cause this not to be getting set? Ulrich Stärk wrote: You should @InjectComponent private Zone otherCommentsZone and return otherCommentsZone.getBody() from your onSuccess handler method after checking whether this is a XHR request (@Inject Request and do request.isXHR()). Uli On 01.02.2010 09:29 schrieb lebenski: I have a loop that contains a form and a zone. In each iteration of the loop, submission of that form should update it's relevant zone: ... ... Object onSuccessFromPickCommentForm(DraftPick draftPick) { createPickComment(draft.get(draftPick.getPackNumber(), draftPick.getPickNumber())); loadDraft(); return otherCommentsZone; } So i'm binding the zone parameter of the form to the generated client id (not the component id) as suggested in the documentation here: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html After I submit the form the page refreshes rather that updating the zone. The loop runs 45 times so I end up with 45 micro forms and 45 zones on my page. Can anyone see what I'm doing wrong here? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Form and Zone inside a loop
Ah! this seems to have got to the root of the problem. Request.isXHR() is returning false. I understand that this method is looking for the presence of an Http Header called X-Requested-With with the value XMLHttpRequest. Snooping the request I notice that this has not been set. How does this header get set, and what in my example could cause this not to be getting set? Ulrich Stärk wrote: > > You should @InjectComponent private Zone otherCommentsZone and return > otherCommentsZone.getBody() > from your onSuccess handler method after checking whether this is a XHR > request (@Inject Request and > do request.isXHR()). > > Uli > > On 01.02.2010 09:29 schrieb lebenski: >> >> I have a loop that contains a form and a zone. In each iteration of the >> loop, submission of that form should update it's relevant zone: >> >> >> > t:zone="${zoneId}"> >> ... >> >> >> >> >>... >> >> >> >> >> Object onSuccessFromPickCommentForm(DraftPick draftPick) { >> createPickComment(draft.get(draftPick.getPackNumber(), >> draftPick.getPickNumber())); >> >> loadDraft(); >> >> return otherCommentsZone; >> } >> >> So i'm binding the zone parameter of the form to the generated client id >> (not the component id) as suggested in the documentation here: >> >> http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html >> >> After I submit the form the page refreshes rather that updating the zone. >> The loop runs 45 times so I end up with 45 micro forms and 45 zones on my >> page. Can anyone see what I'm doing wrong here? > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/-T5--Form-and-Zone-inside-a-loop-tp27400993p27402655.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Form and Zone inside a loop
On Mon, 01 Feb 2010 06:29:14 -0200, lebenski wrote: I have a loop that contains a form and a zone. In each iteration of the loop, submission of that form should update it's relevant zone: ... ... I would create a simple component wrapping the Form and the Zone and then use it inside your loop. -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Returning a FieldValidator to a TextField
On 29 January 2010 17:47, Thiago H. de Paula Figueiredo wrote: > Inject FieldValidatorSource and use its FieldValidator > createValidators(Field field, String specification) method to generate a > FieldValidator. Then create a FieldValidator getValidator() method using > createValidators() and add t:validate="prop:validator" to your TextField. > > Thanks, this got me in the right direction. I can already create a fieldValidator successfully. The thing is that I found to create it I need to have a @InjectComponent("textFieldName") and the only way I know to do this is inside a page Class. I resolved this adding a fieldValidator to each of my "Field" object when I render the page. My code is like this: ${currentField.fieldName}: This works fine except when using InjectComponent I need to give it a fieldId and since I use a loop I don't really know what the field ID's are (except that they are ID_0, ID_1, etc..) . This is not critical but in a presentation point of view it points the errors to the wrong field. Is there any way to bind a fieldValidator to a field without using InjectComponent in the page class? Thanks in advance, Nuno Ferreira
Re: [T5] Form and Zone inside a loop
You should @InjectComponent private Zone otherCommentsZone and return otherCommentsZone.getBody() from your onSuccess handler method after checking whether this is a XHR request (@Inject Request and do request.isXHR()). Uli On 01.02.2010 09:29 schrieb lebenski: I have a loop that contains a form and a zone. In each iteration of the loop, submission of that form should update it's relevant zone: ... ... Object onSuccessFromPickCommentForm(DraftPick draftPick) { createPickComment(draft.get(draftPick.getPackNumber(), draftPick.getPickNumber())); loadDraft(); return otherCommentsZone; } So i'm binding the zone parameter of the form to the generated client id (not the component id) as suggested in the documentation here: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html After I submit the form the page refreshes rather that updating the zone. The loop runs 45 times so I end up with 45 micro forms and 45 zones on my page. Can anyone see what I'm doing wrong here? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [T5] Form and Zone inside a loop
Hi I don't know if it's the cause of your problem, but you should avoid to use ${} for parameter values, use prop: binding instead. Best Regards, Christophe Developer of wooki @wookicentral.com 2010/2/1 lebenski > > I have a loop that contains a form and a zone. In each iteration of the > loop, submission of that form should update it's relevant zone: > > > >... > > > > > ... > > > > >Object onSuccessFromPickCommentForm(DraftPick draftPick) { >createPickComment(draft.get(draftPick.getPackNumber(), > draftPick.getPickNumber())); > >loadDraft(); > >return otherCommentsZone; >} > > So i'm binding the zone parameter of the form to the generated client id > (not the component id) as suggested in the documentation here: > > > http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html > > After I submit the form the page refreshes rather that updating the zone. > The loop runs 45 times so I end up with 45 micro forms and 45 zones on my > page. Can anyone see what I'm doing wrong here? > -- > View this message in context: > http://old.nabble.com/-T5--Form-and-Zone-inside-a-loop-tp27400993p27400993.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > >
[T5] Form and Zone inside a loop
I have a loop that contains a form and a zone. In each iteration of the loop, submission of that form should update it's relevant zone: ... ... Object onSuccessFromPickCommentForm(DraftPick draftPick) { createPickComment(draft.get(draftPick.getPackNumber(), draftPick.getPickNumber())); loadDraft(); return otherCommentsZone; } So i'm binding the zone parameter of the form to the generated client id (not the component id) as suggested in the documentation here: http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Zone.html After I submit the form the page refreshes rather that updating the zone. The loop runs 45 times so I end up with 45 micro forms and 45 zones on my page. Can anyone see what I'm doing wrong here? -- View this message in context: http://old.nabble.com/-T5--Form-and-Zone-inside-a-loop-tp27400993p27400993.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: problem with component
if you rewrite the URL you have to take care of the context yourself. you could use the PageRenderLinkSource service to create a Link with the desired context and return the generated url : Link link = pageLinkSource.createPageRenderLinkWithContext( DocumentExportPage.class, "my","context", "values"); return new SimpleRequestWrapper(request, link.toRedirectURI()); g, kris Jan Jirout 30.01.2010 22:58 Bitte antworten an "Tapestry users" An Tapestry users Kopie Thema problem with component Hi All, I have strange problem with URL rewriting. I'm changing path name in URLRewriterRule. In following way: public Request process(Request request, URLRewriteContext context) { return new SimpleRequestWrapper(request, "somePath"); } It works fine. Problem is with page context in case of component events. If component event with some context is passed into previous URLRewriterRule then page context is lost. Only way how to avoid this problem is following adjustment: public Request process(Request request, URLRewriteContext context) { if (context.getPageParameters() == null) { /** * it's component event */ return request; } return new SimpleRequestWrapper(request, "somePath"); } In this case component events are not processed so context is preserved. Problem is that component event URLs are not adjusted. Even following example lost component event context. public Request process(Request request, URLRewriteContext context) { return new SimpleRequestWrapper(request, request.getPath()); } Do you have any clue how to process component events without lost context? thanks Jan - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 - Forms created inside a loop don't fire onSuccess methods
Thanks - got this working! Thiago H. de Paula Figueiredo wrote: > > On Sun, 31 Jan 2010 16:09:11 -0200, lebenski wrote: > >> Hi, > > Hi! > >> This is my code: >> >> >> ... >> >> >> >> >> I'm obsering that submitting this form does not fire >> onSuccessFromPickCommentForm or even just onSuccess, onValidateForm >> etc. Is this because i've created multiple forms with the same id? If >> so, is there a way to support form creation inside a loop like this? > > Each Form component has a different id. Just use onSuccess() and use > draftPick as the context to your form. Something like this: > > > > ... > > > > > > Object onSuccess(Integer id) { > DraftPick draftPick = load(id); > createPickComment(draftPick, getNewComment()); > } > > By the way, you don't need to use the Submit component unless you have > more than one submit button in the same form. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, software architect and developer, Ars Machina Tecnologia da > Informação Ltda. > http://www.arsmachina.com.br > > - > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://old.nabble.com/T5---Forms-created-inside-a-loop-don%27t-fire-onSuccess-methods-tp27395072p27400845.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org