Re: Jetty lock on JS-files in classpath breaks eclipse autobuild

2009-10-06 Thread Peter Stavrinides
If you are moving to maven the you will have the maven plug-in to run your app, 
and the default maven setup will work out of the box, so really there is very 
little for you to configure. 

Add your source folders (and matching resource folders) to the build path, 
configure the output folder and nothing more.

Peter

-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.

- Original Message -
From: "Inge Solvoll" 
To: "Tapestry users" 
Sent: Wednesday, 7 October, 2009 09:40:36 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: Jetty lock on JS-files in classpath breaks eclipse autobuild

The file synch approach worked nicely. But it would be nice to hear about
other and possibly better solutions, as this is a hack that is a bit
cumbersome to distribute among our developers...

My environment:

T5.1.0.5
Eclipse 3.4
Vista 64 bit
Java 1.6u17 64 bit
Jetty 6.1.12rc1

I have configured jetty to point to my project directory to launch the
webapp through a "mycontext.xml" in /contexts. My project
structure is pretty much a war layout, with all java files and T5 resource
files in CVS under /src. We're planning migration from ant to
Maven, but no luck getting the resources needed yet.

Howard: In what way are classes folders added to the runtime path? I guess
they are in eclipse, but is the webapp running on a standalone jetty aware
of their existence? When I set WEB-INF/classes as build target for my src
folder, all class files end up there, accessible in a standard webapp way.
Are other classes folders added as jars in WEB-INF/lib?

On Tue, Oct 6, 2009 at 7:18 PM, Howard Lewis Ship  wrote:

> One option here is to put your non-Java resources into a folder,
> src/main/resources, and mark that folder as a classes folder (not a
> source folder). classes folder are simply added to the runtime path
> with no copying. This is what I do.
>
> On Tue, Oct 6, 2009 at 7:59 AM, Peter Stavrinides
>  wrote:
> > What is your exact environment / configuration?
> >
> > - Original Message -
> > From: "Inge Solvoll" 
> > To: "Tapestry users" 
> > Sent: Tuesday, 6 October, 2009 10:57:30 GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> > Subject: Jetty lock on JS-files in classpath breaks eclipse autobuild
> >
> > Hi!
> >
> > I'm having problems with my development environment.
> >
> > First of all: I have set the useFileMappedBuffer=false in
> > /etc/webdefault.xml
> >
> > My problem is that Tapestry 5 Javascript files located in WEB-INF/classes
> > and subfolders are locked by Jetty. This prevents eclipse from deleting
> > WEB-INF/classes to do a rebuild after I make a change in a java file. The
> > end result is that most class files are deleted and not rebuilt, so I
> have
> > to stop jetty, do a manual rebuild, and then start Jetty again. This if,
> of
> > course, a disaster for me...
> >
> > Does anyone here have a clue on how to prevent Jetty from locking the
> > resource files in WEB-INF/classes?
> >
> > -
> > 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
>
>

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



Re: Jetty lock on JS-files in classpath breaks eclipse autobuild

2009-10-06 Thread Inge Solvoll
The file synch approach worked nicely. But it would be nice to hear about
other and possibly better solutions, as this is a hack that is a bit
cumbersome to distribute among our developers...

My environment:

T5.1.0.5
Eclipse 3.4
Vista 64 bit
Java 1.6u17 64 bit
Jetty 6.1.12rc1

I have configured jetty to point to my project directory to launch the
webapp through a "mycontext.xml" in /contexts. My project
structure is pretty much a war layout, with all java files and T5 resource
files in CVS under /src. We're planning migration from ant to
Maven, but no luck getting the resources needed yet.

Howard: In what way are classes folders added to the runtime path? I guess
they are in eclipse, but is the webapp running on a standalone jetty aware
of their existence? When I set WEB-INF/classes as build target for my src
folder, all class files end up there, accessible in a standard webapp way.
Are other classes folders added as jars in WEB-INF/lib?

On Tue, Oct 6, 2009 at 7:18 PM, Howard Lewis Ship  wrote:

> One option here is to put your non-Java resources into a folder,
> src/main/resources, and mark that folder as a classes folder (not a
> source folder). classes folder are simply added to the runtime path
> with no copying. This is what I do.
>
> On Tue, Oct 6, 2009 at 7:59 AM, Peter Stavrinides
>  wrote:
> > What is your exact environment / configuration?
> >
> > - Original Message -
> > From: "Inge Solvoll" 
> > To: "Tapestry users" 
> > Sent: Tuesday, 6 October, 2009 10:57:30 GMT +02:00 Athens, Beirut,
> Bucharest, Istanbul
> > Subject: Jetty lock on JS-files in classpath breaks eclipse autobuild
> >
> > Hi!
> >
> > I'm having problems with my development environment.
> >
> > First of all: I have set the useFileMappedBuffer=false in
> > /etc/webdefault.xml
> >
> > My problem is that Tapestry 5 Javascript files located in WEB-INF/classes
> > and subfolders are locked by Jetty. This prevents eclipse from deleting
> > WEB-INF/classes to do a rebuild after I make a change in a java file. The
> > end result is that most class files are deleted and not rebuilt, so I
> have
> > to stop jetty, do a manual rebuild, and then start Jetty again. This if,
> of
> > course, a disaster for me...
> >
> > Does anyone here have a clue on how to prevent Jetty from locking the
> > resource files in WEB-INF/classes?
> >
> > -
> > 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
>
>


Script Error:Tapestry is undefined

2009-10-06 Thread Vidya Sivadas

I  have a login page where I am using an external javascript file to validate
the username and password field.

But at times I am getting script error in IE 6,7,8 - 'tapestry' is
undefined.Also in IE 8,  error in line 1 of
effects.js,prototype.js,tapestry,js,scriptaculous.js which are added by
tapestry automatically.

The server is OC4J standalone container and tapestry version is 5.0.15.When
I restart the server multiple times,the problem vanishes at times.I have
tested in Tomcat also.Same scenario there also.

Please revert back if anybody has any idea on this issue.


Thanks in advance...
-- 
View this message in context: 
http://www.nabble.com/Script-Error%3ATapestry-is-undefined-tp25780930p25780930.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: passing values between pages (search -> result)

2009-10-06 Thread 976

Thanks a lot! I'll try it in the afternoon when I get time.

joshcanfield wrote:
> 
> 
> Here is fully functioning code that accepts search parameters in an
> object on one page and transfers the object to another for rendering.
> ...
> 

-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25780840.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: passing values between pages (search -> result)

2009-10-06 Thread 976

Hello again.
What I have to is to have one page with entity:


Then I want to pass this entity to another page, and in that next page I
want to use it's all fields to perform hibernate query to find matching
records and display them on this second page.

Thanks,
Adam

Thiago H. de Paula Figueiredo wrote:
> 
> 
>> Anyways, what I do in SearchClient is running the setClient() method of  
>> ClientsList, as I suppose it's not being used at all how is the data  
>> supposed to be placed in this
>> EventContext? How should I put in in my SearchClient.java?
> 
> I'm sorry, I'm not following you. Please post what you want to do, not how  
> to implement it.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25780833.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] upgrade to java 6 and javassist

2009-10-06 Thread Ville Virtanen

Hi,

Also make 100% sure that there aren't multiple javassists (different
versions in classpath) AND that the included javassist version is the right
one. Check this from the produced war, do NOT trust what the ide is saying
;)

Sometimes we have had problems like this, but those were because maven
dependencies affected to the included javassist version.

We use java 6, and our compile targets are 1.6 in about ten projects, we
have multiple developers compiling with different versions of java and
haven't had any problems besides those javaassist version related.

The version of javassist that gets included for us is 3.9.0.GA

 - Ville

Ps. Below is the mvn configuration we're using w/ netbeans


org.apache.maven.plugins
maven-compiler-plugin

1.6
1.6
true
UTF-8
true
true




Thiago H. de Paula Figueiredo wrote:
> 
> Em Tue, 06 Oct 2009 17:39:17 -0300, Fermin Da Costa Gomez  
>  escreveu:
> 
>> Using Eclipse, my Compiler compliance level is set at 1.5 already and  
>> still. What OS are you using?
> 
> Ubuntu. But I guess it's not operating-system related.
> 
>> The @OnEvent i understand but i can't find a 'ready made' entry for the
>> EventConstants.
> 
> What do you mean by ready-made? EventConstants is just a class that  
> declares String constants. You can use the event name directly if you want  
> or need.
> 
>> Do i make my own enum for that?
> 
> No, event names are Strings.
> 
>> And if so, how does that
>> hook into the autocompleter mixin without additional coding?
> 
> I'm not following you here. All events are hooked by name and, optionally,  
> component id, just that.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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://www.nabble.com/-t5--upgrade-to-java-6-and-javassist-tp25295834p25780245.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: passing values between pages (search -> result)

2009-10-06 Thread Josh Canfield
I haven't seen enough code to really understand what you are doing
wrong. Storing your search criteria in the session is a reasonable
approach. Don't store your search results in the session though, that
would be a scalability nightmare...

Here is fully functioning code that accepts search parameters in an
object on one page and transfers the object to another for rendering.

ListPerson.tml

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
  xmlns="http://www.w3.org/1999/xhtml";
  xml:lang="en"
  lang="en">

List



Search Results:
${filterPerson?.name} ${filterPerson?.age}

All People:



${person.name}
${person.age}



Clear Filter
Search



* ListPerson.java


package usr.joshcan.tapestry.pages.person;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;
import usr.joshcan.support.Person;
import usr.joshcan.tapestry.services.PersonSource;

import java.util.List;

/**
 * User: joshcanfield
 * Date: Oct 6, 2009
 */
public class ListPerson {

@Property
private List _people;

@Property
private Person _person;

@Property
@Persist
private Person _filterPerson;

@Inject
private PersonSource _source;


public void setFilter(Person person) {
_filterPerson = person;
}

void setupRender() {
if (_filterPerson != null) {
_people = _source.find(_filterPerson);
} else {
_people = _source.find();
}
}

void onClearFilter() {
_filterPerson = null;
}
}

**  SearchPerson.tml


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";
  xmlns="http://www.w3.org/1999/xhtml";
  xml:lang="en"
  lang="en">

Search People




Name


age








 SearchPerson.java

package usr.joshcan.tapestry.pages.person;

import org.apache.tapestry5.annotations.InjectPage;
import org.apache.tapestry5.annotations.Property;
import usr.joshcan.support.Person;

/**
 * User: joshcanfield
 * Date: Oct 6, 2009
 */
public class SearchPerson {

@Property
private String _name;

@Property
private Integer _age;

@InjectPage
private ListPerson _listPerson;


ListPerson onSuccessFromSearchForm() {
_listPerson.setFilter(new Person(_name, _age));
return _listPerson;
}
}


 for completeness  PersonSource.java (bound as a service in AppModule)

package usr.joshcan.tapestry.services;

import usr.joshcan.support.Person;

import java.util.ArrayList;
import java.util.List;

/**
 * User: joshcanfield
 * Date: Oct 6, 2009
 */
public class PersonSource {
private static final List _source = new ArrayList();
{
_source.add(new Person("John", 24));
_source.add(new Person("Jane", 52));
_source.add(new Person("Fred", 27));
_source.add(new Person("Bill", 95));
}

public List find() {
return _source;
}

public List find(Person filter) {
List filtered = new ArrayList();
for (Person p : _source) {
if (filter.getName() != null) {
if (p.getName().contains(filter.getName())) {
filtered.add(p);
}
}

if (filter.getAge() != null) {
if (p.getAge().equals(filter.getAge())) {
filtered.add(p);
}
}
}
return filtered;
}
}

Josh

On Tue, Oct 6, 2009 at 2:48 AM, 976  wrote:
>
> I'm totally new to Tapestry (2 days playing with it), but I'm stuck with
> quite simple problem;( (At least I guess so).
>
> What I want to to is to create 4 pages for Client entity:
> - list (list all clients or ones from search result)
> - edit
> - add
> - find
>
> Didn't have any problems with first three, but having problems with last
> one.
>
> I've created SearchClient, AddClient, ListClients pages (java+tml).
>
> What I want to do is to input search criteria on SearchClient and list the
> results in ListClients and I don't really now how to pass data between
> pages.
> First of all AddClient and SearchClient have
>
> @IncludePage
> private ListClients listClients;
> and AddClient has:
>        public Object onSuccess() {
>                clientService.addClient(client);
>                return listClients;
>        }
>
> which works just fine.
>
> In SearchClient I firstly tried to retrieve data onSuccess and pass the
> collection to onActivate method of ListClients but passing it didn't work;(
> Can't get the idea of what happens there, but what I wanted to do show
> collection passed from SearchClient if it existed and list all if it didnt.
> And always came up with list of all clients.
>
> Later I tried putting in SearchClient:
>        Object onSu

Accessing the T5 IoC Registry

2009-10-06 Thread Benny Law
Hello,

How can I obtain a service from the IoC registry inside a static
initializer? Injection doesn't seem to work with static members, so I need
to access the registry directly, or is there a better way?

Thanks,

Benny Law


Re: Problem with error404

2009-10-06 Thread Kalle Korhonen
Don't think I can help you much, but I can verify the same sendError
and error configurations work for me on Tomcat 5.5 (haven't tried on
Tomcat 6).

Kalle


On Tue, Oct 6, 2009 at 3:05 AM, Jan Jirout  wrote:
> Hi All,
>
> I'm playing some time with t5. I have meet simple problem. I hope that it's
> not my fault.
>
> So.
>
> I would like to handle "Error 404" in my application so I have in web.xml:
>
>        
>                app
>                /*
>                REQUEST
>                ERROR
>        
>
>        
>                404
>                /error404
>        
>
>
> My Index.java is:
>
>
>    void onActivate(final String pageUrl) throws IOException {
>        if (isKnownPage(pageUrl)) {
>            //show page
>        } else {
>             response.sendError(404, null);
>        }
>    }
>
> If I access page "/hello"  then pageUrl property is "hello". If there is
> page /hello then this page is normally processed. If I sendError then page
> error404 should be shown. This Error page exists. So when I access /blah
> then /error404 page is shown. It works fine with jetty. But it doesn't work
> with tomcat 6.
>
> I have tried to debug it, and it seems to me, that information about content
> type is lost. In class BufferedGZipOutputStream is already information about
> content type lost but in class PageResponseRendererImpl is still present.
>
> thanks for help
>
> Jan
>
>
>
> Here is my stack trace:
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NullPointerException
>        at
> org.apache.tapestry5.internal.services.ResponseCompressionAnalyzerImpl.isCompressable(ResponseCompressionAnalyzerImpl.java:65)
>        at
> $ResponseCompressionAnalyzer_1241954ff2c.isCompressable($ResponseCompressionAnalyzer_1241954ff2c.java)
>        at
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:77)
>        at
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70)
>        at
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116)
>        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
>        at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
>        at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
>        at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
>        at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
>        at java.io.BufferedWriter.write(BufferedWriter.java:212)
>        at java.io.PrintWriter.write(PrintWriter.java:412)
>        at java.io.PrintWriter.write(PrintWriter.java:429)
>        at java.io.PrintWriter.print(PrintWriter.java:559)
>        at org.apache.tapestry5.dom.Text.toMarkup(Text.java:59)
>        at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>        at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>        at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>        at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>        at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>        at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>        at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>        at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>        at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>        at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>        at org.apache.tapestry5.dom.Document.toMarkup(Document.java:163)
>        at org.apache.tapestry5.dom.Node.toMarkup(Node.java:80)
>        at
> org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup(MarkupWriterImpl.java:57)
>        at
> org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67)
>        at
> $PageResponseRenderer_1241954ff57.renderPageResponse($PageResponseRenderer_1241954ff57.java)
>        at
> org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77)
>        at
> $RequestExceptionHandler_1241954ff38.handleRequestException($RequestExceptionHandler_1241954ff38.java)
>        at
> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
>        at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>        at
> org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778)
>        at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>        at
> org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767)
>        at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>        at
> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:8

Re: Problem with error404

2009-10-06 Thread Jan Jirout

Hi,

Thanks for reply. It seems to me like work around. You suppose me to  
change place where I detect that page can't be found to different  
one.  When I place this logic of detecting invalid page in filer then  
I'll do this work two times. Once time in filter and second time I'll  
examine the requested path in Index.java.


Maybe I should reformulate questions:
Is it bug or not. Same code leads in different results at jetty and  
tomcat?

How you handle invalid page requests?

thanks for any help

Jan


On Oct 6, 2009, at 12:45 PM, cordenier christophe wrote:


Hello

Have you tried with a ComponenRequestFilter instead ?

Christophe

2009/10/6 Jan Jirout 


Hi All,

I'm playing some time with t5. I have meet simple problem. I hope  
that it's

not my fault.

So.

I would like to handle "Error 404" in my application so I have in  
web.xml:


  
  app
  /*
  REQUEST
  ERROR
  

  
  404
  /error404
  


My Index.java is:


  void onActivate(final String pageUrl) throws IOException {
  if (isKnownPage(pageUrl)) {
  //show page
  } else {
   response.sendError(404, null);
  }
  }

If I access page "/hello"  then pageUrl property is "hello". If  
there is
page /hello then this page is normally processed. If I sendError  
then page
error404 should be shown. This Error page exists. So when I access / 
blah
then /error404 page is shown. It works fine with jetty. But it  
doesn't work

with tomcat 6.

I have tried to debug it, and it seems to me, that information about
content type is lost. In class BufferedGZipOutputStream is already
information about content type lost but in class  
PageResponseRendererImpl is

still present.

thanks for help

Jan



Here is my stack trace:
SEVERE: Servlet.service() for servlet default threw exception
java.lang.NullPointerException
  at
org.apache.tapestry5 
.internal.services.ResponseCompressionAnalyzerImpl.isCompressable 
(ResponseCompressionAnalyzerImpl.java:65)

  at
$ResponseCompressionAnalyzer_1241954ff2c.isCompressable 
($ResponseCompressionAnalyzer_1241954ff2c.java)

  at
org.apache.tapestry5 
.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream 
(BufferedGZipOutputStream.java:77)

  at
org.apache.tapestry5 
.internal.gzip.BufferedGZipOutputStream.checkForCutover 
(BufferedGZipOutputStream.java:70)

  at
org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write 
(BufferedGZipOutputStream.java:116)

  at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
  at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
  at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
  at java.io.OutputStreamWriter.write(OutputStreamWriter.java: 
190)

  at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
  at java.io.BufferedWriter.write(BufferedWriter.java:212)
  at java.io.PrintWriter.write(PrintWriter.java:412)
  at java.io.PrintWriter.write(PrintWriter.java:429)
  at java.io.PrintWriter.print(PrintWriter.java:559)
  at org.apache.tapestry5.dom.Text.toMarkup(Text.java:59)
  at
org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
  at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
  at
org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
  at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
  at
org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
  at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
  at
org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
  at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
  at
org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
  at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
  at org.apache.tapestry5.dom.Document.toMarkup(Document.java: 
163)

  at org.apache.tapestry5.dom.Node.toMarkup(Node.java:80)
  at
org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup 
(MarkupWriterImpl.java:57)

  at
org.apache.tapestry5 
.internal.services.PageResponseRendererImpl.renderPageResponse 
(PageResponseRendererImpl.java:67)

  at
$PageResponseRenderer_1241954ff57.renderPageResponse 
($PageResponseRenderer_1241954ff57.java)

  at
org.apache.tapestry5 
.internal.services.DefaultRequestExceptionHandler.handleRequestException 
(DefaultRequestExceptionHandler.java:77)

  at
$RequestExceptionHandler_1241954ff38.handleRequestException 
($RequestExceptionHandler_1241954ff38.java)

  at
org.apache.tapestry5.internal.services.RequestErrorFilter.service 
(RequestErrorFilter.java:42)

  at
$RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
  at
org.apache.tapestry5.services.TapestryModule$4.service 
(TapestryModule.java:778)

  at
$RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java

Re: [t5] upgrade to java 6 and javassist

2009-10-06 Thread Thiago H. de Paula Figueiredo
Em Tue, 06 Oct 2009 17:39:17 -0300, Fermin Da Costa Gomez  
 escreveu:


Using Eclipse, my Compiler compliance level is set at 1.5 already and  
still. What OS are you using?


Ubuntu. But I guess it's not operating-system related.


The @OnEvent i understand but i can't find a 'ready made' entry for the
EventConstants.


What do you mean by ready-made? EventConstants is just a class that  
declares String constants. You can use the event name directly if you want  
or need.



Do i make my own enum for that?


No, event names are Strings.


And if so, how does that
hook into the autocompleter mixin without additional coding?


I'm not following you here. All events are hooked by name and, optionally,  
component id, just that.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: [t5] upgrade to java 6 and javassist

2009-10-06 Thread Fermin Da Costa Gomez
>
>  If given a choice between documentation and resolving this particular
>> issue i would always opt for the resolution of the issue. I would even be
>> willing to make a montary donation to get it out of the way!
>>
>
> Howard, the framework creator and main committer, has plans to stop using
> Javassist to do the class manipulation used in Tapestry. If you want to
> donate to the project to have this issue solved more quickly, I guess
>
I have read about this hence my reply .. ;-)

Again, I have never had this issue. I had just checked that all my projects
> have a Java 1.5 compiler target, while running them in Java 6. Maybe this
> can be a solution while the Javassist replacement isn't done.

Using Eclipse, my Compiler compliance level is set at 1.5 already and still.
What OS are you using?

Re. the EventConstants.PROVIDE_COMPLETIONS annotation thing you mentioned.
The @OnEvent i understand but i can't find a 'ready made' entry for the
EventConstants. Do i make my own enum for that? And if so, how does that
hook into the autocompleter mixin without additional coding?

Tia,


Re: [t5] upgrade to java 6 and javassist

2009-10-06 Thread Thiago H. de Paula Figueiredo
Em Tue, 06 Oct 2009 17:13:01 -0300, Fermin Da Costa Gomez  
 escreveu:


If given a choice between documentation and resolving this particular  
issue i would always opt for the resolution of the issue. I would even  
be willing to make a montary donation to get it out of the way!


Howard, the framework creator and main committer, has plans to stop using  
Javassist to do the class manipulation used in Tapestry. If you want to  
donate to the project to have this issue solved more quickly, I guess


Again, I have never had this issue. I had just checked that all my  
projects have a Java 1.5 compiler target, while running them in Java 6.  
Maybe this can be a solution while the Javassist replacement isn't done.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: [t5] upgrade to java 6 and javassist

2009-10-06 Thread Fermin Da Costa Gomez
Hi Thiago,

public class Search {
>>>public List onProvideCompletionsFromFieldName(String partial)
>>> {
>>>return new ArrayList();
>>>}
>>>
>>>
>> this method name is quite long. Did you try to use a shorter one?
>>
>
> Example:
>
> @OnEvent(EventConstants.PROVIDE_COMPLETIONS)
> public List completions(String partial) {... }

Thx for this feedback.

I am still a bit puzzled by the whole thing but encouraged enough by your
and Gunters tips to not yet drop T5 and switch to Wicket.

Much appreciated.

Cheers,

Fermin DCG


Re: [t5] upgrade to java 6 and javassist

2009-10-06 Thread Fermin Da Costa Gomez
Hi Gunter,

we were also hit by some spurios javassit failures.
>
> Fermin Da Costa Gomez schrieb:
> > public class Search {
> > public List onProvideCompletionsFromFieldName(String partial)
> {
> > return new ArrayList();
> > }
> >
>
> this method name is quite long. Did you try to use a shorter one?
>
I hear what you say but and will try your suggested solution but you would
agree that this is slightly ridiculous!
What is the point of a modern tool if we are to be again bound by using
variables/ methods of a maximum length.
W'r talking a 64b system not an old ms-dos machine with 640K memory ..

We use several strategies to "fix" the problems:
>
> * replace @Property annotation by plain old setters and getters
> * reduce the number of @Inject
> * reduce the length of event handlers (which already failed for you)
>
> Once, we were successful by replacing an
>  @Inject LoggerSource loggerSource;
> whith simply
>  @Inject Logger log;
>
I will keep your recommendations in mind and try to work them into the thing
i'm working on.

Unfortunately we still have no idea why the (mostly random) refactorings
> fixed the problem. IMHO, the only reliable fix was  to downgrade the
> compiler level to 1.5 for all pages.
>
Really appreciate your feedback and suggestions and i will try to implement/
use them, although it does seem to go a long way in defeating the whole
purpose or at least some important strong parts of T5.

I am a consultant/ problem solver (sw developer) mainly focussing on the
investment banking/ insurance and for my hourly rate (200+) my clients
expect solid advice. I was planning on working T5 into  my solutions but
with this erratic behaviour i can in all honesty not do that. I would even
have to advice against actually using it in production environments.
Please take note of the fact that i still prefer the framework above any
other but having to navigate around these icebergs is not something one
should want ..

If given a choice between documentation and resolving this particular issue
i would always opt for the resolution of the issue. I would even be willing
to make a montary donation to get it out of the way!

Got it out of my system now.

Tia,

Fermin DCG


Re: passing values between pages (search -> result)

2009-10-06 Thread Thiago H. de Paula Figueiredo

Em Tue, 06 Oct 2009 16:43:29 -0300, 976  escreveu:

Thanks for the reply - I'd have never thought it's stored in context in  
such way.


The activation context is a concept I only found in Tapestry (don't know  
about other frameworks).



What If I want to store a collection of clients.


It's not a good idea (not just in Tapestry), specially search results.  
Pass the parameters only and do the search in the page that shows the  
results.
The activation context is just a better-looking way of passing information  
between pages without using query parameters  
(url?parameter1=value1?parameter2=value2).


Anyways, what I do in SearchClient is running the setClient() method of  
ClientsList, as I suppose it's not being used at all how is the data  
supposed to be placed in this

EventContext? How should I put in in my SearchClient.java?


I'm sorry, I'm not following you. Please post what you want to do, not how  
to implement it.


And one more thing if I can still bother you, when is exactly  
onPassivate() called?


Everytime Tapestry needs to generate an URL for a given page.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: passing values between pages (search -> result)

2009-10-06 Thread 976

Thanks for the reply - I'd have never thought it's stored in context in such
way. What If I want to store a collection of clients. Anyways, what I do in
SearchClient is running the setClient() method of ClientsList, as I suppose
it's not being used at all how is the data supposed to be placed in this
EventContext? How should I put in in my SearchClient.java?

And one more thing if I can still bother you, when is exactly onPassivate()
called? I've read about it on some sites but how come is it invoked about 10
times?

Thanks again for help.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Tue, 06 Oct 2009 14:36:51 -0300, 976  escreveu:
> 
>> How should then onActivate and onPassivate look like?
> 
> Suppose your Client class has the following properties: id (an Integer),  
> firstName, lastName.
> 
> Your onActivate would look like this (not tested):
> 
> private Client client;
> 
> public void onActivate(EventContext context) {
> 
>   client = new Client()
> 
>   int count = context.getCount();
> 
>   if (count >= 1) {
>   client.setId(context.get(Integer.class, 0));
>   }
>   if (count >= 2) {
>   client.setFirstName(context.get(String.class, 1));
>   }
>   if (count >= 3) {
>   client.setastName(context.get(String.class, 2));
>   }
> 
> }
> 
> public Object onPassivate() {
> 
>   List list = new ArrayList();
>   list.add(client.getId());
>   list.add(client.getFirstName());
>   list.add(client.getLastName());
> 
>   return list;
> 
> }
> 
>> I'm not able to sth that seemed to be easy - it normally takes me few  
>> mins do to it in JSF or Struts, so why not in Tapestry.
> 
> You just aren't used to Tapestry yet as you're to JSF or Struts, so the
> comparison here is not exactly fair.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25775368.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] upgrade to java 6 and javassist

2009-10-06 Thread Thiago H. de Paula Figueiredo
Em Tue, 06 Oct 2009 14:52:44 -0300, Gunter Winkler   
escreveu:



public class Search {
public List onProvideCompletionsFromFieldName(String  
partial) {

return new ArrayList();
}



this method name is quite long. Did you try to use a shorter one?


Example:

@OnEvent(EventConstants.PROVIDE_COMPLETIONS)
public List completions(String partial) {... }

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: passing values between pages (search -> result)

2009-10-06 Thread Thiago H. de Paula Figueiredo

Em Tue, 06 Oct 2009 14:36:51 -0300, 976  escreveu:


How should then onActivate and onPassivate look like?


Suppose your Client class has the following properties: id (an Integer),  
firstName, lastName.


Your onActivate would look like this (not tested):

private Client client;

public void onActivate(EventContext context) {

client = new Client()

int count = context.getCount();

if (count >= 1) {
client.setId(context.get(Integer.class, 0));
}
if (count >= 2) {
client.setFirstName(context.get(String.class, 1));
}
if (count >= 3) {
client.setastName(context.get(String.class, 2));
}

}

public Object onPassivate() {

List list = new ArrayList();
list.add(client.getId());
list.add(client.getFirstName());
list.add(client.getLastName());

return list;

}

I'm not able to sth that seemed to be easy - it normally takes me few  
mins do to it in JSF or Struts, so why not in Tapestry.


You just aren't used to Tapestry yet as you're to JSF or Struts, so the
comparison here is not exactly fair.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



minor error in docs

2009-10-06 Thread Erick Erickson
Sorry for posting this here, but I don't see a convenient way to send an
e-mail to the dev list without subscribing
On this page:
http://tapestry.apache.org/tapestry5.1/tapestry-core/ref/org/apache/tapestry5/corelib/components/Errors.html

the  entry is unterminated.

I don't think the world will end if this is left though 

Erick


Re: Problems using upload inside an ajax zone

2009-10-06 Thread Toby Hobson
One option is to use a hidden iframe, not technically ajax but it achieves
the same result

2009/10/6 Pete Poulos 

> Ok, so if what you are saying is correct, then unless I want to use
> yet another technology on this project (which i don't) I will have to
> forget using ajax and reload the whole page?
>
> Can does anyone else have a work around on the problem?  Can anyone
> shed some light on what's going on?
>
> Thanks,
> Pete Poulos
>
> On Mon, Oct 5, 2009 at 8:35 PM, Toby Hobson 
> wrote:
> > Its about 12 months since I used Tapestry but if I remember correctly
> file
> > uploads and ajax don't play well together ... it's not specific to T5,
> ajax
> > and multipart forms just don't work together. If I remember correctly I
> used
> > a flash based solution to handle ajax style file uploads ... I'll dig
> > through some of my old code and report back
> >
> > Toby
> >
> > 2009/10/6 Pete Poulos 
> >
> >> I'm trying to create an ImageUpload component using tapestry-upload.
> >> Once the user selects a file and submits the form, I want to replace
> >> that form with the image itself.  However, I have found an issue where
> >> the form starts behaving differently when I place the tapestry-upload
> >> field inside the form.
> >>
> >> In the code below, when the upload component is NOT present, the
> >> onSuccess() method/event is called when the user presses the submit
> >> button.  However, when the upload component is added to the form, the
> >> form no longer generates the onSuccess() method/event but begins
> >> generating the onSubmit() method/event (which it wasn't previously
> >> doing).
> >>
> >> If you remove the zone parameter from the form, it works as expected
> >> (the form generates onSuccess() while the upload component is
> >> present).
> >>
> >> I am at a complete loss as to what is going on.  Am I doing something
> >> wrong, or is this a bug of some sort?
> >>
> >> Here is some sample code to reproduce the problem.
> >>
> >> Thanks,
> >> Pete Poulos
> >>
> >> .tml file
> >> 
> >>
> >>  >> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
> >> xmlns:p="tapestry:parameter">
> >> 
> >>   
> >>
> >>   
> >>   
> >>
> >>   
> >> 
> >> 
> >>
> >>
> >> Java File
> >> ---
> >>
> >> public class ImageUpload {
> >>
> >>   @Property
> >>   private UploadedFile file;
> >>
> >> }
> >>
> >>   public void onSubmit() {
> >>  System.out.println( "SUBMIT" );
> >>   }
> >>
> >>   public Object onSuccess() {
> >>   System.out.println( "SUCCESS" );
> >>   return this;
> >>   }
> >> }
> >>
> >> -
> >> 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: [t5] upgrade to java 6 and javassist

2009-10-06 Thread Gunter Winkler
Hello Fermin,

we were also hit by some spurios javassit failures.

Fermin Da Costa Gomez schrieb:
> public class Search {
> public List onProvideCompletionsFromFieldName(String partial) {
> return new ArrayList();
> }
>   

this method name is quite long. Did you try to use a shorter one?

> ...
>   
> @Log
> void setupRender() {
> }
> }
>   
>

We use several strategies to "fix" the problems:

* replace @Property annotation by plain old setters and getters
* reduce the number of @Inject
* reduce the length of event handlers (which already failed for you)

Once, we were successful by replacing an
  @Inject LoggerSource loggerSource;
whith simply
  @Inject Logger log;

Unfortunately we still have no idea why the (mostly random) refactorings
fixed the problem. IMHO, the only reliable fix was  to downgrade the
compiler level to 1.5 for all pages.

mfg
Gunter


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



Re: passing values between pages (search -> result)

2009-10-06 Thread 976

How should then onActivate and onPassivate look like?
When I use onActivate(Client client) - it's not invoked at all.
I know I can put search and results on the same page - even almost decided
to do so but thought that's stupid that I need to change my vision because
I'm not able to sth that seemed to be easy - it normally takes me few mins
do to it in JSF or Struts, so why not in Tapestry.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Tue, 06 Oct 2009 13:45:47 -0300, 976  escreveu:
> 
>> It's just:
>> http://localhost:/crm/client/listclients
>>
>> in SearchClient on submit button I run:
>>  Object onSuccess() {
>>  listClients.setClient(client);
>>  return listClients;
>>  }
> 
> The onActivate() and onPassivate() methods must be in ListClients. By the  
> way, why don't you put the form and the result in the same page? That's  
> the approach I use almost all the time.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25773281.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 clientIds for elements in a block/zone

2009-10-06 Thread Julian Wood
Another option which avoids reliance on class name:
$$('[id^=techFirstName]')[0]

J


Re: Jetty lock on JS-files in classpath breaks eclipse autobuild

2009-10-06 Thread Howard Lewis Ship
One option here is to put your non-Java resources into a folder,
src/main/resources, and mark that folder as a classes folder (not a
source folder). classes folder are simply added to the runtime path
with no copying. This is what I do.

On Tue, Oct 6, 2009 at 7:59 AM, Peter Stavrinides
 wrote:
> What is your exact environment / configuration?
>
> - Original Message -
> From: "Inge Solvoll" 
> To: "Tapestry users" 
> Sent: Tuesday, 6 October, 2009 10:57:30 GMT +02:00 Athens, Beirut, Bucharest, 
> Istanbul
> Subject: Jetty lock on JS-files in classpath breaks eclipse autobuild
>
> Hi!
>
> I'm having problems with my development environment.
>
> First of all: I have set the useFileMappedBuffer=false in
> /etc/webdefault.xml
>
> My problem is that Tapestry 5 Javascript files located in WEB-INF/classes
> and subfolders are locked by Jetty. This prevents eclipse from deleting
> WEB-INF/classes to do a rebuild after I make a change in a java file. The
> end result is that most class files are deleted and not rebuilt, so I have
> to stop jetty, do a manual rebuild, and then start Jetty again. This if, of
> course, a disaster for me...
>
> Does anyone here have a clue on how to prevent Jetty from locking the
> resource files in WEB-INF/classes?
>
> -
> 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: passing values between pages (search -> result)

2009-10-06 Thread Thiago H. de Paula Figueiredo

Em Tue, 06 Oct 2009 13:45:47 -0300, 976  escreveu:


It's just:
http://localhost:/crm/client/listclients

in SearchClient on submit button I run:
Object onSuccess() {
listClients.setClient(client);
return listClients;
}


The onActivate() and onPassivate() methods must be in ListClients. By the  
way, why don't you put the form and the result in the same page? That's  
the approach I use almost all the time.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: passing values between pages (search -> result)

2009-10-06 Thread 976

It's just:
http://localhost:/crm/client/listclients

in SearchClient on submit button I run:
Object onSuccess() {
listClients.setClient(client);
return listClients;
}

the client is the object that holds data thanks to which I want to retrieve
clients in ListClients.onActivate()

Thanks again for help.


cordenier christophe wrote:
> 
> Can you give us the URL that fails ?
> 
> 
> 2009/10/6 976 
> 
>>
>> You mean in ListClients?
>> When I add EventContext it's always class EmptyEventContext.
>>
>>
>> Thiago H. de Paula Figueiredo wrote:
>> >
>> >
>> > Em Tue, 06 Oct 2009 10:58:03 -0300, 976  escreveu:
>> >
>> >> Thanks for fast response.
>> >> ListClients:
>> >>  public void onActivate(){
>> >
>> > You're ignoring the activation context. You should get it through an
>> > onActivate(EventContext context) method and then set the field(s)
>> > containing the search criteria.
>> >
>> > --
>> > Thiago H. de Paula Figueiredo
>> > Independent Java consultant, developer, and instructor
>> > http://www.arsmachina.com.br/thiago
>> >
>> > -
>> > 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769572.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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25772409.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: Problems using upload inside an ajax zone

2009-10-06 Thread Pete Poulos
Ok, so if what you are saying is correct, then unless I want to use
yet another technology on this project (which i don't) I will have to
forget using ajax and reload the whole page?

Can does anyone else have a work around on the problem?  Can anyone
shed some light on what's going on?

Thanks,
Pete Poulos

On Mon, Oct 5, 2009 at 8:35 PM, Toby Hobson  wrote:
> Its about 12 months since I used Tapestry but if I remember correctly file
> uploads and ajax don't play well together ... it's not specific to T5, ajax
> and multipart forms just don't work together. If I remember correctly I used
> a flash based solution to handle ajax style file uploads ... I'll dig
> through some of my old code and report back
>
> Toby
>
> 2009/10/6 Pete Poulos 
>
>> I'm trying to create an ImageUpload component using tapestry-upload.
>> Once the user selects a file and submits the form, I want to replace
>> that form with the image itself.  However, I have found an issue where
>> the form starts behaving differently when I place the tapestry-upload
>> field inside the form.
>>
>> In the code below, when the upload component is NOT present, the
>> onSuccess() method/event is called when the user presses the submit
>> button.  However, when the upload component is added to the form, the
>> form no longer generates the onSuccess() method/event but begins
>> generating the onSubmit() method/event (which it wasn't previously
>> doing).
>>
>> If you remove the zone parameter from the form, it works as expected
>> (the form generates onSuccess() while the upload component is
>> present).
>>
>> I am at a complete loss as to what is going on.  Am I doing something
>> wrong, or is this a bug of some sort?
>>
>> Here is some sample code to reproduce the problem.
>>
>> Thanks,
>> Pete Poulos
>>
>> .tml file
>> 
>>
>> > xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>> xmlns:p="tapestry:parameter">
>>         
>>           
>>
>>           
>>           
>>
>>           
>>         
>> 
>>
>>
>> Java File
>> ---
>>
>> public class ImageUpload {
>>
>>   @Property
>>   private UploadedFile file;
>>
>> }
>>
>>   public void onSubmit() {
>>      System.out.println( "SUBMIT" );
>>   }
>>
>>   public Object onSuccess() {
>>       System.out.println( "SUCCESS" );
>>       return this;
>>   }
>> }
>>
>> -
>> 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: T5 / Creating a form insides a loop ...

2009-10-06 Thread cordenier christophe
Hello

- Note that if you want to have only one submit button in one form, it is
possible to use the tapestry grid and loop component with a value encoder to
have a global submit.

- If you want to add rows dynamically, have a look the AjaxFormLoop that
also have an encoder parameter.

By the way, using a loop with hiddenfield or a context sounds good to me.
But keep in mind that by using context, i'm not sure that you can enjoy
validation and automatic binding features provided with the Hidden component
(an all the form components)

Christophe.

2009/10/6 Gunnar Eketrapp 

> Hi !
>
> OK I'll try ...
>
> I have a table where each row contains a form with some hidden fields
> (year,week) + a field to enter percentage value plus s a submit button.
>
> How would you port this!
>
> Currently I am testing to pass a context to the form and It seems like that
> might be the right track 
>
> /Gunnar
>
> 2009/10/6 Toby Hobson 
>
> > Hi Gunnar
> >
> > Maybe you could give us a higher level explanation of what you are trying
> > to
> > achieve i.e. what is the business logic driving this? In my experience
> when
> > migrating from a technology like struts or servlets to tapestry it's best
> > to
> > rethink your whole strategy, instead of thinking in terms of "i did this
> in
> > a servlet, how do I do it in tapestry"
> >
> > Toby
> >
> > 2009/10/6 Gunnar Eketrapp 
> >
> > > Hi!
> > >
> > > Ok the ${} was a typo ... I havent tested the page yeat you know!
> > >
> > > My problem is that each form pass a context (in three hidden fields)
> back
> > > to
> > > the server and how is this best done!
> > >
> > > But I just saw that I could pass a t:context attribute to my form so I
> > will
> > > try that solution.
> > >
> > > E.g I will now try something like ...
> > >
> > > 
> > > 
> > >
> > > t:context="item.year,item.weekNum,item.totalRake">
> > > Base percentage:  > > name="payoutPercentage" value="0.40" />
> > > > > class="nicebutton"/>
> > >
> > >
> > >
> > > ..
> > >
> > >
> > >
> > >
> > > 2009/10/6 Thiago H. de Paula Figueiredo 
> > >
> > > > Em Tue, 06 Oct 2009 11:51:17 -0300, Gunnar Eketrapp <
> > > > gunnar.eketr...@gmail.com> escreveu:
> > > >
> > > >  Hi !
> > > >>
> > > >
> > > > Hi!
> > > >
> > > >  The problem is that I would like  to take one property as
> > the
> > > >> inparameter and another as the out parameter.
> > > >>
> > > >
> > > > Why?
> > > >
> > > >  
> > > >>
> > > >
> > > > Never use ${} as a component parameter. Never!
> > > >
> > > > --
> > > > Thiago H. de Paula Figueiredo
> > > > Independent Java consultant, developer, and instructor
> > > > http://www.arsmachina.com.br/thiago
> > > >
> > > > -
> > > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > > Allévägen 2A, 132 42 Saltsjö-Boo
> > >
> >
>
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: T5 / Creating a form insides a loop ...

2009-10-06 Thread Gunnar Eketrapp
Hi !

OK I'll try ...

I have a table where each row contains a form with some hidden fields
(year,week) + a field to enter percentage value plus s a submit button.

How would you port this!

Currently I am testing to pass a context to the form and It seems like that
might be the right track 

/Gunnar

2009/10/6 Toby Hobson 

> Hi Gunnar
>
> Maybe you could give us a higher level explanation of what you are trying
> to
> achieve i.e. what is the business logic driving this? In my experience when
> migrating from a technology like struts or servlets to tapestry it's best
> to
> rethink your whole strategy, instead of thinking in terms of "i did this in
> a servlet, how do I do it in tapestry"
>
> Toby
>
> 2009/10/6 Gunnar Eketrapp 
>
> > Hi!
> >
> > Ok the ${} was a typo ... I havent tested the page yeat you know!
> >
> > My problem is that each form pass a context (in three hidden fields) back
> > to
> > the server and how is this best done!
> >
> > But I just saw that I could pass a t:context attribute to my form so I
> will
> > try that solution.
> >
> > E.g I will now try something like ...
> >
> > 
> > 
> >
> >
> > Base percentage:  > name="payoutPercentage" value="0.40" />
> > > class="nicebutton"/>
> >
> >
> >
> > ..
> >
> >
> >
> >
> > 2009/10/6 Thiago H. de Paula Figueiredo 
> >
> > > Em Tue, 06 Oct 2009 11:51:17 -0300, Gunnar Eketrapp <
> > > gunnar.eketr...@gmail.com> escreveu:
> > >
> > >  Hi !
> > >>
> > >
> > > Hi!
> > >
> > >  The problem is that I would like  to take one property as
> the
> > >> inparameter and another as the out parameter.
> > >>
> > >
> > > Why?
> > >
> > >  
> > >>
> > >
> > > Never use ${} as a component parameter. Never!
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java consultant, developer, and instructor
> > > http://www.arsmachina.com.br/thiago
> > >
> > > -
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> > Allévägen 2A, 132 42 Saltsjö-Boo
> >
>



-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: T5 / Creating a form insides a loop ...

2009-10-06 Thread Toby Hobson
Hi Gunnar

Maybe you could give us a higher level explanation of what you are trying to
achieve i.e. what is the business logic driving this? In my experience when
migrating from a technology like struts or servlets to tapestry it's best to
rethink your whole strategy, instead of thinking in terms of "i did this in
a servlet, how do I do it in tapestry"

Toby

2009/10/6 Gunnar Eketrapp 

> Hi!
>
> Ok the ${} was a typo ... I havent tested the page yeat you know!
>
> My problem is that each form pass a context (in three hidden fields) back
> to
> the server and how is this best done!
>
> But I just saw that I could pass a t:context attribute to my form so I will
> try that solution.
>
> E.g I will now try something like ...
>
> 
> 
>
>
> Base percentage:  name="payoutPercentage" value="0.40" />
> class="nicebutton"/>
>
>
>
> ..
>
>
>
>
> 2009/10/6 Thiago H. de Paula Figueiredo 
>
> > Em Tue, 06 Oct 2009 11:51:17 -0300, Gunnar Eketrapp <
> > gunnar.eketr...@gmail.com> escreveu:
> >
> >  Hi !
> >>
> >
> > Hi!
> >
> >  The problem is that I would like  to take one property as the
> >> inparameter and another as the out parameter.
> >>
> >
> > Why?
> >
> >  
> >>
> >
> > Never use ${} as a component parameter. Never!
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>
>
> --
> [Hem: 08-715 59 57, Mobil: 0708-52 62 90]
> Allévägen 2A, 132 42 Saltsjö-Boo
>


Re: passing values between pages (search -> result)

2009-10-06 Thread cordenier christophe
>From my point of view activate/passivate should be used with simple
parameter (numerical ids...) if you want to persist complex object accross
request, @Persist is maybe a better solution that serializing the whole
criterium object in the request.

@Persist("flash") should be deterministic, in your case :

1. Submit set the datas on the target page and return the page instance
2. Tapestry redirects your user to the target (result) page (which give a
new URL)
3. The data with @Persist("flash") should be restored for the first access
only

Another way to achieve, if it suits to your ergonomy is to use a Zone to
display the result under your criterium filter, to achieve this use
something like :


   
   ...
   
   

   



...


And return the block that will display result in the success method, this
will update the div marked with class 't-zone-update'.

Check component reference for more information
http://tapestry.apache.org/tapestry5.1/guide/ajax.html
Chapter called 'zone'

2009/10/6 cordenier christophe 

> Can you give us the URL that fails ?
>
>
> 2009/10/6 976 
>
>>
>> You mean in ListClients?
>> When I add EventContext it's always class EmptyEventContext.
>>
>>
>> Thiago H. de Paula Figueiredo wrote:
>> >
>> >
>> > Em Tue, 06 Oct 2009 10:58:03 -0300, 976  escreveu:
>> >
>> >> Thanks for fast response.
>> >> ListClients:
>> >>  public void onActivate(){
>> >
>> > You're ignoring the activation context. You should get it through an
>> > onActivate(EventContext context) method and then set the field(s)
>> > containing the search criteria.
>> >
>> > --
>> > Thiago H. de Paula Figueiredo
>> > Independent Java consultant, developer, and instructor
>> > http://www.arsmachina.com.br/thiago
>> >
>> > -
>> > 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769572.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 / Creating a form insides a loop ...

2009-10-06 Thread Gunnar Eketrapp
Hi!

Ok the ${} was a typo ... I havent tested the page yeat you know!

My problem is that each form pass a context (in three hidden fields) back to
the server and how is this best done!

But I just saw that I could pass a t:context attribute to my form so I will
try that solution.

E.g I will now try something like ...





Base percentage: 




..




2009/10/6 Thiago H. de Paula Figueiredo 

> Em Tue, 06 Oct 2009 11:51:17 -0300, Gunnar Eketrapp <
> gunnar.eketr...@gmail.com> escreveu:
>
>  Hi !
>>
>
> Hi!
>
>  The problem is that I would like  to take one property as the
>> inparameter and another as the out parameter.
>>
>
> Why?
>
>  
>>
>
> Never use ${} as a component parameter. Never!
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
[Hem: 08-715 59 57, Mobil: 0708-52 62 90]
Allévägen 2A, 132 42 Saltsjö-Boo


Re: Jetty lock on JS-files in classpath breaks eclipse autobuild

2009-10-06 Thread Peter Stavrinides
What is your exact environment / configuration?

- Original Message -
From: "Inge Solvoll" 
To: "Tapestry users" 
Sent: Tuesday, 6 October, 2009 10:57:30 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Jetty lock on JS-files in classpath breaks eclipse autobuild

Hi!

I'm having problems with my development environment.

First of all: I have set the useFileMappedBuffer=false in
/etc/webdefault.xml

My problem is that Tapestry 5 Javascript files located in WEB-INF/classes
and subfolders are locked by Jetty. This prevents eclipse from deleting
WEB-INF/classes to do a rebuild after I make a change in a java file. The
end result is that most class files are deleted and not rebuilt, so I have
to stop jetty, do a manual rebuild, and then start Jetty again. This if, of
course, a disaster for me...

Does anyone here have a clue on how to prevent Jetty from locking the
resource files in WEB-INF/classes?

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



Re: T5 / Creating a form insides a loop ...

2009-10-06 Thread Thiago H. de Paula Figueiredo
Em Tue, 06 Oct 2009 11:51:17 -0300, Gunnar Eketrapp  
 escreveu:



Hi !


Hi!


The problem is that I would like  to take one property as the
inparameter and another as the out parameter.


Why?





Never use ${} as a component parameter. Never!

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



T5 / Creating a form insides a loop ...

2009-10-06 Thread Gunnar Eketrapp
Hi !

I am porting a project from a ancient technology (starts with j and ends
with p)  and have come across a loop where
a form is created inside the loop.

The form has three hidden fields + a text field and my question is how is
this best done the T5 way ... I looked in the howto's
but couldn't find a match to my problem.

The problem is that I would like  to take one property as the
inparameter and another as the out parameter.

Ofcourse I have missed something ...

Thanks in advance,
Gunnar Eketrapp

This is the current unfinished TML version  ...








Base percentage: 




...


Re: passing values between pages (search -> result)

2009-10-06 Thread cordenier christophe
Can you give us the URL that fails ?


2009/10/6 976 

>
> You mean in ListClients?
> When I add EventContext it's always class EmptyEventContext.
>
>
> Thiago H. de Paula Figueiredo wrote:
> >
> >
> > Em Tue, 06 Oct 2009 10:58:03 -0300, 976  escreveu:
> >
> >> Thanks for fast response.
> >> ListClients:
> >>  public void onActivate(){
> >
> > You're ignoring the activation context. You should get it through an
> > onActivate(EventContext context) method and then set the field(s)
> > containing the search criteria.
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java consultant, developer, and instructor
> > http://www.arsmachina.com.br/thiago
> >
> > -
> > 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769572.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: passing values between pages (search -> result)

2009-10-06 Thread 976

You mean in ListClients?
When I add EventContext it's always class EmptyEventContext. 


Thiago H. de Paula Figueiredo wrote:
> 
> 
> Em Tue, 06 Oct 2009 10:58:03 -0300, 976  escreveu:
> 
>> Thanks for fast response.
>> ListClients:
>>  public void onActivate(){
> 
> You're ignoring the activation context. You should get it through an  
> onActivate(EventContext context) method and then set the field(s)  
> containing the search criteria.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769572.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: passing values between pages (search -> result)

2009-10-06 Thread 976

When I add EventContext it's always class EmptyEventContext.


Thiago H. de Paula Figueiredo wrote:
> 
> Em Tue, 06 Oct 2009 11:07:15 -0300, 976  escreveu:
> 
>> When I add parameter the activate method is not being invoked at all -  
>> also tried with two different activate methods;(
> 
> Try onActivate(EventContext context). It will be called regardless of the  
> number of parameters. Also take a look at  
> http://tapestry.apache.org/tapestry5.1/guide/pagenav.html.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java consultant, developer, and instructor
> http://www.arsmachina.com.br/thiago
> 
> -
> 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://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769545.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: passing values between pages (search -> result)

2009-10-06 Thread Thiago H. de Paula Figueiredo

Em Tue, 06 Oct 2009 11:07:15 -0300, 976  escreveu:

When I add parameter the activate method is not being invoked at all -  
also tried with two different activate methods;(


Try onActivate(EventContext context). It will be called regardless of the  
number of parameters. Also take a look at  
http://tapestry.apache.org/tapestry5.1/guide/pagenav.html.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



Re: passing values between pages (search -> result)

2009-10-06 Thread 976

When I add parameter the activate method is not being invoked at all - also
tried with two different activate methods;(


cordenier christophe wrote:
> 
> I think you should add a parameter to your activate method to respond to
> the
> corresponding passivate method.
> 
> Christophe
> 
> 

-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769403.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: passing values between pages (search -> result)

2009-10-06 Thread Thiago H. de Paula Figueiredo


Em Tue, 06 Oct 2009 10:58:03 -0300, 976  escreveu:


Thanks for fast response.
ListClients:
public void onActivate(){


You're ignoring the activation context. You should get it through an  
onActivate(EventContext context) method and then set the field(s)  
containing the search criteria.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



RE: passing values between pages (search -> result)

2009-10-06 Thread 976

Thanks - as I described in first post - I've tried that.
When I use @Persist this value is ALWAYS there, and I ALWAYS get data
retrieved from client query and I have separate link for SearchClients where
I want to list all clients. When I use flash type the behavior is
nondeterministic.

Is there any tutorial for search+result pages?



Newham, Cameron wrote:
> 
> I've never used onPassivate()
> 
> You need to have @Persist otherwise the value will be null.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769321.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: passing values between pages (search -> result)

2009-10-06 Thread cordenier christophe
I think you should add a parameter to your activate method to respond to the
corresponding passivate method.

Christophe

2009/10/6 976 

>
> Thanks for fast response.
> ListClients:
>public void onActivate(){
>System.out.println("___ List activate");
>if(client==null){
>System.out.println("getting all");
>clients = clientService.getClients();
>}else{
>System.out.println("getting for search:
> "+client.getFirst());
>clients = clientService.getClientByCriteria(client);
>}
>}
>
>
>Object onPassivate() {
>System.out.println("___ List passivate");
>return clients;
>}
>
> SearchClient:
>public Object onPassivate(){
>System.out.println("_ search passivate return
> "+(client!=null));
>return client;
>}
>
> If i remove the passivate methods - the result is exactly the same
>
> corTdenier christophe wrote:
> >
> > Can you post your activate and passivate methods ?
> >
> > 2009/10/6 976 
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769253.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: passing values between pages (search -> result)

2009-10-06 Thread 976

Thanks for fast response.
ListClients:
public void onActivate(){
System.out.println("___ List activate");
if(client==null){
System.out.println("getting all");
clients = clientService.getClients();
}else{
System.out.println("getting for search: 
"+client.getFirst());
clients = clientService.getClientByCriteria(client);
}
}


Object onPassivate() {
System.out.println("___ List passivate");
return clients;
}

SearchClient:
public Object onPassivate(){
System.out.println("_ search passivate return 
"+(client!=null));
return client;
}

If i remove the passivate methods - the result is exactly the same

corTdenier christophe wrote:
> 
> Can you post your activate and passivate methods ?
> 
> 2009/10/6 976 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769253.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: passing values between pages (search -> result)

2009-10-06 Thread Thiago H. de Paula Figueiredo
Em Tue, 06 Oct 2009 10:55:13 -0300, Newham, Cameron   
escreveu:



I've never used onPassivate()


You should. ;)


You need to have @Persist otherwise the value will be null.


That's another solution, as long as you don't need to support different  
searches in different tabs.


--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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



RE: passing values between pages (search -> result)

2009-10-06 Thread Newham, Cameron
I've never used onPassivate()

You need to have @Persist otherwise the value will be null.


-Original Message-
From: 976 [mailto:amsc...@gmail.com] 
Sent: 06 October 2009 14:48
To: users@tapestry.apache.org
Subject: Re: passing values between pages (search -> result)


Hi.
Thanks for the info - I've read it all again, and added passivate
returning
my search criteria client in SearchClient and list of clients in
ClientList
and still no luck;(
I added sysouts in activate and passivate methods and one in setter and
the
output is:
___setting client with name: John
___ List passivate
___ List activate
getting all
___ List passivate
_ search passivate return false
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate

Somehow it says client is null in SearchClients - like it wasn't passed
from
SearchClient at all, but the setter is invoked - client property is set
and
in activate it says it's null;(
I think I don't understand onActivate and onPassivate in proper way;(

Thanks,
Adam

Hello

Have a look at http://tapestry.apache.org/tapestry5.1/guide/pagenav.html

If you want to use 'activate' you have also to define the pending
'passivate' method.

Christophe.


-- 
View this message in context:
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result
%29-tp25765698p25769048.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


**
 
Experience the British Library online at http://www.bl.uk/
 
The British Library’s new interactive Annual Report and Accounts 2007/08 : 
http://www.bl.uk/knowledge
 
Help the British Library conserve the world's knowledge. Adopt a Book. 
http://www.bl.uk/adoptabook
 
The Library's St Pancras site is WiFi - enabled
 
*
 
The information contained in this e-mail is confidential and may be legally 
privileged. It is intended for the addressee(s) only. If you are not the 
intended recipient, please delete this e-mail and notify the 
mailto:postmas...@bl.uk : The contents of this e-mail must not be disclosed or 
copied without the sender's consent.
 
The statements and opinions expressed in this message are those of the author 
and do not necessarily reflect those of the British Library. The British 
Library does not take any responsibility for the views of the author.
 
*
 

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



Re: passing values between pages (search -> result)

2009-10-06 Thread cordenier christophe
Can you post your activate and passivate methods ?

2009/10/6 976 

>
> Hi.
> Thanks for the info - I've read it all again, and added passivate returning
> my search criteria client in SearchClient and list of clients in ClientList
> and still no luck;(
> I added sysouts in activate and passivate methods and one in setter and the
> output is:
> ___setting client with name: John
> ___ List passivate
> ___ List activate
> getting all
> ___ List passivate
> _ search passivate return false
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
> ___ List passivate
>
> Somehow it says client is null in SearchClients - like it wasn't passed
> from
> SearchClient at all, but the setter is invoked - client property is set and
> in activate it says it's null;(
> I think I don't understand onActivate and onPassivate in proper way;(
>
> Thanks,
> Adam
>
> Hello
>
> Have a look at http://tapestry.apache.org/tapestry5.1/guide/pagenav.html
>
> If you want to use 'activate' you have also to define the pending
> 'passivate' method.
>
> Christophe.
>
>
> --
> View this message in context:
> http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769048.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: passing values between pages (search -> result)

2009-10-06 Thread 976

Hi.
Thanks for the info - I've read it all again, and added passivate returning
my search criteria client in SearchClient and list of clients in ClientList
and still no luck;(
I added sysouts in activate and passivate methods and one in setter and the
output is:
___setting client with name: John
___ List passivate
___ List activate
getting all
___ List passivate
_ search passivate return false
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate
___ List passivate

Somehow it says client is null in SearchClients - like it wasn't passed from
SearchClient at all, but the setter is invoked - client property is set and
in activate it says it's null;(
I think I don't understand onActivate and onPassivate in proper way;(

Thanks,
Adam

Hello

Have a look at http://tapestry.apache.org/tapestry5.1/guide/pagenav.html

If you want to use 'activate' you have also to define the pending
'passivate' method.

Christophe.


-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25769048.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 clientIds for elements in a block/zone

2009-10-06 Thread Toby Hobson
typo ... should have been $$('.billing') ... i need some new glasses!

2009/10/6 Toby Hobson 

> I can confirm that both Thiago's and Christophe's approaches work. In the
> end I used Thiago's suggestion because although I gave the example of
> needing to copy one text field, in fact I needed to do this for 10 fields so
> passing 20 clientIds to a javascript function/constructor was less than
> ideal. Thiago's suggestion worked especially well because I could do
> something like
>
> 
> 
> ...
> 
> 
>
> function copyDetails() {
>   var techFields = $(('.tech');
>   var billingFields = $(('.billing');
>   for (var i = 0; i < techFields.length; i++) {
> // check field type
> ...
> // if field is textfield
> billingFields[i].value = techFields[i].value;
>   }
> }
>
> Thanks to Thiago and Christophe!
>
> Toby
>
> 2009/10/6 cordenier christophe 
>
>> Thanks Thiago, never thought about this approach.
>>
>> Even if class is not unique, we would be able to find my elements like
>> this
>> too.
>>
>
>


Re: T5 clientIds for elements in a block/zone

2009-10-06 Thread Toby Hobson
I can confirm that both Thiago's and Christophe's approaches work. In the
end I used Thiago's suggestion because although I gave the example of
needing to copy one text field, in fact I needed to do this for 10 fields so
passing 20 clientIds to a javascript function/constructor was less than
ideal. Thiago's suggestion worked especially well because I could do
something like



...



function copyDetails() {
  var techFields = $(('.tech');
  var billingFields = $(('.billing');
  for (var i = 0; i < techFields.length; i++) {
// check field type
...
// if field is textfield
billingFields[i].value = techFields[i].value;
  }
}

Thanks to Thiago and Christophe!

Toby

2009/10/6 cordenier christophe 

> Thanks Thiago, never thought about this approach.
>
> Even if class is not unique, we would be able to find my elements like this
> too.
>


Re: Problem with error404

2009-10-06 Thread cordenier christophe
Hello

Have you tried with a ComponenRequestFilter instead ?

Christophe

2009/10/6 Jan Jirout 

> Hi All,
>
> I'm playing some time with t5. I have meet simple problem. I hope that it's
> not my fault.
>
> So.
>
> I would like to handle "Error 404" in my application so I have in web.xml:
>
>
>app
>/*
>REQUEST
>ERROR
>
>
>
>404
>/error404
>
>
>
> My Index.java is:
>
>
>void onActivate(final String pageUrl) throws IOException {
>if (isKnownPage(pageUrl)) {
>//show page
>} else {
> response.sendError(404, null);
>}
>}
>
> If I access page "/hello"  then pageUrl property is "hello". If there is
> page /hello then this page is normally processed. If I sendError then page
> error404 should be shown. This Error page exists. So when I access /blah
> then /error404 page is shown. It works fine with jetty. But it doesn't work
> with tomcat 6.
>
> I have tried to debug it, and it seems to me, that information about
> content type is lost. In class BufferedGZipOutputStream is already
> information about content type lost but in class PageResponseRendererImpl is
> still present.
>
> thanks for help
>
> Jan
>
>
>
> Here is my stack trace:
> SEVERE: Servlet.service() for servlet default threw exception
> java.lang.NullPointerException
>at
> org.apache.tapestry5.internal.services.ResponseCompressionAnalyzerImpl.isCompressable(ResponseCompressionAnalyzerImpl.java:65)
>at
> $ResponseCompressionAnalyzer_1241954ff2c.isCompressable($ResponseCompressionAnalyzer_1241954ff2c.java)
>at
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream(BufferedGZipOutputStream.java:77)
>at
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.checkForCutover(BufferedGZipOutputStream.java:70)
>at
> org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write(BufferedGZipOutputStream.java:116)
>at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
>at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
>at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
>at java.io.OutputStreamWriter.write(OutputStreamWriter.java:190)
>at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
>at java.io.BufferedWriter.write(BufferedWriter.java:212)
>at java.io.PrintWriter.write(PrintWriter.java:412)
>at java.io.PrintWriter.write(PrintWriter.java:429)
>at java.io.PrintWriter.print(PrintWriter.java:559)
>at org.apache.tapestry5.dom.Text.toMarkup(Text.java:59)
>at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>at
> org.apache.tapestry5.dom.Element.writeChildMarkup(Element.java:840)
>at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
>at org.apache.tapestry5.dom.Document.toMarkup(Document.java:163)
>at org.apache.tapestry5.dom.Node.toMarkup(Node.java:80)
>at
> org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup(MarkupWriterImpl.java:57)
>at
> org.apache.tapestry5.internal.services.PageResponseRendererImpl.renderPageResponse(PageResponseRendererImpl.java:67)
>at
> $PageResponseRenderer_1241954ff57.renderPageResponse($PageResponseRenderer_1241954ff57.java)
>at
> org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler.handleRequestException(DefaultRequestExceptionHandler.java:77)
>at
> $RequestExceptionHandler_1241954ff38.handleRequestException($RequestExceptionHandler_1241954ff38.java)
>at
> org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
>at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>at
> org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778)
>at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>at
> org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767)
>at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>at
> org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85)
>at
> $RequestHandler_1241954ff3a.service($RequestHandler_1241954ff3a.java)
>at
> org.apach

Re: passing values between pages (search -> result)

2009-10-06 Thread cordenier christophe
Hello

Have a look at http://tapestry.apache.org/tapestry5.1/guide/pagenav.html

If you want to use 'activate' you have also to define the pending
'passivate' method.

Christophe.

2009/10/6 976 

>
> I'm totally new to Tapestry (2 days playing with it), but I'm stuck with
> quite simple problem;( (At least I guess so).
>
> What I want to to is to create 4 pages for Client entity:
> - list (list all clients or ones from search result)
> - edit
> - add
> - find
>
> Didn't have any problems with first three, but having problems with last
> one.
>
> I've created SearchClient, AddClient, ListClients pages (java+tml).
>
> What I want to do is to input search criteria on SearchClient and list the
> results in ListClients and I don't really now how to pass data between
> pages.
> First of all AddClient and SearchClient have
>
> @IncludePage
> private ListClients listClients;
> and AddClient has:
>public Object onSuccess() {
>clientService.addClient(client);
>return listClients;
>}
>
> which works just fine.
>
> In SearchClient I firstly tried to retrieve data onSuccess and pass the
> collection to onActivate method of ListClients but passing it didn't work;(
> Can't get the idea of what happens there, but what I wanted to do show
> collection passed from SearchClient if it existed and list all if it didnt.
> And always came up with list of all clients.
>
> Later I tried putting in SearchClient:
>Object onSuccess() {
>listClients.setClient(client);
>return listClients;
>}
>
> Still - this client was always null in the following:
>public void onActivate(){
>if(client==null){
>clients = clientService.getClients();
>}else{
>clients = clientService.getClientByCriteria(client);
>}
>}
>
> After doing some search I tried doing @Persist on client property in, but
> it
> turned out to ALWAYS be set which wasn't also good as couldn't list all
> clients - always one from criteria.
>
> So I tried @Persist("flash") - and the behavior of this one I can't even
> describe;)
>
> I really tried to google the solution for search screen + results screen
> but
> with no luck.
>
> Is this onActivate() approach good at all or should I use some other way of
> passing data between pages?
> As I said - what I want to accomplish is to list clients from search screen
> and if this criteria was not created at all (list all clients from
> dirrenent
> link) I want to list them all.
>
>
> Will be very grateful for any help.
> bwt. I made sure to look over all info on tapestry main page;( + other
> googled examples/tutorials
>
> Thanks,
> Adam
>
> --
> View this message in context:
> http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25765698.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
>
>


Problem with error404

2009-10-06 Thread Jan Jirout

Hi All,

I'm playing some time with t5. I have meet simple problem. I hope that  
it's not my fault.


So.

I would like to handle "Error 404" in my application so I have in  
web.xml:



app
/*
REQUEST
ERROR



404
/error404



My Index.java is:


void onActivate(final String pageUrl) throws IOException {
if (isKnownPage(pageUrl)) {
//show page
} else {
 response.sendError(404, null);
}
}

If I access page "/hello"  then pageUrl property is "hello". If there  
is page /hello then this page is normally processed. If I sendError  
then page error404 should be shown. This Error page exists. So when I  
access /blah then /error404 page is shown. It works fine with jetty.  
But it doesn't work with tomcat 6.


I have tried to debug it, and it seems to me, that information about  
content type is lost. In class BufferedGZipOutputStream is already  
information about content type lost but in class  
PageResponseRendererImpl is still present.


thanks for help

Jan



Here is my stack trace:
SEVERE: Servlet.service() for servlet default threw exception
java.lang.NullPointerException
at  
org.apache.tapestry5 
.internal.services.ResponseCompressionAnalyzerImpl.isCompressable 
(ResponseCompressionAnalyzerImpl.java:65)
at $ResponseCompressionAnalyzer_1241954ff2c.isCompressable 
($ResponseCompressionAnalyzer_1241954ff2c.java)
at  
org.apache.tapestry5 
.internal.gzip.BufferedGZipOutputStream.openResponseOutputStream 
(BufferedGZipOutputStream.java:77)
at  
org.apache.tapestry5 
.internal.gzip.BufferedGZipOutputStream.checkForCutover 
(BufferedGZipOutputStream.java:70)
at  
org.apache.tapestry5.internal.gzip.BufferedGZipOutputStream.write 
(BufferedGZipOutputStream.java:116)

at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java: 
190)

at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:111)
at java.io.BufferedWriter.write(BufferedWriter.java:212)
at java.io.PrintWriter.write(PrintWriter.java:412)
at java.io.PrintWriter.write(PrintWriter.java:429)
at java.io.PrintWriter.print(PrintWriter.java:559)
at org.apache.tapestry5.dom.Text.toMarkup(Text.java:59)
at org.apache.tapestry5.dom.Element.writeChildMarkup 
(Element.java:840)

at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
at org.apache.tapestry5.dom.Element.writeChildMarkup 
(Element.java:840)

at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
at org.apache.tapestry5.dom.Element.writeChildMarkup 
(Element.java:840)

at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
at org.apache.tapestry5.dom.Element.writeChildMarkup 
(Element.java:840)

at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
at org.apache.tapestry5.dom.Element.writeChildMarkup 
(Element.java:840)

at org.apache.tapestry5.dom.Element.toMarkup(Element.java:356)
at org.apache.tapestry5.dom.Document.toMarkup(Document.java: 
163)

at org.apache.tapestry5.dom.Node.toMarkup(Node.java:80)
at  
org.apache.tapestry5.internal.services.MarkupWriterImpl.toMarkup 
(MarkupWriterImpl.java:57)
at  
org.apache.tapestry5 
.internal.services.PageResponseRendererImpl.renderPageResponse 
(PageResponseRendererImpl.java:67)
at $PageResponseRenderer_1241954ff57.renderPageResponse 
($PageResponseRenderer_1241954ff57.java)
at  
org.apache.tapestry5 
.internal.services.DefaultRequestExceptionHandler.handleRequestException 
(DefaultRequestExceptionHandler.java:77)
at $RequestExceptionHandler_1241954ff38.handleRequestException 
($RequestExceptionHandler_1241954ff38.java)
at  
org.apache.tapestry5.internal.services.RequestErrorFilter.service 
(RequestErrorFilter.java:42)
at $RequestHandler_1241954ff3a.service 
($RequestHandler_1241954ff3a.java)
at org.apache.tapestry5.services.TapestryModule$4.service 
(TapestryModule.java:778)
at $RequestHandler_1241954ff3a.service 
($RequestHandler_1241954ff3a.java)
at org.apache.tapestry5.services.TapestryModule$3.service 
(TapestryModule.java:767)
at $RequestHandler_1241954ff3a.service 
($RequestHandler_1241954ff3a.java)
at  
org.apache.tapestry5.internal.services.StaticFilesFilter.service 
(StaticFilesFilter.java:85)
at $RequestHandler_1241954ff3a.service 
($RequestHandler_1241954ff3a.java)
at  
org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke 
(CheckForUpdatesFilter.java:90)
at  
org.apache.tapestry5.internal.services.Ch

passing values between pages (search -> result)

2009-10-06 Thread 976

I'm totally new to Tapestry (2 days playing with it), but I'm stuck with
quite simple problem;( (At least I guess so).

What I want to to is to create 4 pages for Client entity:
- list (list all clients or ones from search result)
- edit
- add
- find

Didn't have any problems with first three, but having problems with last
one.

I've created SearchClient, AddClient, ListClients pages (java+tml).

What I want to do is to input search criteria on SearchClient and list the
results in ListClients and I don't really now how to pass data between
pages.
First of all AddClient and SearchClient have 

@IncludePage
private ListClients listClients;
and AddClient has:
public Object onSuccess() {
clientService.addClient(client);
return listClients;
}

which works just fine.

In SearchClient I firstly tried to retrieve data onSuccess and pass the
collection to onActivate method of ListClients but passing it didn't work;(
Can't get the idea of what happens there, but what I wanted to do show
collection passed from SearchClient if it existed and list all if it didnt.
And always came up with list of all clients.

Later I tried putting in SearchClient:
Object onSuccess() {
listClients.setClient(client);
return listClients;
}

Still - this client was always null in the following:
public void onActivate(){
if(client==null){
clients = clientService.getClients();
}else{
clients = clientService.getClientByCriteria(client);
}
}
 
After doing some search I tried doing @Persist on client property in, but it
turned out to ALWAYS be set which wasn't also good as couldn't list all
clients - always one from criteria.

So I tried @Persist("flash") - and the behavior of this one I can't even
describe;)

I really tried to google the solution for search screen + results screen but
with no luck.

Is this onActivate() approach good at all or should I use some other way of
passing data between pages?
As I said - what I want to accomplish is to list clients from search screen
and if this criteria was not created at all (list all clients from dirrenent
link) I want to list them all.


Will be very grateful for any help.
bwt. I made sure to look over all info on tapestry main page;( + other
googled examples/tutorials

Thanks,
Adam

-- 
View this message in context: 
http://www.nabble.com/passing-values-between-pages-%28search--%3E-result%29-tp25765698p25765698.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: Antwort: Validation question - at which point are property values set before post

2009-10-06 Thread Ulrich Stärk
Also consider the validateForm event that gets fired before success and after all individual form 
fields have been processed. This is the right point for cross-field validation.


Uli

Am 06.10.2009 09:30 schrieb dirk.latterm...@bgs-ag.de:
Peter Stavrinides  schrieb am 06.10.2009 
09:07:53:



Validation question - at which point are property values set before post


They seem to be set after the input field validators complete.

//This code works
public void onSuccess() throws SQLException {

  if(isTerminated()){
 if(personnelData.getEndDate() == null){ 
employeeform.recordError("End date is required");

return;
 }
  }
...
}


On success is fired after the validation succeeded, so the properties are 
set.



//And this code doesn't because the property personnelData.getEndDate
() appears to not have been set yet!

void onValidateFromEndDate(){
   if(isTerminated()){
  if(personnelData.getEndDate() == null){
 employeeform.recordError("End date is required");
  }
   }
}


In the field validators, the corresponding properties are not set yet. You 
can get the value via a parameter:


void onValidateFromEndDate(String theDate) { ... }

If you don't use a String parameter, the type will be coerced to the class 
you specified. I'm not sure which class works best for your endDate, maybe

void onValidateFromEndDate(Date theDate) { ... }

HTH, Dirk
BGS Beratungsgesellschaft 
Software Systemplanung AG Niederlassung Köln/Bonn 
Grantham-Allee 2-8 
53757 Sankt Augustin 
Fon: +49 (0) 2241 / 166-500 
Fax: +49 (0) 2241 / 166-680 
www.bgs-ag.de Geschäftssitz Mainz 
Registergericht 
Amtsgericht Mainz 
HRB 62 50 
  Aufsichtsratsvorsitzender 
Klaus Hellwig 
Vorstand 
Hermann Kiefer 
Nils Manegold 
Thomas Reitz 



  


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



Re: T5.1 submit not working

2009-10-06 Thread formpost

> Your form does not need the Submit component, just an ordinary  HTML tag. 

Whether I use a component to render a submit button, or use the standard
submit button doesn't change the fact that the form is calling javascript
that doesn't work. The method, Tapestry.waitForPage(event) that is added to
the form onSubmit event is the start of the issue. 

from source:


The offending line in the waitForPage(event) javascript method that never
ends, and therefore stopped the POST event from reaching the server.

var overlay = new Element("div", {'class' : 't-dialog-overlay'});

I cannot give you the file as it is a virtual asset of T5.1, but the line is
5590 of that file. :)



>A checkbox needs to be bound to a boolean property, and you're tring to
bind it to an Item.

I apologise, I should have included my bean class, Item. (see below) As you
can see I have a boolean field for each checkbox and a String field for each
name within the loop. 

If the loop isn't configured to be volatile submitting the form via a simple
this.form.submit call (I can't use a submit button due to the issues already
stated) I get "Could not find a coercion from type java.lang.String to type
Item" 

Can anyone explain why changing the loop to volatile changes this behavior.
And what string T5 is trying to coerce into Item?  If it is the false/true
string from the checkbox, how would/should I normally handle such coercions.

Item.class
public class Item implements Serializable {
  private static final long serialVersionUID = 1L;
  private String name = "";
  private boolean toBeDeleted;
  public Item() {
  this.toBeDeleted = false;
  }
  public Item(String name) {
  this();
  this.name = name;
  }
  public String getName() {
  return name;
  }
  public void setName(String name) {
  this.name = name;
   }
   public boolean isToBeDeleted() {
  return toBeDeleted;
  }
  public void setToBeDeleted(boolean toBeDeleted) {
  this.toBeDeleted = toBeDeleted;
  }
  @Override
  public boolean equals(Object obj) {
  return EqualsBuilder.reflectionEquals(this, obj);
  }
  @Override
  public int hashCode() {
  return HashCodeBuilder.reflectionHashCode(this);
  }
}
-- 
View this message in context: 
http://www.nabble.com/T5.1-submit-not-working-tp25751968p25764497.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



Jetty lock on JS-files in classpath breaks eclipse autobuild

2009-10-06 Thread Inge Solvoll
Hi!

I'm having problems with my development environment.

First of all: I have set the useFileMappedBuffer=false in
/etc/webdefault.xml

My problem is that Tapestry 5 Javascript files located in WEB-INF/classes
and subfolders are locked by Jetty. This prevents eclipse from deleting
WEB-INF/classes to do a rebuild after I make a change in a java file. The
end result is that most class files are deleted and not rebuilt, so I have
to stop jetty, do a manual rebuild, and then start Jetty again. This if, of
course, a disaster for me...

Does anyone here have a clue on how to prevent Jetty from locking the
resource files in WEB-INF/classes?


Re: T5 clientIds for elements in a block/zone

2009-10-06 Thread cordenier christophe
Thanks Thiago, never thought about this approach.

Even if class is not unique, we would be able to find my elements like this
too.


Antwort: Validation question - at which point are property values set before post

2009-10-06 Thread dirk . lattermann
Peter Stavrinides  schrieb am 06.10.2009 
09:07:53:

> Validation question - at which point are property values set before post

They seem to be set after the input field validators complete.
> 
> //This code works
> public void onSuccess() throws SQLException {
> 
>   if(isTerminated()){
>  if(personnelData.getEndDate() == null){ 
> employeeform.recordError("End date is required");
> return;
>  }
>   }
> ...
> }

On success is fired after the validation succeeded, so the properties are 
set.

> 
> //And this code doesn't because the property personnelData.getEndDate
> () appears to not have been set yet!
> 
> void onValidateFromEndDate(){
>if(isTerminated()){
>   if(personnelData.getEndDate() == null){
>  employeeform.recordError("End date is required");
>   }
>}
> }

In the field validators, the corresponding properties are not set yet. You 
can get the value via a parameter:

void onValidateFromEndDate(String theDate) { ... }

If you don't use a String parameter, the type will be coerced to the class 
you specified. I'm not sure which class works best for your endDate, maybe
void onValidateFromEndDate(Date theDate) { ... }

HTH, Dirk
BGS Beratungsgesellschaft 
Software Systemplanung AG Niederlassung Köln/Bonn 
Grantham-Allee 2-8 
53757 Sankt Augustin 
Fon: +49 (0) 2241 / 166-500 
Fax: +49 (0) 2241 / 166-680 
www.bgs-ag.de Geschäftssitz Mainz 
Registergericht 
Amtsgericht Mainz 
HRB 62 50 
  Aufsichtsratsvorsitzender 
Klaus Hellwig 
Vorstand 
Hermann Kiefer 
Nils Manegold 
Thomas Reitz 


  

Validation question - at which point are property values set before post

2009-10-06 Thread Peter Stavrinides
Hi everyone,

I came across what seems a strange scenario to me, using Tapestry 5 validation. 
I am looking for a little understanding more than anything else with regards to 
'the point at which properties values are set, before a form posts'...  please 
examine this code snippet:

//This code works
public void onSuccess() throws SQLException {

if(isTerminated()){
if(personnelData.getEndDate() == null){  
employeeform.recordError("End date is 
required");
return;
}
}
...
}

//And this code doesn't because the property personnelData.getEndDate() appears 
to not have been set yet!

void onValidateFromEndDate(){
if(isTerminated()){
if(personnelData.getEndDate() == null){
employeeform.recordError("End date is required");
}
}
}

personnelData.getEndDate() evaluates to a date in the onSuccess() method, but 
in the onValidateFromEndDate validator it is null?? the component in question 
is a datepicker, so the value is set via JavaScript. I am wandering why 
Tapestry doesn't pick up the value change until the onSuccess() event triggers.

Thanks,
Peter

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