Re: Getting the target Page of a Link from a Mixin

2012-11-26 Thread Lance Java
Use declare a field in your mixin with the @BindParameter annotation and
tapestry will mirror the parameter from the component to your mixin. Any
updates you make to the field will update the underlying field.

Note that updates to @BindParameter fields will only work for prop:
bindings. Parameters that are bound to literal: or message: etc are
read-only.

http://tapestry.apache.org/component-mixins.html#ComponentMixins-Bindingtheparameterofthecorecomponent



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Getting-the-target-Page-of-a-Link-from-a-Mixin-tp5718275p5718276.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



Custom messages source

2012-11-26 Thread Guillaume Bodet
Hi all,


I am migrating an application to Tapestry 5.3. This application uses its
own system to manage i18n messages (using a database to store messages).

I would like to bridge its API to t5's Messages API, so I can transparently
use the message binding with keys from the old system.

Unfortunately, I did not find a easy way to achieve this (this only way to
contribute the ComponentMessageSource is to provide extra Resources with a
file semantic).

Any idea?


Best regards


Guillaume


Re: Custom messages source

2012-11-26 Thread Lance Java
You will either decorate or override ComponentMessagesSource

http://tapestry.apache.org/tapestry-ioc-decorators.html
http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/messages/ComponentMessagesSource.html



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Custom-messages-source-tp5718277p5718278.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: JS does not work within t:block?

2012-11-26 Thread Lance Java
Using  tags in your templates is a hack. Use JavaScriptSupport in a page
request or AjaxResponseRenderer in an ajax request for that.

http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ajax/AjaxResponseRenderer.html
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/javascript/JavaScriptSupport.html



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JS-does-not-work-within-t-block-tp5718269p5718279.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: SinglePage app design thoughts

2012-11-26 Thread Geoff Callender
My suggestions below...

On 25/11/2012, at 10:42 PM, bigcache1 wrote:

 I have started to work on my new application, that would address thought
 work.
 And single page design is very appealing to me. I am heavily inspired by 
 Asana http://asana.com   example.
 What is main feature of single page design for me? It is a seamless
 experience. Because page reloads, are not natural, they only eat time.
 Actually, any loads eat time.
 These are my first thought design considerations, after 1,5 year Tapestry5
 experience, and reading Igor's book. How I imagine page/component aspect of
 the app design:
 1) Pages. Only one page. Index.

 2) Components. Few rich behavior pane components, like the main pane on
 tapestry.apache.org, or like panes in Asana. Load them through zone.
 This is the sketch of what I have now:
 page
menu, which is the mainZone controller
mainZone, with components
pane-like component
subzones and smaller components (visually)
/pane-like component
...may be additional components and zones here...
/mainZone
...may be additional components and zones here...
 /page

In the following link, each menu option is a single page, but it's not a big 
step to turn them into components in just one page.


http://jumpstart.doublenegative.com.au/jumpstart/together/withlayout2/gracefulajaxfiltercrud/persons

I haven't tried the single page approach with anything complex in Tapestry so I 
don't know how pleasant it would be doing without onActivate(...) and 
onPassivate().
You will have to consider problems like how to make views bookmark-able. 
You'll also lose the browser's Back button functionality because when all your 
calls are AJAX there's no browser history. Perhaps a mixin on each link and 
submit could create a bookmark URL and push it to the browser history.

 3) API. Also, I like the idea of API that could work for both internal and
 external use, and I'm wondering how to implement that with Tapestry, and
 practices are known? Should I go check REST extensions?

 4) Architecture. I'am want to roll out server-side software, and have
 different client applications: web-app, mobile app, desktop app. I see
 client applications using the same API for data syncing, and event-driven
 interaction.

I'd go with Tapestry for web tier (client and server) and EJB3 for business 
tier. That gives you a business tier you can access easily from multiple 
front-ends.
If you need web services, use Tapestry or tapestry-resteasy in front of he 
business tier.


http://jumpstart.doublenegative.com.au/jumpstart/examples/ws/webservicesmore


If your front end is mobile it may be Tapestry or, say, jQuery Mobile to web 
services, or iOS app to web services.
If your front end is a desktop app, it could reach the business tier on a LAN 
with RMI, or remotely by RMI over HTTP, or remotely via REST, etc. etc. 

I have used all the elements of this architecture and marvelled at its 
modularity and the ease with which you can use it to build up robust, flexible 
systems.

 Post Scriptum:
 Discussion. If discussion will turns out beautiful, I will be glad to
 contribute to the Tapestry community, by organizing it into an article,
 which could be published on any Tapestry broadcasting channels, as a guide
 or FAQ.
 Me. I believe I have short, but intense developer experience. I do OOP for 3
 years, Java for 2 years, Tapestry for 1 year. I know few patterns like CoC,
 I like the idea of small testable pieces of whatever, maybe I understand the
 REST idea. I am trying to live and work by KISS, YAGNI, DRY principles.
 Also, think global, act local. 
 
 
 
 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/SinglePage-app-design-thoughts-tp5718264.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: JS does not work within t:block?

2012-11-26 Thread nquirynen
When do you run the javascript? Is the content of the blocks rendered when
you apply this javascript?
Maybe you should make a simple mixin which you assign to the input fields.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/JS-does-not-work-within-t-block-tp5718269p5718280.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



TAP5-1741 when will it get fixed?

2012-11-26 Thread Rural Hunter

Hi,

This is a very severe bug for non-English/UTF8 environment. It seems 
there is already a patch for it. any way to push it to be fixed?


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



kaptcha

2012-11-26 Thread John
please share opinions on the best Tapestry Kaptcha solution please, i.e. 
easiest to integrate and simple to use - I believe there is more than 1 choice

TIA

TapestryCayenneModule - register listener on startup

2012-11-26 Thread devnull2000
Hi,

I'd like to register a listener and filter at application startup on a Cayenne 
data domain (a non-Tapestry filter/listener). I need to add something like 
these two lines somewhere:

runtime.getDataDomain().getEntityResolver().getCallbackRegistry().addListener(new
 LastModifiedListener());
runtime.getDataDomain().addFilter(new ChangeSetFilter());

Since I use tapestry5-cayenne there's no easy way to do this, because I just 
add the dependency in my pom and then inject the cayenne object context (or 
data context). I never do something like 
ServerRuntime runtime = new ServerRuntime(cayenne.xml); ..

In the TapestryCayenneModule there's a ObjectContextProvider service with a 
private field runtime. I tried to override this service and add my two lines 
but got a conflict because in TapestryCayenneModule.java the service is not 
only bound but also overridden.

Then I tried to inject this service into my startup method and access the 
DataDomain object via the ObjectContext returned by a method of the service. 
But nothing worked. I guess it's too early, the service isn't available yet. 
The actual exception was 
Registry Error invoking service contribution method 
de.myapp.services.AppModule.registerCayenneFilterAndListener(): Unable to 
delegate method invocation to property 'request' of Proxy 
for RequestGlobals(org.apache.tapestry5.services.RequestGlobals), because the 
property is null.

I also tried a method with @Startup and 
ServerRuntime runtime = new ServerRuntime(cayenne.xml); ..
but then the data domain in the TapestryCayenneModule doesn't know about any 
listener or filter.


So is there any way to access a field of a service from another module on 
startup?
Or is there something like the @Startup annotation but at a later point of 
time, after the services are available?

Initially I asked on the cayenne mailing list 
http://mail-archives.apache.org/mod_mbox/cayenne-user/201211.mbox/%3c20121121200224.59...@gmx.net%3E
but then it became more of a tapestry question.


Cheers,
-bjello



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



Re: kaptcha

2012-11-26 Thread Stephan Windmüller
On 26.11.2012 15:03, John wrote:

 please share opinions on the best Tapestry Kaptcha solution please,
 i.e. easiest to integrate and simple to use - I believe there is more
 than 1 choice

Hi John,

please do not start a new thread by replying to an existing message and
changing the subject. Instead, please write a new e-mail. Thanks.

About your question: We use the kaptcha component integrated in
Tapestry:

http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/kaptcha/components/package-summary.html

Example code:

t:kaptchaimage t:id=captchaImage/
br/
t:kaptchafield label=Security Check t:id=captchaField
image=captchaImage t:visible=true/

HTH
 Stephan



smime.p7s
Description: S/MIME Kryptografische Unterschrift


Re: Zones / Forms in a loop - Which iteration invoked the action?

2012-11-26 Thread Norman Franke
Generally I include a hidden field inside the form that has the context. It's 
very easy to implement and use.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Nov 24, 2012, at 2:31 PM, Lenny Primak wrote:

 t:loop source=...
  t:zone update=none
form t:type=form zone=^
input t:type=submit event=start value=Start/ 
   /form
 /t:zone
 /t:loop
 
 ... Java
 
 onStart()
 {
  // how do I know which one of the start buttons got pushed?
 // there are n possibilities since there are n loop iterations
  return zone.getBody();
 }
 
 
 Thanks for your help!
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org
 



Re: Zones / Forms in a loop - Which iteration invoked the action?

2012-11-26 Thread Lenny Primak
Yup.  That'll work too.  Thanks!

On Nov 26, 2012, at 11:03 AM, Norman Franke wrote:

 Generally I include a hidden field inside the form that has the context. It's 
 very easy to implement and use.
 
 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com
 
 
 
 On Nov 24, 2012, at 2:31 PM, Lenny Primak wrote:
 
 t:loop source=...
 t:zone update=none
   form t:type=form zone=^
   input t:type=submit event=start value=Start/ 
  /form
 /t:zone
 /t:loop
 
 ... Java
 
 onStart()
 {
 // how do I know which one of the start buttons got pushed?
 // there are n possibilities since there are n loop iterations
 return zone.getBody();
 }
 
 
 Thanks for your help!
 
 -
 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



Accessing tapestry request params outwith a page

2012-11-26 Thread dkeenan
Hi. I have a utility class that I call from within my application. Is it
possible to access the current request and requests parameters from within
my utility class so I can access form parameter values that were uploaded in
the current request?




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Accessing-tapestry-request-params-outwith-a-page-tp5718291.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: Accessing tapestry request params outwith a page

2012-11-26 Thread Thiago H de Paula Figueiredo
On Mon, 26 Nov 2012 14:25:50 -0200, dkeenan david_siedle...@yahoo.co.uk  
wrote:



Hi. I have a utility class that I call from within my application. Is it
possible to access the current request and requests parameters from  
within my utility class so I can access form parameter values that were  
uploaded in the current request?


Just inject the Request service.

--
Thiago H. de Paula Figueiredo

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



Re: Accessing tapestry request params outwith a page

2012-11-26 Thread dkeenan
Nice. I was thinking I could only inject a request into a page class. So I
can inject the request anywhere in the application? Great. Thanks.




--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Accessing-tapestry-request-params-outwith-a-page-tp5718291p5718293.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: Accessing tapestry request params outwith a page

2012-11-26 Thread dkeenan
...just out of interest. Am I correct in thinking that form parameters for a
Tapestry form upload are not stored in the usual HttpServletRequest
parameters?

The reason I ask is that I was originally accessing the HttpServletRequest
object, to try and get to the form parameter I was looking for. From memory,
I think that my HttpServletRequst only had a parameter called 'f:formdata',
rather than each parameter of the form.

Does tapestry actually put submitted form fields into a single
HttpServletReqeust parameter when a form is submitted? If so, is this why we
inject a tapestry Request class to get access to the form parameters, rather
than accessing them from the original HttpServletRequest (as they would
actually be bundled within one parameter at that stage)?

Not sure if I'm way off the mark with my thinking there ^^^








--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Accessing-tapestry-request-params-outwith-a-page-tp5718291p5718294.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: Accessing tapestry request params outwith a page

2012-11-26 Thread Thiago H de Paula Figueiredo
On Mon, 26 Nov 2012 14:46:16 -0200, dkeenan david_siedle...@yahoo.co.uk  
wrote:


Nice. I was thinking I could only inject a request into a page class. So  
I can inject the request anywhere in the application? Great. Thanks.


Yes. It is a normal per-thread Tapestry-IoC service. Of course, this will  
only work on threads that are requests.


--
Thiago H. de Paula Figueiredo

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



Re: Accessing tapestry request params outwith a page

2012-11-26 Thread Thiago H de Paula Figueiredo
On Mon, 26 Nov 2012 14:51:50 -0200, dkeenan david_siedle...@yahoo.co.uk  
wrote:


...just out of interest. Am I correct in thinking that form parameters  
for a Tapestry form upload are not stored in the usual HttpServletRequest

parameters?


No. The Tapestry form field components generate ordinary HTML fields.

The reason I ask is that I was originally accessing the  
HttpServletRequest object, to try and get to the form parameter I was  
looking for. From memory, I think that my HttpServletRequst only had a  
parameter called 'f:formdata', rather than each parameter of the form.


Please check again.


Does tapestry actually put submitted form fields into a single
HttpServletReqeust parameter when a form is submitted?


No. Request is just a thin layer separating most code from using the  
HttpServletRequest directly.


--
Thiago H. de Paula Figueiredo

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



Re: Zones / Forms in a loop - Which iteration invoked the action?

2012-11-26 Thread Geoff Callender
Just for the record, I think you'll find that onPrepare() gets called 
regardless.

In comes an AJAX form submit. The Form may have a context. The Submit may 
specify an event other than SELECT.
- Form bubbles up PREPARE_FOR_SUBMIT. Form context is available if 
specified.
- Form bubbles up PREPARE.
- Submit bubbles up SELECT or the event you specified. In your example I 
think you handle this event and return the zone which stops Form bubbling up 
VALIDATE_FROM_FORM and SUCCESS or FAILURE.
Tapestry switches to rendering the zone content...
- Form bubbles up PREPARE_FOR_RENDER.
- Form bubbles up PREPARE.
Out goes AJAX response with zone content.

On 26/11/2012, at 1:30 AM, Lenny Primak wrote:

 There is another tiny bit that I do that's not like your example that makes 
 all the difference. 
 The button event method updates the zone the form is in, so onPrepare() or 
 any other form methods do not get called. This is why I can't have the 
 context in the form itself, which would Indeed work because the context would 
 be saved in t:formdata element. 
 
 The event link method works great though and without extra forms. 
 
 On Nov 24, 2012, at 11:18 PM, Geoff Callender 
 geoff.callender.jumpst...@gmail.com wrote:
 
 On 25/11/2012, at 12:37 PM, Lenny Primak wrote:
 
 Once again, Geoff, fantastic work on JumpStart!
 
 Thanks Lenny.
 
 Not quite... 
 In the first example, none of the action buttons care in which zone/form 
 they are in, they just set the global action variable.
 You can readily see the problem if you try to pass a context in the select 
 or cancel button, as it will be null.
 
 Sorry, I don't understand the difference. The button event handlers don't 
 need to carry a context because the Form does it for them.  
 
   form t:id=personForm t:type=form t:context=person.id ...
 
 When you click Edit, the first event handler invoked is this one:
 
   void onPrepareForSubmitFromPersonForm(Long personId)
 
 Now we know the context. Then this event handler is invoked:
 
   void onSelectedFromEdit()
 
 Now we know the action. We're ready to do anything. Then this is invoked:
 
   void onValidateFromPersonForm()
 
 Doesn't that match your situation?
 



Re: Which phase of page lifecycle will not occur when we access page 2nd time?

2012-11-26 Thread Norman Franke
I vote for that. It makes sense and would make initialization from a database 
easier and more consistent. I end up doing it in onActivate since it's called 
for form submission and regular rendering.

Norman Franke
Answering Service for Directors, Inc.
www.myasd.com



On Nov 21, 2012, at 3:09 PM, Howard Lewis Ship wrote:

 However, I'm thinking of de-deprecating @PageAttached and @PageDetached.
 I think they are actually useful in the long run.
 
 So:
 
 @PageLoaded - once when the page is initially constructed
 @PageAttached - once per request, when the page is first used in that
 request
 @PageDetached - once per request, after the response has been sent to the
 client user agent
 
 
 On Wed, Nov 21, 2012 at 12:43 AM, Lance Java lance.j...@googlemail.comwrote:
 
 @PageAttached and @PageDetached are deprecated and are leftovers from page
 pooling. The page pool has been disabled by default since version 5.2 in
 favour of page singletons which maintain mutable state in thread local
 maps.
 
 
 
 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/Which-phase-of-page-lifecycle-will-not-occur-when-we-access-page-2nd-time-tp5718142p5718144.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
 
 
 
 
 -- 
 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



Re: Which phase of page lifecycle will not occur when we access page 2nd time?

2012-11-26 Thread Howard Lewis Ship
I'm back and forth because these kind of per-request things might be better
done in a PerThread service, which gains some laziness that isn't present
in the attach/detach lifecycle events.


On Mon, Nov 26, 2012 at 11:41 AM, Norman Franke nor...@myasd.com wrote:

 I vote for that. It makes sense and would make initialization from a
 database easier and more consistent. I end up doing it in onActivate since
 it's called for form submission and regular rendering.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com



 On Nov 21, 2012, at 3:09 PM, Howard Lewis Ship wrote:

  However, I'm thinking of de-deprecating @PageAttached and
 @PageDetached.
  I think they are actually useful in the long run.
 
  So:
 
  @PageLoaded - once when the page is initially constructed
  @PageAttached - once per request, when the page is first used in that
  request
  @PageDetached - once per request, after the response has been sent to the
  client user agent
 
 
  On Wed, Nov 21, 2012 at 12:43 AM, Lance Java lance.j...@googlemail.com
 wrote:
 
  @PageAttached and @PageDetached are deprecated and are leftovers from
 page
  pooling. The page pool has been disabled by default since version 5.2 in
  favour of page singletons which maintain mutable state in thread local
  maps.
 
 
 
  --
  View this message in context:
 
 http://tapestry.1045711.n5.nabble.com/Which-phase-of-page-lifecycle-will-not-occur-when-we-access-page-2nd-time-tp5718142p5718144.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
 
 
 
 
  --
  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


SessionState

2012-11-26 Thread Pillar
Hi,

In the Tapestry User Guide for  session storage
http://tapestry.apache.org/session-storage.html  , it states Any other
component or page that declares a field of the same type, regardless of
name, and marks it with the SessionState annotation will share the same
value. I have the following Page class:

public class Page {
@SessionState
private User loggedInUser;

@SessionState
private User buddy;
}

Am I understanding correctly that both of these instances of User will be
the same? And that if I want them to be different, I have to encapsulate
them in another class, add an instance variable of that class to my Page
class, and annotate it as SessionState? Or are there other alternatives (not
necessarily for this use case, just having two instances of the same type in
session)?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/SessionState-tp5718302.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: SessionState

2012-11-26 Thread Thiago H de Paula Figueiredo

On Mon, 26 Nov 2012 18:45:14 -0200, Pillar sotodel...@hotmail.com wrote:


Hi,


Hi!


In the Tapestry User Guide for  session storage
http://tapestry.apache.org/session-storage.html  , it states Any other
component or page that declares a field of the same type, regardless of
name, and marks it with the SessionState annotation will share the same
value. I have the following Page class:

public class Page {
@SessionState
private User loggedInUser;
   @SessionState
private User buddy;
}

Am I understanding correctly that both of these instances of User will be
the same?


Exactly the same. The actual name of the session attribute (which you  
should consider completely irrelevant) is based on the fully-qualified  
class name. The field name is ignored.



And that if I want them to be different, I have to encapsulate
them in another class, add an instance variable of that class to my Page
class, and annotate it as SessionState?


Yep. Or just create another class, for example, UserState, with two  
different fields, loggedInUser and buddy, and don't have an User in the  
@SessionState directly, so you have a single place for looking for the  
current logged in user.


I've been working with Tapestry 5 since the first alphas. @SessionState  
works exactly in the same way since then, almost 5 years ago. I've *never*  
needed two different instances of the same class in the session.


--
Thiago H. de Paula Figueiredo

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



RE: SessionState

2012-11-26 Thread Pillar
I don't know if it's common practice to send thank you's in a mailing list, but 
screw it. Thanks! I'm pretty sure I'll be using much more of Tapestry in the 
future.

Sotirios

Date: Mon, 26 Nov 2012 13:08:55 -0800
From: ml-node+s1045711n5718303...@n5.nabble.com
To: sotodel...@hotmail.com
Subject: Re: SessionState



On Mon, 26 Nov 2012 18:45:14 -0200, Pillar [hidden email] wrote:


 Hi,


Hi!


 In the Tapestry User Guide for  session storage

 http://tapestry.apache.org/session-storage.html  , it states Any other

 component or page that declares a field of the same type, regardless of

 name, and marks it with the SessionState annotation will share the same

 value. I have the following Page class:



 public class Page {

 @SessionState

 private User loggedInUser;

@SessionState

 private User buddy;

 }



 Am I understanding correctly that both of these instances of User will be

 the same?

Exactly the same. The actual name of the session attribute (which you  

should consider completely irrelevant) is based on the fully-qualified  

class name. The field name is ignored.


 And that if I want them to be different, I have to encapsulate

 them in another class, add an instance variable of that class to my Page

 class, and annotate it as SessionState?


Yep. Or just create another class, for example, UserState, with two  

different fields, loggedInUser and buddy, and don't have an User in the  

@SessionState directly, so you have a single place for looking for the  

current logged in user.


I've been working with Tapestry 5 since the first alphas. @SessionState  

works exactly in the same way since then, almost 5 years ago. I've *never*  

needed two different instances of the same class in the session.


-- 

Thiago H. de Paula Figueiredo


-

To unsubscribe, e-mail: [hidden email]

For additional commands, e-mail: [hidden email]













If you reply to this email, your message will be added to the 
discussion below:

http://tapestry.1045711.n5.nabble.com/SessionState-tp5718302p5718303.html



To unsubscribe from SessionState, click here.

NAML
  



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/SessionState-tp5718302p5718304.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Accessing tapestry request params outwith a page

2012-11-26 Thread Lance Java
I'm taking an educated guess here and guessing that you're trying to
implement your file upload progress bar mentioned here
http://tapestry.1045711.n5.nabble.com/Adding-a-progress-listener-to-UploadedFile-td5718197.html

To implement this you will do two things:
1. Upload a file
2. Send regular ajax requests to get the percentage complete of the file
upload.

So, you must keep in mind that 1 and 2 are separate requests on separate
threads so you will not share any request state or thread state between the
two. Instead, you will probably update a session attribute in the file
upload which can be polled by the ajax requests.

Cheers,
Lance.



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Accessing-tapestry-request-params-outwith-a-page-tp5718291p5718305.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: Accessing tapestry request params outwith a page

2012-11-26 Thread Howard Lewis Ship
In the case of a multipart form submission (one that has a FileUpload
component involved), then request parameters are NOT visible inside the
HttpServletRequest but ARE visible inside the (Tapestry) Request.


On Mon, Nov 26, 2012 at 9:07 AM, Thiago H de Paula Figueiredo 
thiag...@gmail.com wrote:

 On Mon, 26 Nov 2012 14:51:50 -0200, dkeenan david_siedle...@yahoo.co.uk
 wrote:

  ...just out of interest. Am I correct in thinking that form parameters
 for a Tapestry form upload are not stored in the usual HttpServletRequest
 parameters?


 No. The Tapestry form field components generate ordinary HTML fields.


  The reason I ask is that I was originally accessing the
 HttpServletRequest object, to try and get to the form parameter I was
 looking for. From memory, I think that my HttpServletRequst only had a
 parameter called 'f:formdata', rather than each parameter of the form.


 Please check again.


  Does tapestry actually put submitted form fields into a single
 HttpServletReqeust parameter when a form is submitted?


 No. Request is just a thin layer separating most code from using the
 HttpServletRequest directly.


 --
 Thiago H. de Paula Figueiredo

 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@tapestry.**apache.orgusers-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


Re: SessionState

2012-11-26 Thread Thiago H de Paula Figueiredo

On Mon, 26 Nov 2012 19:17:45 -0200, Pillar sotodel...@hotmail.com wrote:

I don't know if it's common practice to send thank you's in a mailing  
list, but screw it. Thanks! I'm pretty sure I'll be using much more of  
Tapestry in the future.


We in the Tapestry mailing lists are very happy to help. :) Stick around  
and you'll notice many people providing very useful insights. ;)


--
Thiago H. de Paula Figueiredo

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



Re: Getting the target Page of a Link from a Mixin

2012-11-26 Thread Howard Lewis Ship
Instead of a mixin on PageLink, I would just write a custom component. What
PageLink does is quite straightforward.

On Monday, November 26, 2012, Lance Java wrote:

 Use declare a field in your mixin with the @BindParameter annotation and
 tapestry will mirror the parameter from the component to your mixin. Any
 updates you make to the field will update the underlying field.

 Note that updates to @BindParameter fields will only work for prop:
 bindings. Parameters that are bound to literal: or message: etc are
 read-only.


 http://tapestry.apache.org/component-mixins.html#ComponentMixins-Bindingtheparameterofthecorecomponent



 --
 View this message in context:
 http://tapestry.1045711.n5.nabble.com/Getting-the-target-Page-of-a-Link-from-a-Mixin-tp5718275p5718276.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.

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



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


How to give the link to the select component value.

2012-11-26 Thread Anbazhagan
Hi,

I am developing a web application. In my application I am using select
component to display the categories  with submit button. My select component
is

input t:type=select t:validate=required t:value=selectGame
model=gamesList / .
input t:type=submit t:value=Go /

Here I select the specific category and click the go button, then only its
take the action and display the content. But I want to take the action when
I select the particular item from select component list.

Please any one say how can I achieve it.





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/How-to-give-the-link-to-the-select-component-value-tp5718309.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: How to give the link to the select component value.

2012-11-26 Thread Taha Siddiqi
Hi

You can submit the form using javascript. Adding a simple inline attribute to 
the select button can do the trick

onchange='this.form.submit()'

regards
Taha

On Nov 27, 2012, at 12:24 PM, Anbazhagan wrote:

 Hi,
 
 I am developing a web application. In my application I am using select
 component to display the categories  with submit button. My select component
 is
 
 input t:type=select t:validate=required t:value=selectGame
 model=gamesList / .
 input t:type=submit t:value=Go /
 
 Here I select the specific category and click the go button, then only its
 take the action and display the content. But I want to take the action when
 I select the particular item from select component list.
 
 Please any one say how can I achieve it.
 
 
 
 
 
 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/How-to-give-the-link-to-the-select-component-value-tp5718309.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: Accessing tapestry request params outwith a page

2012-11-26 Thread Taha Siddiqi
Hi

If your utility class is managed by the ioc, which seems unlikely, then you can 
@Inject request and response into it. 

regards
Taha

On Nov 26, 2012, at 9:55 PM, dkeenan wrote:

 Hi. I have a utility class that I call from within my application. Is it
 possible to access the current request and requests parameters from within
 my utility class so I can access form parameter values that were uploaded in
 the current request?
 
 
 
 
 --
 View this message in context: 
 http://tapestry.1045711.n5.nabble.com/Accessing-tapestry-request-params-outwith-a-page-tp5718291.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