Re: Different Zone Update's

2014-09-03 Thread Sumanth
Exactly, It's too messy to do it that way, and hence I had to post it here
to find an alternative for it.

We also need a decoupled solution. We thought of  pub-sub  but have no idea
on how to implement it (Cant find much about this topic). So if anyone
knows of such a way to do it , this would help a lot.

This is one of our common requirement, cause we have many zones under
multiple nested components in layout component and on action of some of the
nested components in pages, those layout component needs to be updated.

On Thu, Sep 4, 2014 at 12:08 AM, Geoff Callender <
geoff.callender.jumpst...@gmail.com> wrote:

> I think the issue here is that he'd like one deeply nested component,
> let's call it Z, to be refreshed when another deeply nested component,
> let's call it N, that doesn't know about Z, is refreshed.
>
> One way is to bubble up an event from N until it reaches a common parent,
> C, which in this example is the parent of the layout. C then calls
> component.doChangeOfNotifications(), which calls
> componentA.doChangeOfNotifications(), which calls ... etc. .. which calls
> Z.doChangeOfNotifications(). Messy, with lots of components needing new
> method doChangeOfNotifications. You can see something like this in:
>
>
> http://jumpstart.doublenegative.com.au/jumpstart7/together/ajaxcomponentscrud/persons
>
> where Persons, which is the page, calls list.doChangeOfSelectedPerson() in
> response to several bubbled-up events.
>
> Ideally, a synchronous pub-sub server-side could solve it. N would publish
> and Z would subscribe. Z would use AjaxResponseRenderer to add its zone to
> the render list. Unfortunately, I don't know of such a mechanism.
>
> Any other suggestions?
>
> On 4 Sep 2014, at 3:51 am, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Wed, 03 Sep 2014 13:40:53 -0300, Sumanth 
> wrote:
> >
> >> Hello Experts,
> >
> > Hi!
> >
> >>
> >> I have encountered one more hurdle now regarding zones,
> >>
> >> I have a layout
> >> component>componentA>componentB>componentC>NotificationComponent>Zone
> >>
> >> This zone is a count zone and is updated using a mixin
> (periodiczonerefresh
> >> mixin).
> >>
> >> I have a notification page in which i have a Zone(a table inside a zone
> >> containing notifications) and an actionlink to delete the selected
> >> notifications.(bulk delete). On delete of these notifications i want the
> >> count which is in layout component (mentioned above) to be updated.
> >>
> >> How can i do it?
> >
> > The easiest way is to define the id of the zone to be updated and use
> its addRender(String clientId, Object renderer) to update it.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Update zone out side main thread

2014-09-03 Thread Chung Khanh Duy
Thanks everyone. I will try.

Duy.
On Sep 4, 2014 8:21 AM, "Geoff Callender" <
geoff.callender.jumpst...@gmail.com> wrote:

> How about making onActionFromALink() return a zone that contains a
> ProgressiveDisplay, and have the ProgressiveDisplay do "do something"?
>
>
> http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/progressivedisplay
>
> Cheers,
>
> Geoff
>
> On 4 Sep 2014, at 10:56 am, Chung Khanh Duy 
> wrote:
>
> > Thanks for your answers. Does any one have example for that ? I went
> > through all samples in jumpstart site but it looks like does not have any
> > sample that I am looking for.
> >
> > Thanks.
> > Duy
> >
> >
> > On Wed, Sep 3, 2014 at 10:09 PM, Thiago H de Paula Figueiredo <
> > thiag...@gmail.com> wrote:
> >
> >> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> >> chungkhanhduy1...@gmail.com> wrote:
> >>
> >> Hi experts,
> >>>
> >>
> >> Hi!
> >>
> >>
> >> So now I would like to do something in another thread and after this
> >>> thread completed, I will render resultZone. Is that possible ?
> >>>
> >>
> >> Yes and no. Yes if you don't mind the AJAX request being blocked until
> the
> >> other thread finishes, no otherwise. That would need async support,
> >> something Tapestry doesn't have yet and only the latest servlet
> containers
> >> support.
> >>
> >>
> >> Because I would
> >>> like to increase performance in case "do something" consume a lot of
> time.
> >>>
> >>
> >> The general rule for performance in any kind of program is to not
> optimize
> >> something anything unless you're already sure this something is
> actually a
> >> bottleneck. Otherwise, you risk complicating and breaking a piece of
> code
> >> for no gain.
> >>
> >> --
> >> Thiago H. de Paula Figueiredo
> >> Tapestry, Java and Hibernate consultant and developer
> >> http://machina.com.br
> >>
> >> -
> >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> >> For additional commands, e-mail: users-h...@tapestry.apache.org
> >>
> >>
> >
> >
> > --
> > Chung Khánh Duy
> > Project Support Manager
> > Formos
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Update zone out side main thread

2014-09-03 Thread Geoff Callender
How about making onActionFromALink() return a zone that contains a 
ProgressiveDisplay, and have the ProgressiveDisplay do "do something"?


http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/progressivedisplay

Cheers,

Geoff

On 4 Sep 2014, at 10:56 am, Chung Khanh Duy  wrote:

> Thanks for your answers. Does any one have example for that ? I went
> through all samples in jumpstart site but it looks like does not have any
> sample that I am looking for.
> 
> Thanks.
> Duy
> 
> 
> On Wed, Sep 3, 2014 at 10:09 PM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
> 
>> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
>> chungkhanhduy1...@gmail.com> wrote:
>> 
>> Hi experts,
>>> 
>> 
>> Hi!
>> 
>> 
>> So now I would like to do something in another thread and after this
>>> thread completed, I will render resultZone. Is that possible ?
>>> 
>> 
>> Yes and no. Yes if you don't mind the AJAX request being blocked until the
>> other thread finishes, no otherwise. That would need async support,
>> something Tapestry doesn't have yet and only the latest servlet containers
>> support.
>> 
>> 
>> Because I would
>>> like to increase performance in case "do something" consume a lot of time.
>>> 
>> 
>> The general rule for performance in any kind of program is to not optimize
>> something anything unless you're already sure this something is actually a
>> bottleneck. Otherwise, you risk complicating and breaking a piece of code
>> for no gain.
>> 
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>> 
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>> 
>> 
> 
> 
> -- 
> Chung Khánh Duy
> Project Support Manager
> Formos


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



Re: Different Zone Update's

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 19:29:36 -0300, Lance Java   
wrote:



This topic had come up a few times. I agree that a serverside pub sub
mechanism would be great for decoupling.

I've got a few ideas for how it would work. It would be nice if
subscription handlers could be done via annotations or naming  
conventions,

similar to event handlers.


As far as I remember, someone already implemented that, but I couldn't  
find it.


 On 3 Sep 2014 23:09, "Geoff Callender"  


wrote:


I think the issue here is that he'd like one deeply nested component,
let's call it Z, to be refreshed when another deeply nested component,
let's call it N, that doesn't know about Z, is refreshed.

One way is to bubble up an event from N until it reaches a common  
parent,

C, which in this example is the parent of the layout. C then calls
component.doChangeOfNotifications(), which calls
componentA.doChangeOfNotifications(), which calls ... etc. .. which  
calls

Z.doChangeOfNotifications(). Messy, with lots of components needing new
method doChangeOfNotifications. You can see something like this in:


http://jumpstart.doublenegative.com.au/jumpstart7/together/ajaxcomponentscrud/persons

where Persons, which is the page, calls list.doChangeOfSelectedPerson()  
in

response to several bubbled-up events.

Ideally, a synchronous pub-sub server-side could solve it. N would  
publish
and Z would subscribe. Z would use AjaxResponseRenderer to add its zone  
to

the render list. Unfortunately, I don't know of such a mechanism.

Any other suggestions?

On 4 Sep 2014, at 3:51 am, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 03 Sep 2014 13:40:53 -0300, Sumanth 
wrote:
>
>> Hello Experts,
>
> Hi!
>
>>
>> I have encountered one more hurdle now regarding zones,
>>
>> I have a layout
>> component>componentA>componentB>componentC>NotificationComponent>Zone
>>
>> This zone is a count zone and is updated using a mixin
(periodiczonerefresh
>> mixin).
>>
>> I have a notification page in which i have a Zone(a table inside a  
zone

>> containing notifications) and an actionlink to delete the selected
>> notifications.(bulk delete). On delete of these notifications i want  
the

>> count which is in layout component (mentioned above) to be updated.
>>
>> How can i do it?
>
> The easiest way is to define the id of the zone to be updated and use
its addRender(String clientId, Object renderer) to update it.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org





--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Update zone out side main thread

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 21:56:28 -0300, Chung Khanh Duy  
 wrote:



Thanks for your answers. Does any one have example for that ? I went
through all samples in jumpstart site but it looks like does not have any
sample that I am looking for.


For the non-async-request option, any Java solution will do.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Update zone out side main thread

2014-09-03 Thread Chung Khanh Duy
Thanks for your answers. Does any one have example for that ? I went
through all samples in jumpstart site but it looks like does not have any
sample that I am looking for.

Thanks.
Duy


On Wed, Sep 3, 2014 at 10:09 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> chungkhanhduy1...@gmail.com> wrote:
>
>  Hi experts,
>>
>
> Hi!
>
>
>  So now I would like to do something in another thread and after this
>> thread completed, I will render resultZone. Is that possible ?
>>
>
> Yes and no. Yes if you don't mind the AJAX request being blocked until the
> other thread finishes, no otherwise. That would need async support,
> something Tapestry doesn't have yet and only the latest servlet containers
> support.
>
>
>  Because I would
>> like to increase performance in case "do something" consume a lot of time.
>>
>
> The general rule for performance in any kind of program is to not optimize
> something anything unless you're already sure this something is actually a
> bottleneck. Otherwise, you risk complicating and breaking a piece of code
> for no gain.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Chung Khánh Duy
Project Support Manager
Formos


Re: Simpler Hello World

2014-09-03 Thread Net Dawg
Yes, I may have hijacked my own thread ;-).  


Yes, I wanted to do parameterized/using flash persisted session variables.  Use 
case being: first do query/search for a term using HTML interface to a 
database, then print the result rendered also in PDF format using a 
button/link.  But realized that I could not even print "Hello World" using 
tapestry - (without HTML tags) - let alone create a fancy custom PDF!  That is 
how this got started... 



On Wednesday, September 3, 2014 11:12 AM, Thiago H de Paula Figueiredo 
 wrote:
 


On Wed, 03 Sep 2014 17:44:20 -0300, Net Dawg   
wrote:

> Well, the thread is still open ;-).  Hopefully the tapestry framework  
> developers will see the "parameterized" streaming pattern to be equally  
> important as HTML (and not some sort of hack/gimmick that needs, as you  
> put it, to "abort the goodness").

I'm sorry, Net Dawg, but I really don't get what you're saying in this  
thread. For me, a simple Hello World in Tapestry would be this:

public class HelloWorld {
}





Hello, World!



If you're generating HTML, in Tapestry the usual method is using a  
template.

Regarding what you call parameterized streaming pattern, that's not a  
Hello World anymore, and "Simpler Hello World" is the title of the thread  
you've created.

>> Thanks Chris.  The intent of this question was to get a start toward
>> streaming "pure content" - not just text, but also (and especially PDF),
>> XML, imagery - whatever - anything except HTML.  My solution finally  
>> was to mimic a previously coded button press on an HTML page.  Why?  
>> Because that> is where I get all the session variables set (search,  
>> query etc) to
>> properly construct the PDF content.

1) What do you mean by session variables?

2) If you want to use a button, you can. Just use the Form component:






StreamResponse onSuccessFromPdf() {
StreamResponse response = ...;
return response;
}

>> Then I hid the button and launched
>> the "pure content" page as a pagelink, instead, as follows:
>>
>> PDF

You can also return StreamResponse in Tapestry event handlers just like  
you do in onActivate().


>> Rather convoluted, but gets the job doneand, yes, hardly a simpler
>> hello world now...(this workaround would be more useful to say "Hello
>> Chris" -  after, say, selecting from an HTML list of users)

My concept of Hello World, which is probably the same most people have, is  
to just output "Hello, World!" using the tool of your choice. If you  
parameterize it, it's not a Hello World anymore.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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

Re: dynamic ids for zones

2014-09-03 Thread Geoff Callender
Here's an example showing unique client ids being generated for zones.


http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/eventlinksinaloop

Geoff

On 4 Sep 2014, at 5:52 am, Thiago H de Paula Figueiredo  
wrote:

> On Wed, 03 Sep 2014 16:31:50 -0300, John  wrote:
> 
>> doesn't the t:id need to be unqiue as well, or does the framework handle 
>> this?
> 
> t:id must be unique inside the template, but that's the Tapestry server-side 
> component id, not the HTML client-side id. So t:id and id are completely 
> different things, even if id is defined based on t:id if you don't bind the 
> id parameter. Lance's suggestion is the way to go.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
> 
> -
> 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: Different Zone Update's

2014-09-03 Thread Lance Java
This topic had come up a few times. I agree that a serverside pub sub
mechanism would be great for decoupling.

I've got a few ideas for how it would work. It would be nice if
subscription handlers could be done via annotations or naming conventions,
similar to event handlers.
 On 3 Sep 2014 23:09, "Geoff Callender" 
wrote:

> I think the issue here is that he'd like one deeply nested component,
> let's call it Z, to be refreshed when another deeply nested component,
> let's call it N, that doesn't know about Z, is refreshed.
>
> One way is to bubble up an event from N until it reaches a common parent,
> C, which in this example is the parent of the layout. C then calls
> component.doChangeOfNotifications(), which calls
> componentA.doChangeOfNotifications(), which calls ... etc. .. which calls
> Z.doChangeOfNotifications(). Messy, with lots of components needing new
> method doChangeOfNotifications. You can see something like this in:
>
>
> http://jumpstart.doublenegative.com.au/jumpstart7/together/ajaxcomponentscrud/persons
>
> where Persons, which is the page, calls list.doChangeOfSelectedPerson() in
> response to several bubbled-up events.
>
> Ideally, a synchronous pub-sub server-side could solve it. N would publish
> and Z would subscribe. Z would use AjaxResponseRenderer to add its zone to
> the render list. Unfortunately, I don't know of such a mechanism.
>
> Any other suggestions?
>
> On 4 Sep 2014, at 3:51 am, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Wed, 03 Sep 2014 13:40:53 -0300, Sumanth 
> wrote:
> >
> >> Hello Experts,
> >
> > Hi!
> >
> >>
> >> I have encountered one more hurdle now regarding zones,
> >>
> >> I have a layout
> >> component>componentA>componentB>componentC>NotificationComponent>Zone
> >>
> >> This zone is a count zone and is updated using a mixin
> (periodiczonerefresh
> >> mixin).
> >>
> >> I have a notification page in which i have a Zone(a table inside a zone
> >> containing notifications) and an actionlink to delete the selected
> >> notifications.(bulk delete). On delete of these notifications i want the
> >> count which is in layout component (mentioned above) to be updated.
> >>
> >> How can i do it?
> >
> > The easiest way is to define the id of the zone to be updated and use
> its addRender(String clientId, Object renderer) to update it.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Different Zone Update's

2014-09-03 Thread Geoff Callender
I think the issue here is that he'd like one deeply nested component, let's 
call it Z, to be refreshed when another deeply nested component, let's call it 
N, that doesn't know about Z, is refreshed.

One way is to bubble up an event from N until it reaches a common parent, C, 
which in this example is the parent of the layout. C then calls 
component.doChangeOfNotifications(), which calls 
componentA.doChangeOfNotifications(), which calls ... etc. .. which calls 
Z.doChangeOfNotifications(). Messy, with lots of components needing new method 
doChangeOfNotifications. You can see something like this in:


http://jumpstart.doublenegative.com.au/jumpstart7/together/ajaxcomponentscrud/persons

where Persons, which is the page, calls list.doChangeOfSelectedPerson() in 
response to several bubbled-up events.

Ideally, a synchronous pub-sub server-side could solve it. N would publish and 
Z would subscribe. Z would use AjaxResponseRenderer to add its zone to the 
render list. Unfortunately, I don't know of such a mechanism.

Any other suggestions?

On 4 Sep 2014, at 3:51 am, Thiago H de Paula Figueiredo  
wrote:

> On Wed, 03 Sep 2014 13:40:53 -0300, Sumanth  wrote:
> 
>> Hello Experts,
> 
> Hi!
> 
>> 
>> I have encountered one more hurdle now regarding zones,
>> 
>> I have a layout
>> component>componentA>componentB>componentC>NotificationComponent>Zone
>> 
>> This zone is a count zone and is updated using a mixin (periodiczonerefresh
>> mixin).
>> 
>> I have a notification page in which i have a Zone(a table inside a zone
>> containing notifications) and an actionlink to delete the selected
>> notifications.(bulk delete). On delete of these notifications i want the
>> count which is in layout component (mentioned above) to be updated.
>> 
>> How can i do it?
> 
> The easiest way is to define the id of the zone to be updated and use its 
> addRender(String clientId, Object renderer) to update it.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Simpler Hello World

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 17:44:20 -0300, Net Dawg   
wrote:


Well, the thread is still open ;-).  Hopefully the tapestry framework  
developers will see the "parameterized" streaming pattern to be equally  
important as HTML (and not some sort of hack/gimmick that needs, as you  
put it, to "abort the goodness").


I'm sorry, Net Dawg, but I really don't get what you're saying in this  
thread. For me, a simple Hello World in Tapestry would be this:


public class HelloWorld {
}





Hello, World!



If you're generating HTML, in Tapestry the usual method is using a  
template.


Regarding what you call parameterized streaming pattern, that's not a  
Hello World anymore, and "Simpler Hello World" is the title of the thread  
you've created.



Thanks Chris.  The intent of this question was to get a start toward
streaming "pure content" - not just text, but also (and especially PDF),
XML, imagery - whatever - anything except HTML.  My solution finally  
was to mimic a previously coded button press on an HTML page.  Why?   
Because that> is where I get all the session variables set (search,  
query etc) to

properly construct the PDF content.


1) What do you mean by session variables?

2) If you want to use a button, you can. Just use the Form component:






StreamResponse onSuccessFromPdf() {
StreamResponse response = ...;
return response;
}


Then I hid the button and launched
the "pure content" page as a pagelink, instead, as follows:

PDF


You can also return StreamResponse in Tapestry event handlers just like  
you do in onActivate().



Rather convoluted, but gets the job doneand, yes, hardly a simpler
hello world now...(this workaround would be more useful to say "Hello
Chris" -  after, say, selecting from an HTML list of users)


My concept of Hello World, which is probably the same most people have, is  
to just output "Hello, World!" using the tool of your choice. If you  
parameterize it, it's not a Hello World anymore.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Simpler Hello World

2014-09-03 Thread Net Dawg
Well, the thread is still open ;-).  Hopefully the tapestry framework 
developers will see the "parameterized" streaming pattern to be equally 
important as HTML (and not some sort of hack/gimmick that needs, as you put it, 
to "abort the goodness").  



On Tuesday, September 2, 2014 10:07 PM, Chris Mylonas  
wrote:
 


I was wondering if you'd want to get the last word in Net Dawg ;)



On Wed, Sep 3, 2014 at 5:26 PM, Net Dawg  wrote:

> Thanks Chris.  The intent of this question was to get a start toward
> streaming "pure content" - not just text, but also (and especially PDF),
> XML, imagery - whatever - anything except HTML.  My solution finally was to
> mimic a previously coded button press on an HTML page.  Why?  Because that
> is where I get all the session variables set (search, query etc) to
> properly construct the PDF content.   Then I hid the button and launched
> the "pure content" page as a pagelink, instead, as follows:
>
> PDF
>
> Rather convoluted, but gets the job doneand, yes, hardly a simpler
> hello world now...(this workaround would be more useful to say "Hello
> Chris" -  after, say, selecting from an HTML list of users)
>
>
>
> On Tuesday, September 2, 2014 4:27 PM, Chris Mylonas 
> wrote:
>
>
>
> For future noobs, this is not a simpler hello world, it's making tapestry
> respond with text only, no template, nothing but pure text.
>
> I had to do this today and this thread caught my eye last month.
>
> In the standard tapestry 5.3.7 archetype, my Contact.java looks like this.
>
>
> package org.example.pages;
>
> import org.apache.tapestry5.StreamResponse;
> import org.apache.tapestry5.util.TextStreamResponse;
>
> public class Contact {
>
> StreamResponse onActivate(){
> return new TextStreamResponse("text/plain","some plain old text -
> no .tml file, no nothing. plain old text - yay!");
> }
> }
>
> I wouldn't describe it as a simpler hello world at all because you're
> making tapestry end it's goodness prematurely.  Like learning how to write
> a program and the first statement in main() you learn is exit(1);
>

Re: dynamic ids for zones

2014-09-03 Thread Thiago H de Paula Figueiredo

On Wed, 03 Sep 2014 16:31:50 -0300, John  wrote:

doesn't the t:id need to be unqiue as well, or does the framework handle  
this?


t:id must be unique inside the template, but that's the Tapestry  
server-side component id, not the HTML client-side id. So t:id and id are  
completely different things, even if id is defined based on t:id if you  
don't bind the id parameter. Lance's suggestion is the way to go.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: dynamic ids for zones

2014-09-03 Thread Lance Java
As you are probably aware, there is only one instance of the zone
component. This one instance is rendered multiple times to produce many
clientside elements.

t:id is the serverside id, id is the clientside id(s). They don't need to
match.
On 3 Sep 2014 20:32, "John"  wrote:

> doesn't the t:id need to be unqiue as well, or does the framework handle
> this?
>   - Original Message -
>   From: Lance Java
>   To: Tapestry users
>   Sent: Wednesday, September 03, 2014 8:05 PM
>   Subject: Re: dynamic ids for zones
>
>
>   Yes, and id="prop:myClientId" can produce a different, but predictable,
> id
>   each time through the loop.
>On 3 Sep 2014 19:36, "John"  wrote:
>
>   > Hi,
>   >
>   > Because the zone is reused elsewhere in the page I don't want to
>   > explicitly name the Id because that does not generate a unique Id for
>   > rerendering. I need a fresh Id for each successive render, and O need
> to
>   > know that Id in my javascript and the page.
>   >
>   > John
>   >   - Original Message -
>   >   From: Lance Java
>   >   To: Tapestry users
>   >   Sent: Wednesday, September 03, 2014 5:46 PM
>   >   Subject: Re: dynamic ids for zones
>   >
>   >
>   >   zone="^" is a clientside concept and means find the first parent
> zone to
>   >   the element which fired the event.
>   >
>   >   I'm assuming you know you can explicitly define the zone id using:
>   >   
>   >
>   >
>   > ---
>   > This email is free from viruses and malware because avast! Antivirus
>   > protection is active.
>   > http://www.avast.com
>   >
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>


Re: dynamic ids for zones

2014-09-03 Thread John
doesn't the t:id need to be unqiue as well, or does the framework handle this?
  - Original Message -
  From: Lance Java
  To: Tapestry users
  Sent: Wednesday, September 03, 2014 8:05 PM
  Subject: Re: dynamic ids for zones


  Yes, and id="prop:myClientId" can produce a different, but predictable, id
  each time through the loop.
   On 3 Sep 2014 19:36, "John"  wrote:

  > Hi,
  >
  > Because the zone is reused elsewhere in the page I don't want to
  > explicitly name the Id because that does not generate a unique Id for
  > rerendering. I need a fresh Id for each successive render, and O need to
  > know that Id in my javascript and the page.
  >
  > John
  >   - Original Message -
  >   From: Lance Java
  >   To: Tapestry users
  >   Sent: Wednesday, September 03, 2014 5:46 PM
  >   Subject: Re: dynamic ids for zones
  >
  >
  >   zone="^" is a clientside concept and means find the first parent zone to
  >   the element which fired the event.
  >
  >   I'm assuming you know you can explicitly define the zone id using:
  >   
  >
  >
  > ---
  > This email is free from viruses and malware because avast! Antivirus
  > protection is active.
  > http://www.avast.com
  >


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


Re: dynamic ids for zones

2014-09-03 Thread Lance Java
Yes, and id="prop:myClientId" can produce a different, but predictable, id
each time through the loop.
 On 3 Sep 2014 19:36, "John"  wrote:

> Hi,
>
> Because the zone is reused elsewhere in the page I don't want to
> explicitly name the Id because that does not generate a unique Id for
> rerendering. I need a fresh Id for each successive render, and O need to
> know that Id in my javascript and the page.
>
> John
>   - Original Message -
>   From: Lance Java
>   To: Tapestry users
>   Sent: Wednesday, September 03, 2014 5:46 PM
>   Subject: Re: dynamic ids for zones
>
>
>   zone="^" is a clientside concept and means find the first parent zone to
>   the element which fired the event.
>
>   I'm assuming you know you can explicitly define the zone id using:
>   
>
>
> ---
> This email is free from viruses and malware because avast! Antivirus
> protection is active.
> http://www.avast.com
>


Re: dynamic ids for zones

2014-09-03 Thread John
Hi,

Because the zone is reused elsewhere in the page I don't want to explicitly 
name the Id because that does not generate a unique Id for rerendering. I need 
a fresh Id for each successive render, and O need to know that Id in my 
javascript and the page.

John
  - Original Message -
  From: Lance Java
  To: Tapestry users
  Sent: Wednesday, September 03, 2014 5:46 PM
  Subject: Re: dynamic ids for zones


  zone="^" is a clientside concept and means find the first parent zone to
  the element which fired the event.

  I'm assuming you know you can explicitly define the zone id using:
  


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


Re: Different Zone Update's

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 13:40:53 -0300, Sumanth   
wrote:



Hello Experts,


Hi!



I have encountered one more hurdle now regarding zones,

I have a layout
component>componentA>componentB>componentC>NotificationComponent>Zone

This zone is a count zone and is updated using a mixin  
(periodiczonerefresh

mixin).

I have a notification page in which i have a Zone(a table inside a zone
containing notifications) and an actionlink to delete the selected
notifications.(bulk delete). On delete of these notifications i want the
count which is in layout component (mentioned above) to be updated.

How can i do it?


The easiest way is to define the id of the zone to be updated and use its  
addRender(String clientId, Object renderer) to update it.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread Lance Java
I've never fully understand tapestry's whacky url encoding. I'm sure
there's a reason for it.

I'm pretty sure you can override the tapestry URLEncoder to use the more
normal java.net.URLEncoder and java.net.URLDecoder

http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/services/URLEncoder.html
On 3 Sep 2014 17:51, "George Christman"  wrote:

> Thanks Thiago, I'm aware I have to add MyActivationRequestParameter, just
> wanted to be sure I was using public static void provideTransformWorkers in
> my app module the same as Tapestry is using it in there module.
>
> Yes lance, it would be a great feature especially when working with multi
> facet searches. Examples would be the side bar filter search on amazon,
> homedopt, ebay etc.
>
> Ebay uses unencoded pipes in their urls creating a really nice clean url,
> example make=ford|chevy&color=blue|black|white compared to
> make=ford$007chevy&color=blue$007black$007white
>
> I'll work on this stuff tonight, hopefully I'll get something working.
>
> Thanks Guys.
>
>
> On Wed, Sep 3, 2014 at 11:49 AM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Wed, 03 Sep 2014 12:36:15 -0300, George Christman <
> > gchrist...@cardaddy.com> wrote:
> >
> >  So would I just add that exact method to my AppModule along with my owe
> >> annotation annotation instance?
> >>
> >
> > You'll need to write your own worker and annotation, so you'll need to
> > adapt the line you posted here.
> >
> > If you add this to your AppModule
> >
> > configuration.addInstance("ActivationRequestParameter",
> > ActivationRequestParameterWorker.class);
> >
> > you'll override the ActivationRequestParameterWorker from Tapestry
> > instead of adding a new one. You'll need something like this:
> >
> > configuration.addInstance("MyActivationRequestParameter",
> > MyActivationRequestParameterWorker.class);
> >
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Tapestry, Java and Hibernate consultant and developer
> > http://machina.com.br
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>


Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread George Christman
Thanks Thiago, I'm aware I have to add MyActivationRequestParameter, just
wanted to be sure I was using public static void provideTransformWorkers in
my app module the same as Tapestry is using it in there module.

Yes lance, it would be a great feature especially when working with multi
facet searches. Examples would be the side bar filter search on amazon,
homedopt, ebay etc.

Ebay uses unencoded pipes in their urls creating a really nice clean url,
example make=ford|chevy&color=blue|black|white compared to
make=ford$007chevy&color=blue$007black$007white

I'll work on this stuff tonight, hopefully I'll get something working.

Thanks Guys.


On Wed, Sep 3, 2014 at 11:49 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 03 Sep 2014 12:36:15 -0300, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>  So would I just add that exact method to my AppModule along with my owe
>> annotation annotation instance?
>>
>
> You'll need to write your own worker and annotation, so you'll need to
> adapt the line you posted here.
>
> If you add this to your AppModule
>
> configuration.addInstance("ActivationRequestParameter",
> ActivationRequestParameterWorker.class);
>
> you'll override the ActivationRequestParameterWorker from Tapestry
> instead of adding a new one. You'll need something like this:
>
> configuration.addInstance("MyActivationRequestParameter",
> MyActivationRequestParameterWorker.class);
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: dynamic ids for zones

2014-09-03 Thread Lance Java
zone="^" is a clientside concept and means find the first parent zone to
the element which fired the event.

I'm assuming you know you can explicitly define the zone id using:



Different Zone Update's

2014-09-03 Thread Sumanth
Hello Experts,

I have encountered one more hurdle now regarding zones,

I have a layout
component>componentA>componentB>componentC>NotificationComponent>Zone

This zone is a count zone and is updated using a mixin (periodiczonerefresh
mixin).

I have a notification page in which i have a Zone(a table inside a zone
containing notifications) and an actionlink to delete the selected
notifications.(bulk delete). On delete of these notifications i want the
count which is in layout component (mentioned above) to be updated.

How can i do it?

Thank you,
Sumanth


dynamic ids for zones

2014-09-03 Thread John
I have a zone in a component that appear multiple times on a page so it needs 
unqiue ids each time.

I was thinking not to assign an id for thew zone and let the framework provide 
one.

How do I access this unqiue id when I want to rerender the zone. I see some 
compnents take the ^ value for teh zone name, how do I implement that for my 
inner components?

John

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread Lance Java
> Aren't you talking about different things: ActivationRequestParameter vs.
PageActivationContext ?

Yes, my mistake. I can see this being a nice feature for
ActivationRequestParameter.

I'm guessing a proper fix will need to look at the generic type of the
field to properly support type coercion for List


Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 12:36:15 -0300, George Christman  
 wrote:



So would I just add that exact method to my AppModule along with my owe
annotation annotation instance?


You'll need to write your own worker and annotation, so you'll need to  
adapt the line you posted here.


If you add this to your AppModule

configuration.addInstance("ActivationRequestParameter",  
ActivationRequestParameterWorker.class);


you'll override the ActivationRequestParameterWorker from Tapestry instead  
of adding a new one. You'll need something like this:


configuration.addInstance("MyActivationRequestParameter",  
MyActivationRequestParameterWorker.class);


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread George Christman
So would I just add that exact method to my AppModule along with my owe
annotation annotation instance?


On Wed, Sep 3, 2014 at 11:33 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 03 Sep 2014 12:30:14 -0300, George Christman <
> gchrist...@cardaddy.com> wrote:
>
>  Thanks Thiago, what would I need to do to get tapestry to see my
>> annotation. I see this in the tapestry app module.
>>
>> @Contribute(ComponentClassTransformWorker2.class)  @Primary  public
>> static
>> void provideTransformWorkers(  OrderedConfiguration<
>> ComponentClassTransformWorker2> configuration,  MetaWorker metaWorker,
>> ComponentClassResolver resolver)  {
>> configuration .addInstance("ActivationRequestParameter",
>> ActivationRequestParameterWorker.class);
>>
>
> I'd base my own annotation and worker (ComponentClassTransformWorker2
> implementation) and start from there, so I think you're in the right path.
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 12:30:14 -0300, George Christman  
 wrote:



Thanks Thiago, what would I need to do to get tapestry to see my
annotation. I see this in the tapestry app module.

@Contribute(ComponentClassTransformWorker2.class)  @Primary  public  
static

void provideTransformWorkers(  OrderedConfiguration<
ComponentClassTransformWorker2> configuration,  MetaWorker metaWorker,
ComponentClassResolver resolver)  {
configuration .addInstance("ActivationRequestParameter",
ActivationRequestParameterWorker.class);


I'd base my own annotation and worker (ComponentClassTransformWorker2  
implementation) and start from there, so I think you're in the right path.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread George Christman
Thanks Thiago, what would I need to do to get tapestry to see my
annotation. I see this in the tapestry app module.

@Contribute(ComponentClassTransformWorker2.class)  @Primary  public static
void provideTransformWorkers(  OrderedConfiguration<
ComponentClassTransformWorker2> configuration,  MetaWorker metaWorker,
ComponentClassResolver resolver)  {
configuration .addInstance("ActivationRequestParameter",
ActivationRequestParameterWorker.class);


On Wed, Sep 3, 2014 at 11:15 AM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 03 Sep 2014 11:58:33 -0300, Dmitry Gusev 
> wrote:
>
>  Aren't you talking about different things: ActivationRequestParameter vs.
>> PageActivationContext ?
>>
>
> Yeah, Lance is talking about activation context, while George about
> request parameters.
>
> https://issues.apache.org/jira/browse/TAP5-1403 implemented array support
> for multiple values for a single query parameter in @RequestParameter. It
> shouldn't be too different for doing the same for
> @ActivationRequestParameter.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Update zone out side main thread

2014-09-03 Thread Chris Poulsen
Could this be a case for ProgressiveDisplay?

-- 
Chris


On Wed, Sep 3, 2014 at 5:09 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy <
> chungkhanhduy1...@gmail.com> wrote:
>
>  Hi experts,
>>
>
> Hi!
>
>
>  So now I would like to do something in another thread and after this
>> thread completed, I will render resultZone. Is that possible ?
>>
>
> Yes and no. Yes if you don't mind the AJAX request being blocked until the
> other thread finishes, no otherwise. That would need async support,
> something Tapestry doesn't have yet and only the latest servlet containers
> support.
>
>
>  Because I would
>> like to increase performance in case "do something" consume a lot of time.
>>
>
> The general rule for performance in any kind of program is to not optimize
> something anything unless you're already sure this something is actually a
> bottleneck. Otherwise, you risk complicating and breaking a piece of code
> for no gain.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 11:58:33 -0300, Dmitry Gusev   
wrote:



Aren't you talking about different things: ActivationRequestParameter vs.
PageActivationContext ?


Yeah, Lance is talking about activation context, while George about  
request parameters.


https://issues.apache.org/jira/browse/TAP5-1403 implemented array support  
for multiple values for a single query parameter in @RequestParameter. It  
shouldn't be too different for doing the same for  
@ActivationRequestParameter.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread George Christman
Yes, but I get what he was saying. I'll take a look at the tap worker
method tonight and see if I can't figure out how to get a custom one
working. Dmitry, do you know what I'll need to do in my app module to get
my custom annotation working?


On Wed, Sep 3, 2014 at 10:58 AM, Dmitry Gusev 
wrote:

> Aren't you talking about different things: ActivationRequestParameter vs.
> PageActivationContext ?
>
>
> On Wed, Sep 3, 2014 at 5:31 PM, George Christman 
> wrote:
>
> > I'd like to just create my own then since it handles the urls so well.
> How
> > would I go about doing that lance?
> >
> >
> > On Wed, Sep 3, 2014 at 2:23 AM, Lance Java 
> > wrote:
> >
> > > @PageActivationContext is a convenience annotation that ultimately
> > creates
> > > onActivate(..) and onPassivate() methods on your page. I think you're
> > > surpassing what it was designed for.
> > >
> > > You should just declare onActivate(..) and onPassivate() instead (or
> > maybe
> > > create your own @PageActivationContexts annotation / worker).
> > >
> >
> >
> >
> > --
> > George Christman
> > www.CarDaddy.com
> > P.O. Box 735
> > Johnstown, New York
> >
>
>
>
> --
> Dmitry Gusev
>
> AnjLab Team
> http://anjlab.com
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Update zone out side main thread

2014-09-03 Thread Thiago H de Paula Figueiredo
On Wed, 03 Sep 2014 08:51:29 -0300, Chung Khanh Duy  
 wrote:



Hi experts,


Hi!

So now I would like to do something in another thread and after this  
thread completed, I will render resultZone. Is that possible ?


Yes and no. Yes if you don't mind the AJAX request being blocked until the  
other thread finishes, no otherwise. That would need async support,  
something Tapestry doesn't have yet and only the latest servlet containers  
support.



Because I would
like to increase performance in case "do something" consume a lot of  
time.


The general rule for performance in any kind of program is to not optimize  
something anything unless you're already sure this something is actually a  
bottleneck. Otherwise, you risk complicating and breaking a piece of code  
for no gain.


--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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



Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread Dmitry Gusev
Aren't you talking about different things: ActivationRequestParameter vs.
PageActivationContext ?


On Wed, Sep 3, 2014 at 5:31 PM, George Christman 
wrote:

> I'd like to just create my own then since it handles the urls so well. How
> would I go about doing that lance?
>
>
> On Wed, Sep 3, 2014 at 2:23 AM, Lance Java 
> wrote:
>
> > @PageActivationContext is a convenience annotation that ultimately
> creates
> > onActivate(..) and onPassivate() methods on your page. I think you're
> > surpassing what it was designed for.
> >
> > You should just declare onActivate(..) and onPassivate() instead (or
> maybe
> > create your own @PageActivationContexts annotation / worker).
> >
>
>
>
> --
> George Christman
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Tynamo-Conversations + Tapestry-Atmosphere

2014-09-03 Thread Semen Vishniakov
Thanks for your help.

I just changed the port from 8080 to 8081 and it works now.

Sem

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



Update zone out side main thread

2014-09-03 Thread Chung Khanh Duy
Hi experts,

I am facing the problem :

- I have one action link in tml with its name is alink binding with zone



- in Java code I have:

onActionFromALink() {

// do something
if (request.isXHR()) {
   return resultZone;
}

}

So now I would like to do something in another thread and after this thread
completed, I will render resultZone. Is that possible ? Because I would
like to increase performance in case "do something" consume a lot of time.

Thanks,
Duy.



--


Re: Customize ActivationRequestParameter to take a list

2014-09-03 Thread George Christman
I'd like to just create my own then since it handles the urls so well. How
would I go about doing that lance?


On Wed, Sep 3, 2014 at 2:23 AM, Lance Java 
wrote:

> @PageActivationContext is a convenience annotation that ultimately creates
> onActivate(..) and onPassivate() methods on your page. I think you're
> surpassing what it was designed for.
>
> You should just declare onActivate(..) and onPassivate() instead (or maybe
> create your own @PageActivationContexts annotation / worker).
>



-- 
George Christman
www.CarDaddy.com
P.O. Box 735
Johnstown, New York


Re: Simpler Hello World

2014-09-03 Thread Chris Mylonas
I was wondering if you'd want to get the last word in Net Dawg ;)


On Wed, Sep 3, 2014 at 5:26 PM, Net Dawg  wrote:

> Thanks Chris.  The intent of this question was to get a start toward
> streaming "pure content" - not just text, but also (and especially PDF),
> XML, imagery - whatever - anything except HTML.  My solution finally was to
> mimic a previously coded button press on an HTML page.  Why?  Because that
> is where I get all the session variables set (search, query etc) to
> properly construct the PDF content.   Then I hid the button and launched
> the "pure content" page as a pagelink, instead, as follows:
>
> PDF
>
> Rather convoluted, but gets the job doneand, yes, hardly a simpler
> hello world now...(this workaround would be more useful to say "Hello
> Chris" -  after, say, selecting from an HTML list of users)
>
>
>
> On Tuesday, September 2, 2014 4:27 PM, Chris Mylonas 
> wrote:
>
>
>
> For future noobs, this is not a simpler hello world, it's making tapestry
> respond with text only, no template, nothing but pure text.
>
> I had to do this today and this thread caught my eye last month.
>
> In the standard tapestry 5.3.7 archetype, my Contact.java looks like this.
>
>
> package org.example.pages;
>
> import org.apache.tapestry5.StreamResponse;
> import org.apache.tapestry5.util.TextStreamResponse;
>
> public class Contact {
>
> StreamResponse onActivate(){
> return new TextStreamResponse("text/plain","some plain old text -
> no .tml file, no nothing. plain old text - yay!");
> }
> }
>
> I wouldn't describe it as a simpler hello world at all because you're
> making tapestry end it's goodness prematurely.  Like learning how to write
> a program and the first statement in main() you learn is exit(1);
>


Re: Simpler Hello World

2014-09-03 Thread Net Dawg
Thanks Chris.  The intent of this question was to get a start toward streaming 
"pure content" - not just text, but also (and especially PDF), XML, imagery - 
whatever - anything except HTML.  My solution finally was to mimic a previously 
coded button press on an HTML page.  Why?  Because that is where I get all the 
session variables set (search, query etc) to properly construct the PDF 
content.   Then I hid the button and launched the "pure content" page as a 
pagelink, instead, as follows: 

PDF

Rather convoluted, but gets the job doneand, yes, hardly a simpler hello 
world now...(this workaround would be more useful to say "Hello Chris" -  
after, say, selecting from an HTML list of users)



On Tuesday, September 2, 2014 4:27 PM, Chris Mylonas  wrote:
 


For future noobs, this is not a simpler hello world, it's making tapestry
respond with text only, no template, nothing but pure text.

I had to do this today and this thread caught my eye last month.

In the standard tapestry 5.3.7 archetype, my Contact.java looks like this.


package org.example.pages;

import org.apache.tapestry5.StreamResponse;
import org.apache.tapestry5.util.TextStreamResponse;

public class Contact {

StreamResponse onActivate(){
return new TextStreamResponse("text/plain","some plain old text -
no .tml file, no nothing. plain old text - yay!");
}
}

I wouldn't describe it as a simpler hello world at all because you're
making tapestry end it's goodness prematurely.  Like learning how to write
a program and the first statement in main() you learn is exit(1);