T5 is it possible to Inject PersistanceLocale in AppModule ?
Hi, Is there any way to inject PersistanceLocale in AppModule ? -- sincerely yours M. H. Shamsi
Re: What is the difference between a Translator and FieldTranslator
Well, I now just assure all my Translators are also FieldTranslators and vice versa. Kind egards, Joachim Christoph Jäger wrote: Hi, I just stumbled upon the same problem when updating from 5.0.14 to 5.0.15. There must be a way that Tapestry automatically creates the FieldTranslator if a Translator is specified for a field. All the information should be there. As I see it, apart from the Translator, the FieldTranslator needs the Field, a MessageFormatter and a FormSupport instance to do its work. I can't believe we have to manually pick up all of these objects and create a FieldTranslator (a separate one for each field in a form). Looking at how Tapestry automatically creates / converts / coerces lots of other useful stuff, I am almost sure there are some magic configuration entries to enable automatic creation of FieldTranslators (given a Translator), we just need to find them. Best Regards, Christoph On Oct 8, 2008, at 19:25 , Joachim Van der Auwera wrote: Howard Lewis Ship wrote: A FieldTranslator is a wrapper around a Translator that is configured for a specific Field component. Thanks. Should these not be created automatically? This has caused me major headaches for migrating to 5.0.15, I had to change all my translators, assure they also implement FieldTranslator and replace all translate=translate:string to a (custom) StringTranslator which implements both Translator and FieldTranslator. Kind regards, Joachim On Wed, Oct 8, 2008 at 5:40 AM, Joachim Van der Auwera [EMAIL PROTECTED] wrote: And when should which be used? I am getting coercing errors trying to convert between the two, but it is unclear to me why there is a difference (the interfaces look very similar). Joachim -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Christoph Jäger [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry 5 Problems with client-side validation
Hi all! I'm using Tapestry 5.0.15, and I'm having some problems with validate (on client side) a required text field in my forms. Basically, the validation bubble does not appear for me. Let's show my codes. First, I have an entity, called Organizadora. Here's is the code: public class Organizadora implements Serializable { private static final long serialVersionUID = 1L; // primary key private Integer id; // other fields private String nome; private String sigla; private SetProva provas; private String url; public Organizadora() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getSigla() { return sigla; } public void setSigla(String sigla) { this.sigla = sigla; } public SetProva getProvas() { return provas; } public void setProvas(SetProva provas) { this.provas = provas; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public void adicionaProva(Prova prova) { if (this.provas == null) { this.provas = new HashSetProva(); } prova.setOrganizadora(this); this.provas.add(prova); } @Override public boolean equals(Object obj) { return super.equals(obj); } @Override public int hashCode() { return super.hashCode(); } @Override public String toString() { return super.toString(); } } Then, I have a page that contains a form to save a new entity. Here's the .tml: t:border t:tituloPagina=Include Organizadora xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; H3Include Organizadora/H3 t:form t:id=form fieldset TABLE cellSpacing=1 cellPadding=0 border=0 TBODY TR TDSTRONGNome:/STRONG/TD TDt:textfield t:id=nome t:value=organizadora.nome t:validate=required size=80//TD /TR TR TDSTRONGUrl:/STRONG/TD TDt:textfield size=80 t:id=url t:value=organizadora.url //TD /TR TR TDSTRONGSigla:/STRONG/TD TDt:textfield size=40 t:id=sigla t:value=organizadora.sigla //TD /TR /TBODY /TABLE /fieldset div align=right INPUT t:type=submit type=submit value=Include / /div /t:form div align=center Back to the Organizadora's list. /div /t:border As you can note, the text field nome is marked as required. And, finally, here is the class for this .tml: package br.com.tiquestoes.pages; import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import br.com.tiquestoes.dao.OrganizadoraDAO; import br.com.tiquestoes.dominio.Organizadora; /** * @author André Thiago * */ public class PaginaIncluirOrganizadora { @Property private Organizadora organizadora; @Inject private OrganizadoraDAO organizadoraDAO; @InjectPage private PaginaListaOrganizadoras paginaLista; private Integer id; public void onActivate(Integer id){ this.id = id; organizadora = new Organizadora(); } public Object onPassivate() { return id; } Object onSubmitFromForm() { organizadoraDAO.inserirOrganizadora(organizadora); paginaLista.setMensagemSucesso(Entity was included successfully.); return paginaLista; } } But, as I said, when I click in the submit button, the client-side validation is not performed. Did I forget anything? André Thiago -- View this message in context:
Any chance to find out which component fired an event?
Hi, I have a list of objects over which a page is iterating and creating instances of beanedit components. In case of validation I can simply catch the validation event of all forms with a onValidateForm. However I don't know where to record a potential error. The gotcha here is that the list has a dynamic length and I do not have references to every beanedit component in my page class. Is there any possibility to get a reference to the component that fired the event at runtime? Thanks, Markus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5 Problems with client-side validation
It should work. Try it in Firefox with Firebug installed, check to see if there are any errors. Trying using Shift-F5 to force a reload of the page (this ensures that fresh copies of files are retrieved from the server, rather than cached copies). View the source and check that the validation JavaScript is included at the bottom of the page. Also make sure your Border component includes an html and body element ... if either is missing, no JavaScript is sent to the client. On Sat, Oct 25, 2008 at 9:17 AM, andrethiago [EMAIL PROTECTED] wrote: Hi all! I'm using Tapestry 5.0.15, and I'm having some problems with validate (on client side) a required text field in my forms. Basically, the validation bubble does not appear for me. Let's show my codes. First, I have an entity, called Organizadora. Here's is the code: public class Organizadora implements Serializable { private static final long serialVersionUID = 1L; // primary key private Integer id; // other fields private String nome; private String sigla; private SetProva provas; private String url; public Organizadora() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getSigla() { return sigla; } public void setSigla(String sigla) { this.sigla = sigla; } public SetProva getProvas() { return provas; } public void setProvas(SetProva provas) { this.provas = provas; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public void adicionaProva(Prova prova) { if (this.provas == null) { this.provas = new HashSetProva(); } prova.setOrganizadora(this); this.provas.add(prova); } @Override public boolean equals(Object obj) { return super.equals(obj); } @Override public int hashCode() { return super.hashCode(); } @Override public String toString() { return super.toString(); } } Then, I have a page that contains a form to save a new entity. Here's the .tml: t:border t:tituloPagina=Include Organizadora xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; H3Include Organizadora/H3 t:form t:id=form fieldset TABLE cellSpacing=1 cellPadding=0 border=0 TBODY TR TDSTRONGNome:/STRONG/TD TDt:textfield t:id=nome t:value=organizadora.nome t:validate=required size=80//TD /TR TR TDSTRONGUrl:/STRONG/TD TDt:textfield size=80 t:id=url t:value=organizadora.url //TD /TR TR TDSTRONGSigla:/STRONG/TD TDt:textfield size=40 t:id=sigla t:value=organizadora.sigla //TD /TR /TBODY /TABLE /fieldset div align=right INPUT t:type=submit type=submit value=Include / /div /t:form div align=center Back to the Organizadora's list. /div /t:border As you can note, the text field nome is marked as required. And, finally, here is the class for this .tml: package br.com.tiquestoes.pages; import org.apache.tapestry5.annotations.InjectPage; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.ioc.annotations.Inject; import br.com.tiquestoes.dao.OrganizadoraDAO; import br.com.tiquestoes.dominio.Organizadora; /** * @author André Thiago * */ public class PaginaIncluirOrganizadora { @Property private Organizadora organizadora; @Inject private OrganizadoraDAO organizadoraDAO; @InjectPage private PaginaListaOrganizadoras paginaLista; private Integer id; public void onActivate(Integer id){ this.id = id; organizadora = new Organizadora(); } public Object onPassivate() {
JSON return from an event
Hi, I read the page on AJAX on the website and it implies I can return a JSONObject directly from an event (if it is called via ajax). However when I implemented this - I got an error saying it didn't know what to do with a JSON object. It does work if you encode the JSON response via a TextStreamResponse. Is this a bug? - Or am a I missing something?
T5: Using with hibernate and Mysql
Hello, I was wondering if anyone has a good example of using Tapestry 5 with Hibernate and Mysql or can tell me what I am doing wrong I use Eclipse/Tomcat/Mysql. I created a new project using Maven: mvn archetype:create -DarchetypeGroupId=org.apache.tapestry -DarchetypeArtifactId=quickstart -DgroupId=com.james -DartifactId=taphib -DpackageName=com.james.taphib -Dversion=1.0.0-SNAPSHOT I added this to my pom.xml dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-hibernate/artifactId version${tapestry-release-version}/version /dependency dependency groupIdmysql/groupId artifactIdmysql-connector-java/artifactId version5.1.5/version /dependency I created a filed called: hibernate.cfg.xml in src/main/resources ?xml version=1.0 encoding=UTF-8? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=hibernate.connection.driver_class org.gjt.mm.mysql.Driver/property property name=hibernate.connection.url jdbc:mysql://localhost/dbname?charset=utf8/property property name=hibernate.dialect org.hibernate.dialect.MySQLDialect/property property name=hibernate.connection.usernameuser/property property name=hibernate.connection.password/property !-- pool via c3p0 which knows how to reconnect to server and does it nicely-- property name=connection.provider_class org.hibernate.connection.C3P0ConnectionProvider/property property name=hibernate.c3p0.acquire_increment1/property property name=hibernate.c3p0.idle_test_period100/property !-- seconds -- property name=hibernate.c3p0.max_size10/property property name=hibernate.c3p0.max_statements0/property property name=hibernate.c3p0.min_size1/property property name=hibernate.c3p0.timeout100/property !-- seconds -- /session-factory /hibernate-configuration When I try to package using mvn package so I can deploy to eclipse I get the error: INFO] [ERROR] BUILD ERROR [INFO] [INFO] Failed to resolve artifact. Missing: -- 1) org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-co mmons-annotations -Dversion=3.1.0.GA -Dpackaging=jar -Dfile=/path/to/file I found a hibernate-commons-annotations.jar but I believe I am doing something wrong to cause this error. Thanks, --James
Re: Tapestry 5 Problems with client-side validation
Hi Howard! Thanks for the reply. I installed Firebug, but there was no errors. I also cleaned all personal data (cookies, data from forms ...) but it still not works! An interesting thing that I could note, looking at the generated source code, is that there is no javascript inside my page. Obviously, that is the reason because the client-side validation is not working. But, I cannot understand why the scripts are not sent. By the way, here is the source code of the border component: pre HTML xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; HEAD TITLEQuestões de TI - ${tituloPagina}/TITLE meta content=MSHTML 6.00.6000.16705 name=GENERATOR / META http-equiv=Content-Type content=text/html;charset=UTF-8 / LINK href=${asset:context:/styles/main.css} type=text/css rel=stylesheet / LINK href=${asset:context:/styles/styles.css} type=text/css rel=stylesheet / /HEAD BODY DIV class=box id=main DIV id=header H1 id=logoQuestões de TI/H1 HR class=noscreen / /DIV !-- header -- !-- Main menu (tabs) -- DIV class=noprint id=tabs UL class=box LI # Cargos /LI LI # Organizadoras /LI LI # Orgãos do Governo /LI LI # Provas /LI LI # Subtemas /LI LI # Temas /LI LI # Tipos de Questão /LI /UL HR class=noscreen / /DIV !-- /tabs -- DIV class=box id=page DIV class=box noprint id=strip!-- Breadcrumbs -- P id=breadcrumbsVoce está aqui: # Página Inicial /P HR class=noscreen / /DIV !-- /strip -- DIV id=content t:body / !-- content --/DIV /DIV !-- page -- DIV id=footer P align=centerQuestões de TI - 2008/P /DIV /DIV /BODY /HTML /pre Thanks again! Howard Lewis Ship wrote: It should work. Try it in Firefox with Firebug installed, check to see if there are any errors. Trying using Shift-F5 to force a reload of the page (this ensures that fresh copies of files are retrieved from the server, rather than cached copies). View the source and check that the validation JavaScript is included at the bottom of the page. Also make sure your Border component includes an html and body element ... if either is missing, no JavaScript is sent to the client. On Sat, Oct 25, 2008 at 9:17 AM, andrethiago [EMAIL PROTECTED] wrote: Hi all! I'm using Tapestry 5.0.15, and I'm having some problems with validate (on client side) a required text field in my forms. Basically, the validation bubble does not appear for me. Let's show my codes. First, I have an entity, called Organizadora. Here's is the code: public class Organizadora implements Serializable { private static final long serialVersionUID = 1L; // primary key private Integer id; // other fields private String nome; private String sigla; private SetProva provas; private String url; public Organizadora() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getSigla() { return sigla; } public void setSigla(String sigla) { this.sigla = sigla; } public SetProva getProvas() { return provas; } public void setProvas(SetProva provas) { this.provas = provas; } public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public void adicionaProva(Prova prova) { if (this.provas == null) { this.provas = new HashSetProva(); } prova.setOrganizadora(this); this.provas.add(prova); } @Override public boolean equals(Object obj) { return super.equals(obj); } @Override public int hashCode() { return super.hashCode(); } @Override public String toString() { return super.toString(); } } Then, I have a page that contains a form to save a new entity. Here's the .tml: t:border t:tituloPagina=Include Organizadora xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; H3Include Organizadora/H3 t:form t:id=form fieldset TABLE cellSpacing=1 cellPadding=0 border=0 TBODY TR TDSTRONGNome:/STRONG/TD TDt:textfield t:id=nome t:value=organizadora.nome t:validate=required size=80//TD /TR TR TDSTRONGUrl:/STRONG/TD
Re: Tapestry 5 Problems with client-side validation
Em Sat, 25 Oct 2008 15:10:41 -0300, andrethiago [EMAIL PROTECTED] escreveu: pre HTML xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; Are your sure you have a pre tag surrounding your HTML? You could also try to put all tags in lowercase. By the way, welcome to the list. :) One more Brazilian (as me)? -- Thiago H. de Paula Figueiredo Independent Java consultant, developer, and instructor http://www.arsmachina.com.br/thiago - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: T5: Using with hibernate and Mysql
Hello, I got the project working by adding these to the pom: dependency groupIdorg.hibernate/groupId artifactIdhibernate/artifactId version3.2.2.ga/version /dependency dependency groupIdc3p0/groupId artifactIdc3p0/artifactId version0.9.0/version /dependency dependency groupIdgeronimo-spec/groupId artifactIdgeronimo-spec-jta/artifactId version1.0-M1/version scopetest/scope /dependency And repository idAgile Java/id urlhttp://agilejava.com/maven//url /repository I am not sure if this is correct or not but I can interact with the DB and have the tutorial at http://wiki.apache.org/tapestry/Tapestry5HowToUseTapestryHibernate Working. I still cannot find a good Tapestry-Hibernate tutorial though. I have a rather large database created and would like to generate objects from it(this tutorial is the other way around). I am assuming this may be a hibernate situation and not tapestry-hibernate but any nudge in the right direction would be appreciated. Thanks, --James -Original Message- From: James Sherwood [mailto:[EMAIL PROTECTED] Sent: October-25-08 2:11 PM To: Tapestry users Subject: T5: Using with hibernate and Mysql Hello, I was wondering if anyone has a good example of using Tapestry 5 with Hibernate and Mysql or can tell me what I am doing wrong I use Eclipse/Tomcat/Mysql. I created a new project using Maven: mvn archetype:create -DarchetypeGroupId=org.apache.tapestry -DarchetypeArtifactId=quickstart -DgroupId=com.james -DartifactId=taphib -DpackageName=com.james.taphib -Dversion=1.0.0-SNAPSHOT I added this to my pom.xml dependency groupIdorg.apache.tapestry/groupId artifactIdtapestry-hibernate/artifactId version${tapestry-release-version}/version /dependency dependency groupIdmysql/groupId artifactIdmysql-connector-java/artifactId version5.1.5/version /dependency I created a filed called: hibernate.cfg.xml in src/main/resources ?xml version=1.0 encoding=UTF-8? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD 3.0//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=hibernate.connection.driver_class org.gjt.mm.mysql.Driver/property property name=hibernate.connection.url jdbc:mysql://localhost/dbname?charset=utf8/property property name=hibernate.dialect org.hibernate.dialect.MySQLDialect/property property name=hibernate.connection.usernameuser/property property name=hibernate.connection.password/property !-- pool via c3p0 which knows how to reconnect to server and does it nicely-- property name=connection.provider_class org.hibernate.connection.C3P0ConnectionProvider/property property name=hibernate.c3p0.acquire_increment1/property property name=hibernate.c3p0.idle_test_period100/property !-- seconds -- property name=hibernate.c3p0.max_size10/property property name=hibernate.c3p0.max_statements0/property property name=hibernate.c3p0.min_size1/property property name=hibernate.c3p0.timeout100/property !-- seconds -- /session-factory /hibernate-configuration When I try to package using mvn package so I can deploy to eclipse I get the error: INFO] [ERROR] BUILD ERROR [INFO] [INFO] Failed to resolve artifact. Missing: -- 1) org.hibernate:hibernate-commons-annotations:jar:3.1.0.GA Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-co mmons-annotations -Dversion=3.1.0.GA -Dpackaging=jar -Dfile=/path/to/file I found a hibernate-commons-annotations.jar but I believe I am doing something wrong to cause this error. Thanks, --James __ Information from ESET Smart Security, version of virus signature database 3536 (20081019) __ The message was checked by ESET Smart Security. http://www.eset.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the difference between a Translator and FieldTranslator
Ok, lets try to make our Translator also implement FieldTranslator. FieldTranslator defines 4 methods: 1. ClassT getType() 2. T parse(String input) 3. void render(MarkupWriter writer) 4. String toClient(T value) 1 is already implemented in Translator, for 2 we can call the already existing parseClient() method, 4 is already implemented. The only problem is 3: the API documentation says: Invokes Translator.render(Field, String, MarkupWriter,org.apache.tapestry5.services.FormSupport). So now our implementation needs to know about the Field and FormSupport, and a MessageFormatter. Where do you get these from in your implementation? There is a FieldTranslatorImpl class, which takes all of these objects as parameters for the constructor. Maybe use this instead of making your Translator also implement FieldTranslator? But as there is a class like this, I think it should be automatically instantiated when a FieldTranslator is needed and only a Translator is available. Am I missing something here? Best Regards, Christoph On Oct 25, 2008, at 16:13 , Joachim Van der Auwera wrote: Well, I now just assure all my Translators are also FieldTranslators and vice versa. Kind egards, Joachim Christoph Jäger wrote: Hi, I just stumbled upon the same problem when updating from 5.0.14 to 5.0.15. There must be a way that Tapestry automatically creates the FieldTranslator if a Translator is specified for a field. All the information should be there. As I see it, apart from the Translator, the FieldTranslator needs the Field, a MessageFormatter and a FormSupport instance to do its work. I can't believe we have to manually pick up all of these objects and create a FieldTranslator (a separate one for each field in a form). Looking at how Tapestry automatically creates / converts / coerces lots of other useful stuff, I am almost sure there are some magic configuration entries to enable automatic creation of FieldTranslators (given a Translator), we just need to find them. Best Regards, Christoph On Oct 8, 2008, at 19:25 , Joachim Van der Auwera wrote: Howard Lewis Ship wrote: A FieldTranslator is a wrapper around a Translator that is configured for a specific Field component. Thanks. Should these not be created automatically? This has caused me major headaches for migrating to 5.0.15, I had to change all my translators, assure they also implement FieldTranslator and replace all translate=translate:string to a (custom) StringTranslator which implements both Translator and FieldTranslator. Kind regards, Joachim On Wed, Oct 8, 2008 at 5:40 AM, Joachim Van der Auwera [EMAIL PROTECTED] wrote: And when should which be used? I am getting coercing errors trying to convert between the two, but it is unclear to me why there is a difference (the interfaces look very similar). Joachim -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Christoph Jäger [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Christoph Jäger [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: The URL encoding issue
On Fri, Oct 24, 2008 at 7:01 PM, Howard Lewis Ship [EMAIL PROTECTED] wrote: BTW, I'm actively working on the issue with URL encoding/decoding. Because of the differences between Jetty and Tomcat, I'm abandoning standard URL encoding (i.e., %2f and all that) and using my own scheme. As a side effect, we can now properly support null and blank string values in page activation and event contexts (they will appear in URLs as $N and $B, respectively). It's somehow between strange and sad to have this issues again and again but that seems to have come out nice, as usual. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Grid component removing a field
http://202.177.217.122:8080/jumpstart/examples/tables/addandremovecolumns1 On 25/10/2008, at 12:00 AM, James Sherwood wrote: Hello, Let's say I have a grid component running off a source with objects such as: Id Fname Lname How do I remove Id from the grid? Remove=Id in the html of t:grid does not work. Thanks, --James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the difference between a Translator and FieldTranslator
What are you trying to achieve with FieldTranslator that Translator doesn't already do? I guess what I'm is whether the following example needs more work? http://202.177.217.122:8080/jumpstart/examples/input/creatingtranslators1 Cheers, Geoff On 26/10/2008, at 6:41 AM, Christoph Jäger wrote: Ok, lets try to make our Translator also implement FieldTranslator. FieldTranslator defines 4 methods: 1. ClassT getType() 2. T parse(String input) 3. void render(MarkupWriter writer) 4. String toClient(T value) 1 is already implemented in Translator, for 2 we can call the already existing parseClient() method, 4 is already implemented. The only problem is 3: the API documentation says: Invokes Translator.render(Field, String, MarkupWriter,org.apache.tapestry5.services.FormSupport). So now our implementation needs to know about the Field and FormSupport, and a MessageFormatter. Where do you get these from in your implementation? There is a FieldTranslatorImpl class, which takes all of these objects as parameters for the constructor. Maybe use this instead of making your Translator also implement FieldTranslator? But as there is a class like this, I think it should be automatically instantiated when a FieldTranslator is needed and only a Translator is available. Am I missing something here? Best Regards, Christoph On Oct 25, 2008, at 16:13 , Joachim Van der Auwera wrote: Well, I now just assure all my Translators are also FieldTranslators and vice versa. Kind egards, Joachim Christoph Jäger wrote: Hi, I just stumbled upon the same problem when updating from 5.0.14 to 5.0.15. There must be a way that Tapestry automatically creates the FieldTranslator if a Translator is specified for a field. All the information should be there. As I see it, apart from the Translator, the FieldTranslator needs the Field, a MessageFormatter and a FormSupport instance to do its work. I can't believe we have to manually pick up all of these objects and create a FieldTranslator (a separate one for each field in a form). Looking at how Tapestry automatically creates / converts / coerces lots of other useful stuff, I am almost sure there are some magic configuration entries to enable automatic creation of FieldTranslators (given a Translator), we just need to find them. Best Regards, Christoph On Oct 8, 2008, at 19:25 , Joachim Van der Auwera wrote: Howard Lewis Ship wrote: A FieldTranslator is a wrapper around a Translator that is configured for a specific Field component. Thanks. Should these not be created automatically? This has caused me major headaches for migrating to 5.0.15, I had to change all my translators, assure they also implement FieldTranslator and replace all translate=translate:string to a (custom) StringTranslator which implements both Translator and FieldTranslator. Kind regards, Joachim On Wed, Oct 8, 2008 at 5:40 AM, Joachim Van der Auwera [EMAIL PROTECTED] wrote: And when should which be used? I am getting coercing errors trying to convert between the two, but it is unclear to me why there is a difference (the interfaces look very similar). Joachim -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Christoph Jäger [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joachim Van der Auwera PROGS bvba, progs.be - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Christoph Jäger [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]