Re: method call with parameters inside TML ?

2011-09-15 Thread Robert Zeigler
As long as the java function isn't static/is "reachable" from a property path 
where the root object is the page.

So assuming min is a function in your page or component class, then yes:

${min(tableColumns, itemsPerPage))

Or:



Robert

On Sep 15, 2011, at 9/1511:15 PM , Ken in Nashua wrote:

> 
> Hi All,
> 
> T5
> 
> Can I reference a java function inside my template with parameters ?
> 
> min(tableColumns, ${itemsPerPage})
> 
> thanks
> 
> 
> 


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



method call with parameters inside TML ?

2011-09-15 Thread Ken in Nashua

Hi All,

T5

Can I reference a java function inside my template with parameters ?

min(tableColumns, ${itemsPerPage})

thanks


  

Re: outputting expression logic

2011-09-15 Thread Steve Eynon
Some call it clutter, I call it refactor safe!

A problem I often saw with T4 is people tended to push as much logic
as they could into the .tml - with the pain they encountered
afterwards, I wondered why they didn't just stick to JSPs?!

And



does nothing more than

${cursor} + 1

as all outputRaw does is evaluate your expression and write out as
raw, un-escaped HTML.

Steve.

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



RE: outputting expression logic

2011-09-15 Thread Ken in Nashua

So far I have to clutter up my component with this.. wish I could just do 
it in the tml like ognl as-is in t-4.1.2
not interested in chenelle

@Persist("session")
@Property
private int cursorStartPosition;

@Persist("session")
@Property
private int cursorEndPosition;

@Persist("session")
@Property
private int collectionSize;

@BeginRender
public void beginRender()
{
itemsPerPage = 50;
tableColumns = 3;

/**
 *  auto paging metrics
 */
cursorStartPosition = cursor + 1;

cursorEndPosition = cursor + (collection == null ? 0 : 
java.lang.Math.min(collection.size(), itemsPerPage));

collectionSize = (collection == null ? 0 : collection.size());
}

kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: RE: outputting expression logic
Date: Thu, 15 Sep 2011 22:53:18 -0400








I guess I am asking for an ognl engine... to do these calculations within tml 
files

be nice if there were an expression operator in T5 to do these...

guess I will have to make a java method...

any solutions or canonical approach are appreciated...

kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: RE: outputting expression logic
Date: Thu, 15 Sep 2011 22:47:03 -0400










this seems to produce "0 + 1" instead of the desired "1"

all i am trying to do is have the arithmetic performed before the output

thanks
kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: outputting expression logic
Date: Thu, 15 Sep 2011 22:00:46 -0400








Hi All,

I have this expression in a component definition...

${cursor} + 1

For my case cursor is initially 0

After render... I view page source and I see the following...

0 + 1

when what I actually wanted to see is... the sum of the expression and the 
value rendered...

1

Any tips on how i can do this ? Is there an arithmetic or expression operator 
that I can prefix before my "${cursor} + 1" ?

Thanks


  

RE: outputting expression logic

2011-09-15 Thread Ken in Nashua

I guess I am asking for an ognl engine... to do these calculations within tml 
files

be nice if there were an expression operator in T5 to do these...

guess I will have to make a java method...

any solutions or canonical approach are appreciated...

kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: RE: outputting expression logic
Date: Thu, 15 Sep 2011 22:47:03 -0400










this seems to produce "0 + 1" instead of the desired "1"

all i am trying to do is have the arithmetic performed before the output

thanks
kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: outputting expression logic
Date: Thu, 15 Sep 2011 22:00:46 -0400








Hi All,

I have this expression in a component definition...

${cursor} + 1

For my case cursor is initially 0

After render... I view page source and I see the following...

0 + 1

when what I actually wanted to see is... the sum of the expression and the 
value rendered...

1

Any tips on how i can do this ? Is there an arithmetic or expression operator 
that I can prefix before my "${cursor} + 1" ?

Thanks

  

RE: outputting expression logic

2011-09-15 Thread Ken in Nashua



this seems to produce "0 + 1" instead of the desired "1"

all i am trying to do is have the arithmetic performed before the output

thanks
kcola...@live.com
 



From: kcola...@live.com
To: users@tapestry.apache.org
Subject: outputting expression logic
Date: Thu, 15 Sep 2011 22:00:46 -0400








Hi All,

I have this expression in a component definition...

${cursor} + 1

For my case cursor is initially 0

After render... I view page source and I see the following...

0 + 1

when what I actually wanted to see is... the sum of the expression and the 
value rendered...

1

Any tips on how i can do this ? Is there an arithmetic or expression operator 
that I can prefix before my "${cursor} + 1" ?

Thanks

  

Re: outputting expression logic

2011-09-15 Thread Taha Hafeez
Hi

Tapestry property expressions do not support arithmetic operations. See

http://tapestry.apache.org/property-expressions.html

for complete list of operations supported


On Fri, Sep 16, 2011 at 7:30 AM, Ken in Nashua  wrote:
>
> Hi All,
>
> I have this expression in a component definition...
>
>     ${cursor} + 1    
>
> For my case cursor is initially 0
>
> After render... I view page source and I see the following...
>
> 0 + 1
>
> when what I actually wanted to see is... the sum of the expression and the 
> value rendered...
>
> 1
>
> Any tips on how i can do this ? Is there an arithmetic or expression operator 
> that I can prefix before my "${cursor} + 1" ?
>
> Thanks
>



-- 
Regards

Taha Hafeez Siddiqi (tawus)
http://tawus.wordpress.com

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



outputting expression logic

2011-09-15 Thread Ken in Nashua

Hi All,

I have this expression in a component definition...

${cursor} + 1

For my case cursor is initially 0

After render... I view page source and I see the following...

0 + 1

when what I actually wanted to see is... the sum of the expression and the 
value rendered...

1

Any tips on how i can do this ? Is there an arithmetic or expression operator 
that I can prefix before my "${cursor} + 1" ?

Thanks
  

Re: textchanged like clientEvent

2011-09-15 Thread Thiago H. de Paula Figueiredo
On Thu, 15 Sep 2011 19:35:14 -0300, leothelion   
wrote:



Hi all,


Hi!

I trying to trigger a clientEvent so that whenever the text in the field  
is changed, the other fields can be updated automatically. Is there a  
thing

like "textchanged"? I tried "keyup" or "mouseup", but neither works as
expected.


This is a pure JavaScript question, not related to Tapestry at all, so I'm  
quite lazy to answer it at this moment . . .


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Re: Tapestry 5.3-beta-8

2011-09-15 Thread Howard Lewis Ship
I was working with a client and put a bunch of code to prevent
deadlocks in place for beta-8 ... but it looks like it only made the
deadlock situation worse; they'll be pulled out for beta-9 (due pretty
shortly).

On Thu, Sep 15, 2011 at 7:53 AM, Steve Eynon
 wrote:
> Hi,
>
> I don't know if this is related, but I can make my app server (Jetty
> 6) lock up in a repeatable and reliable fashion using T5.3-beta-8
> which doesn't happen with T5.3-beta-6 - but it's only when I have
> ProdMode set to true. The steps are:
>
> - I log into my app (via 2 pages in Firefox v3.6), thereby creating
> some session state.
> - I restart the app server
> - I then directly request the home page - http://localhost:8080/
> - I get a partial render (probably browser caching) and the request
> never completes. The app then won't serve up any more pages. Not even
> if I use a different browser, i.e. Chrome.
>
> I tried the procedure 4 times in a row (just to make sure!) with the
> same results. I set ProdMode to false, and all was okay again. I
> turned ProdMode back to true, downgraded to T5.3-beta-6 and still no
> problems.
>
> As it wasn't specified exactly what changed between versions, its
> difficult to know if this post is relevant or not, but I thought I'd
> post it just in case...
>
> Here are some partial Thread dumps from when it locked up with
> T5.3-beta-8. Oh, and I'm using JDK 5.0.22... (I know, I know, but I
> have no control over the prod env!)
>
> Thread [22552192@qtp-30702379-0] (Suspended)
>        Unsafe.park(boolean, long) line: not available [native method]
>        LockSupport.park() line: 118
>        AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: 716
>        
> ReentrantReadWriteLock$NonfairSync(AbstractQueuedSynchronizer).doAcquireShared(int)
> line: 844
>        
> ReentrantReadWriteLock$NonfairSync(AbstractQueuedSynchronizer).acquireShared(int)
> line: 1159
>        ReentrantReadWriteLock$ReadLock.lock() line: 423
>        ConcurrentBarrier.withRead(Invokable) line: 75
>        ModuleImpl.findOrCreate(ServiceDef3,
> Collection) line: 213
>        ModuleImpl.getService(String, Class) line: 109
>        RegistryImpl.getService(String, Class) line: 448
>        RegistryImpl.getService(Class) line: 695
>        ServiceResourcesImpl(ObjectLocatorImpl).getService(Class) line: 45
>        ServiceInjectionProvider.provideInjection(PlasticField,
> ObjectLocator, MutableComponentModel) line: 43
>         type>($InjectionProvider2_116c58bbc2e23).provideInjection(PlasticField,
> ObjectLocator, MutableComponentModel) line: not available
>        $InjectionProvider2_116c58bbc2e1f.provideInjection(PlasticField,
> ObjectLocator, MutableComponentModel) line: not available
>        InjectWorker$2.run() line: 73
>        OperationTrackerImpl$1.invoke() line: 51
>        OperationTrackerImpl$1.invoke() line: 48
>        OperationTrackerImpl.invoke(String, Invokable) line: 74
>
> Thread [13174783@qtp-30702379-3] (Suspended)
>        Unsafe.park(boolean, long) line: not available [native method]
>        LockSupport.park() line: 118
>        AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: 716
>        
> ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(AbstractQueuedSynchronizer$Node,
> int) line: 746
>        ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) 
> line: 1076
>        ReentrantLock$NonfairSync.lock() line: 184
>        ReentrantLock.lock() line: 256
>        ComponentInstantiatorSourceImpl.getInstantiator(String) line: 217
>        $ComponentInstantiatorSource_116c58bbc2e12.getInstantiator(String)
> line: not available
>        PageLoaderImpl$4.invoke() line: 205
>        PageLoaderImpl$4.invoke() line: 203
>        OperationTrackerImpl.invoke(String, Invokable) line: 74
>        PerThreadOperationTracker.invoke(String, Invokable) line: 87
>        RegistryImpl.invoke(String, Invokable) line: 1082
>        PageLoaderImpl.createAssembler(String, ComponentResourceSelector) 
> line: 203
>        PageLoaderImpl.getAssembler(String, ComponentResourceSelector) line: 
> 194
>        PageLoaderImpl$3.invoke() line: 168
>        PageLoaderImpl$3.invoke() line: 164
>        OperationTrackerImpl.invoke(String, Invokable) line: 74
>
>
> Thread [17265362@qtp-30702379-5] (Suspended)
>        Unsafe.park(boolean, long) line: not available [native method]
>        LockSupport.park() line: 118
>        AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: 716
>        
> ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(AbstractQueuedSynchronizer$Node,
> int) line: 746
>        ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) 
> line: 1076
>        ReentrantLock$NonfairSync.lock() line: 184
>        ReentrantLock.lock() line: 256
>        ComponentInstantiatorSourceImpl.getInstantiator(String) line: 217
>        $ComponentInstantiatorSource_116c58bbc2e12.getInstantiator(String)
> line: not available
>        PageLoaderImpl$4.invoke

textchanged like clientEvent

2011-09-15 Thread leothelion
Hi all,

I trying to trigger a clientEvent so that whenever the text in the field is
changed, the other fields can be updated automatically. Is there a thing
like "textchanged"? I tried "keyup" or "mouseup", but neither works as
expected.

Thanks!

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/textchanged-like-clientEvent-tp4808658p4808658.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: [T5.3-beta-6] Not Ready For Production!

2011-09-15 Thread Howard Lewis Ship
Nice trick ... I wonder what the Gradle equivalent is.  We may be
doing it the hard way right now.

On Thu, Sep 15, 2011 at 10:50 AM, Martin Strand
 wrote:
> On Wed, 14 Sep 2011 15:57:11 +0200, Steve Eynon
>  wrote:
>
>> Yep, looks like you can't inject SymbolSource into your
>> ApplicationDefaults contribution method when ProdMode is set to true;
>> bit of a pain because I was using it to extract my webapp version for
>> setting as the tapestry.app-version.
>
>
> As a side note, an easy way to automatically set the version number is to
> read it from the jar's manifest:
>
> contributeApplicationDefaults(...)
> {
>
>  String version = YourModule.class.getPackage().getImplementationVersion();
>  if (version != null)
>  {
>    configuration.add(SymbolConstants.APPLICATION_VERSION, version);
>  }
>
>
>
> With Maven, use addDefaultImplementationEntries to add version info to the
> manifest:
>
> 
>  org.apache.maven.plugins
>  maven-jar-plugin
>  
>    true
>    
>      
>
>  true
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Free Tapestry Laptop Stickers

2011-09-15 Thread Howard Lewis Ship
I just got in the second batch of Tapestry laptop stickers.  Do you
want one?  They're free --- all I ask is that you share your Tapestry
story (or tell me not too).  Details on my blog:

http://tapestryjava.blogspot.com/2011/08/tapestry-5-laptop-stickers.html

For those who previously responded and are still waiting for them ...
I'll be getting a big batch of them out shortly!

-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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



Re: Any Element Name for Embedded Components?

2011-09-15 Thread Thiago H. de Paula Figueiredo
On Thu, 15 Sep 2011 09:19:36 -0300, Katherine Luxton  
 wrote:



Hi


Hi!

I have a tapestry page which contains a custom component; and I always  
thought that the element name given to for the component within the TML  
file was used to work out which component to render.


This is correct for the  syntax, not for the  one.

However, in my example below, it seems that I can give this component  
any element name I like and it will still discover what the correct  
Component to render is.  I'm assuming this might be because the embedded  
component has a t:id attribute which is declared in the java class as a  
specific type of component.


You're correct. You've used the @Component annotation, so it defines the  
component class to be used.


You shouldn't use both @Component and  at the same time, as this  
will cause confusion about what (class or template) is defining what  
(component type, parameters, etc).


If you really want to use @Component, it should look like this:

@Component(parameters = {"label=message:dob-label",  
"value=member.securityQuestion.dob", ...})

private DateOfBirth dob;

 (notice the element can be of any tag, but has just the  
t:id attribute).


Or forget about @Component (you don't need it) and leave the template as  
is. If you really need to get the DateOfBirth component instance in your  
class, you should use @InjectComponent, not @Component.


This is the second different question about @Component and  in the  
same component instance in two consecutive days. Interesting. :)


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor

Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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



Any Element Name for Embedded Components?

2011-09-15 Thread Katherine Luxton
Hi

I have a tapestry page which contains a custom component; and I always thought 
that the element name given to for the component within the TML file was used 
to work out which component to render.  However, in my example below, it seems 
that I can give this component any element name I like and it will still 
discover what the correct Component to render is.  I'm assuming this might be 
because the embedded component has a t:id attribute which is declared in the 
java class as a specific type of component.

Is this expected behaviour in Tapesetry?  Is it right that I can use element 
name I like so long as I have a t:id attribute?

Cheers
Katherine


MyPage.java

...
import mypackage.components.DateOfBirth;
...
@Component
private DateOfBirth dob;
…


MyPage.tml

…

…


But if I use this instead; the component is still found and rendered:
…

…



Re: [T5.3-beta-6] Not Ready For Production!

2011-09-15 Thread Martin Strand
On Wed, 14 Sep 2011 15:57:11 +0200, Steve Eynon  
 wrote:



Yep, looks like you can't inject SymbolSource into your
ApplicationDefaults contribution method when ProdMode is set to true;
bit of a pain because I was using it to extract my webapp version for
setting as the tapestry.app-version.



As a side note, an easy way to automatically set the version number is to  
read it from the jar's manifest:


contributeApplicationDefaults(...)
{

  String version =  
YourModule.class.getPackage().getImplementationVersion();

  if (version != null)
  {
configuration.add(SymbolConstants.APPLICATION_VERSION, version);
  }



With Maven, use addDefaultImplementationEntries to add version info to the  
manifest:



  org.apache.maven.plugins
  maven-jar-plugin
  
true

  
true

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



Grid "overrides" question

2011-09-15 Thread cqasker
So say I have a component that wraps a grid like:

SomeGrid.tml
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xmlns:p="tapestry:parameter">

  
  



SomeGrid.java
   @SuppressWarnings("unused")
   @Component(parameters={"overrides=prop:overrides", ...other params...})
   private Grid grid;

   @Parameter(value = "this", allowNull = false)
   @Property(write = false)
   private PropertyOverrides overrides;

A component that contains SomeGrid.tml and it overrides a column:
SomeGridContainer.tml
http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
xmlns:p="tapestry:parameter">
  
test Some Grid Container
  


SomeGridContainer.java
   @SuppressWarnings("unused")
   @Component(parameters={"overrides=prop:overrides", ...other params...})
   private SomeGrid grid;

   @Parameter(value = "this", allowNull = false)
   @Property(write = false)
   private PropertyOverrides overrides;

A page that contains SomeGridContainer
MyPage.tml
  
test Page
  


In SomeGrid and SomeGridContainer I have @SupportsInformalParameters and
inject ComponentResources and pass in the overrides.

in the Name column, "test Page" always shows. I then tried and removed
p:nameCell from myPage.tml and column displayed whatever was in the name
property of the current row.  So it seems p:nameCell in SomeGridContainer is
always ignored. Is this the right behavior? It would be nice if I can get
around this since I can define column parameters in the container component
and not have to redefine them in every page I use. And for cases where I
want to override the ones in the container I can define them in the page.
Anyways interesting behavior.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Grid-overrides-question-tp4807689p4807689.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Tapestry 5.3-beta-8

2011-09-15 Thread Steve Eynon
Hi,

I don't know if this is related, but I can make my app server (Jetty
6) lock up in a repeatable and reliable fashion using T5.3-beta-8
which doesn't happen with T5.3-beta-6 - but it's only when I have
ProdMode set to true. The steps are:

- I log into my app (via 2 pages in Firefox v3.6), thereby creating
some session state.
- I restart the app server
- I then directly request the home page - http://localhost:8080/
- I get a partial render (probably browser caching) and the request
never completes. The app then won't serve up any more pages. Not even
if I use a different browser, i.e. Chrome.

I tried the procedure 4 times in a row (just to make sure!) with the
same results. I set ProdMode to false, and all was okay again. I
turned ProdMode back to true, downgraded to T5.3-beta-6 and still no
problems.

As it wasn't specified exactly what changed between versions, its
difficult to know if this post is relevant or not, but I thought I'd
post it just in case...

Here are some partial Thread dumps from when it locked up with
T5.3-beta-8. Oh, and I'm using JDK 5.0.22... (I know, I know, but I
have no control over the prod env!)

Thread [22552192@qtp-30702379-0] (Suspended)
Unsafe.park(boolean, long) line: not available [native method]  
LockSupport.park() line: 118
AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: 716

ReentrantReadWriteLock$NonfairSync(AbstractQueuedSynchronizer).doAcquireShared(int)
line: 844

ReentrantReadWriteLock$NonfairSync(AbstractQueuedSynchronizer).acquireShared(int)
line: 1159
ReentrantReadWriteLock$ReadLock.lock() line: 423
ConcurrentBarrier.withRead(Invokable) line: 75   
ModuleImpl.findOrCreate(ServiceDef3,
Collection) line: 213
ModuleImpl.getService(String, Class) line: 109   
RegistryImpl.getService(String, Class) line: 448 
RegistryImpl.getService(Class) line: 695 
ServiceResourcesImpl(ObjectLocatorImpl).getService(Class) line: 45   
ServiceInjectionProvider.provideInjection(PlasticField,
ObjectLocator, MutableComponentModel) line: 43
($InjectionProvider2_116c58bbc2e23).provideInjection(PlasticField,
ObjectLocator, MutableComponentModel) line: not available
$InjectionProvider2_116c58bbc2e1f.provideInjection(PlasticField,
ObjectLocator, MutableComponentModel) line: not available
InjectWorker$2.run() line: 73   
OperationTrackerImpl$1.invoke() line: 51
OperationTrackerImpl$1.invoke() line: 48
OperationTrackerImpl.invoke(String, Invokable) line: 74  

Thread [13174783@qtp-30702379-3] (Suspended)
Unsafe.park(boolean, long) line: not available [native method]  
LockSupport.park() line: 118
AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: 716

ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(AbstractQueuedSynchronizer$Node,
int) line: 746
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) 
line: 1076   
ReentrantLock$NonfairSync.lock() line: 184  
ReentrantLock.lock() line: 256  
ComponentInstantiatorSourceImpl.getInstantiator(String) line: 217   
$ComponentInstantiatorSource_116c58bbc2e12.getInstantiator(String)
line: not available
PageLoaderImpl$4.invoke() line: 205 
PageLoaderImpl$4.invoke() line: 203 
OperationTrackerImpl.invoke(String, Invokable) line: 74  
PerThreadOperationTracker.invoke(String, Invokable) line: 87 
RegistryImpl.invoke(String, Invokable) line: 1082
PageLoaderImpl.createAssembler(String, ComponentResourceSelector) line: 
203 
PageLoaderImpl.getAssembler(String, ComponentResourceSelector) line: 
194
PageLoaderImpl$3.invoke() line: 168 
PageLoaderImpl$3.invoke() line: 164 
OperationTrackerImpl.invoke(String, Invokable) line: 74  


Thread [17265362@qtp-30702379-5] (Suspended)
Unsafe.park(boolean, long) line: not available [native method]  
LockSupport.park() line: 118
AbstractQueuedSynchronizer.parkAndCheckInterrupt() line: 716

ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquireQueued(AbstractQueuedSynchronizer$Node,
int) line: 746
ReentrantLock$NonfairSync(AbstractQueuedSynchronizer).acquire(int) 
line: 1076   
ReentrantLock$NonfairSync.lock() line: 184  
ReentrantLock.lock() line: 256  
ComponentInstantiatorSourceImpl.getInstantiator(String) line: 217   
$ComponentInstantiatorSource_116c58bbc2e12.getInstantiator(String)
line: not available
PageLoaderImpl$4.invoke() line: 205 
PageLoaderImpl$4.invoke() line: 203 
OperationTrackerImpl.invoke(String, Invokable) line: 74  

Thread [5553796@qtp-30702379-4] (Suspended) 
JustInTim

Re: Ajax events, expired session and @Persist fields

2011-09-15 Thread Lenny Primak
Thanks Thiago. I will try all these options and report the results. 



On Sep 14, 2011, at 5:19 PM, "Thiago H. de Paula Figueiredo" 
 wrote:

> On Wed, 14 Sep 2011 16:25:14 -0300, Lenny Primak  
> wrote:
> 
>> This is a design/best practices question.
>> We set up @Persist fields inside @SetupRender method.
>> When a session is invalid/expired and an Ajax event is called,
>> All these fields at null.
>> The question is if there is a better way to handle this situation than 
>> having to check for Null in every Ajax event method for every @Persist field?
> 
> You don't need to check all of them, just whether Request.getSession(false) 
> returns null or not.
> 
>> I was thinking that @SetupRender should be called in case of session 
>> expiration during Ajax call.
> 
> I don't like this solution at all, as it uses a component event handler for 
> doing something completely unrelated to rendering. You can even write class 
> transformation to add some logic to be executed in AJAX requests when the 
> session isn't valid. Taha wrote something similar (the @XHR annotation) in 
> his Tapestry Magic blog: 
> http://tawus.wordpress.com/2011/04/16/tapestry-magic-2-ajax-with-graceful-degradation/.
> 
> On the other hand, I guess it's possible to implement a service that notifies 
> listeners when the session is killed. I don't think it's possible to discern 
> between timeout and normal session invalidation.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and 
> instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
> 

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



Re: Using layouts - partial page templates

2011-09-15 Thread dkeenan
Thank you s much!. That's exactly what I've been looking for. Should have
read more closely.

Cheers,

David.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806882.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Using layouts - partial page templates

2011-09-15 Thread Alex Kotchnev
David - try using the t:content element (
http://tapestry.apache.org/component-templates.html). It's supposed to do
exactly what you need - just put it around your "main content" and
everything else would be ignored when the template is rendered.

Cheers,

Alex K

On Thu, Sep 15, 2011 at 9:32 AM, dkeenan wrote:

> Hi. the trouble is when I try to escape everything around the main
> content..
> eg. if the About.tml looks a bit like this...
>
> 
> 
>
> 
>
> 
> about text
> 
>
> 
>
> I want it to have all the body/head tags in the TML file as above, so it
> can
> easily be viewed outiside of tapestry.
>
> But, i want tapestry to use Layout.tml to fill in everyting outside of the
> content, when running live. So i tried doing this approach...
>
> 
> 
> 
>
> 
>
> 
> 
>
> about text
>
> 
> 
>
> 
>
> 
>
>
> I was hoping that tapestry would remove the surrounding html at runtime,
> and
> fill this in using the HTML for my Layout.tml template. But tapestry doesnt
> like removing the above sections as the elements inside the remove tags
> dont
> have matching open close elements.
>
> I know this seems like a really long winded way of doing what I want but I
> cant find anyting simpler. Essentiall i jsut want to have a bunch of TML
> files that can easily be viewed in a browser (nice for the designer), but
> then Tapestry strips out the nav bar at the top and the footer etc. and
> replaces them with ones from Layout.tml.
>
> I wanted to do this so I know that all pages have the correct up to date
> nav
> bar/footer when running live, but the designer can still design against
> full
> html pages?
>
>
> Thanks again,
>
> David.
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806846.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Using layouts - partial page templates

2011-09-15 Thread dkeenan
Hi. the trouble is when I try to escape everything around the main content..
eg. if the About.tml looks a bit like this...







about text




I want it to have all the body/head tags in the TML file as above, so it can
easily be viewed outiside of tapestry.

But, i want tapestry to use Layout.tml to fill in everyting outside of the
content, when running live. So i tried doing this approach...










about text









I was hoping that tapestry would remove the surrounding html at runtime, and
fill this in using the HTML for my Layout.tml template. But tapestry doesnt
like removing the above sections as the elements inside the remove tags dont
have matching open close elements.

I know this seems like a really long winded way of doing what I want but I
cant find anyting simpler. Essentiall i jsut want to have a bunch of TML
files that can easily be viewed in a browser (nice for the designer), but
then Tapestry strips out the nav bar at the top and the footer etc. and
replaces them with ones from Layout.tml.

I wanted to do this so I know that all pages have the correct up to date nav
bar/footer when running live, but the designer can still design against full
html pages?


Thanks again,

David.

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806846.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: Using layouts - partial page templates

2011-09-15 Thread Steve Eynon
Can you elaborate on the  tags not working and a T5 version?
I've not had any trouble with it in the past.

Steve.

Ther is


On 15 September 2011 21:16, dkeenan  wrote:
> Hi there. I'm looking to create a Layout.tml template file to hold the
> header/footer/navigation elements of my page, and then create the content
> within separate files such as Index.tml, About.tml
>
> Obviously, at the moment, when viewing these files outside of Tapestry, they
> just show a snippet of html. It is only when running under tapestry that it
> fills in the surrounding header/body at runtime using the Layout.tml
> template and replacing the  element.
>
> So far so good. But I would like Index.tml and About.tml to look complete
> when viewed as plain files (not running under tapestry), to help our
> designer. Therefore I would like Index.tml and About.tml to have all the
> complete header/body elements.
>
> I tried putting  tags around the html in these files that I want
> tapestry to ignore at runtime (so it can replace them with the contents of
> Layout.tml. But this doesnt seem to work. Is there another way to achieve
> what Im trying to do?
>
> Many thanks,
>
> David.
>
>
>
> Is ther
>

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



Re: [5.3-alpha-13] - Combine/Minify doesn't appear to work ...

2011-09-15 Thread Steve Eynon
Hi,

I had a go at turning on minimization in my app [T5.3-beta-8] with the
following results:

- The content of the files are squished / minimised
- The JS stacks are combined into a single JS file
- All other files are included individually
- JS minimisation often throws exceptions, returning HTTP 500 error
pages instead of JavaScript.

I was rather hoping more files would be combined. For this is now my
standard  list:















Though the exceptions are more of a worry because they prevent the
page from working! Could the minimiser not catch YuiCompressor
exceptions and return the un-compressed version instead?

Some of my own JS code throws similar exceptions, but it works fine
when run through: http://www.refresh-sf.com/yui/ - any ideas on how I
may tidy up my code?

Some sample minimiser exceptions below:


2011-09-15 20:45:51,187 ERROR :  Registry -
java.util.EmptyStackException
2011-09-15 20:45:51,187 ERROR :  Registry - Operations trace:
2011-09-15 20:45:51,187 ERROR :  Registry - [ 1]
Streaming asset stack en/core.js
2011-09-15 20:45:51,187 ERROR :  Registry - [ 2]
Minimizing JavaScript
2011-09-15 20:45:51,359 INFO  :SystemActivity - ERROR:
java.util.EmptyStackException - null
2011-09-15 20:45:51,359 ERROR : RequestExceptionDecorator - null - caused by
null
org.apache.tapestry5.ioc.internal.OperationException
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.logAndRethrow(OperationTrackerImpl.java:121)
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:88)
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.run(OperationTrackerImpl.java:47)
at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.run(PerThreadOperationTracker.java:76)
...
Caused by: java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:79)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.getCurrentScope(JavaScriptCompressor.java:559)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1105)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:553)
at 
org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98)

2011-09-15 20:47:50,859 ERROR :  Registry -
java.util.EmptyStackException
2011-09-15 20:47:50,859 ERROR :  Registry - Operations trace:
2011-09-15 20:47:50,859 ERROR :  Registry - [ 1]
Streaming classpath:org/apache/tapestry5/scriptaculous_1_9_0/controls.js
2011-09-15 20:47:50,859 ERROR :  Registry - [ 2]
Minimizing JavaScript
2011-09-15 20:47:50,953 INFO  :SystemActivity - ERROR:
java.util.EmptyStackException - null
2011-09-15 20:47:50,953 ERROR : RequestExceptionDecorator - null - caused by
Caused by: java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:79)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.getCurrentScope(JavaScriptCompressor.java:559)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSymbolTree(JavaScriptCompressor.java:1105)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.compress(JavaScriptCompressor.java:553)
at 
org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:98)

and

Caused by: java.lang.StringIndexOutOfBoundsException: String index out
of range: 286
at java.lang.String.substring(String.java:1765)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceString(JavaScriptCompressor.java:267)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:330)
at 
com.yahoo.platform.yui.compressor.JavaScriptCompressor.(JavaScriptCompressor.java:533)
at 
org.apache.tapestry5.internal.yuicompressor.JavaScriptResourceMinimizer.doMinimize(JavaScriptResourceMinimizer.java:97)
at 
org.apache.tapestry5.internal.yuicompressor.AbstractMinimizer$1.perform(AbstractMinimizer.java:68)

Steve.




On 15 September 2011 06:32, Howard Lewis Ship  wrote:
> On Wed, Sep 14, 2011 at 11:32 AM, Joe Klecko  wrote:
>> Hi Howard thanks for the reply.   I do have the tapestry-yuicompressor in my
>> pom.xml.  It also appears on the classpath.  Here are tapestry jars on my
>> classpath:
>
> Well, it should be working.
>
> Note that minimization is only for files that are served by Tapestry
> (typically, via the @Import annotation, or via the JavaScriptSupport
> environmental), not arbitrary files in the context.
>
>>
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\org\apache\tapestry\tapestry-core\5.3-alpha-13\tapestry-core-5.3-alpha-13.jar
>> ProjectClassLoader:
>> entry=C:\Users\me\.m2\repository\o

Using layouts - partial page templates

2011-09-15 Thread dkeenan
Hi there. I'm looking to create a Layout.tml template file to hold the
header/footer/navigation elements of my page, and then create the content
within separate files such as Index.tml, About.tml

Obviously, at the moment, when viewing these files outside of Tapestry, they
just show a snippet of html. It is only when running under tapestry that it
fills in the surrounding header/body at runtime using the Layout.tml
template and replacing the  element.

So far so good. But I would like Index.tml and About.tml to look complete
when viewed as plain files (not running under tapestry), to help our
designer. Therefore I would like Index.tml and About.tml to have all the
complete header/body elements.

I tried putting  tags around the html in these files that I want
tapestry to ignore at runtime (so it can replace them with the contents of
Layout.tml. But this doesnt seem to work. Is there another way to achieve
what Im trying to do? 

Many thanks,

David.



Is ther

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Using-layouts-partial-page-templates-tp4806800p4806800.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



Re: commons-codec version

2011-09-15 Thread Michael Dukaczewski
I've noticed that commons-io and commons-fileupload maybe should also be
updated.

https://issues.apache.org/jira/browse/TAP5-1653



Am 15.09.2011 11:21, schrieb Igor Drobiazko:
> There is no reason for using commons-codec-1.3. Please fill a JIRA issue.
> 
> On Thu, Sep 15, 2011 at 10:16 AM, Michael Dukaczewski <
> m.dukaczew...@tu-bs.de> wrote:
> 
>> Is there a reason why Tapestry still uses commons-codec-1.3 from 2004?
>> The current version is 1.5 and I have a project where I need to use the
>> current version. Can there be problems? Would it make sense to link
>> Tapestry generally to the new version?
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
> 
> 

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



Re: commons-codec version

2011-09-15 Thread Igor Drobiazko
There is no reason for using commons-codec-1.3. Please fill a JIRA issue.

On Thu, Sep 15, 2011 at 10:16 AM, Michael Dukaczewski <
m.dukaczew...@tu-bs.de> wrote:

> Is there a reason why Tapestry still uses commons-codec-1.3 from 2004?
> The current version is 1.5 and I have a project where I need to use the
> current version. Can there be problems? Would it make sense to link
> Tapestry generally to the new version?
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de


commons-codec version

2011-09-15 Thread Michael Dukaczewski
Is there a reason why Tapestry still uses commons-codec-1.3 from 2004?
The current version is 1.5 and I have a project where I need to use the
current version. Can there be problems? Would it make sense to link
Tapestry generally to the new version?


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