Re: uninitialized proxy passed to save()

2013-09-12 Thread Lance Java
I think the issue is because mOrder is not connected to the hibernate session. It looks like you are only saving the entity when the user clicks "accept". I'm guessing that at some stage before you are submitting a form and storing mOrder on the HttpSession? If I were you, I'd try to remove HttpS

Re: Tapestry Server Push/Web Socket/Comet implementation

2013-09-12 Thread Lance Java
It depends on how you want to use it. If you just simply want external services to push JSON to the client and then write a whole lot of javascript to update the DOM then that's fine. With tapestry-cometd I wanted to the option to write ZERO javascript by leveraging tapestry component events and t

Re: uninitialized proxy passed to save()

2013-09-13 Thread Lance Java
@Persist("entity") will store the id in the HttpSession and then lookup the entity from the db any time it's required. In 99% of cases, you can avoid HttpSession usage all together. By using @PageActivationContext or onActivate() / onPassivate() you can pass the id in the URL and avoid HttpSession

Re: Looping the textfield component with dynamic entity properties

2013-09-17 Thread Lance Java
Not sure exactly what you're doing but you might find the map: binding prefix useful from tapestry-stitch http://tapestry-stitch.uklance.cloudbees.net/mapbindingdemo

Re: Dynamically setting translate within a textfield

2013-09-19 Thread Lance Java
The default binding prefix for the translate parameter is "translate:", not "prop:". Also, a prop binding of "field.type" will call yourPage.getField().getType() Tapestry provides translators for Byte, Short, Integer, Long, Float, Double, BigInteger and BigDecimal which can all be referenced by t

Re: Encoding a template as a valid JSON String

2013-09-19 Thread Lance Java
Unfortunately this is a bit tricky but it can be done TML --- Java --- @InjectComponent Block myBlock; @Property myBlockBodyAsString; Block beginRender(MarkupWriter writer) { writer.element("container"); return myBlock; } void beforeRenderTempl

Re: Encoding a template as a valid JSON String

2013-09-19 Thread Lance Java
Actually, that should be void beforeRenderTemplate(MarkupWriter writer) { Element container = writer.getElement(); writer.end(); myBlockBodyAsString = container.getChildMarkup(); container.remove(); }

Re: Encoding a template as a valid JSON String

2013-09-19 Thread Lance Java
Whilst that might work, it will likely produce invalid dom. If the element has an id, there's a good chance you will have 2 elements on your page with the same id which us illegal.

Re: Encoding a template as a valid JSON String

2013-09-19 Thread Lance Java
Well... In this case, if the cardLightbox generates an id you will start with one hidden element with the id when you render the page. Then, when the colorbox pops up the HTML will be used to create another with exactly the same id. On 19 Sep 2013 11:55, "Dmitry Gusev" wrote: > > You will get 2

Re: Encoding a template as a valid JSON String

2013-09-19 Thread Lance Java
I don't think you can guarantee that id based css selectors will work on all browsers. And document.getElementById() would also not be guaranteed. It would be simple to develop a component which converts it's body to a string and updates a parameter binding. This component can then be included in

Re: Encoding a template as a valid JSON String

2013-09-22 Thread Lance Java
> Also if I remember correctly doesnt Tapestry always create unique ids for > elements by adding $number to the components name? Whilst it's true that most tapestry components will avoid an id conflict when rendering, in this case it's not tapestry rendering the second instance. A javascript is us

Re: How to best construct and express this service?

2013-09-22 Thread Lance Java
Igor has written a blog about scheduling jobs with tapestry here http://blog.tapestry5.de/index.php/2011/09/18/scheduling-jobs-with-tapestry/ The hibernate session provided by tapestry is a singleton and can be injected as any other service. The singleton is a proxy to a per-thread instance which

Re: Tapestry + Hibernate + Testing

2013-09-22 Thread Lance Java
I do this http://stackoverflow.com/questions/15664815/how-to-test-dao-layer-in-tapestry-dependent-projects/15671034#15671034 On 22 September 2013 19:16, Boris Horvat wrote: > Hi all, > > How does one make a proper testing of the business layer in tapestry that I > inject into the page as a serv

Re: How to best construct and express this service?

2013-09-23 Thread Lance Java
g-ridden < > > http://en.wikipedia.org/wiki/Computer_bug>, > > slow implementation of half of Hudson. > > > > > > On Sun, Sep 22, 2013 at 4:53 AM, Martin Kersten < > > martin.kersten...@gmail.com > > > wrote: > > > > > Thanks Lance.

Re: Encoding a template as a valid JSON String

2013-09-23 Thread Lance Java
Since colorbox supports 'inline' option you can solve this problem without ever needing the HTML of the element you want to display. Just render the colorbox content in a hidden div and use $("#link").colorbox({inline:true, href:$("#showMe")}

Re: BaseURLSource with access to current request

2013-09-23 Thread Lance Java
Your ClassCastException is caused by using configuration.add(…, …) instead of configuration.addInstance(…, …) If you find that contribution to ServiceOverride fails causes circular dependency you can decorate instead of override: static BaseURLSource decorateBaseURLSource(BaseUrlSource default, @

Re: How to best construct and express this service?

2013-09-23 Thread Lance Java
Assuming MyTask implements Runnable and takes a Session in it's constructor: Either @Startup public static void scheduleMyJob(PeriodicExecutor executor, Session hibernateSession) { Runnable mytask = new MyTask(hibernateSession); executor.addJob(new IntervalSchedule(100L), "

Re: MethodInvocationPlan?

2013-09-23 Thread Lance Java
Methods marked with @PostInjection will be called after your constructor. The method params will be injected. http://tapestry.apache.org/tapestry5/apidocs//org/apache/tapestry5/ioc/annotations/PostInjection.html Eg public class MyServiceImpl implements MyService { public MyServiceImpl(Dependen

Re: MethodInvocationPlan?

2013-09-23 Thread Lance Java
I'm not sure I see the point. ALL services in the tapestry registry are singletons (including the hibernate session). So all services can be constructor injected. I get the feeling you don't understand how the hibernate session works in tapestry. Please re-read my comment from the other thread des

Re: MethodInvocationPlan?

2013-09-23 Thread Lance Java
> I know exactly how it works. So please correct your opinion about the session source. Ok, noted ;) I'm guessing that want to create some form of dynamic proxy using plastic (or java.lang.reflect.Proxy) to invoke a method. The proxy will inject in the method arguments based on type / annotation

Re: How to call a function at the time of page scroll in tapestry?

2013-09-24 Thread Lance Java
There's not an inbuilt component, I'm not sure exactly what you're doing but it might be worth looking at infinite scroll. This library allows you to render a page with a "next page" link which is then hidden after applying the plugin. It's been on my TODO list for a while now to integrate this w

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Lance Java
It's in tapestry-hibernate-core https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-hibernate-core/src/main/java/org/apache/tapestry5/internal/hibernate/PackageNameHibernateConfigurer.java

Re: Tapestry + Hibernate + Testing

2013-09-25 Thread Lance Java
> Is it possible somehow to automate this? Have you read Howard's answer on the Stack Overflow question? He suggests splitting your AppModules in such a way that you can load a DAOModule together with HibernateCoreModule for testing.

Re: Tapestry + Hibernate + Testing

2013-09-26 Thread Lance Java
HibernateEntityPackageManager only has one method which gets the list of hibernate entity package names. You might find it more lightweight to create mock this rather than including HibernateModule. On 26 Sep 2013 01:30, "Thiago H de Paula Figueiredo" wrote: > On Wed, 25 Sep 2013 20:01:14 -0300,

Re: Multi Upload for Tap5.4?

2013-09-27 Thread Lance Java
Taha blogged about integrating Valums file-uploader with tapestry (pre 5.4) here http://tawus.wordpress.com/2011/06/25/ajax-upload-for-tapestry/ I see that file-uploader has changed to fine-uploader and now has a commercial license so perhaps it's not suitable but the blog post still might be help

Re: dynamically revealing a block

2013-09-27 Thread Lance Java
This is a pure javascript question, not really related to tapestry. jQuery toggle() and show() will do it (and also support animations). http://api.jquery.com/toggle/ http://api.jquery.com/show/

Re: 5.4 Autocomplete exception

2013-09-29 Thread Lance Java
Possibly a web crawler sending an invalid request?

Re: 5.4 Autocomplete exception

2013-09-30 Thread Lance Java
You can often use the user agent header to detect a bot.

Re: Development environment for a modular Tapestry app

2013-10-01 Thread Lance Java
If you are using m2e maven eclipse plugin then it should do the "right" thing 1. If it can resolve the dependency from your eclipse workspace, it will use the local class files 2. If not (lets say you close / delete the project) then it will use the jar files from your maven repository The RunJe

Re: Development environment for a modular Tapestry app

2013-10-01 Thread Lance Java
BTW tapestry-stitch has two modules (component library + webapp) and I develop in eclipse using m2e + RunJettyRun. As you can see, StitchModule is added to the manifest here: https://github.com/uklance/tapestry-stitch/blob/master/pom.xml#L67 But also declared as a SubModule here for easy testing:

Re: Tapestry documentation proposal

2013-10-01 Thread Lance Java
Take a look at the built in pages PageCatalog and ServiceStatus in the tapestry sources which display a list of your app's pages and services. Notice the @WhiteListOnly annotation which hides the pages from public view.

Re: [5.4.22] Need example of custom javascript

2013-10-02 Thread Lance Java
You are trying to import stuff.js twice. Once via require.js and once via @Import. I get the feeling it's the @Import that's failing. On 2 Oct 2013 14:13, "Geoff Callender" wrote: > I'm desperately seeking an up-to-date example of custom javascript, > because nothing I've tried works. Here's on

Re: 5.4 List inside form is failing Could not find a coercion from type java.lang.String

2013-10-04 Thread Lance Java
Tapestry does not provide a default coercion from String to Date. You can contribute a CoercionTuple to the TypeCoercer service. Docs here http://tapestry.apache.org/typecoercer-service.html

Re: Tapestry transforms a class in the base package !

2013-10-04 Thread Lance Java
base, components, pages and mixins are special packages and anything in these packages is transformed and loaded by a different classloader. These packages are not suitable for utilities etc.

Re: 5.4 List inside form is failing Could not find a coercion from type java.lang.String

2013-10-04 Thread Lance Java
On second thought, you are better to contribute a ValueEncoder to the ValueEncoderSource.

Re: 5.4 List inside form is failing Could not find a coercion from type java.lang.String

2013-10-04 Thread Lance Java
The loop / ValueEncoder are used to serialize the values that were used to render the form. This is used to re-hydrate the initial form state when the POST is received. If you are happy to re-lookup the values (or the values are static) then it is fine to use formState="none". If you don't want to

Re: Getting Block content as String

2013-10-09 Thread Lance Java
Here's some discussion which has a couple of answers http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Encoding-a-template-as-a-valid-JSON-String-td5723504.html

Re: Getting Block content as String

2013-10-09 Thread Lance Java
It's probably overkill but depending on what you are doing, you might find tapestry-offline useful https://github.com/uklance/tapestry-offline

RE: Getting Block content as String

2013-10-09 Thread Lance Java
You can only get the rendered HTML after the point at which your block is rendered to tapestry's MarkupWriter. So, you only have an opportunity to get the HTML in a full page render request or an AJAX event request which causes a partial page render Getting the HTML in a non-ajax action (ie your

RE: Getting Block content as String

2013-10-09 Thread Lance Java
As Thiago said, can you specify the value somewhere (message catalogue, database etc) and reference the same value in both the template and the action?

Re: [ANN] A new blog about Tapestry and a quirky new blog engine

2013-10-09 Thread Lance Java
Nice! I noticed your blog has links to URL's on port 8080. Is this on purpose? My proxy at work blocks these URL's.

RE: Getting Block content as String

2013-10-10 Thread Lance Java
> because if at that point I inspect the block instance (Eclipse debug) I see the instance already contains that text. I've never really looked into the inner workings of a block. The only thing you should ever need to know about a block is that it can be coerced to a RenderCommand. I'm sure it ho

Re: Hibernate Search Fix

2013-10-11 Thread Lance Java
Seems like it's caused by your jvm's security and accessing a private class. This should work (less verbose too): public static FullTextSession buildFullTextSession( final HibernateSessionManager sessionManager, PropertyShadowBuilder propertyShadowBuilder) {

Re: Hibernate Search Fix

2013-10-11 Thread Lance Java
This would also work (and would only happen at most once per request: @Scope(ScopeConstants.PERTHREAD) public static FullTextSession buildFullTextSession(HibernateSessionManager sessionManager) { return Search.getFullTextSession(sessionManager.getSession()); }

Re: JPA

2013-10-11 Thread Lance Java
http://lmgtfy.com/?q=tapestry+jpa&l=1 :)

Re: autore_connect after connection_timeout using c3p0

2013-10-13 Thread Lance Java
And how is this related to tapestry?

Re: Safety check if a service has been initialized

2013-10-14 Thread Lance Java
Take a look at the built in ServiceStatus page. You can @Inject ServiceActivityScoreboard and check ServiceActivity.getStatus()

Re: Dynamic Loading of Templates

2013-10-14 Thread Lance Java
I've never used it myself but I assume it'd be something like: Java - public class MyDynamicPage { @Inject private DynamicTemplateParser parser; @Property private DynamicTemplate template; public void onActivate(EventContext context) { // TODO: implement this Resour

Re: Safety check if a service has been initialized

2013-10-14 Thread Lance Java
The Scoreboard is a ServiceActivityTracker. I've never needed to do it myself but I'm sure you can register your own custom tracker. On 14 Oct 2013 13:17, "Martin Kersten" wrote: > Sometimes it is very important. I for myself need this in some tests to > recognize some specials in tear down and s

Re: Tapestry Flow

2013-10-14 Thread Lance Java
Perhaps the unit tests will help? https://github.com/apache/tapestry-5/tree/master/tapestry-func/src/test/java/org/apache/tapestry5/func

Re: Safety check if a service has been initialized

2013-10-14 Thread Lance Java
Why not add the following to your database services: @PostInjection public void addShutdownListener(RegistryShutdownHub shutdownHub) { shutdownHub.addRegistryShutdownListener(new Runnable() { … }); } The shutdown listener will only fire if the service has been realized (constructed)

Re: PageRenderLinkSource inside periodic executor

2013-10-14 Thread Lance Java
As Barry has said, this might be easier to do inside a real request fired by Hudson. If you want to go down the 'fake' request route then I'll give my tapestry-offline project a plug :) https://github.com/uklance/tapestry-offline

Re: Safety check if a service has been initialized

2013-10-14 Thread Lance Java
Gelbana* > http://www.linkedin.com/in/mgelbana > > > On Mon, Oct 14, 2013 at 5:23 PM, Lance Java >wrote: > > > Why not add the following to your database services: > > > > @PostInjection > > public void addShutdownListener(RegistryShutdownHub shutdownHub

Re: Dynamic Loading of Templates

2013-10-15 Thread Lance Java
I'm interested to see if it works. It's worth noting that your Resource implementation should have a proper hashCode() and equals() to take advantage of template caching.

Re: Switching off Reloading of Service Implemenation?

2013-10-15 Thread Lance Java
Reloadable services are a development only feature that are aimed at improving developer productivity by reducing down time. As Thiago has said, casting to the concrete type is not good OO practice. If you need to access methods on the concrete class it's probably a sign that you need to add metho

Re: Switching off Reloading of Service Implemenation?

2013-10-16 Thread Lance Java
If you really really really want to do this thing that we are both suggesting is a bad idea, you can do one of the following in AppModule public static MyServiceImpl buildMyServiceImpl(…) { return new MyServiceImpl(…); } OR public static void bind(ServiceBinder binder) { binder.bind(MyServ

Re: Switching off Reloading of Service Implemenation?

2013-10-16 Thread Lance Java
Here's a workaround public interface LegacyService { void method1(); } public class LegacyServiceImpl implements LegacyService { public void method1() { ... } public void method2() { ... } } public interface ExtendedService { void m

Re: StreamResponse an EventLink

2013-10-16 Thread Lance Java
Are you using GAE? You might be hitting this: http://code.google.com/p/googleappengine/issues/detail?id=8201 http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-and-AppEngine-1-7-3-dev-server-IllegalStateException-td5717683.html Fix here: https://bitbucket.org/akochnev/tap5-gae-u

Re: StreamResponse an EventLink

2013-10-16 Thread Lance Java
I notice there's a whole lotta spring security stuff in your stack trace before it gets to the TapestryFilter. Can you try removing spring security from the mix to try to isolate the problem?

Re: T5.4 ajax select menu bug

2013-10-16 Thread Lance Java
Can you post a stack trace?

Re: StreamResponse an EventLink

2013-10-16 Thread Lance Java
Sorry, I missed your post where you'd isolated the problem to spring security. I get the feeling that spring security is somehow introducing the exact same bug as GAE. Can you try adding the filter from the GAE fix to your module? I have a hunch that it will fix this your issue too. http://tinyur

Re: T5.4 ajax select menu bug

2013-10-16 Thread Lance Java
It seems like a new 'secure' parameter has been added to select which defaults to true (value must exist in the model). Try setting secure="false" I think this should be the default to maintain backwards compatibility.

Re: StreamResponse an EventLink

2013-10-16 Thread Lance Java
Can you @Inject RequestGlobals and log RequestGlobals.getHttpServletRequest().getClass()? I'm thinking that one of the spring filters is wrapping the request in an faulty implementation. I'm starting to point the finger at RequestCacheAwareFilter.

Re: StreamResponse an EventLink

2013-10-16 Thread Lance Java
Oops, I meant to print out the HttpServletResponse class. Once you know the response class, you'll need to put in some breakpoints to find out why isComitted() is not true. A response should be committed as soon as it's outputstream / writer is first written to or it is redirected.

Re: T5.4 ajax select menu bug

2013-10-17 Thread Lance Java
I think the secure parameter should default to a symbol. And the default for the symbol should be false

Re: Does a Tap service method exist similar to a SelectModelFactory for use in autocompletes.

2013-10-17 Thread Lance Java
Slightly off topic but this is where groovy excels. List ldapProfiles = ldapCache.findAllLDAPUsers(keyword) List names = ldapProfiles*.name

Re: Dynamic Loading of Templates

2013-10-17 Thread Lance Java
It sounds like an interesting way to test. I'm guessing you can define your template directly in your test case rather than needing a separate file. If you were using groovy for testing this would be even nicer since you could use multi-line strings (via """). Or maybe you've come up with some cool

Re: Jack of All Trades Page

2013-10-17 Thread Lance Java
Hey Martin, you're lucky because I have a fair idea of what you're up to :). I think you want to write a custom binding so that your dynamic template can reference values from a map. I'm thinking you'll contribute a test: binding which can read and / or write to a map defined in your test case. Try

Re: Jack of All Trades Page

2013-10-18 Thread Lance Java
Invariant() { return false; } public void set(Object value) { map.put(key, value); } public Object get() { return map.get(key); } public T getAnnotation(Class annotationClass) { return null; } } On 18 October 2013 08:49, Martin Kersten wrote: > That's exactly what I w

Re: Dynamic Loading of Templates

2013-10-18 Thread Lance Java
Strange to hear you talk that way of the tapestry implementation. I personally think it's some of the best code I've seen and I genuinely think that familiarising myself with the tapestry source code has made me a better developer. Everything is overridable and there are many seams where you can in

Re: tapestry-cometd && tynamo-security

2013-10-22 Thread Lance Java
Hi Jarda, I'm not familiar with tynamo security but I'm the author of tapestry-cometd. I think your analysis of the problem is spot on. Just because SecurityComponentRequestFilter is ordered before:* doesn't mean your filter can't be ordered before it. Just find out the name/id of the SecurityComp

Re: tapestry-cometd && tynamo-security

2013-10-23 Thread Lance Java
tapestry-cometd has always used ParallelExecutor to render content so that the current thread is not polluted with PerThreadValues. tapestry-offline was only created to extract the offline rendering into a reusable module. I suspect that Jarda has security on his push event and maybe Boris only ha

Re: Datatables warning when using

2013-10-24 Thread Lance Java
Note that @Import can also be placed on render methods (eg setupRender) instead of annotating at the class level. If used on a render method, the import will only happen when the component is actually rendered. This might be cleaner in this case.

Re: Embedding a file on a page using StreamResponse from another component.

2013-10-24 Thread Lance Java
Can't you just check the user has permissions before serving the file? Throwing exception if they're not authorised. BTW using local files is usually a bad idea (portability, scalability, transactions etc). Have you considered storing in the db or a blobstore?

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Lance Java
Martin, again you are saying @CommitAfter is broken when it's not. It's your understanding of @CommitAfter that is broken :) CommitAfter does exactly what is says on the tin, it commits the current transaction after it executes the method.

Re: How to do a Batch transaction with Tapestry-Hibernate

2013-10-25 Thread Lance Java
I'm assuming a fork is broken too because it's no good for eating soup? Sounds like you need a spoon, it's easy to write your own annotation... Perhaps you want a @MaybeCommitAfter ;)

Re: [5.4.23] Troubleshooting Live Class Reloading

2013-10-25 Thread Lance Java
Just a stab in the dark here but are you using maven and using a version number NOT suffixed with "-SNAPSHOT" if you are this will cause problems as maven assumes that non snapshot versions (releases) are static.

Re: uberValidator for all text input fields

2013-10-25 Thread Lance Java
You could add an implicit mixin to every textfield using a ClassTransformWorker2. See Taha's blog post here http://tawus.wordpress.com/2011/08/01/tapestry-mixins-classtransformations/

Re: fault found

2011-11-28 Thread Lance Java
This sounds like an IE bug I encountered years ago. Are you using an old version of IE (5 perhaps). From memory, IE sends two requests for the PDF and then Acrobat sends one itself. My solution at the time (I don't have access to the code) involved ignoring two of the requests and only returning c

Re: Tapestry 5 and Mobile

2011-11-28 Thread Lance Java
Igor's template skinning blog entry might help too: http://blog.tapestry5.de/index.php/2011/06/24/template-skinning/ On Monday, 28 November 2011, Peter Stavrinides wrote: > Those are fantastic resources, thank you François! > > > > - Original Message - > From: "François Facon" > To: "Tap

Re: How to handle urls for a White Label site

2011-12-21 Thread Lance Java
1. You would want to use tapestry's URL rewriting support to remove "whitelabelpartnerX" from the URL before passing it down the request processing pipeline. 2. As your URLRewriterRule removes the whitelabelpartner from the url, it should push it onto the Environment so that it can be accessed lat

Custom Google Maps Geocode Component

2012-01-01 Thread Lance Java
Hi, I'd like to create a component which does the following 1. Displays an "address" text field and a "find" button and two hidden fields for "latitude" and "longitude" 2. Clicking on the "find" button invokes the googlemaps geocoding API clientside ( http://code.google.com/apis/maps/documentation/

Re: T5 progress bar in a grid

2012-01-03 Thread Lance Java
There are a couple of approaches to do this, since tapestry does not support ajax push (aka reverse ajax) out-of-the box, a simple solution would be to have the client poll the server for the current percentage complete. In order to display a progress bar to the client, you must do the actual work

Re: T5 progress bar in a grid

2012-01-03 Thread Lance Java
else { jsSupport.addScript("setTimeout(\"Tapestry.activateZone('%s', '%s');\", %s);", zoneId, url, pollDelayMillis); } } }); } } On 3 January 2012 10:34, Lance Java wrote: > There are a couple of approaches to do this, since tapestry does not > suppor

Eventlink - Ajax without zone parameter

2012-01-05 Thread Lance Java
Correct me if I'm wrong but currently, if you want an eventlink to use ajax, you must provide a "zone" parameter. This may have been fine in early versions of tapestry 5 but there are now circumstances where we want an eventlink to be done via XHR but shouldn't need to specify a zone in the tml. Th

Re: [5.2] how to read the 'for' attribute of a t:label in a mixin ?

2012-01-11 Thread Lance Java
@Inject ComponentResources and call getInformalParameter(String name, Class type) Cheers, Lance. On Wednesday, 11 January 2012, ffred wrote: > Hello, > I'm trying to develop a mixin for t:label component in which i need to get > the value of the 'for' attribute. > I currently find no way of doin

Re: [5.2] how to read the 'for' attribute of a t:label in a mixin ?

2012-01-11 Thread Lance Java
Hmm... perhaps you have the Mixin's ComponentResources instead of the label's ComponentResources. How about @Inject ComponentResources resources; String for = resources.getContainerResources().getInformalParameter("for", String.class); On Wednesday, 11 January 201

Re: [5.2] how to read the 'for' attribute of a t:label in a mixin ?

2012-01-11 Thread Lance Java
apestry5.Field field; Perhaps that weill help On Wednesday, 11 January 2012, Lance Java wrote: > Hmm... perhaps you have the Mixin's ComponentResources instead of the label's ComponentResources. > > How about > > @Inject ComponentResources resources; >

Re: Eventlink - Ajax without zone parameter

2012-01-12 Thread Lance Java
, Jan 5, 2012 at 5:35 PM, Igor Drobiazko > wrote: > Maybe we should reuse zone paramater by passing a special zone id like > zone="*". There is already a special id ^, which means the first > > container > > zone. > > I like this idea. > I''m using

Re: T5.3 Grid sorting

2012-01-12 Thread Lance Java
This could be done via a mixin like this (untested) public class DontSort { @InjectComponent private Grid grid; @Parameter(required="true") private String unsorted; @SetupRender void setupRender() { BeanModel model = grid.getDataMod

Re: Creating Model objects

2012-01-17 Thread Lance Java
For me, it's mainly about maintainability Consider the following public class ViewPersonPage { @Property @Persist private int dobDay, dobMonth, dobYear; ... } public class EditPersonPage { @Property @Persist private int dobDay, dobMonth, dobYear; ... } public interface P

Re: Programmatical page/component rendering

2012-01-20 Thread Lance Java
Since you are generating plain text, not HTML, I would probably not use tapestry templating to generate the text. Depending on how simple your email is, you may find that using the message catalog and a find-and-replace is easy enough. Otherwise, I would use freemarker, a tempting engine with loc

Re: Stuts VS Tapestry - I need some ammo

2012-01-26 Thread Lance Java
One killer argument is SEO (search engine optimisation). Is your webapp publicly available and do you want to appear high in google results? Whilst google's algorithms are hidden, it is known that if searching for a ferarri, a site like www.mysite.com/cars/ferarri will appear higher in the searc

Re: Stuts VS Tapestry - I need some ammo

2012-01-26 Thread Lance Java
. It saves much time, and time is money. Explain your > managers every deployment costs 4 minutes, you need to do 15 a day. > > Cheers > > > On Thu, Jan 26, 2012 at 11:44 AM, Lance Java wrote: >> One killer argument is SEO (search engine optimisation). Is your webapp >>

Fwd: How to add component to all pages

2012-02-03 Thread Lance Java
If you use a layout component for all of your pages you could simply add the to the layout http://tapestry.apache.org/layout-component.html -- Forwarded message -- From: Yohan Yudanara Date: Friday, 3 February 2012 Subject: How to add component to all pages To: Tapestry users

Re: Mixins and SupportsInformalParameters bug?

2012-02-03 Thread Lance Java
I'm prettty sure that @SupportsInformalParameters is just a marker so that informal parameters are available serverside. In order to write the informal parameters to the html you must @Inject ComponentResources and call renderInformalParameters(MarkupWriter) On Friday, 3 February 2012, Barry Book

Re: Tapestry TreeGrid

2012-02-07 Thread Lance Java
I have done similar things in the past using a flat database structure to build a nested structure. public class Node { private Integer nodeId; // stored in database private String description; // stored in database private Integer parentId; // stored in database private List childNode

Re: Tapestry TreeGrid

2012-02-07 Thread Lance Java
Since tapestry's tree is ajax enabled... you will need to modify the code slightly (db structure can remain the same). Instead of getting the entire tree, you will get a single node and it's first level children for each ajax request. On Tuesday, 7 February 2012, Lance Java wrote: >

Re: Tapestry TreeGrid

2012-02-07 Thread Lance Java
When I said "flat database" I was simply referring to the fact that I was using a single table to represent nested data. I'm talking about a relational database too. > Anyhow, I'm using a single table with a parent node in each row. If parent is null, it becomes the root, other wise it would beco

Re: Tapestry TreeGrid

2012-02-08 Thread Lance Java
The query to get the tree from the db depends on how you are accessing it. If you were to get the entire tree from the db in a single request then the best approach is to do a single query for all the tree nodes and then join them in java (see my earlier code example). The biggest no-no here would

<    7   8   9   10   11   12   13   14   15   16   >