Re: [T4] PageRedirectException in pageValidate after AjaxDirectLink

2008-03-27 Thread Steve Shucker
. There is a dojoRequest parameter, which seems like I can use it for the same purpose. Are you using a version of Tapestry greater than 4.02? I'm going to try to adopt your method, but without moving my authentication code into the servlet filter. Thanks again! Steve Shucker wrote: I already had a servlet

Re: [T4] PageRedirectException in pageValidate after AjaxDirectLink

2008-03-26 Thread Steve Shucker
I already had a servlet filter doing some custom authentication and handling redirects to a separate login service for expired sessions, so I added a little extra code in there. First off, you can identify ajax requests by the presence of an HttpServletRequest header called dojo-ajax-request

Re: Please help me in migration of Tapestry 4.0.2 to 4.1.5

2008-03-21 Thread Steve Shucker
I suspect you have an accessor hardcoded to get/set a java.util.ArrayList. java.util.Arrays$ArrayList implements List but does not extend java.util.ArrayList. Check to see if you're explicitly using the implementation class (ArrayList) when your method should really only get/set something

Re: Conditional validation in T4?

2007-12-21 Thread Steve Shucker
http://tapestry.apache.org/tapestry4.1/usersguide/validation.html http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/form/validator/Identity.html Look at the match/differ validators. The cover the basic concept of a validator that acts on two components. You can probably write

Re: T4: replacing script asset in AbstractSubmit

2007-12-11 Thread Steve Shucker
hack because that didn't really fix my IE problems. I think it just didn't like being applied in a float=right div there. Steve Shucker wrote: I'm a bit nutty about writing clean code, and I didn't want to clutter things up with binding events left and right or extra script tags for each

Re: T4: replacing script asset in AbstractSubmit

2007-12-07 Thread Steve Shucker
implementation, esp. some code :) On Dec 3, 2007 11:30 PM, Steve Shucker [EMAIL PROTECTED] wrote: Is it possible to globally replace the SubmitBindings.script file used by all the AbstractSubmit subclasses to wire up ajax events with my own version? I've got a script that imposes an overlay on top

T4: replacing script asset in AbstractSubmit

2007-12-03 Thread Steve Shucker
Is it possible to globally replace the SubmitBindings.script file used by all the AbstractSubmit subclasses to wire up ajax events with my own version? I've got a script that imposes an overlay on top of the components being updated and prevents double-clicks. Right now, I can wire it up to

Re: Change value property in @Option

2007-11-28 Thread Steve Shucker
You should look at the @PropertySelection component to render a select dropdown complete with options. It takes a model attribute (interface IPropertySelectionModel) which essentially wraps a collection/array of options. For your case, you probably want the BeanPropertySelectionModel or

Re: Blank value for PropertySelection

2007-11-28 Thread Steve Shucker
Look at the LabeledPropertySelectionModel. From the javadoc: Decorates an underlying [EMAIL PROTECTED] IPropertySelectionModel}adding an initial property. The label, option, and value of the initial property are configurable. Joshua Jackson wrote: Dear all, I have a combo box defined as

Re: page size

2007-10-24 Thread Steve Shucker
You can probably set the ajaxDelegate attribute of @Shell to null (or your own renderer). The dojo initialization code looks like it comes from there. -Steve michael wrote: hi we are evaluating tapestry for a web application for mobile phones. we have to keep the size of the pages low (

Re: OGNL Null Problem

2007-09-26 Thread Steve Shucker
With the newer ognl I automatically try the #this prefix to see if it works. Try ognl:{null, '999', #this.checkIn == null ? null : checkIn.time, #this.checkOut == null ? null : checkOut.time, adultsPerRoom} or ognl:{null, '999', #this.checkIn == null ? null : #this.checkIn.time,

Re: Pages Library

2007-07-19 Thread Steve Shucker
Use whatever prefix your library is mapped with. It's the id attribute in your *.application file. BTW, I've found that you NEED to include a *.page file for pages in libraries. Maybe it was fixed in the 4.1.2 release, but specless pages in libraries never worked for me. -Steve Paulo

Re: T4 Pre-Initialization?

2007-07-12 Thread Steve Shucker
The registry is initialized in tapestry's ApplicationServlet.init(). In web.xml, you need to specify load-on-startup1/load-on-startup for the servlet configuration. This will force ApplicationServlet.init() to run when the application is deployed instead of the first time a tapestry page is

Re: No OPTION Tags rendered for PropertySelection after updateComponents

2007-07-05 Thread Steve Shucker
I see two things off the top: - DirectLink won't rewind the form. You should really be using LinkSubmit if you want to capture the selected value. - The updateComponents property of the DirectLink might work, but it's not guaranteed if you have multiple instances of this component or a name

Conditional validation

2007-06-22 Thread Steve Shucker
Is there any way to configure validation so that a validator only runs for a specific submit method? My situation is that I have a page with a few checkboxes and some linksubmits on it. There's also a popup dialog box with some other form controls and a submit button. I need everything in

Re: Conditional validation

2007-06-22 Thread Steve Shucker
the other state. -Steve Michael Sims wrote: Steve Shucker wrote: I need everything in one form because the checkbox states should be persisted even when the popup dialog is submitted. [...] My options as I see them: [...] - use a separate form with an async submit for the popup

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
I just realized I had a bug relating to this yesterday and I could use a little help solving it. I think the solution is to force the hibernate session to flush before the response is committed, but I'm not sure how/where to inject that call into tapestry. If I knew where to make tapestry

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
commits the response. Then I could call session.flush() there to force the exception before the response is committed. I just don't know how I can accomplish this. -Steve Michael Sims wrote: Steve Shucker wrote: I just realized I had a bug relating to this yesterday and I could use

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
. I'd consider a dedicated session in pageBeginRender of my error page (with some extra error handling) to set up the state for your error page. -Steve Michael Sims wrote: Steve Shucker wrote: Keep in mind the difference between a flush and a commit in hibernate. A flush executes all

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
where this happens. The short version is that the WebRequest should have a parameter set that identifies the tapestry service being called. Thanks for the link. -Steve Michael Sims wrote: Steve Shucker wrote: I'm really fishing for a hivemind guru to tell me how to inject some code

Re: Help with handling exceptions while using Hibernate's open-session-in-view pattern in Tapestry

2007-06-20 Thread Steve Shucker
=com.vms.infrastructure.websession.TapestrySessionTxFilter set-object property=serviceEncoders value=service-property:tapestry.url.LinkFactory:serviceEncoders/ /construct Thanks for catching my bug! -Steve Michael Sims wrote: Steve Shucker wrote: Unless I'm

Re: Using Hibernate detached objects in Tapestry (thread-safety question)

2007-06-18 Thread Steve Shucker
I'm not sure if this will completely solve your problem, but I wrote my own WebRequestServicerFilter that only applies the session/transaction wrapping on non-asset requests. public void service(WebRequest request, WebResponse response, WebRequestServicer servicer) throws

Re: Using Hibernate detached objects in Tapestry (thread-safety question)

2007-06-18 Thread Steve Shucker
and away from a kludgy aspect. -Steve Michael Sims wrote: Hi Steve, Steve Shucker wrote: I'm not sure if this will completely solve your problem, but I wrote my own WebRequestServicerFilter that only applies the session/transaction wrapping on non-asset requests. Interesting! Thanks

Re: State problems: contrib:Table in loop

2007-06-15 Thread Steve Shucker
You need to specify the tableSessionStoreManager property. If the loop iterates over something that's stored in the session anyway, you can add a Serializable field to that object (or wrap it in another object containing this field) and implement the two methods of ITableSessionStoreManager

Re: Multiple component validation

2007-06-04 Thread Steve Shucker
the name of the first field to your validator and apply the validator to the second field - this is so that both fields have rewound Steve Shucker wrote: I'm trying to write a variant of the match/differ validators to check if two fields have the same null state. I pass in the name

Re: dojo dialog to populate portion of form and submit

2007-06-01 Thread Steve Shucker
The dojo dialog control moves the rendered dialog around in the DOM so it's just inside the closing /body tag. They do this so it's in a known place and they can make some assumptions about (lack of) nesting when it renders. However, this effectively moves it outside any forms. Use firebug

Re: T4.1.1 - How to inject (dynamic) page into component?

2007-05-30 Thread Steve Shucker
I think you're going down the wrong path with page injection. Try using @Parameter to declare/inject a parameter to pass the page. You can either make your parameter a String and use cycle.getPage(pageName) like Andreas suggested or make it an IPage or ILoginPage to pass the page directly.

Re: starting point for ajax with dojo and tapestry 4.1?

2007-05-01 Thread Steve Shucker
I asked that same question about a month ago and found there wasn't a good answer. Someone pointed me to Shing Hing Man's homepage (http://uk.geocities.com/matmsh/) where he posted some good information, but dojo's documentation wasn't nearly as helpful as it should have been. The first huge

Re: Page Cleanup Tasks

2007-04-05 Thread Steve Shucker
would be very grateful to hear it. Thanks Gareth - Original Message From: Steve Shucker [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Wednesday, 4 April, 2007 9:54:52 PM Subject: Re: Page Cleanup Tasks I'm not sure where you'd call it from

Re: .jwc-file-free components for libraries (4.1.1)

2007-04-04 Thread Steve Shucker
My recent experience (with 4.1.1) is that injecting relative resources isn't working. I have a few components in a library with associated *.script files. Some have templates and use the @Script tag in the template. Others don't have templates and use the @InjectScript annotation. I tried

Re: Page Cleanup Tasks

2007-04-04 Thread Steve Shucker
I'm not sure where you'd call it from, but IRequestCycle.forgetPage(String) will cause it to dump any state connected to a given page. -Steve Gareth wrote: hi, I am storing a list of items in the session using @Persist(session) and that is working well, however I would like to remove that

Re: Clustering Tapestry

2007-03-28 Thread Steve Shucker
This may be the answer to the wrong question, but a long time ago I discovered that when weblogic was running out of memory, it would dump random sessions. The solution was to configure the application server to persist sessions in the database. This also allowed sessions to fail over to the

Re: BaseComponent begin render

2007-03-26 Thread Steve Shucker
Yes, it'll work just fine - with one caveat. pageBeginRender/pageEndRender are called for all (rendered?) components on your page. If you're using Block/RenderBlock to render a component from another page, that component won't have its pageBeginRender/pageEndRender methods called. Unless

Re: Dynamic components with template (? extends BaseComponent)

2007-03-19 Thread Steve Shucker
If you've got the components you want somewhere else on a template, you can always use Block/RenderBlock. That involves setting up @Block areas for each possible content and putting a @RenderBlock in the target area. Then you just need a method to wire up the RenderBlock's block attribute.

Re: Wrapping dojo components for tapestry

2007-03-19 Thread Steve Shucker
might create a plain vanilla html page and include dojo manually on it (ie no tapestry ) and do whatever I had to do to understand how it works there first before moving it to java managed code. On 3/15/07, Steve Shucker [EMAIL PROTECTED] wrote: Can someone point me to a good primer for wrapping

Re: Wrapping dojo components for tapestry

2007-03-19 Thread Steve Shucker
Thanks, I found some useful examples there. -Steve Yiannis Mavroukakis wrote: I think lombok.demon.co.uk has what you need :) On Mon, 2007-03-19 at 09:01 -0700, Steve Shucker wrote: Creating the plain-vanilla web page and slowly moving it into the tapestry world is how I eventually

Re: Dynamic components with template (? extends BaseComponent)

2007-03-16 Thread Steve Shucker
I don't know enough about tapestry internals to say if this is a good idea, but I've played around with DynamicBlock and your solution looks a lot simpler. At a guess, it looks like your approach is setting up your dynamic component when tapestry is loading the page template. If it's part of

Wrapping dojo components for tapestry

2007-03-15 Thread Steve Shucker
Can someone point me to a good primer for wrapping dojo components to be used with tapestry 4.1. Yesterday I went through a lot of grief before I realized that tapestry was setting parseWidgets=false. Eventually I concluded that: 1) Tapestry doesn't want dojo to automatically inspect the

Re: Tapestry 4 dynamically changing the template

2007-03-02 Thread Steve Shucker
You've got two separate problems here: 1) choosing which component to render at runtime without a fixed list of possibilities 2) pulling the template from the database The first problem is addressed by Michael Henderson's DynamicBlock: http://www.behindthesite.com/blog/C1931765677/E1630021481/

Re: plugins for a tapestry app?

2007-03-02 Thread Steve Shucker
Could one of the gurus please post some example hivemind config showing how I can include a hivemodule.xml with my component library project so that the library automagically registers itself with whatever application is running? I've thought for a while that the *.application file was

Re: plugins for a tapestry app?

2007-03-02 Thread Steve Shucker
anonymous/anon Dan Adams wrote: Is there an anonymous login for this? On Fri, 2007-03-02 at 09:41 -0500, James Carman wrote: There's a HiveMind module for that, actually. Check out: http://svn.javaforge.com/svn/hivemind/hivemind-hibernate3/trunk/src/main/resources/META-INF/hivemodule.xml

Re: Friendly URL's and service encoders

2007-01-22 Thread Steve Shucker
I'm not sure if it's legal to map the html extension to two different encoders. Try using a different extension for the external pages. -Steve Peter Stavrinides wrote: Does anyone have any ideas? Peter Stavrinides wrote: Hi everyone I am having some trouble with friendly URL's. Getting

Re: Tacos:Tree - Node opens after submit only

2007-01-17 Thread Steve Shucker
Are you using the tree in a form? If so, it's bugged. http://tacoscomponents.jot.com/BugReporter/Bug32 I posted a workaround a while ago, but it assumes that you don't have any form controls in your tree nodes. http://mail-archives.apache.org/mod_mbox/tapestry-users/200606.mbox/[EMAIL

specless pages in libraries

2006-12-29 Thread Steve Shucker
I'm writing specless pages/components in my current projects, but I can't get specless pages working in libraries. My pages work fine if I just create an empty spec and specless components work flawlessly. I've looked at the PageSpecificationResolverImpl and

Re: How to move tapestry project to the web root

2006-12-29 Thread Steve Shucker
When I install tomcat, I usually remove or rename webapps/ROOT to something else. If I want to deploy an app to the root context, I just name the war file ROOT.war and let tomcat autodeploy it. For maven's tomcat plugin, I provide a context.xml file that specifies the root context. Tomcat's

Re: getting .page and .html from a database

2006-12-11 Thread Steve Shucker
, Steve Shucker [EMAIL PROTECTED]: I've got this working for pages and components, but it's probably a bit different than what you want. I have a template table in my database and I'm looking up content by a numeric PK rather than a name because I have a requirement to let users version some

Re: getting .page and .html from a database

2006-12-02 Thread Steve Shucker
I've got this working for pages and components, but it's probably a bit different than what you want. I have a template table in my database and I'm looking up content by a numeric PK rather than a name because I have a requirement to let users version some templates. I'm also leaving out my

Re: Tapestry-Hibernate

2006-11-06 Thread Steve Shucker
I've used AspectJ to do this. It works, but it's not the most efficient solution out there. We have all our entities implement an interface Persistent, so the pointcut looks like: pointcut persistentUse(Persistent persistent): call(java.util.Set+ Persistent+.get*())

Changing template locations

2006-11-02 Thread Steve Shucker
Is there a way to change the location where tapestry looks for html templates? I've got a component library project with a standard maven2 file structure. I'm writing specless components. I've created a /src/main/webapp directory containing a basic *.application and web.xml file and I use

Re: Newbie question about ApplicationServlet

2006-10-05 Thread Steve Shucker
First of all, if you want a single manager object, tapestry provides Application State Objects to do this. See http://tapestry.apache.org/tapestry4/UsersGuide/state.html#state.aso for more info. For a single instance of an ASO across an entire application, you set the scope to application

Re: Button values dont print

2006-09-28 Thread Steve Shucker
I don't know if this will work, but you can try adding another stylesheet just for printing that will override the button's style. link href=/css/print.css media=print rel=stylesheet type=text/css / Then set the color or other attributes for buttonSpecial to be something different. It

Re: Custom exception page

2006-09-27 Thread Steve Shucker
Look at tapestry's ExceptionDisplay component source. It uses something called an ExceptionAnalyzer and also displays the contents of the ExceptionDescription.getProperties(). I've got a custom exception page that writes to log4j. Here's what I use to get the text: public void

Re: Custom exception page

2006-09-27 Thread Steve Shucker
. -Steve [EMAIL PROTECTED] wrote: Thanks Steve. So in Exception.html I could just have a span jwcid=@ExceptionDisplay exceptions=ognl:exceptionDescription / ? Thanks, Greg -Original Message- From: Steve Shucker [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 27, 2006 11:04 AM

Re: Dynamic columns

2006-09-20 Thread Steve Shucker
Just use an ognl expression for the columns attribute of the table. table jwcid=@contrib:Table columns=ognl:'column1, column2, column3' + (isAdminUser ? ',deleteColumn', '') ... Never underestimate the coolness of the terniary operator. -Steve [EMAIL PROTECTED] wrote: Anybody know a simple

Re: WG: Question: Can not get access to object fields (Null Pointer Exception) pls pls help!

2006-09-12 Thread Steve Shucker
As a general rule, it's safer to put the literal first in statements like this: admin.equals(user.getState()) If anyone wants to say that it looks/reads a bit funny, I'll agree. It's an odd syntax, but it protects you from NPEs. -Steve Martin Strand wrote: Well, if you get a NPE on this

RE: listener desired on For component

2006-08-17 Thread Steve Shucker
Try putting an @InvokeListener component in your @For loop. -Steve -Original Message- From: Patrick Moore [mailto:[EMAIL PROTECTED] Sent: Thursday, August 17, 2006 1:13 AM To: Tapestry users Subject: listener desired on For component Hi there -- I have a situation where I am

RE: contrib:Table paging in @For loop

2006-07-21 Thread Steve Shucker
Thank you! That was a trivially simple solution that solved 90% of my issues. I'd spent several hours digging into the table's internals before I saw your email and fixed the paging in 10 minutes. It was no problem to make the objects I was iterating over implement ITableSessionStoreManager. Is

contrib:Table paging in @For loop

2006-07-20 Thread Steve Shucker
I'm having a problem with the contrib:Table component nested inside a @For loop. Essentially I'm rendering several lists of objects. The initial display is correct, but paging fails. What I think is happening is that a single @contrib:Table component is being reused with each iteration of the

RE: How to set cookie ftom T4 application for different host

2006-06-30 Thread Steve Shucker
The cookie domain must be a domain, not a host. For a cookie at tapestry.apache.org, the domain is apache.org and will be valid for tomcat.apache.org as well. If you don't have at least one period in the hostname, the cookie just isn't set. Personally, I have a small bit of logic to detect if

RE: Tree w/Checkbox on each node--Way to Fix Indent?

2006-06-30 Thread Steve Shucker
:[EMAIL PROTECTED] Sent: Friday, June 30, 2006 10:48 AM To: Tapestry users Subject: Re: Tree w/Checkbox on each node--Way to Fix Indent? Is there an open issue for this in tacos? Seems like a big enough deal thing that I should fix it. http://tacoscomponents.jot.com/BugReporter On 6/30/06, Steve

RE: Logging error page into log4j

2006-06-21 Thread Steve Shucker
My team did something like this recently. We put a line in our *.application file: page name=Exception specification-path=/ErrorPage.page / Then we copied/modified the code from tapestry's error page so we could pipe tapestry's stacktrace generation to log4j. The actual html/page file was just

RE: strange problem losing session variables

2006-06-06 Thread Steve Shucker
I've seen something like this once before involving an app designed for a small number of large sessions. My problem was that I was persisting my sessions in-memory. When there was no more memory available, my app server (weblogic 8.1) conveniently started discarding sessions. Turning on JDBC