Re: Zebra Grid in Tapestry 5.2.6

2011-08-08 Thread Dmitry Gusev
Here's one solution:

CSS:

.myRowClass:hover, .myRowClass:nth-child(even):hover {

background-color: #DCE5FF;
}

.myRowClass:nth-child(even) {
background-color: #E8E8E8;
}


TML:




On Tue, Aug 9, 2011 at 06:14, TG  wrote:

> What is the simplest way to do this without writing any codes but maybe
> just
> css3?
>
> Thanks.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Zebra-Grid-in-Tapestry-5-2-6-tp4680461p4680461.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
>
>


-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Zebra Grid in Tapestry 5.2.6

2011-08-08 Thread Lenny Primak
Tapestry JumpStart shows you how to do exactly that.  Not exactly no code, but 
its pretty easy.

On Aug 8, 2011, at 10:14 PM, TG wrote:

> What is the simplest way to do this without writing any codes but maybe just
> css3?
> 
> Thanks.
> 
> --
> View this message in context: 
> http://tapestry.1045711.n5.nabble.com/Zebra-Grid-in-Tapestry-5-2-6-tp4680461p4680461.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
> 


-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Zebra Grid in Tapestry 5.2.6

2011-08-08 Thread TG
What is the simplest way to do this without writing any codes but maybe just
css3?

Thanks.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Zebra-Grid-in-Tapestry-5-2-6-tp4680461p4680461.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: Tapestry 5.3 and progressive display

2011-08-08 Thread Howard Lewis Ship
Ok; I just created an alpha-10 to address some of the other issues Andy has hit.

On Mon, Aug 8, 2011 at 10:53 AM, pedro  wrote:
> I'll take a look at it, maybe we are not using the latest alpha release (I
> think we are in alpha 9). We haven't patched that code, and there is no
> check in the zone variable, so I'll look for the latest code and let you
> know.
>
> --
> View this message in context: 
> http://tapestry-users.832.n2.nabble.com/Tapestry-5-3-and-progressive-display-js-issue-tp6664856p6665232.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
>
>



-- 
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



submit form (via linksubmit button) on enter key

2011-08-08 Thread Ray Nicholus
It looks like, by default, hitting the enter key while on the last textfield
in a form does not trigger linksubmit.  Is there any (simple) way to make
this happen?  I'm sure there is a way to do this w/ js, but I'm wondering if
there is a dirt-simple way to make this happen that I am simply not aware
of.


Re: Tapestry principles/tips learned during training session

2011-08-08 Thread Michael Gentry
Hi Howard,

As an example, in one application we had URLs from an application
outside of Tapestry that included parameters (like state=WA) in the
URL that we'd pick off in onActivate to start the Tapestry application
with certain defaults preset for that request.

mrg


On Mon, Aug 8, 2011 at 12:57 PM, Howard Lewis Ship  wrote:
> True, but that will only work on simple pages (that have no callbacks
> to themselves, such as ActionLinks or Forms) ... unless you use the
> activate event to store page stage into the session, which kind of
> undermines the whole point of activate/passivate.  But I could be
> wrong ... tell us about your use case ...
>
>
> On Mon, Aug 8, 2011 at 5:26 AM, Michael Gentry  wrote:
>> Hi Les,
>>
>> Thanks for sharing!
>>
>> One comment, though, is you actually can have onActivate without
>> onPassivate.  I've done this many times.
>>
>> Thanks,
>>
>> mrg
>>
>>
>> On Sat, Aug 6, 2011 at 2:54 PM, robert baker  wrote:
>>> Hi,
>>>
>>> I've been in Tapestry training for the past week, have really enjoyed
>>> it, and picked up some useful stuff along the way (if you've been
>>> seeing "Clemson University" run across the tweet box, that was
>>> connected with us).  Mr. Lewis-Ship really gave a broad and deep
>>> overview of how Tapestry works (thank you!), and I thought I would
>>> share some of the things I personally got out of it in hopes it would
>>> help someone else learning the framework.
>>>
>>>
>>> * Activation and passivation in Tapestry work in concert -- can't have
>>> one w/o the other.
>>>  - If you populate an instance variable on the page in onActivate,
>>> return it back in onPassivate
>>>  - PageLink asks for activation context using onPassivate if you
>>> don't supply context parameter
>>>  - May have to @InjectPage and supply what gets passivated beforehand
>>> in some cases.
>>>
>>> * Play around with page URLs and see what happens
>>>  - What happens if you don't supply any activation context?
>>>  - What happens if the activation context is garbage?
>>>  - What happens if the activation context points to something you
>>> shouldn't be able to access?
>>>
>>> * Do work in baby steps -- just try to get *something* visible and
>>> work from there.
>>>  - Components should default as much as possible to aid this process.
>>>
>>> * JavaScript is very sensitive about syntax and loose about semantics
>>> -- watching Firebug debugger religiously during development of
>>> non-trivial JS almost a must.
>>>  - Any client-side IDs need to be passed down to client, or use
>>> well-known class names on the client.
>>>
>>> * Ajax: All about what happens when, and breaking up responsibility
>>> between server and client.
>>>  - Treat URLs going down to the client as immutable.
>>>  - Can "bake in" data into the URL that will be passed back up as a
>>> parameter on the handling method server-side using "context" parameter
>>> on *Link, Form, ProgressiveDisplay components.
>>>  - Keeping that in mind, what if you want to make an AJAX request
>>> with dynamic number of parameters and/or with values not known at
>>> render-time?  Use "parameters" object parameter on
>>> Tapestry.ajaxRequest() to add query parameters to the AJAX request.
>>>
>>> * If you're banging your head against the framework, it's okay to step
>>> down to raw elements and do things manually.
>>>  - Request service (and @RequestParameter on method parameters) and
>>> template property expansions (e.g. ${blah}) a good bridge between page
>>> class and raw elements (prop expands for render-time, request parms
>>> for submit-time).
>>>
>>> * Whatever tools you use, know them inside-out.
>>>
>>>
>>> Thanks,
>>> Les Baker
>>>
>>> -
>>> 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
>>
>>
>
>
>
> --
> 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
>
>

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Tapestry 5.3 and progressive display

2011-08-08 Thread pedro
I'll take a look at it, maybe we are not using the latest alpha release (I
think we are in alpha 9). We haven't patched that code, and there is no
check in the zone variable, so I'll look for the latest code and let you
know.

--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Tapestry-5-3-and-progressive-display-js-issue-tp6664856p6665232.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: Tapestry 5.3 and progressive display

2011-08-08 Thread Howard Lewis Ship
Are you possibly monkey-patching the code?  Here's the current version of that:

processReply : function(reply) {
Tapestry.loadScriptsInReply(reply, function() {
/*
 * In a multi-zone update, the reply.content may be missing, in
 * which case, leave the curent content in place. TAP5-1177
 */
reply.content != undefined && this.show(reply.content);

/*
 * zones is an object of zone ids and zone content that will be
 * present in a multi-zone update response.
 */
reply.zones && Object.keys(reply.zones).each(function(zoneId) {
var manager = Tapestry.findZoneManagerForZone(zoneId);

if (manager) {
var zoneContent = reply.zones[zoneId];
manager.show(zoneContent);
}
});
}.bind(this));
},


Unless I'm missing something, that should handle the case for
reply.zones being null/undefined correctly.  Certainly, Tapestry's
test suite includes the case for ProgressiveDisplay without additional
zones being updated.

In addition, Tapestry is transitioning towards a more "fail early"
approach on the client side, since the mechanisms in place to allow
initialization to continue after a JavaScript error make it very hard
to actually identify and fix the cause of the JavaScript error.

On Mon, Aug 8, 2011 at 9:58 AM, Howard Lewis Ship  wrote:
> Thanks, I'll take a peek at this.  I think it must be some unintended
> consequences of other changes.
>
> On Mon, Aug 8, 2011 at 9:13 AM, pedro  wrote:
>> Hi,
>>
>> We are currently going through the update to Tapestry 5.3 and we have found
>> an issue while using the progressive display component.
>>
>> There is an exception in the tapestry javascript while loading the
>> progressive display in the processReply function. The problem is in the loop
>> through the zones of the reply (
>> /Object.keys(reply.zones).each(function(zoneId) / ) as they are not defined
>> in the case of this component.
>>
>> After the exception no other javascript is processed.
>>
>> Regars,
>> Pedro Ayala
>> Software Developer
>> ProQuest
>>
>>
>> --
>> View this message in context: 
>> http://tapestry-users.832.n2.nabble.com/Tapestry-5-3-and-progressive-display-tp6664856p6664856.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
>>
>>
>
>
>
> --
> 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
>



-- 
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: Tapestry 5.3 and progressive display

2011-08-08 Thread Howard Lewis Ship
Thanks, I'll take a peek at this.  I think it must be some unintended
consequences of other changes.

On Mon, Aug 8, 2011 at 9:13 AM, pedro  wrote:
> Hi,
>
> We are currently going through the update to Tapestry 5.3 and we have found
> an issue while using the progressive display component.
>
> There is an exception in the tapestry javascript while loading the
> progressive display in the processReply function. The problem is in the loop
> through the zones of the reply (
> /Object.keys(reply.zones).each(function(zoneId) / ) as they are not defined
> in the case of this component.
>
> After the exception no other javascript is processed.
>
> Regars,
> Pedro Ayala
> Software Developer
> ProQuest
>
>
> --
> View this message in context: 
> http://tapestry-users.832.n2.nabble.com/Tapestry-5-3-and-progressive-display-tp6664856p6664856.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
>
>



-- 
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: Tapestry principles/tips learned during training session

2011-08-08 Thread Howard Lewis Ship
True, but that will only work on simple pages (that have no callbacks
to themselves, such as ActionLinks or Forms) ... unless you use the
activate event to store page stage into the session, which kind of
undermines the whole point of activate/passivate.  But I could be
wrong ... tell us about your use case ...


On Mon, Aug 8, 2011 at 5:26 AM, Michael Gentry  wrote:
> Hi Les,
>
> Thanks for sharing!
>
> One comment, though, is you actually can have onActivate without
> onPassivate.  I've done this many times.
>
> Thanks,
>
> mrg
>
>
> On Sat, Aug 6, 2011 at 2:54 PM, robert baker  wrote:
>> Hi,
>>
>> I've been in Tapestry training for the past week, have really enjoyed
>> it, and picked up some useful stuff along the way (if you've been
>> seeing "Clemson University" run across the tweet box, that was
>> connected with us).  Mr. Lewis-Ship really gave a broad and deep
>> overview of how Tapestry works (thank you!), and I thought I would
>> share some of the things I personally got out of it in hopes it would
>> help someone else learning the framework.
>>
>>
>> * Activation and passivation in Tapestry work in concert -- can't have
>> one w/o the other.
>>  - If you populate an instance variable on the page in onActivate,
>> return it back in onPassivate
>>  - PageLink asks for activation context using onPassivate if you
>> don't supply context parameter
>>  - May have to @InjectPage and supply what gets passivated beforehand
>> in some cases.
>>
>> * Play around with page URLs and see what happens
>>  - What happens if you don't supply any activation context?
>>  - What happens if the activation context is garbage?
>>  - What happens if the activation context points to something you
>> shouldn't be able to access?
>>
>> * Do work in baby steps -- just try to get *something* visible and
>> work from there.
>>  - Components should default as much as possible to aid this process.
>>
>> * JavaScript is very sensitive about syntax and loose about semantics
>> -- watching Firebug debugger religiously during development of
>> non-trivial JS almost a must.
>>  - Any client-side IDs need to be passed down to client, or use
>> well-known class names on the client.
>>
>> * Ajax: All about what happens when, and breaking up responsibility
>> between server and client.
>>  - Treat URLs going down to the client as immutable.
>>  - Can "bake in" data into the URL that will be passed back up as a
>> parameter on the handling method server-side using "context" parameter
>> on *Link, Form, ProgressiveDisplay components.
>>  - Keeping that in mind, what if you want to make an AJAX request
>> with dynamic number of parameters and/or with values not known at
>> render-time?  Use "parameters" object parameter on
>> Tapestry.ajaxRequest() to add query parameters to the AJAX request.
>>
>> * If you're banging your head against the framework, it's okay to step
>> down to raw elements and do things manually.
>>  - Request service (and @RequestParameter on method parameters) and
>> template property expansions (e.g. ${blah}) a good bridge between page
>> class and raw elements (prop expands for render-time, request parms
>> for submit-time).
>>
>> * Whatever tools you use, know them inside-out.
>>
>>
>> Thanks,
>> Les Baker
>>
>> -
>> 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
>
>



-- 
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



Tapestry 5.3 and progressive display

2011-08-08 Thread pedro
Hi,

We are currently going through the update to Tapestry 5.3 and we have found
an issue while using the progressive display component.

There is an exception in the tapestry javascript while loading the
progressive display in the processReply function. The problem is in the loop
through the zones of the reply (
/Object.keys(reply.zones).each(function(zoneId) / ) as they are not defined
in the case of this component.

After the exception no other javascript is processed.

Regars,
Pedro Ayala
Software Developer
ProQuest 


--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Tapestry-5-3-and-progressive-display-tp6664856p6664856.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: Exception invoking function Tapestry.Initializer.validate

2011-08-08 Thread Jan Fryblik
HI,

i had same issue. Try to comment some fields of form out to find out which
one causes the error. I had field with name 'homepage' and after renaming
this field, the red warning was gone. May be there are some reserved words
or what... ...good luck 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Exception-invoking-function-Tapestry-Initializer-validate-tp4586650p4677995.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: Uploading then displaying Images

2011-08-08 Thread Josh Canfield
Ah, good to hear!

On Mon, Aug 8, 2011 at 5:52 AM, David Canteros
 wrote:
> Hi again Josh, i had not  seen your first response, there was the solution to
> my problem.
> Thank you!
> David
>
>
>
> --
> David Germán Canteros
>
>
> 2011/8/6 David Canteros 
>
>> Yes, user is an object loaded in the setupRender() method, and getImage()
>> returns an InputStream every time the page is loaded.
>>
>>
>> --
>> David Germán Canteros
>>
>>
>> 2011/8/5 Josh Canfield 
>>
>>> The real issue is more likely the first point, you're getting your
>>> InputStream from an object from the session. Does calling getImage()
>>> return a new InputStream every time?
>>>
>>> On Fri, Aug 5, 2011 at 2:44 PM, David Canteros
>>>  wrote:
>>> > Hi Josh;
>>> >           I have already tried with PageRenderLinkSource but It has the
>>> > same behavior.  I did not know the difference between LinkSource and
>>> > PageRenderLinkSource, thanks for the information!
>>> >
>>> > David
>>> >
>>> > --
>>> > David Germán Canteros
>>> >
>>> >
>>> > 2011/8/5 Josh Canfield 
>>> >
>>> >> Also.
>>> >> >    private LinkSource linkSource;
>>> >>
>>> >> This is an internal class, you should be using PageRenderLinkSource.
>>> >> You can replace:
>>> >>
>>> >> >
>>> linkSource.createPageRenderLink(DisplayImagePage.class.getSimpleName(),
>>> >> false, new Object[]{imageId});
>>> >>
>>> >> with
>>> >>
>>> >>
>>> >>
>>> pageRenderLinkSource.createPageRenderLinkWithContext(DisplayImagePage.class,
>>> >> imageId);
>>> >>
>>> >> Josh
>>> >>
>>> >> On Fri, Aug 5, 2011 at 1:39 PM, David Canteros
>>> >>  wrote:
>>> >> > Hi
>>> >> > I have to show a image loaded from database BLOB field. I implemented
>>> >> > Thiago's suggestion, I have created a page with the following code:
>>> >> >
>>> >> > public class ShowImagePage {
>>> >> >
>>> >> >    @Inject
>>> >> >    private LinkSource linkSource;
>>> >> >     (...)
>>> >> >
>>> >> >    public Link *getUploadedFile*(String imageId) {
>>> >> >            return
>>> >> >
>>> linkSource.createPageRenderLink(DisplayImagePage.class.getSimpleName(),
>>> >> > false, new Object[]{imageId});
>>> >> >    }
>>> >> >
>>> >> >    public StreamResponse *onActivate*(String imageId) {
>>> >> >        this.filename = imageId;
>>> >> >        return new StreamResponse() {
>>> >> >
>>> >> >            public String *getContentType*() {
>>> >> >                return contentType;
>>> >> >            }
>>> >> >
>>> >> >            public InputStream *getStream*() throws IOException {
>>> >> >                User user =
>>> >> > (User)_request.getSession(true).getAttribute("user");
>>> >> >                return user.getImage();
>>> >> >            }
>>> >> >
>>> >> >            public void *prepareResponse*(Response response) {
>>> >> >                response.setHeader("Content-Disposition", "inline;
>>> >> > filename=" + filename
>>> >> >                            + ((extension == null) ? "" : ("." +
>>> >> > extension)));
>>> >> >            }
>>> >> >        };
>>> >> >    }
>>> >> >  }
>>> >> > **
>>> >> > In the javacode of the page where i have to show the image, I
>>> injected
>>> >> the
>>> >> > above page and wrote this method
>>> >> >
>>> >> > public Link *getImageLink*(ImageId){
>>> >> >    return showImagewPage.getUploadedFile(imageId);
>>> >> > }
>>> >> >  and in html code I put this:
>>> >> >
>>> >> > 
>>> >> >
>>> >> > It works fine, the image is showed but when I refresh the page (with
>>> F5),
>>> >> > the image dissapear. It behavior does not occur if I submit some form
>>> >> placed
>>> >> > in the same page that refresh the page too (the method
>>>  "onSubmitFrom..."
>>> >> > returns "this" ). I have debugged the code and everything works fine,
>>> do
>>> >> you
>>> >> > have any idea about this behavior?
>>> >> >
>>> >> > Thanks!!
>>> >> >
>>> >> > --
>>> >> > David Germán Canteros
>>> >> >
>>> >> >
>>> >> > 2011/3/11 Rich M 
>>> >> >
>>> >> >> Thanks everyone for the responses so far, conceptually I think this
>>> is
>>> >> >> coming together for me.
>>> >> >>
>>> >> >> So, I'm glad the context path was not a good idea, it felt dirty
>>> from
>>> >> the
>>> >> >> beginning. Avoiding that, there are two main options: use the
>>> database
>>> >> to
>>> >> >> store/retrieve the images, or use a configured system folder from
>>> where
>>> >> I
>>> >> >> can load/save files with Java IO.
>>> >> >>
>>> >> >> Regardless of the option chosen there, the image file will be
>>> captured
>>> >> as
>>> >> >> an InputStream and returned as a StreamResponse in some form to a
>>> >> >> page/component.
>>> >> >>
>>> >> >> As far as linking the StreamResponse to an HTML IMG tag, I believe I
>>> >> >> understand the various options presented here.
>>> >> >>
>>> >> >> LLTYK suggests using 

Re: Uploading then displaying Images

2011-08-08 Thread David Canteros
Hi again Josh, i had not  seen your first response, there was the solution to
my problem.
Thank you!
David



--
David Germán Canteros


2011/8/6 David Canteros 

> Yes, user is an object loaded in the setupRender() method, and getImage()
> returns an InputStream every time the page is loaded.
>
>
> --
> David Germán Canteros
>
>
> 2011/8/5 Josh Canfield 
>
>> The real issue is more likely the first point, you're getting your
>> InputStream from an object from the session. Does calling getImage()
>> return a new InputStream every time?
>>
>> On Fri, Aug 5, 2011 at 2:44 PM, David Canteros
>>  wrote:
>> > Hi Josh;
>> >   I have already tried with PageRenderLinkSource but It has the
>> > same behavior.  I did not know the difference between LinkSource and
>> > PageRenderLinkSource, thanks for the information!
>> >
>> > David
>> >
>> > --
>> > David Germán Canteros
>> >
>> >
>> > 2011/8/5 Josh Canfield 
>> >
>> >> Also.
>> >> >private LinkSource linkSource;
>> >>
>> >> This is an internal class, you should be using PageRenderLinkSource.
>> >> You can replace:
>> >>
>> >> >
>> linkSource.createPageRenderLink(DisplayImagePage.class.getSimpleName(),
>> >> false, new Object[]{imageId});
>> >>
>> >> with
>> >>
>> >>
>> >>
>> pageRenderLinkSource.createPageRenderLinkWithContext(DisplayImagePage.class,
>> >> imageId);
>> >>
>> >> Josh
>> >>
>> >> On Fri, Aug 5, 2011 at 1:39 PM, David Canteros
>> >>  wrote:
>> >> > Hi
>> >> > I have to show a image loaded from database BLOB field. I implemented
>> >> > Thiago's suggestion, I have created a page with the following code:
>> >> >
>> >> > public class ShowImagePage {
>> >> >
>> >> >@Inject
>> >> >private LinkSource linkSource;
>> >> > (...)
>> >> >
>> >> >public Link *getUploadedFile*(String imageId) {
>> >> >return
>> >> >
>> linkSource.createPageRenderLink(DisplayImagePage.class.getSimpleName(),
>> >> > false, new Object[]{imageId});
>> >> >}
>> >> >
>> >> >public StreamResponse *onActivate*(String imageId) {
>> >> >this.filename = imageId;
>> >> >return new StreamResponse() {
>> >> >
>> >> >public String *getContentType*() {
>> >> >return contentType;
>> >> >}
>> >> >
>> >> >public InputStream *getStream*() throws IOException {
>> >> >User user =
>> >> > (User)_request.getSession(true).getAttribute("user");
>> >> >return user.getImage();
>> >> >}
>> >> >
>> >> >public void *prepareResponse*(Response response) {
>> >> >response.setHeader("Content-Disposition", "inline;
>> >> > filename=" + filename
>> >> >+ ((extension == null) ? "" : ("." +
>> >> > extension)));
>> >> >}
>> >> >};
>> >> >}
>> >> >  }
>> >> > **
>> >> > In the javacode of the page where i have to show the image, I
>> injected
>> >> the
>> >> > above page and wrote this method
>> >> >
>> >> > public Link *getImageLink*(ImageId){
>> >> >return showImagewPage.getUploadedFile(imageId);
>> >> > }
>> >> >  and in html code I put this:
>> >> >
>> >> > 
>> >> >
>> >> > It works fine, the image is showed but when I refresh the page (with
>> F5),
>> >> > the image dissapear. It behavior does not occur if I submit some form
>> >> placed
>> >> > in the same page that refresh the page too (the method
>>  "onSubmitFrom..."
>> >> > returns "this" ). I have debugged the code and everything works fine,
>> do
>> >> you
>> >> > have any idea about this behavior?
>> >> >
>> >> > Thanks!!
>> >> >
>> >> > --
>> >> > David Germán Canteros
>> >> >
>> >> >
>> >> > 2011/3/11 Rich M 
>> >> >
>> >> >> Thanks everyone for the responses so far, conceptually I think this
>> is
>> >> >> coming together for me.
>> >> >>
>> >> >> So, I'm glad the context path was not a good idea, it felt dirty
>> from
>> >> the
>> >> >> beginning. Avoiding that, there are two main options: use the
>> database
>> >> to
>> >> >> store/retrieve the images, or use a configured system folder from
>> where
>> >> I
>> >> >> can load/save files with Java IO.
>> >> >>
>> >> >> Regardless of the option chosen there, the image file will be
>> captured
>> >> as
>> >> >> an InputStream and returned as a StreamResponse in some form to a
>> >> >> page/component.
>> >> >>
>> >> >> As far as linking the StreamResponse to an HTML IMG tag, I believe I
>> >> >> understand the various options presented here.
>> >> >>
>> >> >> LLTYK suggests using an EventLink. I was looking through my code and
>> >> found
>> >> >> a Captcha implementation I have using a propertyExpression in the
>> TML on
>> >> the
>> >> >> src attribute of  to reference a getImageLink function that
>> returns
>> >> 

Re: Tapestry principles/tips learned during training session

2011-08-08 Thread Michael Gentry
Hi Les,

Thanks for sharing!

One comment, though, is you actually can have onActivate without
onPassivate.  I've done this many times.

Thanks,

mrg


On Sat, Aug 6, 2011 at 2:54 PM, robert baker  wrote:
> Hi,
>
> I've been in Tapestry training for the past week, have really enjoyed
> it, and picked up some useful stuff along the way (if you've been
> seeing "Clemson University" run across the tweet box, that was
> connected with us).  Mr. Lewis-Ship really gave a broad and deep
> overview of how Tapestry works (thank you!), and I thought I would
> share some of the things I personally got out of it in hopes it would
> help someone else learning the framework.
>
>
> * Activation and passivation in Tapestry work in concert -- can't have
> one w/o the other.
>  - If you populate an instance variable on the page in onActivate,
> return it back in onPassivate
>  - PageLink asks for activation context using onPassivate if you
> don't supply context parameter
>  - May have to @InjectPage and supply what gets passivated beforehand
> in some cases.
>
> * Play around with page URLs and see what happens
>  - What happens if you don't supply any activation context?
>  - What happens if the activation context is garbage?
>  - What happens if the activation context points to something you
> shouldn't be able to access?
>
> * Do work in baby steps -- just try to get *something* visible and
> work from there.
>  - Components should default as much as possible to aid this process.
>
> * JavaScript is very sensitive about syntax and loose about semantics
> -- watching Firebug debugger religiously during development of
> non-trivial JS almost a must.
>  - Any client-side IDs need to be passed down to client, or use
> well-known class names on the client.
>
> * Ajax: All about what happens when, and breaking up responsibility
> between server and client.
>  - Treat URLs going down to the client as immutable.
>  - Can "bake in" data into the URL that will be passed back up as a
> parameter on the handling method server-side using "context" parameter
> on *Link, Form, ProgressiveDisplay components.
>  - Keeping that in mind, what if you want to make an AJAX request
> with dynamic number of parameters and/or with values not known at
> render-time?  Use "parameters" object parameter on
> Tapestry.ajaxRequest() to add query parameters to the AJAX request.
>
> * If you're banging your head against the framework, it's okay to step
> down to raw elements and do things manually.
>  - Request service (and @RequestParameter on method parameters) and
> template property expansions (e.g. ${blah}) a good bridge between page
> class and raw elements (prop expands for render-time, request parms
> for submit-time).
>
> * Whatever tools you use, know them inside-out.
>
>
> Thanks,
> Les Baker
>
> -
> 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: Preparing for the upgrade to Tapestry 5.3

2011-08-08 Thread Thiago H. de Paula Figueiredo
On Fri, 05 Aug 2011 13:51:57 -0300, Howard Lewis Ship   
wrote:



Some of the minor things that were deprecated in 5.2 were removed in
5.3; if there's enough outcry, they can be restored (such as
@IncludeJavaScriptLibrary, etc.).


For each major version change we can create a backward-compatibility  
package to restore things that were removed.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, 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: ActionLink not Search Engine safe?

2011-08-08 Thread Thiago H. de Paula Figueiredo

On Mon, 01 Aug 2011 14:15:43 -0300, PXZ  wrote:


I have found a solution by making a custom link component in this way:
Merge the sourcecode of the following classes: AbstractLink,
AbstractComponentEventLink and ActionLink. Then modify the buildHref()
method so that it simply returns "#". Then you can use your custom  
component instead of the core ActionLink.


Why don't you just subclass AbstractLink? No need to copy sources here.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, 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



chenillekit access module

2011-08-08 Thread olip
Hello,

I am just trying to update from t5 5.1.0.5 to the latest 5.2.6 and for that
reason I need to update chenillekit as well (from 1.0.2 to 1.3) and now I
just see that I also have to update the chenillekit access module we are
using.

After updating chenillekit access from 1.0.2 to 1.3.2 I just realised that
the documentation and test cases are very outdated.

E.G. Most of the constant fields in ChenilleKitAccessConstants are no longer
there but I cannot find any information on how to upgrade my code to the new
fields of the latest version.


So the complete chenillekit docs are for 1.0.2:
http://chenillekit.codehaus.org/chenillekit-access/usage.html  

Has anyone a working example on how to use/setup chenillekit access 1.3.

For example in AppModule: 
 configurations.add( ChenilleKitAccessConstants.WEB_SESSION_USER_KEY,
SignalingWebSessionUser.class );  the WEB_SESSION_USER_KEY constant is no
longer there and I cannot find equilvalent.

Also in my Login Class I use:
ChenilleKitAccessConstants.REQUESTED_PAGENAME_COOKIE
and
ChenilleKitAccessConstants.REQUESTED_EVENTCONTEXT_COOKIE
but cannot find equivalents.

Has anyone got 1.3 to work/is using it?
Thanks in advance
Oliver


--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/chenillekit-access-module-tp6663729p6663729.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: Tapestry Application produces "GC overhead limit exceeded"

2011-08-08 Thread olip
Dear Howard,

Thanks for your answer. I use 5.1.0.5. I think I found it out only by
inspecting the exception msg.

I was creating a large table and was creating two large java objects out of
hibernate calls for every row I rendered (not creating the table data in
someting like setupRender) but during rendering process of table.
I optimized it by using hibernate native sql nd not creating so much java
objects now.

Thank you for your help.

Oliver

--
View this message in context: 
http://tapestry-users.832.n2.nabble.com/Tapestry-Application-produces-GC-overhead-limit-exceeded-tp6651594p6663722.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.3: customize validation messages

2011-08-08 Thread stephanos2k
*Solution:* The key must be "ValidationMessages"

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-customize-validation-messages-tp4659356p4676915.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