Re: How to clear an @Persist-ed value in a component?

2010-01-21 Thread Hilco Wijbenga
2010/1/20 Stephan Windmüller stephan.windmuel...@cs.tu-dortmund.de:
 Hilco Wijbenga wrote:

 Any advice would be appreciated (also comments about this approach, is
 it wrong to @Persist values in a component?).

 You should use @Persist only when it is absolutely necessary. When you
 only need it on one page this may be an indicator to use another
 solution. What happens to your page is someone uses browser tabs?

 Would the activation context do what you need?

So how would you suggest I store data that I only need in a component?
I'm already using the activation context (not for this component) but
the component has a fair number of fields and this is only the first
component. I'm afraid I would be overloading the activation context.
(It's not a lot of data, just a lot of fields.)

I'm not using a database so all data needs to be in either the
session, the URL, or in (the server's) memory (other than the
session). What would be the most economical and scalable way to store
up to a few hundred small fields (tiny integers and single characters
only)? I could probably work out a way to compress it all into a
single string which I could store in the activation context. I suppose
this is the same as the client strategy for @Persist? This is warned
against as being expensive and not scalable.

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



Re: How to clear an @Persist-ed value in a component?

2010-01-21 Thread Stephan Windmüller

Am 21.01.2010 09:04, Hilco Wijbenga wrote:


So how would you suggest I store data that I only need in a component?


That depends on what you want to do with the data and where you need it.


I'm already using the activation context (not for this component) but
the component has a fair number of fields and this is only the first
component. I'm afraid I would be overloading the activation context.
(It's not a lot of data, just a lot of fields.)


Perhaps you could describe what sort of component this is, what the 
users does with it and what you do with the data.



I'm not using a database so all data needs to be in either the
session, the URL, or in (the server's) memory (other than the
session).


So you want to store all the data which the user generates in his session?

 What would be the most economical and scalable way to store

up to a few hundred small fields (tiny integers and single characters
only)? I could probably work out a way to compress it all into a
single string which I could store in the activation context.


On one page I use an approach like this. I want the user to be able to 
undo the settings until he leaves the page, so I store all previous 
steps in a Java List, convert it to compressed XML and store it in a 
hidden field. This is rather ugly but the only way I could think of.


- Stephan

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



RE: T4.1.6 Troubles with accessing bindings from async listener method

2010-01-21 Thread Marko Mrkus
I solved it with passing the index of an item in collection as a direct link
parameter which then updates component's parameter. Then the client of this
component (usually page) access the object from collection with updated
index. Thanks!

-Original Message-
From: andre...@gmail.com [mailto:andre...@gmail.com] On Behalf Of Andreas
Andreou
Sent: Wednesday, January 20, 2010 5:51 PM
To: Tapestry users
Subject: Re: T4.1.6 Troubles with accessing bindings from async listener
method

When the direct link is triggered, your listener is called.
I don't think the source parameter will be bound since there's no page
rendering (or rewinding) happening - just the listener method getting
called.

Anyway, you have a few options here:
- Persist the list into the session.
- or, just add the item to the direct link (it needs to be
serializable or you need
to write a custom DataSqueezer for it) using:
binding name=parameters value=ognl:value /

For further reading:
- http://tapestry.apache.org/tapestry4.1/quickstart/directlink.html
-
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/services/
DataSqueezer.html
- http://wiki.apache.org/tapestry/DataSqueezer


On Wed, Jan 20, 2010 at 18:20, Marko Mrkus marko.mr...@bumblehood.com
wrote:
 Is it possible that only invariant expression bindings are updated in
 listener methods for form submissions and invoking direct service urls?

 -Original Message-
 From: Marko Mrkus [mailto:marko.mr...@bumblehood.com]
 Sent: Wednesday, January 20, 2010 2:55 PM
 To: 'Tapestry users'
 Subject: T4.1.6 Troubles with accessing bindings from async listener
method

 Hi, all!



 I have problems with understanding how bindings work in Tapestry when they
 are accessed from async listener.

 I'm trying to build a List component which takes parameters source, value
 and selectedValue. It renders source and updates value as For component.

 I would like that users can select one row in List component and that some
 components on page are updated and that they use this updated selected
 object value.



 Component specification is:



 component-specification class=org.tapestry.example.ListComponent

            parameter name=source /

            parameter name=value /

            parameter name=selectedValue /

            parameter name=updateComponents /



            component id=iterator type=For

            inherited-binding parameter-name=source name=source /

            inherited-binding parameter-name=value name=value /

 /component



 component id=selectLink type=DirectLink

            binding name=listener value=listener:changeSelecedObject
/

            binding name=parameters
 value=ognl:components.get('iterator').index /

  /component



 /component-specification



 Java class:



 package org.tapestry.example;



 public abstract class ListComponent extends BaseComponents{



            public void changeSelectedObject(IRequestCycle cycle) {

                        int indexOfRow =
 (Integer)cycle.getListenerParameters[0];

                        Object value = this.getSource().get(indexOfRow);
 - THIS LINE THROWS IndexOutOfBoundsException since
 this.getSource() returns empty list.



                        this.setSelectedValue(value);



                        for (String compId : this.getUpdateComponents) {


 cycle.getResponseBuilder().updateComponent(compId);

 }

 }



 public abstract void getSource(); // Biding accessor for Source parameter

 public abstract void getUpdateComponents(); //Biding accessor for Update
 Components parameter

 public abstract void setSelectedValue(Object objValue);

 }



 I wonder why I'm getting empty list in listener method. Parameter source
was
 bound with list with 2 items in it and I got there empty list.



 Any help is appreciated.



 Regards,

 Marko



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





-- 
Andreas Andreou - andy...@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

-
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



T5: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread britske

I have a page showing different blocks (ala myYahoo , netvibes, etc) . 
Each block is a different component. 

One of these components gets it's content from a database and writes it in
the BeginRender() - phase.  The content to store in the database is some
html possibly with tapestry expansions. E.g: today is:   #foo
${dateAsString}  or something.  (The database route is the way to go for me
in this scenario, as content is not known at design-time) 

Is there a way to evaluate the expansions in the the html in the
component.beginRender phase and render the result?
This would be pretty powerful stuff.

Thanks, 
Geert-Jan
-- 
View this message in context: 
http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433039.html
Sent from the Tapestry Users 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: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread Thiago H. de Paula Figueiredo

On Thu, 21 Jan 2010 09:12:02 -0200, britske gbr...@gmail.com wrote:

One of these components gets it's content from a database and writes it  
in the BeginRender() - phase.  The content to store in the database is  
some

html possibly with tapestry expansions. E.g: today is:   #foo
${dateAsString}  or something.  (The database route is the way to go  
for me in this scenario, as content is not known at design-time)


What about using some template engine like FreeMarker or Velocity in  
conjunction with the OutputRaw component or MarkupWriter.writeRaw()?


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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



How to return a t:select component without a form (T5.1.05)

2010-01-21 Thread lyf

The page template looks like:
...
t:form t:id=theForm zone=listZone
table
 t:zone t:id=listZone/
 tr
 tdt:submit //td 
 /tr
/table
t:blockt:myComponent t:id=myComponent//t:block
/t:form

page class:
class Index {
   @InjectComponent
private MyComponent myComponent;

Object onSuccess() {
   return this.myComponent;
}
}


MyComponent template:
tr
tdt:select t:id=list label=List blankOption=never
model=objects encoder=objects 
value=object //td
/tr

MyComponent Class:
class MyComponent {
..
}

When I click submit button, I got a error: Render queue error in
SetupRender[Index: myComponent.list]: The List component must be enclosed by
a Form component.

What's wrong? How can I implement this feature?
-- 
View this message in context: 
http://old.nabble.com/How-to-return-a-%3Ct%3Aselect%3E-component-without-a-form-%28T5.1.05%29-tp27257016p27257016.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: [Announce] Wooki - Collaborative Writing

2010-01-21 Thread cordenier christophe
Hi Igor,

Thanks for comment and suggestion, actually the project is in early
development phase and we are open to all suggestions.
We wanted to announce wooki on the mailing list because wooki answers to
many questions asked by Tapestry beginner.

We have tried to cover all the subjects required by a real production web
application and made a lot of integration with other technologies like.

So we encourage Tapestry beginner and others to checkout the sources from
github.

Also, we have removed email publishing for non logged user and fix some
minor issues :
- Background was flickering sometimes
- Deleting book now remove every activity related for the end-user
- Fix some navigation problems
...

Thanks,
Christophe Cordenier.

Developper of wooki @wookicentral.com
Have a try now !

2010/1/19 Igor Drobiazko igor.drobia...@gmail.com

 Very nice tool. I suggest you don't display user's email.

 On Tue, Jan 19, 2010 at 5:13 PM, cordenier christophe 
 christophe.corden...@gmail.com wrote:

  Hi
 
  Thanks a lot for your feedbacks, currently we have found some minor UI
 bugs
  on the deployed version. So please don't mind for small service
  interruption
  (less than one minute)
 
  Regards,
  Christophe.
 
  2010/1/19 ningdh ningd...@gmail.com
 
   Cool, very nice.
  
   Can't wait to try.
  
   DH
  
   - Original Message -
   From: Robin Komiwes odiss...@gmail.com
   To: Tapestry users users@tapestry.apache.org
   Cc: Verachten Bruno gount...@gmail.com; Christophe Cordenier 
   christophe.corden...@gmail.com
   Sent: Tuesday, January 19, 2010 11:24 PM
   Subject: [Announce] Wooki - Collaborative Writing
  
  
   What would you need if you had to publish a document and then get it
   reviewed by someone else? You will be looking for a publish platform,
  with
   at least some comment system and a social network. That’s Wooki’s
  baseline.
  
   Wooki is thought to be simple, based on a friendly user interface.
 Wooki
   also wants to make your data as accessible as possible, by offering you
  the
   possibility to import or export your documents in many formats, as PDF
  for
   example.
  
   Wooki has been created for two reasons. The first one was described
 just
   above. The second one was to contribute to the open source world, and
   especially to the Tapestry 5 community that will find a lot of concrete
   application of Tapestry 5 concepts in it.
  
   We are pleased to introduce you the first alpha-release of Wooki.
   It is licensed under Apache 2 license, the same as Tapestry 5. It has
  been
   created by Christophe Cordenier, Robin Komiwes and Bruno Verachten.
  
   Try the demo and get Wooki now @ http://wookicentral.com
  
   Source code : http://github.com/robink/wooki
   Blog : http://spreadthesource.com
   Twitter : http://twitter.com/spreadthesource
  
 



 --
 Best regards,

 Igor Drobiazko
 http://tapestry5.de/blog



Required action attribute of form component

2010-01-21 Thread Stephan Windmüller

Hello!

We are creating our templates with default XHTML tags like

 form t:type=form

so we are able to edit and validate them with standard HTML tools. But I 
am unsure how to set the required action parameter of the form 
component. Does it even care for tapestry if I write


 form t:type=form action=invalid

? The component reference is lacking an example for this.

http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html

Regards
 Stephan

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



Re: Required action attribute of form component

2010-01-21 Thread Thiago H. de Paula Figueiredo
On Thu, 21 Jan 2010 12:00:09 -0200, Stephan Windmüller  
stephan.windmuel...@cs.tu-dortmund.de wrote:



Hello!


Hi!


We are creating our templates with default XHTML tags like
  form t:type=form

so we are able to edit and validate them with standard HTML tools. But I  
am unsure how to set the required action parameter of the form  
component. Does it even care for tapestry if I write

  form t:type=form action=invalid
?


I tried exactly the above line it worked. Form ignores the action  
attribute value, overriding it when rendering.


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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: Required action attribute of form component

2010-01-21 Thread Sven Homburg
Tapestry build his own action url and throws yours away.

with regards
Sven Homburg
Founder of the Chenille Kit Project
http://chenillekit.codehaus.org




2010/1/21 Stephan Windmüller stephan.windmuel...@cs.tu-dortmund.de

 Hello!

 We are creating our templates with default XHTML tags like

  form t:type=form

 so we are able to edit and validate them with standard HTML tools. But I am
 unsure how to set the required action parameter of the form component.
 Does it even care for tapestry if I write

  form t:type=form action=invalid

 ? The component reference is lacking an example for this.


 http://tapestry.apache.org/tapestry5/tapestry-core/ref/org/apache/tapestry5/corelib/components/Form.html

 Regards
  Stephan

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




Re: Required action attribute of form component

2010-01-21 Thread Stephan Windmüller

Am 21.01.2010 15:09, schrieb Thiago H. de Paula Figueiredo:


I tried exactly the above line it worked. Form ignores the action
attribute value, overriding it when rendering.


Thanks for the reply and your test!

But is there an official (or even documented) guideline for this?

Regards
 Stephan

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



a space character in url context

2010-01-21 Thread lyf

The url of my form looks like: ./index.domains:selected/Internal%20Domain ,
which caused a exception saying

'Input string 'Internal Domain' is not valid; the character ' ' at position
9 is not valid.'

how to solve this? (T5.1.05)
-- 
View this message in context: 
http://old.nabble.com/a-space-character-in-url-context-tp27258876p27258876.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: How to return a t:select component without a form (T5.1.05)

2010-01-21 Thread Inge Solvoll
This limitation has been a blocker for me too. All form components need to
be enclosed by a form in the same template.

I guess you need to use some other strategy, for example by subclassing the
select component? I would like to se some nice suggestions on this, as this
is a real requirement for me too.

On Thu, Jan 21, 2010 at 1:34 PM, lyf yifanliu...@gmail.com wrote:


 The page template looks like:
 ...
 t:form t:id=theForm zone=listZone
table
 t:zone t:id=listZone/
 tr
 tdt:submit //td
 /tr
/table
t:blockt:myComponent t:id=myComponent//t:block
 /t:form

 page class:
 class Index {
   @InjectComponent
private MyComponent myComponent;

Object onSuccess() {
   return this.myComponent;
}
 }


 MyComponent template:
 tr
tdt:select t:id=list label=List blankOption=never
model=objects encoder=objects
 value=object //td
 /tr

 MyComponent Class:
 class MyComponent {
 ..
 }

 When I click submit button, I got a error: Render queue error in
 SetupRender[Index: myComponent.list]: The List component must be enclosed
 by
 a Form component.

 What's wrong? How can I implement this feature?
 --
 View this message in context:
 http://old.nabble.com/How-to-return-a-%3Ct%3Aselect%3E-component-without-a-form-%28T5.1.05%29-tp27257016p27257016.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: How to return a t:select component without a form (T5.1.05)

2010-01-21 Thread lyf


Thanks for replying. But I've abandoned ajax.



Inge Solvoll-2 wrote:
 
 This limitation has been a blocker for me too. All form components need to
 be enclosed by a form in the same template.
 
 I guess you need to use some other strategy, for example by subclassing
 the
 select component? I would like to se some nice suggestions on this, as
 this
 is a real requirement for me too.
 
 On Thu, Jan 21, 2010 at 1:34 PM, lyf yifanliu...@gmail.com wrote:
 

 The page template looks like:
 ...
 t:form t:id=theForm zone=listZone
table
 t:zone t:id=listZone/
 tr
 tdt:submit //td
 /tr
/table
t:blockt:myComponent t:id=myComponent//t:block
 /t:form

 page class:
 class Index {
   @InjectComponent
private MyComponent myComponent;

Object onSuccess() {
   return this.myComponent;
}
 }


 MyComponent template:
 tr
tdt:select t:id=list label=List blankOption=never
model=objects encoder=objects
 value=object //td
 /tr

 MyComponent Class:
 class MyComponent {
 ..
 }

 When I click submit button, I got a error: Render queue error in
 SetupRender[Index: myComponent.list]: The List component must be enclosed
 by
 a Form component.

 What's wrong? How can I implement this feature?
 --
 View this message in context:
 http://old.nabble.com/How-to-return-a-%3Ct%3Aselect%3E-component-without-a-form-%28T5.1.05%29-tp27257016p27257016.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


 
 

-- 
View this message in context: 
http://old.nabble.com/How-to-return-a-%3Ct%3Aselect%3E-component-without-a-form-%28T5.1.05%29-tp27257016p27259021.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: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread Howard Lewis Ship
You can inject the PropertyConduitSource service (it is public). You
can obtain PropertyConduits, which are the compiled versions of
property expressions (as used by parameter bindings).

The PCS caches the result, so it's reasonable to pass an a class and
an expression, get back a PC, and discard it.

On Thu, Jan 21, 2010 at 3:12 AM, britske gbr...@gmail.com wrote:

 I have a page showing different blocks (ala myYahoo , netvibes, etc) .
 Each block is a different component.

 One of these components gets it's content from a database and writes it in
 the BeginRender() - phase.  The content to store in the database is some
 html possibly with tapestry expansions. E.g: today is:   #foo
 ${dateAsString}  or something.  (The database route is the way to go for me
 in this scenario, as content is not known at design-time)

 Is there a way to evaluate the expansions in the the html in the
 component.beginRender phase and render the result?
 This would be pretty powerful stuff.

 Thanks,
 Geert-Jan
 --
 View this message in context: 
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433039.html
 Sent from the Tapestry Users 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





-- 
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: How to clear an @Persist-ed value in a component?

2010-01-21 Thread Howard Lewis Ship
ComponentResources includes a method, discardPersistentFieldChanges(),
for this purpose ... the trick is to know when to invoke it.

In Tapestry 5.2, there's a new lifecycle method, pageReset(), that
your pages/components can implement.  It is invoked during page render
requests, when the active page changes. See the nightly documentation
for details.

On Wed, Jan 20, 2010 at 5:50 PM, Hilco Wijbenga
hilco.wijbe...@gmail.com wrote:
 Hi all,

 I have a page (MyPage) with an embedded component (MyComponent). The
 component uses @Persist to store a value (@Persist String myValue;).

 This all works (of course). But I noticed that when I jump from
 domain.com/index to domain.com/mypage, myValue still has the value
 from last time. How do I clear it?

 I tried to use @Inject MyComponent myComponent in MyPage so that I
 could clear myValue in the pageDetached method but apparently it's not
 possible to inject a component?

 Any advice would be appreciated (also comments about this approach, is
 it wrong to @Persist values in a component?).

 Cheers,
 Hilco

 -
 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



Re: T5: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread britske

Thanks, this looks like the way to go.

2010/1/21 Howard Lewis Ship [via Tapestry Users] 
ml-node+4434057-1227788...@n2.nabble.comml-node%2b4434057-1227788...@n2.nabble.com


 You can inject the PropertyConduitSource service (it is public). You
 can obtain PropertyConduits, which are the compiled versions of
 property expressions (as used by parameter bindings).

 The PCS caches the result, so it's reasonable to pass an a class and
 an expression, get back a PC, and discard it.

 On Thu, Jan 21, 2010 at 3:12 AM, britske [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=0
 wrote:

 
  I have a page showing different blocks (ala myYahoo , netvibes, etc) .
  Each block is a different component.
 
  One of these components gets it's content from a database and writes it
 in
  the BeginRender() - phase.  The content to store in the database is some
  html possibly with tapestry expansions. E.g: today is:   #foo
  ${dateAsString}  or something.  (The database route is the way to go for
 me
  in this scenario, as content is not known at design-time)
 
  Is there a way to evaluate the expansions in the the html in the
  component.beginRender phase and render the result?
  This would be pretty powerful stuff.
 
  Thanks,
  Geert-Jan
  --
  View this message in context:
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433039.html
  Sent from the Tapestry Users mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=1
  For additional commands, e-mail: [hidden 
  email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=2
 
 



 --
 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: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=3
 For additional commands, e-mail: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4434057i=4



 --
  View message @
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4434057.html
 To unsubscribe from T5: how to eval 'canned' expansions (stored in db)?, click
 here (link removed) =.




-- 
View this message in context: 
http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4434292.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


Re: T5: how to eval 'canned' expansions (stored in db)?

2010-01-21 Thread britske

I'd rather have an all- tapestry solution. Neverthless i'll have a look
thanks.

2010/1/21 Thiago H. de Paula Figueiredo [via Tapestry Users] 
ml-node+4433143-269793...@n2.nabble.comml-node%2b4433143-269793...@n2.nabble.com


 On Thu, 21 Jan 2010 09:12:02 -0200, britske [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4433143i=0
 wrote:

  One of these components gets it's content from a database and writes it

  in the BeginRender() - phase.  The content to store in the database is
  some
  html possibly with tapestry expansions. E.g: today is:   #foo
  ${dateAsString}  or something.  (The database route is the way to go
  for me in this scenario, as content is not known at design-time)

 What about using some template engine like FreeMarker or Velocity in
 conjunction with the OutputRaw component or MarkupWriter.writeRaw()?

 --
 Thiago H. de Paula Figueiredo
 Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
 and instructor
 Owner, software architect and developer, Ars Machina Tecnologia da
 Informação Ltda.
 http://www.arsmachina.com.br

 -
 To unsubscribe, e-mail: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4433143i=1
 For additional commands, e-mail: [hidden 
 email]http://n2.nabble.com/user/SendEmail.jtp?type=nodenode=4433143i=2



 --
  View message @
 http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4433143.html
 To unsubscribe from T5: how to eval 'canned' expansions (stored in db)?, click
 here (link removed) =.




-- 
View this message in context: 
http://n2.nabble.com/T5-how-to-eval-canned-expansions-stored-in-db-tp4433039p4434300.html
Sent from the Tapestry Users mailing list archive at Nabble.com.


Re: How to return a t:select component without a form (T5.1.05)

2010-01-21 Thread Andreas Andreou
On Thu, Jan 21, 2010 at 16:47, Inge Solvoll inge.tapes...@gmail.com wrote:
 This limitation has been a blocker for me too. All form components need to
 be enclosed by a form in the same template.

Is that true? Anyone knows if there's a reason for this? Cause
otherwise, you should
file a bug report

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



Re: How to return a t:select component without a form (T5.1.05)

2010-01-21 Thread Robert Zeigler

It's not quite true, but close enough.
All form components have to have a FormSupport environmental object  
available when they render.  So you can have form fields that are in  
blocks on non-rendering pages and pull those blocks into the rendering  
page and everything works fine.  The problem occurs when you do an  
ajax request where you want to update some small portion of the page,  
itself contained within a form, with some form-based content.  In that  
case, the naive solution will fail. Eg:


t:form
  ...
  t:zone ...!-- some zone to be updated via ajax, within the form;  
we want it to render form fields. --/t:zone

  ...
/t:form

When you update the zone with some form-field-containing content,  
you'll get a failure because the form fields won't have a FormSupport  
object available to them in the environment.


This is what, eg, the FormInjector component tries to solve.   
Unfortunately, it seems geared toward use with, eg, AjaxFormLoop.  In  
any event, it's a bit unwieldy to use on its own.


Robert

On Jan 21, 2010, at 1/219:35 AM , Andreas Andreou wrote:

On Thu, Jan 21, 2010 at 16:47, Inge Solvoll  
inge.tapes...@gmail.com wrote:
This limitation has been a blocker for me too. All form components  
need to

be enclosed by a form in the same template.


Is that true? Anyone knows if there's a reason for this? Cause
otherwise, you should
file a bug report

-
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



Canonical way to involve a listener with JS?

2010-01-21 Thread Michael Prescott
Is there a canonical way to expose a server-side listener for invocation by
custom JavaScript?

Regards,

Michael


Re: Canonical way to involve a listener with JS?

2010-01-21 Thread Thiago H. de Paula Figueiredo
On Thu, 21 Jan 2010 14:28:27 -0200, Michael Prescott  
michael.r.presc...@gmail.com wrote:


Is there a canonical way to expose a server-side listener for invocation  
by custom JavaScript?


Yes. @Inject ComponentResources and create a Link using createEventLink().  
Then pass that link to your JavaScript code through  
RenderSupport.addScript(). More details here:  
http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained


--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, 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: a space character in url context

2010-01-21 Thread Yunhua Sang
Tapestry 5 has its own URLEncoder, a JIRA has been logged about this
issue with client encode js by Hugo, but seems this way's not
recommended.


On Thu, Jan 21, 2010 at 9:45 AM, lyf yifanliu...@gmail.com wrote:

 The url of my form looks like: ./index.domains:selected/Internal%20Domain ,
 which caused a exception saying

 'Input string 'Internal Domain' is not valid; the character ' ' at position
 9 is not valid.'

 how to solve this? (T5.1.05)
 --
 View this message in context: 
 http://old.nabble.com/a-space-character-in-url-context-tp27258876p27258876.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



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



Re: a space character in url context

2010-01-21 Thread Yunhua Sang
forgot the link of ticket: https://issues.apache.org/jira/browse/TAP5-637

On Thu, Jan 21, 2010 at 12:43 PM, Yunhua Sang yunhua.s...@gmail.com wrote:
 Tapestry 5 has its own URLEncoder, a JIRA has been logged about this
 issue with client encode js by Hugo, but seems this way's not
 recommended.


 On Thu, Jan 21, 2010 at 9:45 AM, lyf yifanliu...@gmail.com wrote:

 The url of my form looks like: ./index.domains:selected/Internal%20Domain ,
 which caused a exception saying

 'Input string 'Internal Domain' is not valid; the character ' ' at position
 9 is not valid.'

 how to solve this? (T5.1.05)
 --
 View this message in context: 
 http://old.nabble.com/a-space-character-in-url-context-tp27258876p27258876.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




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



Re: How to clear an @Persist-ed value in a component?

2010-01-21 Thread Hilco Wijbenga
2010/1/21 Stephan Windmüller stephan.windmuel...@cs.tu-dortmund.de:
 Am 21.01.2010 09:04, Hilco Wijbenga wrote:

 So how would you suggest I store data that I only need in a component?

 That depends on what you want to do with the data and where you need it.

The component would consist of a dynamic set of radiogroups and
checkboxes. While the user just sets up his choices I wanted to let
the component take care of remembering those choices (as this is all
temporary and the page doesn't need to know about it). Once completely
done a separate submit would yield an object (for the page) based on
those choices and the component would be done.

 I'm already using the activation context (not for this component) but
 the component has a fair number of fields and this is only the first
 component. I'm afraid I would be overloading the activation context.
 (It's not a lot of data, just a lot of fields.)

 Perhaps you could describe what sort of component this is, what the users
 does with it and what you do with the data.

See above.

 I'm not using a database so all data needs to be in either the
 session, the URL, or in (the server's) memory (other than the
 session).

 So you want to store all the data which the user generates in his session?

:-) I guess there's not really another option. I may be making things
too complicated.

 What would be the most economical and scalable way to store

 up to a few hundred small fields (tiny integers and single characters
 only)? I could probably work out a way to compress it all into a
 single string which I could store in the activation context.

 On one page I use an approach like this. I want the user to be able to undo
 the settings until he leaves the page, so I store all previous steps in a
 Java List, convert it to compressed XML and store it in a hidden field. This
 is rather ugly but the only way I could think of.

Yes, exactly.

Cheers,
Hilco

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



Re: How to clear an @Persist-ed value in a component?

2010-01-21 Thread Hilco Wijbenga
2010/1/21 Howard Lewis Ship hls...@gmail.com:
 In Tapestry 5.2, there's a new lifecycle method, pageReset(), that
 your pages/components can implement.  It is invoked during page render
 requests, when the active page changes. See the nightly documentation
 for details.

That sounds very useful. I'll have a look at that once 5.2 is out.

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



Re: a space character in url context

2010-01-21 Thread lyf

Thanks a lot. 

Temporarily, I am using hex encoding with js and decode it on the server
side.


Yunhua Sang wrote:
 
 forgot the link of ticket: https://issues.apache.org/jira/browse/TAP5-637
 
 On Thu, Jan 21, 2010 at 12:43 PM, Yunhua Sang yunhua.s...@gmail.com
 wrote:
 Tapestry 5 has its own URLEncoder, a JIRA has been logged about this
 issue with client encode js by Hugo, but seems this way's not
 recommended.


 On Thu, Jan 21, 2010 at 9:45 AM, lyf yifanliu...@gmail.com wrote:

 The url of my form looks like:
 ./index.domains:selected/Internal%20Domain ,
 which caused a exception saying

 'Input string 'Internal Domain' is not valid; the character ' ' at
 position
 9 is not valid.'

 how to solve this? (T5.1.05)
 --
 View this message in context:
 http://old.nabble.com/a-space-character-in-url-context-tp27258876p27258876.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



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

-- 
View this message in context: 
http://old.nabble.com/a-space-character-in-url-context-tp27258876p27262791.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.1.0.4] Distinguishing Between Internal and Scripts when Combining

2010-01-21 Thread Kalle Korhonen
This seems to be the case with 5.1.0.5 as well - was there any
resolution for it? Did you ever create an enhancement request?

Kalle


On Sun, May 3, 2009 at 3:07 PM, Steve Eynon
steve.ey...@alienfactory.co.uk wrote:
 Hi,

 If you add a script with an external url then script combining is disabled.

 From DocumentLinkerImpl :

 public void addScriptLink(String scriptURL) {
 ...
    // If a script with an external URL is added, we can't combine the
 scripts after all.
    if (combineScripts  !scriptURL.startsWith(fullAssetPrefix))
        combineScripts = false;
 ...
 }

 Would it not be possible to have two buckets of scripts, one for
 internal scripts and the other for external? The internal scripts
 could then combined into a virtual asset and the external ones
 rendered as separate script tags.

 The script combining and virtual assets were working wonderfully until
 I added script link to Google Analytics on all my pages.

 renderSupport.addScriptLink(http://www.google-analytics.com/ga.js;);

 I don't want to loose this cool feature of T5 and I would imagine
 adding Google Analytics to sites (in the manner above) would be a
 rather common thing to do.

 Regards,

 Steve.

 -
 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



Dynamicly Created Checkboxes

2010-01-21 Thread Hilco Wijbenga
Hi all,

I am trying to get the submit results of a dynamic set of checkboxes
and I'm stumped.

html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  body
t:form
  t:loop source=list value=item
t:checkbox t:id=checkbox t:value=checkbox
t:context=item/${item}br/
  /t:loop
  t:submit/
/t:form
  /body
/html


public class Test {
  private final String[] list = new String[] { Abc, Defg, Hijkl, Mno };
  @Property private String item;
  @Property private boolean checkbox;
  public String[] getList() {
return list;
  }
}

If I simply add onSuccess() I only get the result for Mno. Adding
one or more parameters (for item and checkbox) doesn't seem to work. I
tried various other methods and combinations but nothing seems to do
the trick.

How do I do this?

Cheers,
Hilco

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



Re: T5: some automagical way to export versioned assets to CDN?

2010-01-21 Thread Jun Tsai
You can override AssetPathConverter  service.

example:
http://code.google.com/p/corner/source/browse/corner3/trunk/src/main/java/corner/asset/services/impl/CDNAssetPathConverterImpl.java



2010/1/22 britske gbr...@gmail.com


 Versioning in Tapestry is really easy. Just increment the version-nr in
 appModule and you're set.

 However, I'd like my assets to live on a CDN. (Amazon S3 + cloudfront) .
 For
 this to work (along with versioning)  I would have to do 2 conceptual
 things:
 1. export assets to a specific s3 bucket linked to cloudfront.
 2. point html-code to correct path.

 To do this manually I'd have to:
 - up the version in appmodule by hand.
 - create a new s3 bucket by hand (with the version-nr encoded in it)
 - ? copy/ move the versioned assets-directory created by Tapestry to the
 newly created S3- bucket ( I assume it is created on-the-fly on run-time
 and
 are saved to disk?
 - point html-code to the new correct path. I assume I can code this once,
 bc. I must be able to access the versionnr, and along with the static
 s3-path be able to create the path to the newly created s3-bucket.


 All this is possible, but I would like it to be automated. Is this already
 possible (with some minor tweaking)
 If not, where would I start looking to automate this?

 any pointers highly appreciated.

 Best regards,
 Geert-Jan

 --
 View this message in context:
 http://n2.nabble.com/T5-some-automagical-way-to-export-versioned-assets-to-CDN-tp4437084p4437084.html
 Sent from the Tapestry Users 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




-- 
regards,
Jun Tsai


Re: Dynamicly Created Checkboxes

2010-01-21 Thread Jun Tsai
I think you should write own component to support that.

t:loop source=list value=item
   inpu type=checkbox  id=${xx} name=${xx}
 value=${item}/${item}br/
 /t:loop

processSubmit:

request.getParameters(xxx);


2010/1/22 Hilco Wijbenga hilco.wijbe...@gmail.com

 Hi all,

 I am trying to get the submit results of a dynamic set of checkboxes
 and I'm stumped.

 html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd;
  body
t:form
  t:loop source=list value=item
t:checkbox t:id=checkbox t:value=checkbox
 t:context=item/${item}br/
  /t:loop
  t:submit/
/t:form
  /body
 /html


 public class Test {
  private final String[] list = new String[] { Abc, Defg, Hijkl, Mno
 };
  @Property private String item;
  @Property private boolean checkbox;
  public String[] getList() {
return list;
  }
 }

 If I simply add onSuccess() I only get the result for Mno. Adding
 one or more parameters (for item and checkbox) doesn't seem to work. I
 tried various other methods and combinations but nothing seems to do
 the trick.

 How do I do this?

 Cheers,
 Hilco

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




-- 
regards,
Jun Tsai


Re: [T5.1.0.4] Distinguishing Between Internal and Scripts when Combining

2010-01-21 Thread Ville Virtanen

Hi,

GA works ok for us by just adding it to the tml as is instructed in GA site
- No need to use T5 facilities to include the script. (Done in layout.tml in
our case.)

This doesn't solve the external script problems, and may not work for you
but just thought to let you know.

 - Ville


Kalle Korhonen-2 wrote:
 
 This seems to be the case with 5.1.0.5 as well - was there any
 resolution for it? Did you ever create an enhancement request?
 
 Kalle
 
 
 On Sun, May 3, 2009 at 3:07 PM, Steve Eynon
 steve.ey...@alienfactory.co.uk wrote:
 Hi,

 If you add a script with an external url then script combining is
 disabled.

 From DocumentLinkerImpl :

 public void addScriptLink(String scriptURL) {
 ...
    // If a script with an external URL is added, we can't combine the
 scripts after all.
    if (combineScripts  !scriptURL.startsWith(fullAssetPrefix))
        combineScripts = false;
 ...
 }

 Would it not be possible to have two buckets of scripts, one for
 internal scripts and the other for external? The internal scripts
 could then combined into a virtual asset and the external ones
 rendered as separate script tags.

 The script combining and virtual assets were working wonderfully until
 I added script link to Google Analytics on all my pages.

 renderSupport.addScriptLink(http://www.google-analytics.com/ga.js;);

 I don't want to loose this cool feature of T5 and I would imagine
 adding Google Analytics to sites (in the manner above) would be a
 rather common thing to do.

 Regards,

 Steve.

 -
 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
 
 
 

-- 
View this message in context: 
http://old.nabble.com/-T5.1.0.4--Distinguishing-Between-Internal-and-Scripts-when-Combining-tp23360860p27268795.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.1.0.4] Distinguishing Between Internal and Scripts when Combining

2010-01-21 Thread Kalle Korhonen
On Thu, Jan 21, 2010 at 9:12 PM, Ville Virtanen
ville.virta...@cerion.fi wrote:
 GA works ok for us by just adding it to the tml as is instructed in GA site
 - No need to use T5 facilities to include the script. (Done in layout.tml in
 our case.)

Yes, for GA that's fine.  But in general, addScriptLink is rather
useful for many purposes.

Kalle



 Kalle Korhonen-2 wrote:

 This seems to be the case with 5.1.0.5 as well - was there any
 resolution for it? Did you ever create an enhancement request?

 Kalle


 On Sun, May 3, 2009 at 3:07 PM, Steve Eynon
 steve.ey...@alienfactory.co.uk wrote:
 Hi,

 If you add a script with an external url then script combining is
 disabled.

 From DocumentLinkerImpl :

 public void addScriptLink(String scriptURL) {
 ...
    // If a script with an external URL is added, we can't combine the
 scripts after all.
    if (combineScripts  !scriptURL.startsWith(fullAssetPrefix))
        combineScripts = false;
 ...
 }

 Would it not be possible to have two buckets of scripts, one for
 internal scripts and the other for external? The internal scripts
 could then combined into a virtual asset and the external ones
 rendered as separate script tags.

 The script combining and virtual assets were working wonderfully until
 I added script link to Google Analytics on all my pages.

 renderSupport.addScriptLink(http://www.google-analytics.com/ga.js;);

 I don't want to loose this cool feature of T5 and I would imagine
 adding Google Analytics to sites (in the manner above) would be a
 rather common thing to do.

 Regards,

 Steve.

 -
 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




 --
 View this message in context: 
 http://old.nabble.com/-T5.1.0.4--Distinguishing-Between-Internal-and-Scripts-when-Combining-tp23360860p27268795.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



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