Re: Conditional rendering of HTML attribute

2013-01-15 Thread Arno Haase
That was exactly what I needed, works like a charm. Thanks! Am 15.01.2013 17:48, schrieb Lance Java: > Tapestry will only render an attribute that is not null. But you > need to be aware of the following: 1. For foo="${x}" the value will > be the empty string if getX() is null 2. For foo="prop:x"

Conditional rendering of HTML attribute

2013-01-15 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, the following example is extremely simplified, but the underlying problem is real. I have a custom component with an optional parameter 'x'. If the parameter is present, I want to render Hello otherwise I want the same thing but without the HTM

Switching assets based on something different than language

2012-12-19 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tapestry has a great mechanism to switch assets based on the user's language. Now I would like to have something like that based not on language but the user's tenant (the system is multi-tenanted). So - what is the preferred approach to switch assets

Re: Confusion about tapestry singleton page

2012-06-05 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I tried to reproduce that (being the curious person that I am ;-) ), but the constructor of a page is called only once on my machine - just as one would expect (Tap 5.3.3) If you want to analyze I suggest adding new Error().printStackTrace(); to you

Re: javascript and tapestry - reloading a list

2012-06-03 Thread Arno Haase
render the same markup, you can @InjectComponent the zone and return zone.getBody(): ... @InjectComponent Zone myZone; ... public Object onMyEvent() { ... return myZone.getBody(); } Hope this helps - - Arno > > thx... > > 2012/6/3 Arno Haase [via Tapestry] &l

Re: javascript and tapestry - reloading a list

2012-06-03 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Been offline the last couple of days. Your event handler returns a JSONArray which is probably not what you want. You wrote initially that you would like Tapestry to re-render your zone. The straight-forward way to do that is to put your rendering co

Re: javascript and tapestry - reloading a list

2012-05-30 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If you use a zone, you can call var zoneObject=Tapestry.findZoneManagerForZone(''); zoneObject.updateFromURL('', {}); in JS. When generating the JS code in your TML, you can generate the correct URL by having something like the following in your pag

Re: Building object through wizard.

2012-05-25 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi George, using some sort of conversation (i.e. HTTP session) state is one way to go - you would either detach the entities or use some sort of specialized Transfer Objects. Another way to go is to put the wizard into a single Tapestry page and use

Re: [OT] J2EE write to filesystem & JEE6

2012-05-25 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 JEE application servers typically do not actually prevent you from accessing the file system, and the spec does not require them to. So if it works with your specific app server / jee stack, you are home free. The spec prohibits accessing the file sys

My dynamic tree component - feedback invited

2012-05-23 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, Tapestry has a tree component, but it focuses on one specific way of using trees. In the project I am currently working on, we would like to use trees in a different way. So I got down and started creating a tree component, open sourcing it:

Re: T5.3 's Tree in a Loop

2012-05-23 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sorry, my mistake - I replied without really thinking... I was thinking about a similar phenomenon when a loop contains links that refer to the loop variable, e.g. as their context. Then you need to use 'deferred="true"' with the links. As Lance wrot

Re: T5.3 's Tree in a Loop

2012-05-23 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 try adding deferred="false" to the loop - see javadoc for explanations. Am 23.05.2012 15:09, schrieb Nicolas Barrera: > Hi, > > I got the need to show a dynamic number of tree components in a > page, I thought about using a loop around a tree comp

Re: How to send the selected button value from tml page to corr. java page

2012-05-15 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Your encoder returns null both ways - that is probably the cause for your NPE. It is responsible for storing (and retrieving) the collection elements of the loop for the time between rendering and submit - returning null basically means that all eleme

Re: How to send the selected button value from tml page to corr. java page

2012-05-15 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 could you post your entire page (java + tml)? Am 15.05.2012 14:47, schrieb karthi: > I just interchanged this > > context="videoItem.position" defer="false" > t:value="${videoItem.name}" /> > > to > > defer="false" t:value="${videoItem.position}"

Re: Component with several bodies

2012-05-15 Thread Arno Haase
ix = BindingConstants.BLOCK) @Property > private Block myBlock; > > @Inject private Block myDefaultBlock; > > Block defaultMyBlock(){ return myDefaultBlock; } > > } > > > > > > > My Default Content... > > > regards Taha > > &g

Component with several bodies

2012-05-15 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 It is straightforward to build a component that embeds a single body, using . I would like to extend that so that a component can have several bodies. For example, I would like to build a layout component that allows a page to contribute to the title

Re: How to send the selected button value from tml page to corr. java page

2012-05-15 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Using the context attribute is the way to go. It's plain 'context' and not 't:context', though. The context must be a primitive (or encoded as a primitive), so I would recommend you start by passing only the position value="videoItem.position" There

Re: referencing a form from JS

2012-05-14 Thread Arno Haase
.identify().match(re)) { str = e.identify(); return; } }); >> return str; } >> >> >> We'd use it like: >> >> > style="width:80px;" onblur="aec(this)" onchange="initLow('low1', >> 'high0');"/> &g

Re: referencing a form from JS

2012-05-12 Thread Arno Haase
).each(function(e) { if > (e.identify().match(re)) { str = e.identify(); return; } }); return > str; } > > > We'd use it like: > > style="width:80px;" onblur="aec(this)" onchange="initLow('low1', > 'high0');"/> > >

Re: referencing a form from JS

2012-05-12 Thread Arno Haase
elp: > > http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/com/flowlogix/web/mixins/DisableAfterSubmit.js > > Notice setSubmittingElement() call > > > On May 12, 2012, at 10:45 AM, Arno Haase > wrote: > > It does, unfortunately

Re: referencing a form from JS

2012-05-12 Thread Arno Haase
inspection after an AJAX refresh of the zone shows ... Am 12.05.2012 17:17, schrieb Thiago H. de Paula Figueiredo: > On Sat, 12 May 2012 11:59:42 -0300, Arno Haase > wrote: > >> So referencing the form by its ID is out, since the form is >> assigned a new and di

referencing a form from JS

2012-05-12 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I want a JavaScript event handler to programatically submit a form. This works well using form.performSubmit() (I want Tapestry's AJAX submit). The tricky part is that the form being submitted is part of the zone that is being refreshed by the submit,

Re: Best Practices for @Persist

2012-05-07 Thread Arno Haase
, 07 May 2012 11:34:02 -0300, Arno Haase > wrote: > >> Thanks for pointing out Tynamo! I'll look into it, looks like it >> is what I was looking for. > > I forgot to mention something: > > * Try to avoid using @Persist. In many scenarios the page > activa

Re: Best Practices for @Persist

2012-05-07 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for pointing out Tynamo! I'll look into it, looks like it is what I was looking for. Am 07.05.2012 15:14, schrieb Thiago H. de Paula Figueiredo: > On Mon, 07 May 2012 10:08:40 -0300, Arno Haase > wrote: > >> I know the m

Best Practices for @Persist

2012-05-07 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I know the mechanics of @Persist and Session State. But I am looking for advice on how to deal with some common challenges using Tapestry: * Let's say a page stores stuff in the HttpSession using @Persist - directly or e.g. through use of the Grid com

Re: Best place to initialize form data

2012-05-07 Thread Arno Haase
start.doublenegative.com.au/jumpstart/ > > Cheers, > > Geoff > > On 06/05/2012, at 3:41 PM, Arno Haase wrote: > > That is a great link, thanks for pointing it out. Is there also a > page with the same information for AJAX calls? It is mentioned but > I could not find i

Re: getting the object in a row from a grid component

2012-05-07 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 As I see it, it boils down to one of two cases. A) You somehow store the entire row objects - either in the session (with the obvious drawbacks and limitations) or in hidden fields etc. (with the obvious drawbacks and limitaitions). This should be nec

Re: Best place to initialize form data

2012-05-06 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ah, I see - thanks! Am 06.05.2012 14:37, schrieb Thiago H. de Paula Figueiredo: > On Sun, 06 May 2012 02:41:13 -0300, Arno Haase > wrote: > >> PS: What's the 'relative assets pitfall'? > > Imagine you have a p

Re: Best place to initialize form data

2012-05-05 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 > you can use the onActivate method in the following form: > > class MyPage { @Property String x; > > public onActivate(EventContext context) { if (context.getCount() > > 0) { this.x = context.get(String.class, 0); } else { this.x = > "default value"

Re: Best place to initialize form data

2012-05-05 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 That is a great link, thanks for pointing it out. Is there also a page with the same information for AJAX calls? It is mentioned but I could not find it. PS: What's the 'relative assets pitfall'? Am 05.05.2012 04:59, schrieb Geoff Callender: > Just t

Re: Best place to initialize form data

2012-05-04 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> Thanks for the help - onActivate() at least looks better than >> all ideas I had come up with. It still does not seem like an >> elegant, intuitive solution to me. > > Why not elegant and intuitive? To me, they are. :) Just curious. > ;) If a page

Re: Best place to initialize form data

2012-05-04 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks for the help - onActivate() at least looks better than all ideas I had come up with. It still does not seem like an elegant, intuitive solution to me. - - Arno Am 04.05.2012 21:27, schrieb Norman Franke: > On May 4, 2012, at 12:52 PM, Thiago H

Re: Best place to initialize form data

2012-05-04 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> onPrepare() is called before data binding, but it is called >> again after data binding. So simple initialization code in >> onPrepare() would overwrite the form data with the default. > > This isn't correct. It's called once per request. And Tapes

Best place to initialize form data

2012-05-04 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi everyone, this may be an obvious newbie question, but I have found no answer that looks good to me. Anyway, here goes: What is the best place to initialize a property with a default value for a form? I am looking at a page that makes heavy use of

Re: How do you feel about requiring JRE 1.6 for Tapestry 5.4?

2012-05-02 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 +1 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk+hDU0ACgkQbmZsMyUPuXTuCgCeNSLptu3MMhsSrlKcLZVo3Yw6 KL0AoODvsdVuEYvMn1MSeTF3r2UvVVHR =nqZF -END PGP SI

Re: T5.3 Component with AJAX Form?

2012-04-30 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thanks! This looks like what I was looking for. Looking forward to playing around with it ;-) Am 01.05.2012 06:29, schrieb Lenny Primak: > http://code.google.com/p/flowlogix/source/browse/tapestry-services/src/main/resources/com/flowlogix/web/mixins/D

Re: T5.3 Component with AJAX Form?

2012-04-30 Thread Arno Haase
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have the same problem. Googling, the only thing I came up with was this: http://tapestry.1045711.n5.nabble.com/Tapestry-5-3-rc3-Page-must-be-specified-before-initializing-for-partial-page-render-td4966505.html It mentions creating an "AjaxLink" co