Re: Sharing the Registry instance between web applications (deployed in the same container)

2012-12-14 Thread Lance Java
You cannot use approach #2. Two separate web apps cannot call each other directly. This is like having two processes on separate machines in separate JVMs. This is not entirely true. As Josh said there is a classloader which is common to all webapps running in a container. Take a look at the

Re: How to build both .tml, .java page using ant build

2012-12-14 Thread Lance Java
Firstly, I would urge you not to use ant. It's easy to end up with spaghetti code that does not conform to any standard. Even though I hate maven, it's 1000 times better than ant. I suggest you build with gradle. If you *must* use ant. Then I suggest that you at least conform to the maven

Re: Sharing the Registry instance between web applications (deployed in the same container)

2012-12-14 Thread Lance Java
You could extract your shared services into a separate war and expose them as web-services. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Sharing-the-Registry-instance-between-web-applications-deployed-in-the-same-container-tp5718686p5718721.html Sent from the Tapestry

Re: [5.3.6] GridDataSource provided row index to getRowValue(int)

2012-12-14 Thread Lance Java
JDBC supports paging which is is available in both hibernate and JPA. Tapestry provides GridDataSource implementations for both Hibernate and JPA that support paging. http://tapestry.apache.org/tapestry5/apidocs/src-html/org/apache/tapestry5/hibernate/HibernateGridDataSource.html

Re: [5.3.6] GridDataSource provided row index to getRowValue(int)

2012-12-14 Thread Lance Java
Basically, the prepare() method is used to fetch the rows between startIndex and endIndex in a single batch and cache them. This cache might be a list with indexes ranging from 0 to (endIndex - startIndex) getRowValue(int index) is then used to retrieve a single entry from the batch. This might

Re: Upgrading selenium version

2012-12-13 Thread Lance Java
In maven, the nearest definition wins. http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html So if you declare a version in your pom.xml, it will override the version declared in any of your dependencies (ie tapestry). -- View this message in context:

Re: Component that displays additional containing Page markup

2012-12-13 Thread Lance Java
I've written a simple gallery component which displays a list of items in a grid with prev and next links to go through pages. You pass it a block to display each item. Code: https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/components/Gallery.java

Re: Component that displays additional containing Page markup

2012-12-13 Thread Lance Java
As Thiago has said, the Grid component actually accepts a parameter of type GridDataSource so does not require the entire list in memory at once. Tapestry provides a coercion from List to GridDataSource so you can also pass a List to the Grid.

Re: Return URL POST Redirection from onActivate

2012-12-12 Thread Lance Java
I think the most elegant way of handling this would be to handle a new component event result type called ExternalPost. Then you could return an ExternalPost instance from your onActivate() method. public class ExternalPost { private URL url; private String contentType; private

Re: Return URL POST Redirection from onActivate

2012-12-12 Thread Lance Java
Do you want to do the POST from the client's browser or from the server? I think you want to do it from the client's browser. The server can only send a redirect to the client. A redirect causes a GET on the client. Another option is to send some javascript to the client so that it does a POST.

Re: How to sort Association column in Grid?

2012-12-12 Thread Lance Java
A simple (but slightly hacky) solution is to add a convenience getter to Employee public class Employee { private int id; private String employeeName; private Department department; public String getDepartmentName() { return department == null ? null :

Re: Exception constructing service 'ValueEncoderSource'

2012-12-11 Thread Lance Java
The tapestry-hibernate module provides ValueEncoders for all hibernate entities. If you want to override the ValueEncoders provided by tapestry-hibernate, you should use override() instead of add(). eg: configuration.override(Librarian.class, librarianFactory);

Re: [BUG?] UnclaimedFieldWorker

2012-12-07 Thread Lance Java
Hmm... looks like a bug. PlasticClassImpl uses this.fields in getUnclaimedFields() but never adds to this.fields in introduceField(). public PlasticField introduceField(String className, String suggestedName) { check(); assert PlasticInternalUtils.isNonBlank(className);

Re: T5.3.6 AfterRenderTemplate getElement returns element of parent component

2012-12-06 Thread Lance Java
This is expected behavior. MarkupWriter.getElement() returns the current XML element on the stack that has not been closed (ie markupWriter.end() has not been called for the element). Since all TML templates are well formed XML and hence end() every element thus popping it off of the stack. What

Re: Tapestry generated urls

2012-12-06 Thread Lance Java
You could put all your pages under the shop package and tapestry will do what you want out of the box. eg com.mypackage.pages.shop.Page1 com.mypackage.pages.shop.Page2 If you want more control, you can decorate the ComponentEventLinkEncoder to do whatever you want.

Re: Images from DB to PDF File

2012-12-01 Thread Lance Java
Note that itext is only free for open source -- View this message in context: http://tapestry.1045711.n5.nabble.com/Images-from-DB-to-PDF-File-tp5718438p5718446.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Lance Java
In order to use optimistic locking, hibernate recommends that you use an integer version annotated with @Version on your entity. @Entity public class Person implements Serializable { @Column private String name; @Version @Column private Integer version; // getters and

Re: Tapestry + Hibernate optimistic locking

2012-11-30 Thread Lance Java
Should have been t:hidden t:value=person.version / -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-Hibernate-optimistic-locking-tp5718413p5718416.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Images from DB to PDF File

2012-11-30 Thread Lance Java
I've written a component which allows the power of tapestry components to extend to PDFs by integrating with apache FOP. Apache FOP: http://xmlgraphics.apache.org/fop/ PDF Demo:

Re: T5.3: what's the correct usage of PerThreadValue

2012-11-29 Thread Lance Java
Another option is environmentals http://tapestry.apache.org/environmental-services.html Typically, a parent component will push() and environmental onto the (thread local) stack and a child component will peek() for the environmental and update it in some way. -- View this message in context:

Re: date and time picker

2012-11-29 Thread Lance Java
I've used this jquery UI plugin http://fgelinas.com/code/timepicker in a non-tapestry project and my users love it. -- View this message in context: http://tapestry.1045711.n5.nabble.com/date-and-time-picker-tp5718388p5718392.html Sent from the Tapestry - User mailing list archive at

Re: Override MessagesImpl

2012-11-28 Thread Lance Java
You will either decorate or override the MessagesSource service. Take a look at the MessagesSourceImpl source code for inspiration. http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html http://tapestry.apache.org/tapestry-ioc-decorators.html

Re: Error references component id 'ABC' which does not exist

2012-11-28 Thread Lance Java
If you provide a small snippet of code that's failing and an exception stack trace you are more likely to get help with this. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Error-references-component-id-ABC-which-does-not-exist-tp5718353p5718354.html Sent from the

Re: Referencing files from a jar

2012-11-28 Thread Lance Java
Images, css and js etc are known in tapestry as assets. You can reference assets by classpath: or context:. http://tapestry.apache.org/assets.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Referencing-files-from-a-jar-tp5718355p5718357.html Sent from the Tapestry

Re: tml if statements: unique id components

2012-11-27 Thread Lance Java
Declare your shared content in a t:block id=foo.../t:block Then use t:delegate to=foo / when you want to include the foo block in your logic. -- View this message in context: http://tapestry.1045711.n5.nabble.com/tml-if-statements-unique-id-components-tp5718312p5718314.html Sent from the

Re: tml if statements: unique id components

2012-11-27 Thread Lance Java
You can also avoid the if component all together using this pattern: http://tapestry.apache.org/switching-cases.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/tml-if-statements-unique-id-components-tp5718312p5718315.html Sent from the Tapestry - User mailing list

Re: [plastic] adding fields to pages

2012-11-27 Thread Lance Java
Since the UnclaimedFieldWorker is configured after:* it will be applied after all other ComponentClassTransformWorker2's. This means that your new field will be ThreadLocalized and won't be a singleton. -- View this message in context:

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.

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

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

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

Re: SinglePage app design thoughts

2012-11-25 Thread Lance Java
Tynamo has a resteasy module, I've never used it myself but it looks promising http://tynamo.org/tapestry-resteasy%20guide -- View this message in context: http://tapestry.1045711.n5.nabble.com/SinglePage-app-design-thoughts-tp5718264p5718274.html Sent from the Tapestry - User mailing list

Re: Jquery Tooltip on production mode

2012-11-24 Thread Lance Java
Can you clear your browsers cache and try again? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718223.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Use the power of tapestry components to generate PDFs

2012-11-24 Thread Lance Java
Hi Tapestry Users, I've just written a component that integrates the power of tapestry component templates with apache FOP to generate PDFs. This opens up the possibilities of creating reusable PDF component libraries such as a PDFGrid etc. Usage: I'm looking for a home for this component so

Re: Jquery Tooltip on production mode

2012-11-23 Thread Lance Java
Can you send another screenshot now that YUI is not compressing the javascript? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718200.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Tapestry-JQuery: use of GoogleMap component

2012-11-23 Thread Lance Java
I haven't used the gmap in tapestry-jquery but I have used the gmap component from exanpe without any trouble at all. Demo: http://exanpe-t5-lib.appspot.com/components/googlemap/example2 Source: https://github.com/exanpe/exanpe-t5-lib Demo Source: https://github.com/exanpe/exanpe-t5-demo --

Re: Adding a progress listener to UploadedFile

2012-11-23 Thread Lance Java
You will need to override (or perhaps decorate) the MultipartDecoder. Most likely, you will extend MultipartDecoderImpl and extend the following method to add your progress listener: Note that the MultipartDecoder has per-thread scope

Re: Adding a progress listener to UploadedFile

2012-11-23 Thread Lance Java
http://tapestry.apache.org/ioc-cookbook-overriding-ioc-services.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Adding-a-progress-listener-to-UploadedFile-tp5718197p5718205.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Jquery Tooltip on production mode

2012-11-23 Thread Lance Java
Type mvn dependency:tree at the command line to show your dependency hierarchy -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718210.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Jquery Tooltip on production mode

2012-11-23 Thread Lance Java
Yui isn't on your build path Have you done a clean deploy or a dirty deploy? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718216.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Adding a progress listener to UploadedFile

2012-11-23 Thread Lance Java
In tapestry 5.2+ you have the option of annotations or naming conventions. Prior to 5.2 you can only use naming conventions. See methods starting with contribute here http://tapestry.apache.org/tapestry-ioc-configuration.html -- View this message in context:

Re: Jquery Tooltip on production mode

2012-11-22 Thread Lance Java
Looks very similar to this: http://tapestry.1045711.n5.nabble.com/Problem-in-Production-mode-td5718120.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Jquery-Tooltip-on-production-mode-tp5718174p5718183.html Sent from the Tapestry - User mailing list archive at

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

2012-11-22 Thread Lance Java
I seem to be explaining this concept a bit lately... perhaps the tapestry docs need to include an explanation. Tapestry pages are singletons. Tapestry does a bit of byte code magic on your pages and components to transform them so that any request specific state is stored in a thread local map.

Re: How to reuse a form?

2012-11-22 Thread Lance Java
In addition to Thiago's suggestion, I often set a default for the block: @Parameter(value=block:defaultAdditionalStuff, defaultPrefix = BindingConstants.LITERAL) @Property private Block additionalStuff; t:form ... t:delegate to=additionalStuff/ ... /t:form t:block

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

2012-11-21 Thread Lance Java
@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:

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

2012-11-21 Thread Lance Java
This page says the page pool is disabled as of tapestry 5.2 http://tapestry.apache.org/page-life-cycle.html Two of the links you provided have a deprecated warning: http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PageAttached.html

Re: Adding new properties from AppModule

2012-11-21 Thread Lance Java
How can I add new properties This question is pretty vague, most likely you will use a MappedConfigurationK,V which allows you to contribute to a service which takes a MapK,V in it's constructor. Should I simply use System.setProperties Most likely not Also one other question what is the

Re: Problem in Production mode

2012-11-20 Thread Lance Java
What version of tapestry are you using? My guess is that it's either the GZIP filter or YUI compressor that are causing this problem. I'd start by turning them off one at a time to find the culprit. Disable YUI compressor in pom.xml Disable GZIP here:

Re: Problem in Production mode

2012-11-20 Thread Lance Java
Will try that again (nabble ate my XML) What version of tapestry are you using? My guess is that it's either the GZIP filter or YUI compressor that are causing this problem. I'd start by turning them off one at a time to find the culprit. Disable YUI compressor in pom.xml Disable GZIP here:

RE: Problem in Production mode

2012-11-20 Thread Lance Java
I know the tapestry team have been having troubles with yuicompressor, I'm just not familiar to them myself. Please chime in anyone who knows more about this. Are you saying that rhino was already on your classpath? Is it a dependency in your project or is it part of jetty? Run mvn

Re: Form server side validation in zone

2012-11-20 Thread Lance Java
Actually, it's even easier... you don't need to worry about the environmental. 1. Extend ValidationTrackerImpl and override the recordError() methods to save the error fields 2. Pass your tracker to the form t:form tracker=myTracker ... 3. Profit -- View this message in context:

Re: Form server side validation in zone

2012-11-20 Thread Lance Java
ValidationTrackerImpl is final, so I cannot extend this class. But I found ValidationTrackerWrapper class, maybe I should extend this? Sounds good to me Do I set it as a persisted property? It depends on which tapestry version you are using. Later versions of tapestry will NOT need flash

Re: Problem with checkboxes in dynamic tables

2012-11-19 Thread Lance Java
Ok, so the problem is that you want to generate an eventlink that passes two parameters. One parameter (context) is known when you call componentResources.createEventLink(), the other is a clientside value (the value of the checkbox). Option 1: Generate an event URL via

Re: How stable is 5.4 jsrewrite?

2012-11-19 Thread Lance Java
Thanks for the update... My approach will be to explicitly load jQuery myself in noConflict() mode which I can then remove once tapestry includes jQuery itself. Cheers, Lance. -- View this message in context:

Re: DateField Customization

2012-11-16 Thread Lance Java
t:datefield icon=path/to/myicon.gif ... / -- View this message in context: http://tapestry.1045711.n5.nabble.com/DateField-Customization-tp5718034p5718042.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: DateField Customization

2012-11-16 Thread Lance Java
Note, if you'd like to override the default date editor in the BeanEditForm you will need to contribute an EditBlockContribution to the BeanBlockOverrideSource service. This will require you to create a private page with a block containing a DateField. The page can be made private by annotating it

How stable is 5.4 jsrewrite?

2012-11-16 Thread Lance Java
Hi all, I'm keen to give the js-rewrite branch [1] a whirl and enjoy the twitter-bootstrap and jquery goodness without the need for 3rd party component libraries. I'll only be using it for a toy project but was wanting to get a feel for the current state of the branch. A simple answer such as:

Re: Form server side validation in zone

2012-11-15 Thread Lance Java
Although I'm sure it can be done... it sounds like a lot of effort for not much gain. Why don't you want update the full zone? -- View this message in context: http://tapestry.1045711.n5.nabble.com/Form-server-side-validation-in-zone-tp5718026p5718027.html Sent from the Tapestry - User mailing

Re: Problem with checkboxes in dynamic tables

2012-11-15 Thread Lance Java
This could be done with a mixin to the checkbox which fires an event passing the boolean value of the checkbox and some context identifying the row. Something like this: t:grid source=items row=item p:checkBoxCell t:checkbox value=item.flag t:mixins=checkboxZoneUpdater

Re: Form server side validation in zone

2012-11-15 Thread Lance Java
ValidationTracker is an environmental so you could wrap the existing ValidationTracker and push() the wrapper onto the environment and keep track of the fields this way. I wonder if you could have a hidden zone in the UI which gets updated when the form is submitted. You then run some javascript

Re: DateField Customization

2012-11-15 Thread Lance Java
IMG.t-calendar-trigger { position: relative; left: -25px; top: 2px; } -- View this message in context: http://tapestry.1045711.n5.nabble.com/DateField-Customization-tp5718034p5718035.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: Class reloading with Jetty 7 and 8

2012-11-13 Thread Lance Java
Live class and template reloading will only work in development mode. Are you running in production mode? http://tapestry.apache.org/configuration.html#Configuration-tapestry.productionmode If running in development mode, tapestry will tell you in the logs on startup. -- View this message in

Re: Best practice activation context and later ajax calls

2012-11-13 Thread Lance Java
I'm guessing that you render the recalculate zone by submitting another form... correct? If so, you could include the values from the first calculate as input type=hidden / in the second form. -- View this message in context:

Re: Showing a Block condirionally

2012-11-13 Thread Lance Java
In JSTL, there is a choose tag [1] which I think is a more elegant way of handling the else condition. Perhaps tapestry could benefit from a similar component? t:choose t:when test=fooFoo/t:when t:when test=barBar/t:when t:elseBaz/t:else /t:choose [1]

Re: Using maps withing templates

2012-11-12 Thread Lance Java
Tapestry considers prop: bindings to a method invocation as read-only. Can you give an example of your data? The easiest solution is to wrap your maps in a model with getters and setters? If you can't do that, you might want to consider a custom binding or decorating / overriding the

Re: Using maps withing templates

2012-11-12 Thread Lance Java
Chenillekit provides an ognl: binding, I'm not sure but this might support setters on Maps? http://chenillekit.codehaus.org/chenillekit-tapestry/ognlbinding.html Here are some example custom bindings prefixes: http://wiki.apache.org/tapestry/Tapestry5HowTos#Binding_Prefixes -- View this

Re: Using maps withing templates

2012-11-12 Thread Lance Java
I meant a prop binding to a custom method invocation (ie not a getter) eg: prop:foo will have a read and write binding prop:someMethod('foo') will have a read-only binding -- View this message in context:

Re: Best practice activation context and later ajax calls

2012-11-12 Thread Lance Java
I always avoid @Persist as it makes your webapp far more scalable. In this example, you can pass policyId as an event context to all of the ajax events on your page. eg: t:eventlink event=myEvent context=policyId zone=myZone void onMyEvent(int policyId) { policy =

Re: Best practice activation context and later ajax calls

2012-11-12 Thread Lance Java
Chris is right, if you include an onPassivate() with your policy/policyId there is no need to pass it in the ajax event as it tapestry will implicitly populate the value for you. You might also want to consider the @PageActivationContext annotation which takes care of onActivate() and

Re: Type Coercer for Joda Time

2012-11-12 Thread Lance Java
If the documentation [1] is complete then tapestry does not include coercers for java.uttil.Date by default. You might need to coerce to long instead. [1] http://tapestry.apache.org/typecoercer-service.html -- View this message in context:

RE: select event handler wont hit breakpoint - quarky runtime came back

2012-11-11 Thread Lance Java
I'm not trying to steal your thunder. My design/CSS skills are pretty rubbish so chances are it won't look pretty. There have been a few questions on this list lately regarding a gallery component and I wanted to provide a sample showing that it was possible to do it without the need for @Persist.

Re: Render whole table grid row as a link?

2012-11-11 Thread Lance Java
Well, I'm sure you're a smart guy and can figure out how to get the tbody. The mixin will fire after the grid component has rendered. The grid renders a table inside a div so you will need to do something like: ListNode topChildren = writer.getElement().getChildren(); Element div = (Element)

Re: Render whole table grid row as a link?

2012-11-11 Thread Lance Java
I've just written a GridDecorator mixin that allows you to decorate rows or cells in a grid. The code can be found here: https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/mixins/GridDecorator.java A demo can be found here with examples for RowDecorator and

Re: Can I attach an instance mixin to a nested component

2012-11-11 Thread Lance Java
I was able to solve my problem by developing a GridDecorator mixin which applies RowDecorators and CellDecorators. Code Here: https://github.com/uklance/tapestry-stitch/blob/master/src/main/java/org/lazan/t5/stitch/mixins/GridDecorator.java

RE: select event handler wont hit breakpoint - quarky runtime came back

2012-11-09 Thread Lance Java
I notice that you are attempting to pass itemsPerPage, tableColumns and cursor as component parameters but your are not marking them with the @Parameter annotation. I think you want to define them as: @Parameter(literal:25) private int itemsPerPage; @Property(literal:4) private

RE: select event handler wont hit breakpoint - quarky runtime came back

2012-11-09 Thread Lance Java
As for your problem with debugging. Tapestry transforms your component classes such that they no longer read/write to member variables in your class. Instead, getters and setters are generated that are backed by a thread local. When running in development mode, tapestry helps out the developer by

RE: select event handler wont hit breakpoint - quarky runtime came back

2012-11-09 Thread Lance Java
I've been working on a demo gallery component. The gallery uses a table to display a grid of items with links for next and prev. The GalleryDataSource ensures that only a page of data is loaded into memory at a time. The gallery accepts a block parameter to display each item. I've included a demo

Re: Howto render a block and put it into a JSON reply?

2012-11-09 Thread Lance Java
Tapestry does NOT accept JSONObject as a return value from a component event. If you want to make a JSONObject available in your javascript, you should use AjaxResponseRenderer. http://tawus.wordpress.com/2011/10/01/tapestry-5-3-new-features-part-2/ -- View this message in context:

Re: Can I attach an instance mixin to a nested component

2012-11-08 Thread Lance Java
it seems easier to install both mixins with a component transformer and then just have a parameter on the grid control the row I disagree, mixins are a well understood concept. Asking a user of my library to add a mixin to a grid and then pass parameters to that mixin is well documented. Using

Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
The grid component contains a nested rows component of type GridRows. Is there a way that I can attach a mixin to the nested GridRows instance? I realise that this can be done globally via a ComponentTransformWorker2 but I'd like to apply an instance mixin. FYI, here's the code that initialises

Re: Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
Ok, so rolling with your suggestion... Let's assume that I use a CTW2 to attach a GridRowsMixin to every GridRows component. And now, I attach a GridMixin to the Grid. Is there any way that the GridRowsMixin can lookup the GridMixin? To rephrase my question, can a mixin on a child component

Re: Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
I think I've got a solution: 1. GridMixin calls ComponentResources.storeRenderVariable(name, value) to make config available to GridRowsMixin 2. GridRowsMixin calls ComponentResources.getContainerResources().getRenderVariable(name) 3. ComponentResources.getComponentModel().getMixinClassNames() is

Re: Configurable scheduled jobs?

2012-11-07 Thread Lance Java
So, create an IOC service: public interface Job implements Runnable { // implementors of this must be careful with synchronization public void updateJobConfig(JobConfig config); } public class JobServiceImpl implements JobService { @Inject private PeriodicExecutor executor;

Re: Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
Why not the Environment for passing parameters? Since all nested components will be able to see the environmental, you might get unexpected behavior for a grid inside a grid. -- View this message in context:

Re: Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
I've overwritten both the Grid class and the GridRows class to make it happen Sounds like this might be a problem that needs addressing then... perhaps there should be a mechanism in tapestry to add mixins to subcomponents? eg: t:grid source=... mixins=gridMixin submixins=prop:subMixins .../

Re: Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
Lance, you might be interested in https://issues.apache.org/jira/browse/TAP5-1606. Interesting, I think the @EmbeddedMixin functionality is cleaner than what I suggested. I do agree with HLS' comment on the issue that it breaks the black box philosophy of components. But given the alternatives,

Re: Can I attach an instance mixin to a nested component

2012-11-07 Thread Lance Java
A stack works fine when every grid is guaranteed to put a value on the stack. Since the mixin is optional, the environmental is also optional. So a nested Grid might see an environmental from a parent Grid when the value should have been null. -- View this message in context:

Re: Tapestry t:include grid column at runtime

2012-11-06 Thread Lance Java
t:grid source=... t:include=prop:myIncludes t:exclude=prop:myExcludes / public String getMyIncludes() { // return a comma separated string or null } public String getMyExcludes() { // return a comma separated string or null } -- View this message in context:

Re: Show and hide fields based on boolean dynamic property?

2012-11-06 Thread Lance Java
To me, it sounds like you can achieve most of this with javascript. Attach a listener to the change event on the checkbox which toggles the visibility of the field. On the serverside, you will check he value of the boolean flag to determine if the field is initially hidden or visible. In jquery,

Re: Tapestry t:include grid column at runtime

2012-11-06 Thread Lance Java
http://tapestry.apache.org/component-parameters.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Tapestry-t-include-grid-column-at-runtime-tp5717685p5717694.html Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: T5.2.6: Catch page call in AppModule

2012-11-06 Thread Lance Java
Take a look at the diagram at the bottom of this page: http://tapestry.apache.org/request-processing.html You can contribute a PageRenderRequestFilter to the PageRenderRequestHandler in your AppModule. -- View this message in context:

Re: T5.2.6: Catch page call in AppModule

2012-11-06 Thread Lance Java
You could also use a ComponentClassTransformWorker2 to attach a custom mixin to every Page class. http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/transform/ComponentClassTransformWorker2.html -- View this message in context:

Re: Elegant Handling of Multiple Zones in 'Deep' Hierarchies of Components

2012-11-06 Thread Lance Java
Have you considered an environmental? http://tapestry.apache.org/environmental-services.html -- View this message in context: http://tapestry.1045711.n5.nabble.com/Elegant-Handling-of-Multiple-Zones-in-Deep-Hierarchies-of-Components-tp5717698p5717700.html Sent from the Tapestry - User mailing

Re: onPrepare from grid?

2012-11-05 Thread Lance Java
You can attach a mixin to any component and hook onto the component's render phases. By default, the mixin lifecycle phases will fire before it's containing component which can be switched by adding the @MixinAfter annotation. http://tapestry.apache.org/component-rendering.html

Re: ajaxResponseRenderer in event

2012-11-05 Thread Lance Java
You are using $.get() to get an eventlink URL and you are doing nothing with the response. The default tapestry implementation (prototype) has a ZoneManager.processReply() which is used to process an event response. It looks like you are using tapestry-jquery so you will need to find the

Re: Best practice to store other languages files or I don't understand?

2012-11-01 Thread Lance Java
This is not really a tapestry question. Here's the standard maven project layout http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html Any files under src/main/resources will be available on the classpath (eg Classloader.getResrouceAsStream(...)) Any

Re: use symbol value in POJO

2012-11-01 Thread Lance Java
I think Lance was onto the best ideas. The easiest would be to create a Tapestry service for creating your Cayenne objects That's not what I said, infact I said that a factory was a bad since there are multiple sources for these objects. I was suggesting a service: public class FooServiceImpl

Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
where do I have to place the mixin? I placed it into /components. Mixins must live in basepackage.mixins (http://tapestry.apache.org/component-mixins.html) RowType is the object that is displayed in the grid? Eg onRowClick(UserProfile user)? Correct, it is the collection type backing the grid

Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
When tapestry starts, it lists the registered components and mixins... Is the mixin listed in the logs? Do you have other custom components that are working? Does the mixin code live inside the webapp? Or is the mixin part of a component library?

Re: Render whole table grid row as a link?

2012-11-01 Thread Lance Java
Tapestry is interpreting the event as a property on your page. Change the default binding prefix for the property to LITERAL: @Parameter(required=true, defaultPrefix=BindingConstants.LITERAL) private String event; -- View this message in context:

<    5   6   7   8   9   10   11   12   13   14   >