Re: [Stripes-users] View component inclusion

2011-01-04 Thread Rick Grashel
You can always create an ActionBean superclass if you want to re-use that logic in other action beans (this is probably the best approach). Or... if abstracting the logic into a superclass is not appropriate then you could easily create a simple view helper class (which has the logic) and referenc

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
Yes it works. But I can not reuse the logic in getSearchFields() if I need it for other pages (for the sake of modularizing presentation). I need to duplicate the code or creating a class that hold the code and delegate to it but it can be considered as the lesser of two evils. --

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Rick Grashel
Jonathan, I think what you need here is a single pre-action that will set up everything your search form needs. For example: public class ProjectSearchAction { public Resolution doPreSearch() { return new ForwardResolution( "/my_search_page.jsp" ); } public Collection< String >

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Rick Grashel
Jonathan, Can you tell us exactly what ProjectSearchItemViewAction is? Is this just creating a list of form fields that can be searched? If so, then there are other ways to solve this problem. Thanks. -- Rick On Tue, Jan 4, 2011 at 8:31 AM, Jonathan wrote: > The jsp:include works for simp

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
The jsp:include works for simple case but if one of the main action bean parameters has the same name that a parameter of the included action bean there is a collision (for example an parameters named "entryId"). Another problem, if you use the inclusion in a loop (for example to render a line of a

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
And btw the various actions are also stored using the class name if I remember well... so you can find your beans in the request scope when you have more than one. Cheers Remi 2011/1/4 VANKEISBELCK Remi > Yeah sure, but it can be solved easily by storing the variable before > inclusion, ans us

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
Yeah sure, but it can be solved easily by storing the variable before inclusion, ans using this in the "main" page. You should have no problems inside the "fragments", as Stripes will override the request atrribute when executing the included event. I was more wondering if the jsp:include didn't b

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Ben Gunter
I think what Jonathan is saying is correct, though I've never personally been troubled by it. Stripes stuffs the current ActionBean -- the one that is handling the request -- into request scope under the key "actionBean". (Of course you know that.) So if you're in a JSP that was forwarded from an A

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
Not sure I understand. You say you can't do this : my.jsp : ? I think I've done this already... strange. As you say, Stripes does bind stuff to the request, but each include is isolated (it behaves like a full the request/response cycle). So unless your main controller action (the one

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Nikolaos Giannopoulos
Jonothan, Without sufficient code its really hard to figure out what you are looking for and then you say this and that won't work. Why don't you provide the "actual" code you have - as complete as possible - and then I imagine people can help you. Because as it stands Farouk, Remi, Ben and an

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
This seems to be the solution to first order, but Stripes keeps some informations in the request (the action bean, the name of the event) that prevents this method to function (event name conflict in some cases, impossible to make multiple inclusions of same action bean since it's cached). Based on

Re: [Stripes-users] View component inclusion

2011-01-04 Thread VANKEISBELCK Remi
Hi, Correct if I'm wrong, you have action beans that generate page fragments (as HTML I guess), that you want to be able to invoke over HTTP (AJAX update), and also as parts of a more global page ? If yes, I guess that what you need is just a regular action that generates the fragment : it'll re

Re: [Stripes-users] View component inclusion

2011-01-04 Thread Jonathan
Hello. Yes you're right its a kind of useActionBean but as written in the best practices wiki page (http://www.stripesframework.org/display/stripes/Best+Practices) "Prefer pre-actions over ". What I want to do is to include the pre-action forward resolution in a jsp. If I do that with the useActio

Re: [Stripes-users] View component inclusion

2011-01-03 Thread Ben Gunter
I'm not totally clear on what it is you're looking for, but it seems like you might find the stripes:useActionBean tag useful. http://stripes.sourceforge.net/docs/current/taglib/stripes/useActionBean.html -Ben On Mon

Re: [Stripes-users] View component inclusion

2011-01-03 Thread Jonathan
Hello. Thanks for you response. I'm using kind of page pieces (call it pagelets, composed of an action bean and e jsp) that ca be loaded by Ajax or server side if javascript is not enabled. For example, a widget of "most viewed related contents" on the right side of the page (like on Youtube). It

Re: [Stripes-users] View component inclusion

2011-01-02 Thread farouk alhassan
    return person;     }     public void setPerson(DemoPerson person) {     this.person = person;     } } --- On Mon, 3/1/11, Rick Grashel wrote: From: Rick Grashel Subject: Re: [Stripes-users] View component inclusion To: "Stripes Users List" Date: Monday, 3 January, 2011, 1:02

Re: [Stripes-users] View component inclusion

2011-01-02 Thread Rick Grashel
Jonathan, What is the logic that you are trying to include? A lot of times, you can just use "Helper" objects or what not and just use a plain-old . Especially if the logic provided is fairly static or non-stateful. What is the kind of view component? We've talked about this a few times in IRC