Re: How to know when an Alert is dismissed

2012-06-28 Thread Lance Java
If you use a persistant duration (eg Duration.UNTIL_DISMISSED) then tapestry will send ajax requests back to the server when alerts are dismissed. Tapestry will call AlertStorage.dismiss(long id) on the serverside. You will need to plugin your own AlertStorage implementation to perform your own lo

Re: Tapestry app live console

2012-06-28 Thread Lance Java
This sounds a bit like JMX, would publishing your services to JMX and editing via the JMX console solve your problems? If you'd still like to have the full power of a scripting language (eg bsh) at your fingertips, you could @Inject the ObjectLocator and make it available in the bsh context. From

Re: Tapestry app live console

2012-06-28 Thread Lance Java
Tapestry IOC configuration happens once, when the app is started. It determines the symbols, constructs services and wires them all together. After that, Tapestry IOC's job is done and all of the services are acting upon the config they were provided during construction after that. If you want to

Re: Redirect After Post goes to wrong https port

2012-06-29 Thread Lance Java
You can set the following symbols in your AppModule: SymbolConstants.HOSTNAME SymbolConstants.HOSTPORT SymbolConstants.HOSTPORT_SECURE -- View this message in context: http://tapestry.1045711.n5.nabble.com/Redirect-After-Post-goes-to-wrong-https-port-tp5714185p5714189.html Sent from the Tapestry

Re: Open a window

2012-07-02 Thread Lance Java
Opening a new window is so web 1.0 ;) It's much nicer to open a "lightbox" in the current window or use a jquery dialog Here are a couple of lightbox implementations that I've used over the years (although not with tapestry) http://www.jacklmoore.com/colorbox https://github.com/defunkt/facebox He

Re: How to have every second value in the t:loop different

2012-07-05 Thread Lance Java
This wiki page explains creating a custom binding prefix to achieve zebra stripes http://wiki.apache.org/tapestry/Tapestry5HowToAddBindingPrefixCycle eg: ... -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-have-every-second-value-in-the-t-loop-different-tp5714

Re: embedding google maps javascript into a tapestry page

2012-07-05 Thread Lance Java
Exanpe has a gmap component which you can probably use http://exanpe-t5-lib.appspot.com/components/googlemap/example5 If not, I'm sure peeking at the code will help https://github.com/exanpe/exanpe-t5-lib/blob/master/src/main/java/fr/exanpe/t5/lib/components/GMap.java -- View this message in cont

Re: embedding google maps javascript into a tapestry page

2012-07-05 Thread Lance Java
You can't use ${scopeRadius} in a js file. Javascript files are static and can be cached in the browser. What you can do is construct a JSONObject on the serverside (based on dynamic values) and initialize the client. This can be done two ways: 1. Create a javascript object under the "Tapestry.Ini

Re: How to have every second value in the t:loop different

2012-07-05 Thread Lance Java
I'm not sure that this implementation of CycleBinding is fit for core as it uses a thread local so nested bindings won't work (I don't think) I don't think that the following would work. ... ... I'm thinking that ComponentResources.storeRenderVariable() and compone

Re: Form getting resubmitted after an hour

2012-07-06 Thread Lance Java
This sounds like a push mechanism might be better than refreshing at an interval. I've recently released a beta for a push component based on CometD here https://github.com/uklance/tapestry-cometd I don't currently have a mechanism for stopping the subscription but it could be added quite easily.

Re: How to resolve the rendered component in a mixin

2012-07-09 Thread Lance Java
I'm not 100% sure exactly what you are trying to achieve but I think that you should use an environmental object to communicate between the mixin and the component. The mixin could push() an object onto the environment in beforeRender(). The component then peek()s for the object and sets some valu

Re: T5.2: How to block UI and disable double click upon form submission?

2012-07-09 Thread Lance Java
Geoff has a ClickOnce mixin example in jumpstart http://jumpstart.doublenegative.com.au/jumpstart/examples/javascript/creatingmixins1 -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-How-to-block-UI-and-disable-double-click-upon-form-submission-tp5714365p5714370.html Se

Async process ComponentRequestHandler and JavaScriptSupport

2012-07-10 Thread Lance Java
I'm doing some very non standard stuff in tapestry-cometd where I need to invoke tapestry's templating in an async thread. I do this by creating a spoof request and response and setting RequestGlobals before invoking ComponentRequestHandler.handleComponentEvent(ComponentEventRequestParameters). Thi

Re: Async process ComponentRequestHandler and JavaScriptSupport

2012-07-10 Thread Lance Java
Thanks for that Steve but it didn't work... it seems that a JavaScriptSupport object has never been pushed onto the environment. I get the following exception: Caused by: java.lang.IllegalStateException: Stack is empty. at org.apache.tapestry5.ioc.util.Stack.checkIfEmpty(Stack.java:119)

Re: Inheritance and the order of loaded JS

2012-07-12 Thread Lance Java
This sounds familiar... I think that the solution was to use different render phases to control the ordering of imports. Instead of putting @Import statements at the class level, put them on render phase methods (eg setupRender and beginRender) to control the ordering. -- View this message in cont

Re: Async process ComponentRequestHandler and JavaScriptSupport

2012-07-12 Thread Lance Java
To answer my own question I needed to use AjaxResponseRenderer instead of JavaScriptSupport and it all just works. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Async-process-ComponentRequestHandler-and-JavaScriptSupport-tp5714401p5714441.html Sent from the Tapestry - Use

Re: Errors in named queries

2012-07-13 Thread Lance Java
This is purely a hibernate question, NOT a tapestry question. Your query is wrong... you are checking for "s.id" when it should be "u.id". -- View this message in context: http://tapestry.1045711.n5.nabble.com/Errors-in-named-queries-tp5714445p5714446.html Sent from the Tapestry - User mailing li

Re: Injection javascript code - AjaxResponseRenderer vs JavaScriptSupport

2012-07-15 Thread Lance Java
AjaxResponseRenderer is only available for Ajax requests. JavaScriptSupport is available for non Ajax requests. I'm guessing either you didn't specify a zone on your eventlink / form or you have a JavaScript error on your page (meaning tapestry can't decorate your links with Ajax actions) On Sund

Re: Why the activate of another class got executed? T5.3.3

2012-07-17 Thread Lance Java
In your example, you have not show how "Register" fits into the picture. The code you have provided shows no link between "localhost:8080/info/update" and Register. Perhaps jump start's onActivate / onPassivate explanation can help http://jumpstart.doublenegative.com.au/jumpstart/examples/navigati

Re: Why the activate of another class got executed? T5.3.3

2012-07-17 Thread Lance Java
Does update have a pagelink to register (in a layout perhaps?) >From jumpstart: When is onActivate(...) called? The short answer is: whenever Tapestry gets a page. It can be in response to a browser request. It can be when one page's java uses another. -- View this message in context: http://tap

Re: Adding a dynamic sub directory to URL 

2012-07-18 Thread Lance Java
I have written a sample application which takes a URL of the form "http://host:port/context//foo/bar" and transforms it to "http://host:port/context/foo/bar";. It also sets a "Mode" environmental to contain the . This environmental can then be accessed in pages and components. In your case, the mod

Re: Adding a class to a div based on field validation status

2012-07-18 Thread Lance Java
I think I would do it via a mixin on the textfield. Where the ControlGroupDecorator walks up the DOM to the first div with a class="control-group" and adds the error class if necessary (using the t:id of the textField to see which errors to check for). -- View this message in context: http://

Re: Adding a class to a div based on field validation status

2012-07-18 Thread Lance Java
eg: package foo.bar.mixins; @MixinAfter public class ControlGroupDecorator { @InjectContainer private Field field; @Environmental(false) private ValidationTracker tracker; private Element controlGroup; public void afterRender(MarkupWriter writer) { // need

Re: Adding a dynamic sub directory to URL 

2012-07-18 Thread Lance Java
> If anyone wants to grab its sources, check https://github.com/thiagohp/tapestry-url-rewriter. Peeking at the code, it looks like you needed to decorate ComponentEventLinkEncoder too Whatever happens, we need access to the core behaviour so that we can perform some string manipulation on it. The

Re: Adding a class to a div based on field validation status

2012-07-18 Thread Lance Java
> Has anyone thought of a ValidationDecorator? Nope... never heard of it... time to jump into the tapestry code / javadocs again ;) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Adding-a-class-to-a-div-based-on-field-validation-status-tp5714526p5714553.html Sent from the

Re: Adding a dynamic sub directory to URL 

2012-07-18 Thread Lance Java
> For the incoming ones (requested URLs), it works by changing the Request Yes, I saw that... I'm not sure I agree with that approach. If a downstram process was trying to calculate URL's relative to the current path (to send to the browser), it would get the calculation wrong. -- View this messag

Re: Adding a dynamic sub directory to URL 

2012-07-19 Thread Lance Java
Consider a site with the following url rewriting /mysite/cars/view - view all cars /mysite/cars/bmw/view - set the Car environmental as "bmw" then invoke /mysite/cars/view /mysite/cars/porsche/view - set the Car environmental as "porsche" then invoke /mysite/cars/view /mysite/facebook/cars/view -

Re: beandisplay hide label if value is null?

2012-07-19 Thread Lance Java
You could use the exclude parameter public String getExcludes() { // return a comma separated list of property names based on some logic or null } -- View this message in context: http://tapestry.1045711.n5.nabble.com/beandisplay-hide-label-if-value-is-null-tp5714585p5714592.html Sent from

Re: partially update with another page or component

2012-07-19 Thread Lance Java
Returning a Page class tells tapestry to redirect to that page. I think that you want to extract the page logic / tml into a component and then use the component in two places. -- View this message in context: http://tapestry.1045711.n5.nabble.com/partially-update-with-another-page-or-component-t

Re: Intercepting exceptions/errors in logic within page objects

2012-07-19 Thread Lance Java
Tapestry's default behaviour is to redirect to the ExceptionReport page. If you want to use your own custom page, you can override the SymbolConstants.EXCEPTION_REPORT_PAGE symbol. Make sure that your custom page implements ExceptionReporter. If you'd like to override this behaviour all together,

Re: Tapestry thumbnail gallery

2012-07-22 Thread Lance Java
This isn't really what the grid was designed to do. The grid component is designed to show a table of data with column headings. CSS purists will often tell you that html tables should not be used for layout purposes and that you should use div's (or ul's) and CSS for displaying visual components i

Re: Test if production or test mode..

2012-07-22 Thread Lance Java
You can use @Inject, @Value and @Symbol in tapestry services. @Property can only be used in pages and components, NOT services. The following should work in a service: @Inject @Symbol("tapestry.production-mode") private boolean productionMode; You could also do this: @Inject @Value("${tapestry.

Re: component initialization on post back

2012-07-23 Thread Lance Java
Tapestry performs a post in two phases (using redirect-after-post semantics). 1. onSuccess() is an event handler method. This is fired by the POST request. http://tapestry.apache.org/component-events.html 2. @SetupRender is a render phase method, this is fired by the second request (the redirect)

Re: how to put pages / components java code and tml files in same directory?

2012-08-06 Thread Lance Java
Although this is possible with maven, you are going against mavens conventions src/main/java is for java files src/main/resources is for resources In my experience it's best not to fight against maven and instead follow it's sensible conventions. On Tuesday, 7 August 2012, Patrick Moore wrote:

Re: Tapestry get Post Data

2012-08-08 Thread Lance Java
You can also use @RequestParameter on parameters in render phase methods. eg void onActivate(@RequestParameter("foo") String foo) { ... } Normal tapestry coercion rules apply for types

Re: macbook retina support

2012-08-13 Thread Lance Java
You could write your own custom binding prefix. Eg src="${retina:/foo/bar.png}" See here for custom binding prefix examples wiki.apache.org/tapestry/Tapestry5HowTos On Monday, 13 August 2012, sommeralex wrote: > Hello! > > The apple doc describe 3 ways for supporting retina images. My question,

macbook retina support

2012-08-15 Thread Lance Java
If I were doing this myself, I would want to know the "isRetina" boolean on the serverside. You could include a common js script on each page that redirects /foo/bar to /retina/foo/bar for retina clients. You could then use URL rewriting to store the boolean in an environmental. Take a look at thi

Re: Dynamicly assign fixed "symbolic" root folders to the URL (Tapestry Tapestry 5.3.3)

2012-08-23 Thread Lance Java
As I've mentioned before with these issues... I don't think the Link Transformer API is adequate. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamicly-assign-fixed-symbolic-root-folders-to-the-URL-Tapestry-Tapestry-5-3-3-tp5715743p5715752.html Sent from the Tapestry

Re: StreamResponse for small cacheable images

2012-08-23 Thread Lance Java
If the images are static and you can build them into the jar or war, I'd avoid using StreamResponse and instead use the "asset:" or "context:" binding prefixes. For jpegs on the classpath ${asset:path/to/image.jpg} For jpegs in the web context ${context:path/to/image.jpg http://tapestry.apache

Re: Named translators

2012-08-23 Thread Lance Java
This might work: TML: JAVA: @InjectComponent private Field myField; @Environmental private FormSupport formSupport; @Inject private Message messages; public FieldTranslator getMyTranslator() { Translator translator = new FileSizeTranslator(...); MessageFormatter formatter = messages.ge

Re: StreamResponse for small cacheable images

2012-08-23 Thread Lance Java
If you want the image name as a parameter Link getImage(String imageName) { return resources.createEventLink("Image", imageName); } private StreamResponse onImage(String imageName) { return new ImageResponse(imageName); } If you

Re: Named translators

2012-08-24 Thread Lance Java
I realise that it's a hack but unfortunately tapestry is using MappedConfiguration so that there can only be one translator mapped per class. Perhaps this is another argument to consider adding a MultiMappedConfiguration http://tapestry.1045711.n5.nabble.com/MultiMapConfiguration-td5714003.html

Re: StreamResponse for small cacheable images

2012-08-24 Thread Lance Java
Use a separate page to generate the images and generate Links to the page. For the page, onActivate(String image) returns the StreamResponse. -- View this message in context: http://tapestry.1045711.n5.nabble.com/StreamResponse-for-small-cacheable-images-tp5715755p5715782.html Sent from the Tap

Re: Named translators

2012-08-24 Thread Lance Java
Sorry, I was wrong... you can do it!! AppModule.java --- public void contributeTranslatorAlternatesSource(MappedConfiguration config) { configuration.add("fileSize", new FileSizeTranslator()); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/Named-transl

Re: Dynamicly assign fixed "symbolic" root folders to the URL (Tapestry Tapestry 5.3.3)

2012-08-24 Thread Lance Java
You don't need to @Inject the Environment into your pages or components. You can use the following instead: @Environmental(false) // false means it can be null private Area area; -- View this message in context: http://tapestry.1045711.n5.nabble.com/Dynamicly-assign-fixed-symbolic-root-folder

Re: T.5.2.6 Grid with paginator and Checkbox

2012-08-28 Thread Lance Java
As far as I can see, you have 3 options: 1. Fire an AJAX event when a checkbox is ticked and store the checkbox values serverside (in the session?) 2. Use some javascript to save the checkbox values clientside (in a cookie?) 3. Include the checkbox values (as request parameters?) on the paging (for

Re: When to use SetupRender and PageAttached methods

2012-08-28 Thread Lance Java
A page is a (specialized) component so it has all of the component rendering events. I've never used @PageAttached in a component but I'm assuming that tapestry is giving you access to the containing Page's lifecycle events. -- View this message in context: http://tapestry.1045711.n5.nabble.com

Re: Flash file upload

2012-08-28 Thread Lance Java
Taha has blogged about integrating valums/file-uploader with tapestry http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/ https://github.com/valums/file-uploader -- View this message in context: http://tapestry.1045711.n5.nabble.com/Flash-file-upload-tp5715839p5715845.html Sent fro

Request Filter not called if declared with addInstance (vs add)

2012-08-29 Thread Lance Java
addInstance will invoke the constructor with the most arguments on the given class. It will pass all arguments from the registry that match by type (and additional annotations if provided). Is your logger of type org.slf4j.Logger? -- View this message in context: http://tapestry.1045711.n5.nab

Re: confused using tapestry page to return json data

2012-08-29 Thread Lance Java
Pages / components don't need a template. If your page always returns a StreamResponse from onActivate() then it should not have a template. I'm not sure why you're seeing this strange behaviour though? I would have assumed that tapestry would ignore the TML. -- View this message in context:

How to return HTTP 404 for in-exact URL requests

2012-08-29 Thread Lance Java
It sounds like you are fixing something that really should be handled by tapestry. I agree that a 404 is much better than a 500 in these cases and I think it should be the default behavior. -- View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-return-HTTP-404-for-in-exac

[t5.3.4] Plugin blocks

2012-08-29 Thread Lance Java
I'm assuming that in Taha's example, each department was a separate component library. Component libraries contribute a LibraryMapping to the ComponentClassResolver specifying the prefix to use. See here for the docs on component libraries http://tapestry.apache.org/component-libraries.html --

[t5.3.4] Plugin blocks

2012-08-29 Thread Lance Java
Please disregard my last post as it was wrong (I should take more time reading the actual problem). In Taha's post he refers to a page named "debitCardModule/instructionblocks". This means that he has a page with class "foo.bar.basepackage.pages.debitCardModule.InstructionBlocks" where "foo.bar.ba

Re: [t5.3.4] Plugin blocks

2012-08-29 Thread Lance Java
Are you familiar with the tapestry.app-package init-param in web.xml? If you place pages/mixins/components under this package you won't need to contribute a LibraryMapping

Re: [t5.3.4] Plugin blocks

2012-08-29 Thread Lance Java
If you are writing a component library then yes, you will need a LibraryMapping. I've never included pages in a component library (only components) but I'm assuming that your page names will have require a prefix (as specified in your library mapping). For instance, if your app package "foo.bar",

Re: Passing form component into service

2012-08-29 Thread Lance Java
No, this is not allowed and is generally considered bad practice. You will need to pass a class (or interface) that is not in the components/pages/mixins/base packages. There are two main options: 1. Copy the data into a domain object and pass the domain object 2. Have your component implement an

Request Filter not called if declared with addInstance (vs add)

2012-08-30 Thread Lance Java
I think that you are seeing the expected behavior of OrderedConfiguration. By specifying a constraint of "after:CheckForUpdates", you are not guaranteed that your filter will occur directly after CheckForUpdates. You are only guaranteed that it will occur at some stage after CheckForUpdates (possib

Re: confused using tapestry page to return json data

2012-08-30 Thread Lance Java
After re-reading your code, I see that you have two onActivate() methods with different parameter counts. Perhaps you are witnessing the behaviour mentioned here http://tapestry.1045711.n5.nabble.com/multiple-onActivate-methods-in-page-handler-td2434569.html Whenever I need to handle a variable nu

Re: Passing form component into service

2012-08-30 Thread Lance Java
The Form component implements FormValidationControl. If this interface provides what you need, there is no need for a domain object. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Passing-form-component-into-service-tp5715894p5715909.html Sent from the Tapestry - User ma

Re: [t5.3.4] Plugin blocks

2012-08-31 Thread Lance Java
Short answer: Can't you just do the following? Probes Health Long Answer: Pagelink expects a String pageName and you are (incorrectly) passing a Link. Tapestry sees the mismatch and coerces Link to String. The resulting URL is then used as a page name which fails. -- View this message in con

Re: [t5.3.4] Plugin blocks

2012-08-31 Thread Lance Java
@Inject private ComponentClassResolver componentClassResolver; public String getProbesHealthPageName() { return componentClassResolver.resolvePageClassNameToPageName(ProbesHealth.class.getName()); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/t5-3-4-Plugin-blocks-

Re: Request Filter not called if declared with addInstance (vs add)

2012-09-01 Thread Lance Java
> With "after:CheckForUpdates,before:URLRewriter" the behavior is the same. You can't comma separate constraints in a single string like this. Use two strings in the varargs method. Try using system.out.println instead (or a debug breakpoint) but I doubt that tapestry is logging at different log

Re: onUnload method from AfterRender

2012-09-04 Thread Lance Java
Don't use window.unload directly as prototype/jquery do special things with this function. Use prototype's Event.observe instead (or jQuery bind if using tapestry-jquery). eg: Event.observe(window, 'unload', function() { // your unload actions }); -- View this message in context: http://t

Re: Can't change BeanEditForm submitLabel with a mixin?

2012-09-04 Thread Lance Java
Can you post the code that attaches the mixin to the beaneditform (either TML or Java) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Can-t-change-BeanEditForm-submitLabel-with-a-mixin-tp5716012p5716037.html Sent from the Tapestry - User mailing list archive at Nabble.co

Re: Can't change BeanEditForm submitLabel with a mixin?

2012-09-04 Thread Lance Java
I'm starting to agree with your original suspicions that it's something to do with the "message:" binding. Under the hood, MessageBindingFactory creates a LiteralBinding which can be seen in the error message. I'm guessing you are in some byte code state where tapestry can read from the binding but

Re: Global setting for date format

2012-09-05 Thread Lance Java
Unfortunately, nabble seems to have removed your example so I can't see it. I'm assuming that your post is related to DateField. You could use a similar technique to taha's example [1] and add a custom mixin to all DateField components using a ComponentClassTransformWorker2. [1] http://tawus.word

Re: Bean editor model for XYZ does not contain a property named ZYX.

2012-09-05 Thread Lance Java
This might help http://tapestry.1045711.n5.nabble.com/form-for-nested-entity-td4264623.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Bean-editor-model-for-XYZ-does-not-contain-a-property-named-ZYX-tp5716057p5716058.html Sent from the Tapestry - User mailing list ar

Re: Global setting for date format

2012-09-05 Thread Lance Java
> Hi Lance, Hi > I was refering to DateField but I wanted the same thing applied everywhere ComponentClassTransformWorker2 will do this > even when I just output a text. I don't understand this I just want to be sure that someone did not forget to put a specific attribute somwhere in the cod

Re: Global setting for date format

2012-09-05 Thread Lance Java
> For example in beandisplay component You will need to contribute a BeanBlockContribution to BeanBlockOverrideSource. This will require you to create a page which contains the block that you would like to use instead (the override). eg: MyPage.java @Environmental @Property private Pro

Re: Global setting for date format

2012-09-05 Thread Lance Java
I agree with you that this is difficult to override. It would be nice if there was an overridable service to provide default formats instead of the current hard-coded DateFormat.SHORT. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Global-setting-for-date-format-tp571605

Re: periodic zone updater

2012-09-06 Thread Lance Java
Hi Alex, What's your use case for needing a periodic refresh? Does a serverside push better suit your needs? If so, you might find tapestry-cometd [1] a better fit. https://github.com/uklance/tapestry-cometd -- View this message in context: http://tapestry.1045711.n5.nabble.com/periodic-zone-

Re: How to split up components in a tapestry page

2012-09-06 Thread Lance Java
It sounds like you are either confusing terminology or actual functionality. Let's clear one thing up. 1. You can have many components on a page 2. You can only have one Layout component per page (a Layout is a special component) 3. Layout components can contain normal components Most application

Re: How to split up components in a tapestry page

2012-09-06 Thread Lance Java
Yes, that's exactly what tapestry is great at!! 1. Create components for Header, TopItems, Categories and Footer 2. You could then use the components directly in a page 3. Or, you could create a Layout which contains the 4 components and then re-use this Layout across all of your pages. -- View

Re: How to split up components in a tapestry page

2012-09-06 Thread Lance Java
A component is a java class and and an optional tml file that MUST be in the foo.bar.components package (where foo.bar is your base package). Documentation here: http://tapestry.apache.org/component-classes.html Examples here: http://jumpstart.doublenegative.com.au/jumpstart/examples/component/cre

Re: activation context method

2012-09-06 Thread Lance Java
1. It's a very bad idea to have 2 onActivate methods with the same parameter count. If I hit the URL "/yourpage/true/somePage", how does tapestry know which one to call? 2. I have NEVER needed multiple onActivate methods. If I need to handle multiple cases, I have a single onActivate(EventContext)

Re: hide primary key on call to edit form

2012-09-06 Thread Lance Java
Firstly, I would avoid session usage unless it is definitely required. Passing the primary key in the URL is a good way of avoiding session usage. Secondly, tapestry is most likely adding the primary key to the URL because: a) The EditEvent page has an onPassivate() method. b) The EditEvent page

Re: Making a grid's checkbox column preserve its checked state across pages

2016-02-19 Thread Lance Java
If you want the values serverside, you'll need to POST the form when changing pages. You might find this difficult to achieve as paging is currently done as a GET request. The simplest solution would be to add a change event listener clientside and store the values on the client until the form is

RE: Making a grid's checkbox column preserve its checked state across pages

2016-02-20 Thread Lance Java
dering modifying the Grid (or the GridPager or other > component) so that the component is aware of having checkbox columns and > saves the checkboxes states on paging, and restores them when going back to > the same grid page. Any suggestion or observation about this would be > we

Re: Tapestry ignoring expansions in HTML comments

2016-03-16 Thread Lance Java
http://tapestryjava.blogspot.co.uk/2013/12/tapestry-quicky-conditionalcomment.html On 16 Mar 2016 5:42 a.m., "David Diaz" wrote: > Hi guys, > > I've been working at my Tapestry application for a while and I'm just > cleaning it up and I'm currently ensuring compatibility with Internet > Explorer

Re: Getting ID of an updated zone

2016-09-17 Thread Lance Java
If you want streaming updates to a page you might be interested in tapestry-atmosphere or tapestry-cometd rather than 12 periodic updates on a page. https://github.com/uklance/tapestry-atmosphere http://t5atmosphere-lazan.rhcloud.com/ https://github.com/uklance/tapestry-cometd http://t5cometd-laz

Re: Multiple Context Parameters

2016-09-18 Thread Lance Java
Assuming foo is a property you could also do t:context="[foo,'true']" or t:context="[foo,true]" https://tapestry.apache.org/property-expressions.html On 18 Sep 2016 11:13 a.m., "Bob Harner" wrote: > Yes, that's the correct way to do it. I think you could also do > t:context="foo,bar" if both f

Re: Multiple Page activation context

2016-09-20 Thread Lance Java
@PageActivationContext supports multiple values thanks to the new index property added in 5.3. Missing values will simply be null Eg: @PageActivationContext(index=0) private String value0; @PageActivationContext(index=1) private String value1; @PageActivationContext(index=2) private String value2;

Re: Multiple Page activation context

2016-09-20 Thread Lance Java
Correction: This feature was added in 5.4 (not 5.3) On 20 Sep 2016 5:29 p.m., "Lance Java" wrote: > @PageActivationContext supports multiple values thanks to the new index > property added in 5.3. Missing values will simply be null > > Eg: > @PageActivationContext(index

Re: Multiple Page activation context

2016-09-20 Thread Lance Java
ntext(index=3) private Long id2; > > How do I create links? Can I do this: > > yo > bam > > ? Or do I have to explicitly pass null to keep indexes straight? > > yo > bam > > Adam > > On Tue, Sep 20, 2016 at 6:34 PM, Lance Java > wrote: > >

Re: Multiple Page activation context

2016-09-20 Thread Lance Java
Sorry... I spoke to soon. You want index=1 to be a string sometimes and a long others? If you want to use @PageActivationContext you'll need to declare as a string and parse to long yourself On 20 Sep 2016 5:51 p.m., "Lance Java" wrote: > You don't need explicit nu

Re: Multiple Page activation context

2016-09-20 Thread Lance Java
FYI one bonus of using @PageActivationContext is that you automatically have onPassivate() generated for you. If you declare onActivate() you'll need to do this yourself On 20 Sep 2016 5:56 p.m., "Thiago H de Paula Figueiredo" wrote: > On Tue, 20 Sep 2016 13:24:08 -0300, Nathan Quirynen < > nat.

Re: Problem with POST requests

2016-09-27 Thread Lance Java
onActivate() will be invoked for GET and POST and even during link generation (I think). You shouldn't do any "work" in this method. Better yet, remove the method all together and use @PageActivationContext. If you have "work" needed for render only you should use @SetupRender On 27 Sep 2016 2:12

Re: WebSocket enpoint as a tapestry service

2016-10-26 Thread Lance Java
There's a chat demo in both tapestry-atmosphere and tapestry-cometd Atmosphere Demo: http://t5atmosphere-lazan.rhcloud.com/ Source: https://github.com/uklance/tapestry-atmosphere/tree/master/tapestry-atmosphere-demo Cometd Demo: http://t5cometd-lazan.rhcloud.com/chat Source: https://github.com/uk

Re: WebSocket enpoint as a tapestry service

2016-10-27 Thread Lance Java
using sessionless authentication (w/ JWT), you can pass the > > bearer token around in the sub-protocol header, > > namely Sec-WebSocket-Protocol (see > > http://stackoverflow.com/questions/22383089/is-it- > possible-to-use-bearer- > > authentication-for-websocket-up

Re: WebSocket enpoint as a tapestry service

2016-10-27 Thread Lance Java
I'm guessing it's similar to this? https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/TapestryAtmosphereObjectFactory.java On 27 Oct 2016 9:12 p.m., "Norman Franke" wrote: > I wanted to create a web chat application. I ba

Re: Submit form without t:form component

2016-12-08 Thread Lance Java
Perhaps the observe mixin could help you? http://t5stitch-lazan.rhcloud.com/observedemo On 8 Dec 2016 11:22 p.m., "David Diaz" wrote: > Hi guys, > > I was wondering if there was any way to submit a form without having a > t:form component and retrieve the data being sent? (e.g ideally a map woul

Re: Parameterized service injection

2016-12-15 Thread Lance Java
You should be able to use @InjectService assuming each has a unique id. @InjectService("s1") private MyService s1; @InjectService("s2") private MyService s2; On 13 Dec 2016 7:31 a.m., "Andrus Adamchik" wrote: > From what I gather Tapestry 5.4 still does not support parameterized > se

Re: Rendering block from Java

2017-01-06 Thread Lance Java
There's also the capture component http://t5stitch-lazan.rhcloud.com/capturedemo On 6 Jan 2017 5:17 p.m., "Nathan Quirynen" wrote: > Hey, > > I'm not sure with blocks, but I do know that Lance (Tapestry committer) > made a library to render pages and components in code. Maybe this can help > you

Re: Loop of checkboxes in form

2017-01-23 Thread Lance Java
If you want to avoid http session you could maintain a hidden text field on the page which also gets posted alongside the checkboxes. The text field contains a comma separated list of the checkbox ids (or maybe just a count if index based naming convention) On 23 Jan 2017 10:07 a.m., "Nathan Quiry

Re: How to open a pdf file on click of an action link

2017-03-07 Thread Lance Java
You'll need to set: response.setHeader("Content-Disposition", "attachment; filename=" + fileName); See StreamResponse usage in PDFLink.onPdf() here http://t5stitch-lazan.rhcloud.com/pdflinkdemo On 7 Mar 2017 08:47, "Gopi, Sreela" wrote: > Hello, > >Can anyone please tell me how to open a pd

RE: Remote debugging a Tapestry application

2017-04-05 Thread Lance Java
That's incorrect. Tapestry pages / components are byte code transformed such that properties are stored in PerThreadValue instances. In development mode tapestry duplicates the values into the bean properties to make debugging easier. On 5 Apr 2017 09:30, "Ankit Jain" wrote: > The problem you a

Re: Creating an org.apache.tapestry5.dom.Document from client-side page source

2017-04-06 Thread Lance Java
Why on earth would you do that? On 6 Apr 2017 16:20, "Davide Vecchi" wrote: Hi everybody I am writing a Selenium test to test a Tapestry 5.3.8 web app, and in that test I retrieved the whole client-side page source into a String. It's a regular HTML page generated by Tapestry. Nothing special a

RE: Creating an org.apache.tapestry5.dom.Document from client-side page source

2017-04-06 Thread Lance Java
Typically you'd use the tapestry dom only in production code (pages, components, mixins etc) For verifying html in selenium tests you'd usually use Jsoup or geb or something or maybe even the java xml libraries. But not the tapestry dom libraries. On 6 Apr 2017 17:16, "Davide Vecchi" wrote: >

RE: Creating an org.apache.tapestry5.dom.Document from client-side page source

2017-04-06 Thread Lance Java
, and it settles this, I will use something else. > > Thanks for the help. > > > -Original Message- > From: Lance Java [mailto:lance.j...@googlemail.com] > Sent: Thursday, April 6, 2017 18:21 > To: Tapestry users > Subject: RE: Creating an org.apache.tapestry5.

Re: Tapestry cometd with HTTPS

2017-04-30 Thread Lance Java
tapestry-cometd uses tapestry-offline under the hood to fool tapestry into believing it was invoked via a request / response when it was actually invoked via websockets. I'm guessing you are rendering a link in your websocket flow. You'll need to provide a few extra symbols to render links includi

<    11   12   13   14   15   16   17   >