Re: Getting Session State Object from another servlet alongside Tapestry

2012-05-10 Thread Kartweel
Thanks. That seems like a better approach, rather than ignoring it, to 
still process it but pass it onto the other servlet. I guess the trick 
is making the request filter pass it into Vaadin, so I need to find out 
how Vaadin needs it to work. I guess instantiate the Vaadin servlet and 
just pass the request on?. I'm sure I'll figure it out :).

On 9/05/2012 4:13 PM, Lance Java [via Tapestry] wrote:
 Instead of implementing a HttpServletRequestFilter that is not managed 
 by tapestry, you could contribute a 
 org.apache.tapestry5.services.RequestFilter instead.

 In your AppModule add the following

 public void 
 contributeRequestHandler(OrderedConfigurationRequestFilter configuration) 
 {
 configuration.addInstance(MyRequestFilter.class);
 }

 Here's some further reading:
 http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/services/RequestFilter.html
 http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/internal/services/StaticFilesFilter.html
 http://tapestry.apache.org/request-processing.html

 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://tapestry.1045711.n5.nabble.com/Getting-Session-State-Object-from-another-servlet-alongside-Tapestry-tp5696382p5696736.html
  

 To unsubscribe from Getting Session State Object from another servlet 
 alongside Tapestry, click here 
 http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5696382code=cmhvd0BleGVtYWlsLmNvbS5hdXw1Njk2MzgyfDE5MTMyMDEzNjQ=.
 NAML 
 http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Getting-Session-State-Object-from-another-servlet-alongside-Tapestry-tp5696382p5702040.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Getting Session State Object from another servlet alongside Tapestry

2012-05-08 Thread Kartweel
Hi,

I've got another servlet running alongside tapestry. I would like to get a
sessionstate object from Tapestry to find out the currently logged in user
(And probably a few other things too eventually).

I've accessed the Service registry and can build the ApplicationStateManager
service, but on requesting an object I get the exception below. Which makes
perfect sense, because the request hasn't gone through the tapestry pipeline
(I'm using a tapestry ignorefilter to ignore requests to the other servlet).

So my question is, can I somehow inject the request information into
tapestry so I can access the tapestry session state object?. Or is there a
better way to integrate the other framework to use some more tapestry
features? I understand session objects integrate with the tapestry page
lifecycle, so it might not be so straight forward, but if I could just
access the objects and later work on setting them, then that would be great
:).

My goal is to embed a few Vaadin pages into my tapestry application. So far
so good, I can access services, but it would be great to access the session
related objects too.

Thanks, Ryan


java.lang.NullPointerException: Unable to delegate method invocation to
property 'request' of Proxy for
RequestGlobals(org.apache.tapestry5.services.RequestGlobals), because the
property is null.
at $Request_ab8a69b42eedd.readProperty(Unknown Source)
at $Request_ab8a69b42eedd.getSession(Unknown Source)
at $Request_ab8a69b42eea3.getSession(Unknown Source)
at
org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.getSession(SessionApplicationStatePersistenceStrategy.java:38)
at
org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.getOrCreate(SessionApplicationStatePersistenceStrategy.java:49)
at
org.apache.tapestry5.internal.services.SessionApplicationStatePersistenceStrategy.get(SessionApplicationStatePersistenceStrategy.java:44)


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Getting-Session-State-Object-from-another-servlet-alongside-Tapestry-tp5696382.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: Getting Session State Object from another servlet alongside Tapestry

2012-05-08 Thread Kartweel
Found a similar post here. Any advice? :)

http://osdir.com/ml/users-tapestry-apache/2009-12/msg00140.html


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Getting-Session-State-Object-from-another-servlet-alongside-Tapestry-tp5696382p5696398.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: Getting Session State Object from another servlet alongside Tapestry

2012-05-08 Thread Kartweel
Using the code in that post (and updating it for T5.3) seems to work. But I
don't know why... am I going to create a memory leak?. In my other servlet I
can call registry.cleanUpThread() at the end of every request. Now just the
fun of trying to kinda link a page based framework like tapestry with more
of a desktop style framework like vaadin.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Getting-Session-State-Object-from-another-servlet-alongside-Tapestry-tp5696382p5696405.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



Get progress of file upload

2012-01-01 Thread Kartweel
Hi,

I'm wanting to get the progress of a file upload (server side, not client
side) and then update it client side using an ajax polling component.

The problem is I can't even get the page to activate before the upload is
complete. So I guess I need to hook into the upload component somehow?, any
ideas how I could go about doing this?


Thanks!!

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Get-progress-of-file-upload-tp5113970p5113970.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: [T5.3] Need a replacement for pageDetached (or a better way to achieving this...)

2011-11-28 Thread Kartweel
Thanks,

I'll give it a try.

But I don't think afterRender will be called unless the ajax response 
contains the form? (ie, the form is rendered...). I think that is why I 
was using pageDetached because it is always called. What do you think?

Thanks, Ryan



On 29/11/2011 10:06 AM, joshcanfield [via Tapestry] wrote:
 Hmm... somewhere between nabble and my inbox your sourcecode was
 stripped. This seems to be a pretty common problem with nabble.

 I'm not sure that this is addressed in 5.3, or if there is a defect 
 filed yet.

 But, seems like you could use a mixin?

 // In your page/component holding the form
  @Component(id = form)
  @Mixins({AjaxFormFix})
  private Form form;


 // In your mixins package

 @MixinAfter
 public class AjaxFormFix {

 @Inject
 private Request request;

 @InjectContainer
 private Form form;

 void afterRender() {
 if (request.isXHR()) {
 if (form.getDefaultTracker() != null)
 form.getDefaultTracker().clear();
 form.setDefaultTracker(null);
 }
 }
 }

 Josh

 On Sat, Nov 26, 2011 at 10:56 PM, Kartweel [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030881i=0 wrote:

  Hi,
 
  I have the following code which I've been using to work around forms
  invalidly persisting data on ajax requests (ie. form is rendered in 
 the ajax
  response, but the validation tracker stores the values for the NEXT 
 request,
  it needs to be cleared straight away). Now that pageDetached is 
 depreciated
  what would be a better way to achieve this? Or does 5.3 now handle this
  correctly?
 
 
 
 
 
  Thanks, Ryan
 
 
  --
  View this message in context: 
 http://tapestry.1045711.n5.nabble.com/T5-3-Need-a-replacement-for-pageDetached-or-a-better-way-to-achieving-this-tp5026033p5026033.html
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030881i=1
  For additional commands, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030881i=2
 
 

 -
 To unsubscribe, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030881i=3
 For additional commands, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030881i=4



 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://tapestry.1045711.n5.nabble.com/T5-3-Need-a-replacement-for-pageDetached-or-a-better-way-to-achieving-this-tp5026033p5030881.html
  

 To unsubscribe from [T5.3] Need a replacement for pageDetached (or a 
 better way to achieving this...), click here 
 http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5026033code=cmhvd0BleGVtYWlsLmNvbS5hdXw1MDI2MDMzfDE5MTMyMDEzNjQ=.
 NAML 
 http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespacebreadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-Need-a-replacement-for-pageDetached-or-a-better-way-to-achieving-this-tp5026033p5030891.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: [T5.3] @ActivationRequestParameter not encoding to be URL friendly

2011-11-28 Thread Kartweel
Thanks for the reply, should I file a bug report for this or are you 
more qualified for doing that :) ?

Thanks, Ryan


On 29/11/2011 10:24 AM, joshcanfield [via Tapestry] wrote:
 Looks like a defect, not sure if it's been filed yet.

 ActivationRequestParameterWorker isn't encoding the client value
 returned by the ValueEncoder.

  String clientValue = encoder.toClient(value);

  link.addParameter(parameterName, clientValue);

 addParameter is documented as not doing the encoding (I'm guessing
 legacy oversight that would cause too much grief to fix for code
 already working around it)

 /**
  * Adds a parameter value. The value will be added, as is, to the URL.
 In many cases, the value should be URL
  * encoded via {@link URLCodec}.
  * ...



 Josh


 On Sat, Nov 26, 2011 at 3:50 AM, Kartweel [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030922i=0 wrote:

  Hi, I have a situation where my ActivationRequestParameter has an  
 symbol in
  it. This doesn't seem to get encoded when it is attached to the query
  string. When it gets submitted back to tapestry everything after the 
  is
  just truncated (because obviously after the  it thinks a new 
 parameter is
  starting). I'm assuming this is a bug ? I would have expected 
 tapestry to
  handle it automatically...
 
  For now I can get around it by doing a URLEncoder.encode on it when 
 I set
  it. The funny thing is that it seems to automatically decode by itself,
  because I never actually decode it. So I need to manually encode it for
  every response.
 
  Thanks, Ryan
 
 
  --
  View this message in context: 
 http://tapestry.1045711.n5.nabble.com/T5-3-ActivationRequestParameter-not-encoding-to-be-URL-friendly-tp5024732p5024732.html
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030922i=1
  For additional commands, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030922i=2
 
 

 -
 To unsubscribe, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030922i=3
 For additional commands, e-mail: [hidden email] 
 /user/SendEmail.jtp?type=nodenode=5030922i=4



 
 If you reply to this email, your message will be added to the 
 discussion below:
 http://tapestry.1045711.n5.nabble.com/T5-3-ActivationRequestParameter-not-encoding-to-be-URL-friendly-tp5024732p5030922.html
  

 To unsubscribe from [T5.3] @ActivationRequestParameter not encoding to 
 be URL friendly, click here 
 http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=5024732code=cmhvd0BleGVtYWlsLmNvbS5hdXw1MDI0NzMyfDE5MTMyMDEzNjQ=.
 NAML 
 http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespacebreadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
  



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-ActivationRequestParameter-not-encoding-to-be-URL-friendly-tp5024732p5030928.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

[T5.3] @ActivationRequestParameter not encoding to be URL friendly

2011-11-26 Thread Kartweel
Hi, I have a situation where my ActivationRequestParameter has an  symbol in
it. This doesn't seem to get encoded when it is attached to the query
string. When it gets submitted back to tapestry everything after the  is
just truncated (because obviously after the  it thinks a new parameter is
starting). I'm assuming this is a bug ? I would have expected tapestry to
handle it automatically...

For now I can get around it by doing a URLEncoder.encode on it when I set
it. The funny thing is that it seems to automatically decode by itself,
because I never actually decode it. So I need to manually encode it for
every response.

Thanks, Ryan


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-ActivationRequestParameter-not-encoding-to-be-URL-friendly-tp5024732p5024732.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



[T5.3] Need a replacement for pageDetached (or a better way to achieving this...)

2011-11-26 Thread Kartweel
Hi,

I have the following code which I've been using to work around forms
invalidly persisting data on ajax requests (ie. form is rendered in the ajax
response, but the validation tracker stores the values for the NEXT request,
it needs to be cleared straight away). Now that pageDetached is depreciated
what would be a better way to achieve this? Or does 5.3 now handle this
correctly?





Thanks, Ryan


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-3-Need-a-replacement-for-pageDetached-or-a-better-way-to-achieving-this-tp5026033p5026033.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: Ajax and Validation

2011-06-13 Thread Kartweel
Hi,

I've had major issues with this because the ValidationTracker also reloads
old field values which in a non-ajax scenario is great, but in an ajax
scenario has caused it to clobber the proper field values. It has caused
many headaches and I think it really should be handled [better] by default
in tapestry.

I think I just came across a simple solution to the issue (that i was
specifically having anyway)


@PageDetached
void clearValidationTracker() {
if (request.isXHR()) {
if (form.getDefaultTracker() != null) 
form.getDefaultTracker().clear();
}
}


In early testing it seems to do what I want.

I also wrote a dummy validation tracker which doesn't persist. But it means
there is no fallback on non-ajax (which was fine for me because my objects
were persisted anyway).

Side note: I've done quite a bit of Ajax and forms in tapestry and found in
general they are nasty together. Almost to the point where I want to dump
tapestry and just code it with javascript and something a lot dumber on the
server side. Then forms and loops and ajax and wowzers!. 

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Ajax-and-Validation-tp2431706p4485141.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: Ajax and Validation

2011-06-13 Thread Kartweel
It still gave me issues when submitting a form with an error then submitting
it valid, then it would bring up the old values and clobber the real values
(after saving I default back to different data in the form).

So I ammended it to


@PageDetached
void clearValidationTracker() {
if (request.isXHR()) {
if (workItemsForm.getDefaultTracker() != null)
workItemsForm.getDefaultTracker().clear();
workItemsForm.setDefaultTracker(null);
}
}


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Ajax-and-Validation-tp2431706p4485240.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: T5 Page Doctype Causing Application to Hang

2011-03-12 Thread Kartweel

Howard Lewis Ship wrote:
 
 Looks like you did the correct thing. I'd check with the debugger that
 your contribute method is being invoked, then many put a break point
 inside SaxTemplateParserImpl  as well.
 

Thanks for the quick reply. I feel honoured talking to the main man! :),

I've checked with the debugger and it all appears to be working as it
should.

The issue seems to be that it is getting stuck when trying to resolve dtd:
-//W3C//ELEMENTS XHTML Inline Style 1.0//EN from URL
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod

So my guess of what is happening is the dtd references other dtds and it is
trying to resolve them also. So I guess I need to download everything and
see how that goes :). +1 vote for adding them all into core jar :)

Thanks!

Ryan





--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-Page-Doctype-Causing-Application-to-Hang-tp3445827p3555221.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: T5 Page Doctype Causing Application to Hang

2011-03-12 Thread Kartweel
I got it working.

For reference this is the list of DTDs that need to be stored locally and
contributed to the template parser.

-//WAPFORUM//DTD XHTML Mobile 1.0//EN
http://www.wapforum.org/DTD/xhtml-mobile10.dtd

-//W3C//ELEMENTS XHTML Inline Style 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlstyle-1.mod

-//WAPFORUM//ENTITIES XHTML Mobile 1.0 Document Model 1.0//EN
http://www.wapforum.org/DTD/xhtml-mobile10-model-1.mod

-//W3C//ENTITIES XHTML Modular Framework 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-framework-1.mod

-//W3C//ELEMENTS XHTML Text 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-text-1.mod

-//W3C//ELEMENTS XHTML Hypertext 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-hypertext-1.mod

-//W3C//ELEMENTS XHTML Lists 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-list-1.mod

-//W3C//ELEMENTS XHTML Images 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-image-1.mod

-//W3C//ELEMENTS XHTML Basic Tables 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-table-1.mod

-//W3C//ELEMENTS XHTML Basic Forms 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-basic-form-1.mod

-//W3C//ELEMENTS XHTML Link Element 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-link-1.mod

-//W3C//ELEMENTS XHTML Metainformation 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-meta-1.mod

-//W3C//ELEMENTS XHTML Base Element 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-base-1.mod

-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-style-1.mod

-//W3C//ELEMENTS XHTML Param Element 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-param-1.mod

-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-object-1.mod

-//W3C//ELEMENTS XHTML Document Structure 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-struct-1.mod

-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-blkpres-1.mod

-//W3C//ELEMENTS XHTML Inline Presentation 1.0//EN
http://www.w3.org/TR/xhtml-modularization/DTD/xhtml-inlpres-1.mod

-//W3C//ELEMENTS XHTML Base Architecture 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-arch-1.mod

-//W3C//NOTATIONS XHTML Notations 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-notations-1.mod

-//W3C//ENTITIES XHTML Datatypes 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-datatypes-1.mod

-//W3C//ENTITIES XHTML Qualified Names 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-qname-1.mod

-//W3C//ENTITIES XHTML Intrinsic Events 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-events-1.mod

-//W3C//ENTITIES XHTML Common Attributes 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-attribs-1.mod

-//W3C//ENTITIES XHTML Character Entities 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-charent-1.mod

-//W3C//ELEMENTS XHTML Inline Structural 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-inlstruct-1.mod

-//W3C//ELEMENTS XHTML Inline Phrasal 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-inlphras-1.mod

-//W3C//ELEMENTS XHTML Block Structural 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-blkstruct-1.mod

-//W3C//ELEMENTS XHTML Block Phrasal 1.0//EN
http://www.w3.org/MarkUp/DTD/xhtml-blkphras-1.mod

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-Page-Doctype-Causing-Application-to-Hang-tp3445827p3555240.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



T5 Page Doctype Causing Application to Hang

2011-03-11 Thread Kartweel
Hi,

I have a mobile web application using the doctype lt;!DOCTYPE html PUBLIC
quot;-//WAPFORUM//DTD XHTML Mobile 1.0//ENquot;
quot;http://www.wapforum.org/DTD/xhtml-mobile10.dtdquot;gt;. On the first
page request the application hangs for several hours before it will send a
response. It used to only take several seconds (about 20 seconds), but I am
assuming something has happened in the cosmos causing the dtd not to
download correctly. If I remove this doctype and use a standard one then the
application works correctly (but doesn't render correctly in a mobile
browser).

So I have tried contributing to the template parser so it uses a local copy
of the DTD, but it doesn't seem to make any difference (I am assuming I am
not contributing it correctly). I am having a hard time finding any
documentation on this.

My code is:

  public static void
contributeTemplateParser(MappedConfigurationlt;String, URLgt; config)
  {
  config.add(-//WAPFORUM//DTD XHTML Mobile 1.0//EN,
AppModule.class.getResource(xhtml-mobile10.dtd));
  }

I have put the dtd in the same folder as the AppModule class.

Any help would be appreciated.

Thanks, Ryan

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-Page-Doctype-Causing-Application-to-Hang-tp3445827p3445827.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: T5.1 Ajax requests and responses out of order

2010-08-15 Thread Kartweel

  Thanks, That is a great idea. Much simpler than implementing the token 
idea but would achieve a good result in my case.

On 13/08/2010 5:38 PM, Andreas Andreou-4 [via Tapestry] wrote:
 dojo used to have queueBind - that would trigger an ajax request only 
 after
 the previous one had returned... the implementation is just a few 
 lines, see
 http://bugs.dojotoolkit.org/browser/trunk/src/io/common.js?rev=7811
 around line 340



-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-1-Ajax-requests-and-responses-out-of-order-tp2524956p2636275.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


T5.1 Ajax requests and responses out of order

2010-08-12 Thread Kartweel

Hi,

Before I re-invent the wheel, I was wondering if anyone has dealt with ajax
requests and responses being out of order?.

Issue 1
I have a field which submits with each character typed (with the goal of
filtering down a list). What is happening is that the anti-virus is scanning
the submitted data and the second request is arriving at the server before
the first request. This could happen even without the anti-virus because
messages are not guaranteed to be in order.

Issue 2
Depending on the processing time of each request (and also variables with
the network, etc). Responses could also arrive out of order (which I have
also had happen). The result usually meaning that the later response is
overwritten by the first one, so the results I see are not correct for the
input that is currently on the screen.

In both cases it means my clients view of the data and the server view of
the data are out of sync, which is not acceptible.

For my case it would be acceptable to simply drop out of order requests. But
I was wondering if anyone else has got some tapestry extension or if there
is a better way to deal with this?. My approach was to just send an
incrementing number with each request and response (unique to each event)
and then drop them at the other end if the number received is not the
maximum.

Wouldn't it be good if there was a way it could automatically be taken care
of, or even re-order messages into order!. Just like a TCP stream :).

Thanks, Ryan

-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-1-Ajax-requests-and-responses-out-of-order-tp2524956p2524956.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: T5.1 Ajax requests and responses out of order

2010-08-12 Thread Kartweel


Josh Canfield wrote:
 
 If Autocomplete isn't want you want then you could implement a
 timeout so you only send the data when the user pauses. You can look
 inside the scriptaculous code for an example.
 

Thanks. I actually have implemented a timeout so it only submits when the
user pauses. I've set it to 300ms, so it can cope with a bit of network
latency issues, but it isn't a 100% reliable solution. The other spot I use
the same approach in is for some calculated fields, they calculate and
update as the user types (or when they pause after typing). But still if the
first response takes 3 seconds and the second only takes 200ms (which is
what my anti-virus is causing to happen!, when I disable it everything works
better) then I need something more reliable than a timeout, and it doesn't
make sense to make the timeout 4 seconds.

Do you know of any libraries or avenues to start working on a token to track
that requests / responses are in order?. It is a generic problem so I am
hoping there is something out there already. Very similar issue really to
when a user hits the back button in a non-ajax environment. Or even if
someone hits a submit button twice. Frameworks should have thing built in
that are configurable to handle this sort of thing.

THanks, Ryan
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/T5-1-Ajax-requests-and-responses-out-of-order-tp2524956p2531877.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: [T5] AJAX and partial updates of forms ? [Zone AjaxFormLoop FormInjector FormFragment and the like]

2009-08-21 Thread kartweel

Did you have any success going down this path? I'm trying to do the same
thing. Tapestry is great until it doesn't do something you need to do then
all the benefits of it go out the window as you spend 2 weeks figuring out
how to do something that is quite simple without it.


Francois Armand wrote:
 
 Francois Armand wrote:
 Hello guys,
 [..]
 [1] Ex of what I want :
 t:form
 
 t:actionlink zone=myzoneUpdate info/t:actionlink  // in real 
 life, I whould like to use a mixin for that, trigger on some action on 
 a field
 ...
 t:zone t:id=myzone
 [here goes a lot of stuff with fields and components and the like]
 /t:zone

 /t:form

 
 Nobody to that ?
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--AJAX-and-partial-updates-of-formsZone-AjaxFormLoop-FormInjector-FormFragment-and-the-like--tp19664541p25076129.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: [T5] Security of files in the classpath

2009-08-14 Thread kartweel

http://jumpstart.doublenegative.com.au:8080/jumpstart/assets/ctx/9f6f05886c53821a/WEB-INF/classes/jumpstart/web/services/AppModule.class

you can access the entire web app, it even gives you directory listings



Geoff Callender-2 wrote:
 
 Isn't this simply due to a Maven convention which has passed its use  
 by date? Why not put .java, .tml, and .properties together in the  
 source tree, and compile them all into WEB-INF/classes/ where they're  
 automatically hidden from the users? Surely this makes so much sense.  
 It's what I do with Ant and it seems to work a treat. Or have I missed  
 something?
 
 Eg. correct me if I'm wrong but I'm pretty sure that only the css and  
 images are downloadable from here:
 http://jumpstart.doublenegative.com.au:8080/jumpstart/
 
 Geoff
 
 On 14/08/2009, at 7:07 PM, Juan E. Maya wrote:
 
 The ResourceDigestGenerator by default secures files with extension:
 .tml and .class. To add more restrictions you'd have to contribute
 ResourceDigestGenerator. Something like this:

  public static void
 contributeResourceDigestGenerator(ConfigurationString configuration)
 {
  configuration.add(properties);
  configuration.add(xml);
  }

 However i agree that this should be documented or even created by the
 maven archetype. It's something a new user could easily forget with
 devastating consequences.

 On Fri, Aug 14, 2009 at 4:29 AM, kartweelr...@exemail.com.au wrote:

 Hi Guys, Sorry to pull up an old thread, but there doesn't seem to  
 be a lot
 about this topic. Was there ever a nice solution implemented for  
 this? 2
 years of tapestry framework development later and I can still  
 download all
 my class files. I've restricted assets to authenticated users  
 using a
 method like below, but I thought by now we wouldn't need to be  
 adding custom
 solutions to manage this and it would be part of the core project??


 Robert Zeigler wrote:

 I don't plan on changing the default configuration from whitelist to
 blacklist... it's the fallback.
 I'm a fan of deny unless explicitly authorized, as well.  The
 AssetProtectionDispatcher
 takes an ordered configuration of AssetPathAuthorizer's, with the
 default whitelist implementation
 being the catch all final authorizer in what amounts to a chain of
 command. So you can certainly
 contribute your own implementations of authorizer on top of the
 default.  Having a pattern matching
 whitelist would certainly be useful; I'm in a time crunch at the
 moment (and basically will be until the end of August),
 but in the beginning of September, I will rework the default
 WhitelistAuthorizer to accept url patterns.

 Robert

 On Aug 3, 2007, at 8/38:27 AM , Thiago H de Paula Figueiredo wrote:

 On Fri, 03 Aug 2007 10:03:37 -0300, Francois Armand
 farm...@linagora.com wrote:

 Thiago H de Paula Figueiredo wrote:
 Would a black list intead of a white list better? I suppose there
 are less files to hide than files to allow access.
 Well, I think that one of the best principle in security is
 explicit authorization : you just do not want that a
 confidential file is accessible by error, because a user forgot to
 hide it.

 That's a very good point. ;)

 But I agree that the white list should authorize jokers to enable
 *.jpg kind of filter (and if you name your confidential file
 picture_of_my_secret_weapon.jpg, well,  to bad for you ;)

 Maybe we could allow any .jpg, .gif, .jpg and .css file by default
 and explicitly whitelist the rest.
 And no, I don't want to see the picture of your secret weapon,
 whatever it is. :P

 Thiago

 -
 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




 --
 View this message in context:
 http://www.nabble.com/-T5--Security-of-files-in-the-classpath-tp11816097p24965558.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

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

-- 
View this message in context: 
http://www.nabble.com/-T5--Security-of-files-in-the-classpath-tp11816097p24980563.html
Sent from the Tapestry - User mailing list archive at Nabble.com.



Re: [T5] Security of files in the classpath

2009-08-14 Thread kartweel

I thought the digest generator is meant to make a different digest for each
file, but it seems to be for the whole app?, or is that  bit
something to do with app versioning for caching and what not and not the
digest?. This whole thread has some ideas for a white list approach to files
on the classpath, but I thought by now tapestry would have something out of
the box rather than a custom solution for it...  I'm having a look into the
resourceDigestGenerator, but at the moment it isn't the highest thing on my
list.


Geoff Callender-2 wrote:
 
 Ouch, now I get it. WEB-INF and all its contents are in fact visible,  
 directly below yourapp/assets/ctx//, and it's not hard  
 to find out the value of .
 
 Suggestions anyone?
 

-- 
View this message in context: 
http://www.nabble.com/-T5--Security-of-files-in-the-classpath-tp11816097p24981387.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: [T5] Security of files in the classpath

2009-08-13 Thread kartweel

Hi Guys, Sorry to pull up an old thread, but there doesn't seem to be a lot
about this topic. Was there ever a nice solution implemented for this? 2
years of tapestry framework development later and I can still download all
my class files. I've restricted assets to authenticated users using a
method like below, but I thought by now we wouldn't need to be adding custom
solutions to manage this and it would be part of the core project??


Robert Zeigler wrote:
 
 I don't plan on changing the default configuration from whitelist to  
 blacklist... it's the fallback.
 I'm a fan of deny unless explicitly authorized, as well.  The  
 AssetProtectionDispatcher
 takes an ordered configuration of AssetPathAuthorizer's, with the  
 default whitelist implementation
 being the catch all final authorizer in what amounts to a chain of  
 command. So you can certainly
 contribute your own implementations of authorizer on top of the  
 default.  Having a pattern matching
 whitelist would certainly be useful; I'm in a time crunch at the  
 moment (and basically will be until the end of August),
 but in the beginning of September, I will rework the default  
 WhitelistAuthorizer to accept url patterns.
 
 Robert
 
 On Aug 3, 2007, at 8/38:27 AM , Thiago H de Paula Figueiredo wrote:
 
 On Fri, 03 Aug 2007 10:03:37 -0300, Francois Armand  
 farm...@linagora.com wrote:

 Thiago H de Paula Figueiredo wrote:
 Would a black list intead of a white list better? I suppose there  
 are less files to hide than files to allow access.
 Well, I think that one of the best principle in security is  
 explicit authorization : you just do not want that a  
 confidential file is accessible by error, because a user forgot to  
 hide it.

 That's a very good point. ;)

 But I agree that the white list should authorize jokers to enable  
 *.jpg kind of filter (and if you name your confidential file  
 picture_of_my_secret_weapon.jpg, well,  to bad for you ;)

 Maybe we could allow any .jpg, .gif, .jpg and .css file by default  
 and explicitly whitelist the rest.
 And no, I don't want to see the picture of your secret weapon,  
 whatever it is. :P

 Thiago

 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-T5--Security-of-files-in-the-classpath-tp11816097p24965558.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



Dynamically selecting a component to render output

2009-08-11 Thread kartweel

Ok... This has probably been dealt with, but I can't find an answer or must
be searching the wrong thing...

I need a component to be dynamically selected at runtime rather than being
static in the template and using an t:if (or delegate and blocks, etc) to
show it. Any pointers to be able to do this?

The functionality i am trying to get:

I have a page which lists a whole bunch of rows of data. When the user
clicks a row I want a section to open underneath which displays an editor
for that row. Now the editor displayed will be dependent on the type of data
in that row (each editor will have a different class and template, I can
make all the editors inherit from a base class if needed). My ideal lookup
mechanism for what editor would be to load it using the class name which
matches data in the row so I can simply add new editors by just adding a new
class.

Now I've thought about doing this with the block and delegate method, but
then I need to edit a master template every time I add a class. Other
thoughts were using an iframe and loading it as a page rather than embedding
a component, but I like the component idea better coz it gives me more
flexibility.

Ok Thanks everyone!
-- 
View this message in context: 
http://www.nabble.com/Dynamically-selecting-a-component-to-render-output-tp24912684p24912684.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



T5.1 User authentication, session expiring even though sso is accessed every request

2009-07-14 Thread kartweel

Hi,

I'm scratching my head a bit with my user object expiring in the session.
I'm using the dispatcher method for setting up access control as in the wiki
( http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher2 ). Now
everything is working great except that after around the 20 minute mark (of
actively using the app) I'm presented with the login screen again. So what I
think is happening is the session is expiring based off when the object was
first created, and it isn't being updated.

I tried adding an applicationStateManager.set(...), thinking that might
refresh the object, but that didn't work.

As a side thing, shouldn't the session expiry timer start again every time
the client accesses the session?, or do I need to actually call a method
somewhere to update the session timer? Or does tapestry manage itself on-top
of the session and I need to refresh every object I put in there?

I am suprised because I have a few page @persist object in the session too,
so I don't see how the session would expire...

I'm currently using tapestry 5.1.4 on Jetty 6.1.15

Anyways, thanks for the help.

Ryan

-- 
View this message in context: 
http://www.nabble.com/T5.1-User-authentication%2C-session-expiring-even-though-sso-is-accessed-every-request-tp24475080p24475080.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: T5.1 User authentication, session expiring even though sso is accessed every request

2009-07-14 Thread kartweel

New thoughts.

Could it be the session cookie not being renewed on the browser?. That would
also make sense as I set the session timeout to 900 minutes in the web.xml
and it didn't make any difference... So yes as you say appears to be a
servlet container / browser problem.

Thanks!


Thiago H. de Paula Figueiredo wrote:
 
 
 It's not Tapestry the one which handles the session termination, it's the  
 servlet container (Tomcat, Jetty, etc), so most probably this is not a  
 Tapestry issue.
 
 As a side thing, shouldn't the session expiry timer start again every  
 time the client accesses the session?,
 
 This is a servlet container issue.
 
 

-- 
View this message in context: 
http://www.nabble.com/T5.1-User-authentication%2C-session-expiring-even-though-sso-is-accessed-every-request-tp24475080p24490295.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: Staying in secure or non-secure mode rather than autoswitching based on @secure

2009-05-23 Thread kartweel

Cheers,

I changed this to return null instead too.

  public String getBaseURL(String pageName) {
return baseURLSource.getBaseURL(request.isSecure());
  }

Ryan



Inge Solvoll-2 wrote:
 
 This should do the trick :)
 
 You can probably do the same thing more intuitively by advising the
 RequestSecurityManager. I just didn't bother to change my working
 implementation.
 
 public static void contributeAlias(ConfigurationAliasContribution
 configuration, @InjectService(Request) Request request,
 @InjectService(BaseURLSource) BaseURLSource baseURLSource) {
 RequestSecurityManager manager = new MyRequestSecurityManager(request,
 baseURLSource);

 configuration.add(AliasContribution.create(RequestSecurityManager.class,
 manager));
   }
 
 public class MyRequestSecurityManager implements RequestSecurityManager {
 
   private final Request request;
   private final BaseURLSource baseURLSource;
 
   public MyRequestSecurityManager(Request request, BaseURLSource
 baseURLSource) {
 this.request = request;
 this.baseURLSource = baseURLSource;
   }
 
   public boolean checkForInsecureRequest(String pageName) throws
 IOException
 {
 return false;
   }
 
   public String getBaseURL(String pageName) {
 return baseURLSource.getBaseURL(request.isSecure());
   }
 }
 
 

-- 
View this message in context: 
http://www.nabble.com/Staying-in-secure-or-non-secure-mode-rather-than-autoswitching-based-on-%40secure-tp23681100p23682272.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: Component equivalent of Page onActivate()

2009-04-04 Thread kartweel


Geoffrey Wiseman wrote:
 
 @SetupRender?
 

But it doesn't work for action(event) requests. So great until you press the
button in the form or click an action link.
-- 
View this message in context: 
http://www.nabble.com/Component-equivalent-of-Page-onActivate%28%29-tp22865238p22884820.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: Component equivalent of Page onActivate()

2009-04-04 Thread kartweel


Robert Zeigler wrote:
 
 even easier than using the flag, why not use the @Cached annotation?
 
 @Cached //will now be evaulated once and only once per request, but  
 you can play witih that using the watch parameter.
 
 

Cheers!. Didn't think of that one. Makes it a little tidier :).
-- 
View this message in context: 
http://www.nabble.com/Component-equivalent-of-Page-onActivate%28%29-tp22865238p22888743.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: Component equivalent of Page onActivate()

2009-04-04 Thread kartweel



Geoffrey Wiseman wrote:
 
 On Sat, Apr 4, 2009 at 11:54 AM, kartweel r...@exemail.com.au wrote:
 
 But it doesn't work for action(event) requests. So great until you press
 the
 button in the form or click an action link.

 
 Ah, yes, you said that before.  Sorry.  I've got no help for you, then.
 
   - Geoffrey
 
 

Thanks anyway!. At least I know it isn't just me missing something obvious
:).
-- 
View this message in context: 
http://www.nabble.com/Component-equivalent-of-Page-onActivate%28%29-tp22865238p22888757.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



Component equivalent of Page onActivate()

2009-04-03 Thread kartweel

Hi Everyone,

This may be simple, but I can't seem to figure it out.

A page will initialize on an action request with the onActivate() method.
But I can't figure out how to get a component to initialize on an action
request. I know we can use @SetupRender, etc, but this is no good for an
Ajax response from an embedded component because @SetupRender is never
called...

To illustrate initially I had

Page - Subcomponent

Where the subcomponent is used to return an ajax response. All
initialization is done in the page and then parameters bound to the
component. I have not used any @Persist

I then split it up to

Page - Component - SubComponent

Where initialization needs to be done in the component (The page is very
simple). Because onActivate() doesn't work in the component, I simply used
onActivate() to populate some properties, then bound those to the component.
Just a simple way of passing the activation context to the component. Hope
this makes sense.

So the component needs to fetch some data from the database to initialise,
which it does when @SetupRender is called.

The issue now comes on the action request to the subcomponent, because
@SetupRender has not been called. The onActivate() has been called in the
page and the parameters passed to the component. But the component needs to
initialise and populate some extra fields (which are then passed to the
subcomponent to render the ajax response). Even without the ajax it wouldn't
matter, because if my event handler is accessing database data, it won't be
initialised yet...

I'm sure there has got to be a simple way around this other than injecting
the component into either the page or the subcomponent and then calling an
initialize method on onActivate() (from the page) or onAction() from the
subcomponent. Is there like an initialize annotation I can use? Using the
event bubbling is no good because the subcomponent event handler is fired
first before the component event handler.

-- 
View this message in context: 
http://www.nabble.com/Component-equivalent-of-Page-onActivate%28%29-tp22865238p22865238.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: Component equivalent of Page onActivate()

2009-04-03 Thread kartweel

I decided the easiest way is to use a lazy initialisation approach. So in all
the getters I run an initialise() method (which has a flag to only run
once). That way it is not up to the other components or the page to
initialise that component, it can do it itself. A bit untidy but haven't got
any other ideas??

Anyone else got any other suggestions? An @Initialise or @onActivate
annotation or something would be great so we can make sure things are
initialised on render and action requests.



kartweel wrote:
 
 Hi Everyone,
 
 This may be simple, but I can't seem to figure it out.
 
 A page will initialize on an action request with the onActivate() method.
 But I can't figure out how to get a component to initialize on an action
 request. I know we can use @SetupRender, etc, but this is no good for an
 Ajax response from an embedded component because @SetupRender is never
 called...
 
 To illustrate initially I had
 
 Page - Subcomponent
 
 Where the subcomponent is used to return an ajax response. All
 initialization is done in the page and then parameters bound to the
 component. I have not used any @Persist
 
 I then split it up to
 
 Page - Component - SubComponent
 
 Where initialization needs to be done in the component (The page is very
 simple). Because onActivate() doesn't work in the component, I simply used
 onActivate() to populate some properties, then bound those to the
 component. Just a simple way of passing the activation context to the
 component. Hope this makes sense.
 
 So the component needs to fetch some data from the database to initialise,
 which it does when @SetupRender is called.
 
 The issue now comes on the action request to the subcomponent, because
 @SetupRender has not been called. The onActivate() has been called in the
 page and the parameters passed to the component. But the component needs
 to initialise and populate some extra fields (which are then passed to the
 subcomponent to render the ajax response). Even without the ajax it
 wouldn't matter, because if my event handler is accessing database data,
 it won't be initialised yet...
 
 I'm sure there has got to be a simple way around this other than injecting
 the component into either the page or the subcomponent and then calling an
 initialize method on onActivate() (from the page) or onAction() from the
 subcomponent. Is there like an initialize annotation I can use? Using the
 event bubbling is no good because the subcomponent event handler is fired
 first before the component event handler.
 
 

-- 
View this message in context: 
http://www.nabble.com/Component-equivalent-of-Page-onActivate%28%29-tp22865238p22878887.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