Maximum number of form elements
Hello, in our application we have a single page with a form containing a dynamic number of select fields. It is used as a see all selections in one place page an can get quite large (more than 1,000 select fields displayed in a table structure). We now encountered difficulties when the number of select fields is too high, like onActivate not firing as expected during form submission. My question is: Is there a known limit to the size of elements in a form component and can this limit be raised anyhow? TIA Stephan signature.asc Description: OpenPGP digital signature
[t5.3.1] TextField not handling a single space
Greetings to the developers of the lovely framework, tapestry5 I wrote a form with a single text field, this field is bound to a string object. When I enter a single or multiple spaces in this text field and submit the form, the obtained values is always null. I checked the supplies values in an injected request object, I found the value I'm expecting, but it's not provided in the other usual tapestry way. Is there a way I can override such behavior ? I think I should raise an issue but I need you guys to help me figure out if there is something wrong I'm doing. I have to say that I have other fields that will have blank values so I should be able to distinguish between empty fields and fields with spaces only. t:form t:id=myform Hello, t:textfield t:id=textValue/ /t:form @Property private String textValue; @Component(id = textValue) private TextField textField; @Inject private Request request; @OnEvent(component = myform, value = EventConstants.VALIDATE) void validate() { System.out.println(textValue == null ? 0 : textValue.length()); System.out.println(\ + textValue + \); for (String pn : request.getParameterNames()) { System.out.println(\ + pn + \:\ + request.getParameter(pn) + \); } } @OnEvent(component = myform, value = EventConstants.SUCCESS) void success() { System.out.println(textValue == null ? 0 : textValue.length()); System.out.println(\ + textValue + \); for (String pn : request.getParameterNames()) { System.out.println(\ + pn + \:\ + request.getParameter(pn) + \); } } Thank you. -- *Regards,* *Muhammad Gelbana Java Developer*
Re: Confusion about tapestry singleton page
I don't think this may help but tapestry modifies your pages\components at the run time so it's all handled behind the scenes. Although I can't explain the results of your test here ! On Tue, Jun 5, 2012 at 4:50 AM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 04 Jun 2012 21:56:28 -0300, xieweiguo xiewei...@139.com wrote: Hello! Hi! I heard that from tapepstry 5.2,all page is singleton-object.But,I write some code in the constructor of page class like this: You should avoid using constructors in page classes. So,my question is: Is the page singleton? Yes. The class is changed transparently by the Tapestry classloader in runtime so access to fields is changed to access to a per-thread map. If I want to do something just once in a page,what should I do(use synchronized?)? Your question doesn't make sense. synchronized is used when you have threads. and, if I want a singleton component( such as common parts of all pages),what should I do? There's no such thing as a singleton component. You need to do nothing for a component to be used in more than one page. -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- *Regards,* *Muhammad Gelbana Java Developer*
Re: Maximum number of form elements
It's most likely your web server. Most were patched recently to limit the number of parameters passed in a url or form to avoid a possible denial of service attack. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Maximum-number-of-form-elements-tp5713623p5713627.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: Confusion about tapestry singleton page
On Tue, 05 Jun 2012 08:45:41 -0300, Muhammad Gelbana m.gelb...@gmail.com wrote: I don't think this may help but tapestry modifies your pages\components at the run time so it's all handled behind the scenes. Although I can't explain the results of your test here ! I'd guess Tapestry executes the body of the constructor at each request to that page. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: global variable concurrent access in different services
You will love this tutorial: http://www.youtube.com/playlist?list=PLBB24CFB073F1048Efeature=plcp On Mon, Jun 4, 2012 at 3:22 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 04 Jun 2012 09:20:19 -0300, Angelo C. angelochen...@gmail.com wrote: Hi, Hi! This is a situation, in a PageRenderRequestFilter my app need to access a global String variable, and this global variable is updated every hour in a PeriodicExecutor, any suggestion how to do this? will there be a conflict in accessing this variable? Thanks, This isn't related to Tapestry at all: it's just a Java question. To begin with, Java doesn't have global variables. Second, make this variable a private non-static field of a service, provide methods to get and set it and use some Java mechanism to deal with it (volatile keyword, synchronized keyword, java.concurrent classes, etc). -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- *Regards,* *Muhammad Gelbana Java Developer*
Re: Maximum number of form elements
Am 05.06.2012 13:46, schrieb trsvax: It's most likely your web server. Most were patched recently to limit the number of parameters passed in a url or form to avoid a possible denial of service attack. I think that this is not the cause of the problem. When we limit the POST data more, we get a totally different error, stating that the POST size is too small. - Stephan signature.asc Description: OpenPGP digital signature
Re: [t5.3.1] TextField not handling a single space
On Tue, 05 Jun 2012 08:42:14 -0300, Muhammad Gelbana m.gelb...@gmail.com wrote: Greetings to the developers of the lovely framework, tapestry5 Hi! I wrote a form with a single text field, this field is bound to a string object. When I enter a single or multiple spaces in this text field and submit the form, the obtained values is always null. Check the nulls and translate parameters of TextField in http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Confusion about tapestry singleton page
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I tried to reproduce that (being the curious person that I am ;-) ), but the constructor of a page is called only once on my machine - just as one would expect (Tap 5.3.3) If you want to analyze I suggest adding new Error().printStackTrace(); to your constructor so you can see who actually calls it. - - Arno Am 05.06.2012 13:47, schrieb Thiago H de Paula Figueiredo: On Tue, 05 Jun 2012 08:45:41 -0300, Muhammad Gelbana m.gelb...@gmail.com wrote: I don't think this may help but tapestry modifies your pages\components at the run time so it's all handled behind the scenes. Although I can't explain the results of your test here ! I'd guess Tapestry executes the body of the constructor at each request to that page. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk/OBJcACgkQbmZsMyUPuXQVpACfSWzOJBs0glGBfWEcK814ndGt L30An1Lg1rkSmPj8Cl8V8ZVUcC7P0SqV =HxcB -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Validate BigDecimal maxlength not working
It's not the most ideal solution, but will work. I'm working on a big finance form, so lots of these types of fields to be validated. If you happen to think of a more robust way of doing this, please keep me posted. Thanks Thiago. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Validate-BigDecimal-maxlength-not-working-tp5713611p5713633.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: Validate BigDecimal maxlength not working
On Tue, 05 Jun 2012 10:13:08 -0300, George Christman gchrist...@cardaddy.com wrote: It's not the most ideal solution, but will work. I'm working on a big finance form, so lots of these types of fields to be validated. If you happen to think of a more robust way of doing this, please keep me posted. In your case, I'd write something like a BigDecimalMaxLength validator. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [t5.3.1] TextField not handling a single space
I did so before I sent this mail but I couldn't make use of them ! I can't see how the NullFieldStrategy can help me and I used this FieldTranslator which looked like it would help but it didn't. public FieldTranslatorString getTrans() { return new FieldTranslatorString() { public ClassString getType() { return String.class; } public String parse(String input) throws ValidationException { return input; } public String toClient(String value) { return value; } public void render(MarkupWriter writer) { } }; } On Tue, Jun 5, 2012 at 2:45 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Tue, 05 Jun 2012 08:42:14 -0300, Muhammad Gelbana m.gelb...@gmail.com wrote: Greetings to the developers of the lovely framework, tapestry5 Hi! I wrote a form with a single text field, this field is bound to a string object. When I enter a single or multiple spaces in this text field and submit the form, the obtained values is always null. Check the nulls and translate parameters of TextField in http://tapestry.apache.org/**current/apidocs/org/apache/** tapestry5/corelib/components/**TextField.htmlhttp://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html . -- Thiago H. de Paula Figueiredo -- *Regards,* *Muhammad Gelbana Java Developer*
Re: Validate BigDecimal maxlength not working
Would you be referring to something like this http://wiki.apache.org/tapestry/CreatingCustomValidators -- View this message in context: http://tapestry.1045711.n5.nabble.com/Validate-BigDecimal-maxlength-not-working-tp5713611p5713636.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: Validate BigDecimal maxlength not working
On Tue, 05 Jun 2012 10:50:00 -0300, George Christman gchrist...@cardaddy.com wrote: Would you be referring to something like this http://wiki.apache.org/tapestry/CreatingCustomValidators Exactly, but for BigDecimals. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: Validate BigDecimal maxlength not working
Thanks Thiago, exactly what I was looking for. Almost completed :) -- View this message in context: http://tapestry.1045711.n5.nabble.com/Validate-BigDecimal-maxlength-not-working-tp5713611p5713638.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: Validate BigDecimal maxlength not working
Thiago, I'd like to donate the following code to the community or anybody else who may run into this problem. It would be nice if it was a part of tapestry's core validation library enabling us to validate currency/amounts. I didn't include the js only because we aren't using it at my organization. maximum-precision=You may provide at most %d numbers for %s. maximum-scale=You may provide at most %d decimal digits for %s. //MaxScale public class MaxScale extends AbstractValidatorInteger, BigDecimal { public MaxScale() { super(Integer.class, BigDecimal.class, maximum-scale); } @Override public void validate(Field field, Integer constraintValue, MessageFormatter formatter, BigDecimal value) throws ValidationException { if (value.scale() constraintValue) throw new ValidationException(buildMessage(formatter, field, constraintValue)); } private String buildMessage(MessageFormatter formatter, Field field, Integer constraintValue) { return formatter.format(constraintValue, field.getLabel()); } @Override public void render(Field field, Integer constraintValue, MessageFormatter formatter, MarkupWriter writer, FormSupport formSupport) { formSupport.addValidation(field, maxscale, buildMessage(formatter, field, constraintValue), constraintValue); } } //MaxPrecision public class MaxPrecision extends AbstractValidatorInteger, BigDecimal { public MaxPrecision() { super(Integer.class, BigDecimal.class, maximum-precision); } @Override public void validate(Field field, Integer constraintValue, MessageFormatter formatter, BigDecimal value) throws ValidationException { if (value.precision() constraintValue) throw new ValidationException(buildMessage(formatter, field, constraintValue)); } private String buildMessage(MessageFormatter formatter, Field field, Integer constraintValue) { return formatter.format(constraintValue, field.getLabel()); } @Override public void render(Field field, Integer constraintValue, MessageFormatter formatter, MarkupWriter writer, FormSupport formSupport) { formSupport.addValidation(field, maxprecision, buildMessage(formatter, field, constraintValue), constraintValue); } } //AppModule @SuppressWarnings(rawtypes) public static void contributeFieldValidatorSource(MappedConfigurationString, Validator configuration) { configuration.add(maxScale, new MaxScale()); configuration.add(maxPrecision, new MaxPrecision()); } -- View this message in context: http://tapestry.1045711.n5.nabble.com/Validate-BigDecimal-maxlength-not-working-tp5713611p5713639.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: Validate BigDecimal maxlength not working
On Tue, 05 Jun 2012 13:17:17 -0300, George Christman gchrist...@cardaddy.com wrote: Thiago, I'd like to donate the following code to the community or anybody else who may run into this problem. Nice! Thank you very much! Could you create a JIRA for that and attach the code below in it? Apache requires some way to tell the code author is really donating the code and one of the accepted ways is exactly that. -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Tapestry and Clojure
People who run into me are always asking me Are you going to rewrite Tapestry in Scala? Or Clojure? Well, I'm not going to be rewriting Tapestry at this point, just improving it in place. However, I do want to do some more work with Clojure; I'm really excited by http://datomic.com/ for example, and the best way to leverage Datomic is, in my not very informed honest opinion, to use Clojure code to interface with the Datomic APIs. To that end, I've wanted to make it easy to combine Tapestry view logic with Clojure service logic. The challenge is that, to Java code, the Clojure space is basically a giant collection of objects all implementing the IFn interface; it's not clear what to inject or how to represent it in a meaningful way to Tapestry. Sure I could whip something together that would allow you to inject a function as IFn and you could call one of its many overloaded invoke() methods, but that doesn't feel right. Instead, the new alpha tapestry-clojure library (in the master branch) lets you do the following: Define an interface Map the interface to a Clojure namespace: simply add the @Namespace annotation Build a proxy so that each method invokes a Clojure function Each method name is mapped to a Clojure function in the namespace. It converts camel case to inline dashes .. thus a method named updateDatastore will be mapped to a function named update-datastore. If that's not sufficient, or you want to expose a function from elsewhere, the @FunctionName annotation can be used on a method to provide its specific name, or even a fully qualified name in another namespace. The ClojureBuilder service can be injected; it has a single method: T T build(ClassT interfaceType) The interface must have the @Namespace annotation. All of the methods must have non-void return types. You'll typically use it in a service builder method of a module: public static DatastoreAPI buildDatastoreAPI(ClojureBuilder builder) { return builder.build(DataStoreAPI.class); } That's it ... DatastoreAPI is now a service like any other, and can be injected into any service, page, component, or whatever. Currently, this in in 5.4, which is very early alpha. The code for this is very small, and could easily be ported back to 5.3, for 5.3.4. Any interest? -- 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
Clear clientside validation from tapestrys memory.
Hello, I've built a dynamic validation component which enables fields to be dynamically required depending on either the forms workflow state or the particular action button used. I only want to validate required fields when the form is Submit to the next state, but when the form is Saved I only want to do a sanity check validation, ie field lengths etc. When the form is first rendered, I do not setup clientside validation for required fields do to the fact the Submit action button hasn't been selected. However all other clientside validation has been setup. This part works perfectly fine as long as I don't Submit the form. As soon as I submit the form, the required fields are now recorded as being a part of the clientside validation when the page renders the validation errors. My question is there a way to clear Tapestrys memory of clientside validation preventing required fields from becoming a part of my clientside validation? My code looks like this. .tml t:TextField t:id=allocatedTotal t:validate=prop:purchaseRequestValidation.getFieldValidatorComponent(allocatedTotal, 'regexp,maxScale=2,maxPrecision=10')/ private Integer action; void onAction(Integer action) { this.action= action; } .java public FieldValidator FieldValidator(Field field, String validatorType) { String[] validators = TapestryInternalUtils.splitAtCommas(validatorType); ListFieldValidator fieldValidators = CollectionFactory.FieldValidatornewList(); for (String spec : validators) { String constraintValue = parseConstraint(spec); validatorType = parseValidator(spec); if(required.equalsIgnoreCase(validatorType) || spec.isEmpty()) { break; } ValidatorSpecification originalSpec = new ValidatorSpecification(validatorType, constraintValue); fieldValidators.add(source.createValidator(field, originalSpec.getValidatorType(), originalSpec.getConstraintValue())); } fieldValidators.add(source.createValidator(field, hasValidation(parseClientId(field.getControlName()), this.action), null)); return new CompositeFieldValidator(fieldValidators); } public String hasValidation(String clientId, Integer action) { //List of fields from the database requiring validation for(FormValidation formValidation : this.formValidations) { //Field requiring validation String field = formValidation.getFormField().getDbTableField(); //Action Button Requiring validation. Integer _action = formValidation.getApplicationAction().getId(); //compares current field with database fields along with click action with database action if(field.equalsIgnoreCase(clientId) _action == action) { return required; } } return none; } -- View this message in context: http://tapestry.1045711.n5.nabble.com/Clear-clientside-validation-from-tapestrys-memory-tp5713644.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [t5.3.1] TextField not handling a single space
I did so before I sent this mail but I couldn't make use of them ! I can't see how the NullFieldStrategy can help me and I used this FieldTranslator which looked like it would help but it didn't. public FieldTranslatorString getTrans() { return new FieldTranslatorString() { public ClassString getType() { return String.class; } public String parse(String input) throws ValidationException { return input; } public String toClient(String value) { return value; } public void render(MarkupWriter writer) { } }; } Anyone ? On Tue, Jun 5, 2012 at 2:45 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Tue, 05 Jun 2012 08:42:14 -0300, Muhammad Gelbana m.gelb...@gmail.com wrote: Greetings to the developers of the lovely framework, tapestry5 Hi! I wrote a form with a single text field, this field is bound to a string object. When I enter a single or multiple spaces in this text field and submit the form, the obtained values is always null. Check the nulls and translate parameters of TextField in http://tapestry.apache.org/**current/apidocs/org/apache/** tapestry5/corelib/components/**TextField.htmlhttp://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html . -- Thiago H. de Paula Figueiredo -- *Regards,* *Muhammad Gelbana Java Developer*
Re: Tapestry and Clojure
On Tue, 05 Jun 2012 14:56:17 -0300, Howard Lewis Ship hls...@gmail.com wrote: People who run into me are always asking me Are you going to rewrite Tapestry in Scala? Or Clojure? I really don't get the point of rewriting Tapestry, which is written in Java, in Java-the-platform languages as Scala and Clojure, specially them, as they can interface with Java code very well (at least as far as I know). People have been able to write Tapestry pages and components in Scala for years already. On the other hand, making it easier for writing Tapestry pages, components, etc in other languages is something very interesting IMHO. :) Well, I'm not going to be rewriting Tapestry at this point, just improving it in place. Agreed. ;) -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
This could be because its template file could not be located
I'm starting a new T5 project, and am having some difficulty. For example, if I put my tml files alongside my java classes (com.mycompany.myproj.pages), when I startup my app, and navigate to a page, tapestry tells me that it cannot find the template file. If I then move the template file into my web dir, it can find it and everything seems to work. I don't want to put my template files in my web dir. Why is this not working for me?
new T5 project - can't find TML file
I'm starting a new T5 project, and am having some difficulty. For example, if I put my tml files alongside my java classes (com.mycompany.myproj.pages), when I startup my app, and navigate to a page, tapestry tells me that it cannot find the template file. If I then move the template file into my web dir, it can find it and everything seems to work. I don't want to put my template files in my web dir. Why is this not working for me?
Re: new T5 project - can't find TML file
When you place your .tml files next to your .java files, it is not automatically the case that the .tml files are visible at runtime; they need to be copied (during development) into your output directory (the directory which normally contains .class files). In production, they need to be copied into the WEB-INF/classes folder of the WAR. If you are using Maven or Gradle, and follow the standard convention folders (src/main/java for code, src/main/resources for other stuff, including .tml files) you will be fine. This is not a Tapestry issue; its about your project's layout and build process, or the behavior of your IDE. On Tue, Jun 5, 2012 at 1:34 PM, Markus Johnston tapes...@garstasio.com wrote: I'm starting a new T5 project, and am having some difficulty. For example, if I put my tml files alongside my java classes (com.mycompany.myproj.pages), when I startup my app, and navigate to a page, tapestry tells me that it cannot find the template file. If I then move the template file into my web dir, it can find it and everything seems to work. I don't want to put my template files in my web dir. Why is this not working for me? -- 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: This could be because its template file could not be located
See my notes in an adjacent thread. On Tue, Jun 5, 2012 at 1:51 PM, Ray Nicholus rnicho...@widen.com wrote: I'm starting a new T5 project, and am having some difficulty. For example, if I put my tml files alongside my java classes (com.mycompany.myproj.pages), when I startup my app, and navigate to a page, tapestry tells me that it cannot find the template file. If I then move the template file into my web dir, it can find it and everything seems to work. I don't want to put my template files in my web dir. Why is this not working for me? -- 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
Tapestry 5.3.4-rc-4
I've just put up another preview release of Tapestry 5.3.4. This includes some more tiny performance improvements, and upgrades Tapestry's version of the ASM library to ASM 4.0, for compatibility with bytecode generated by the JDK 1.7 compiler. We are very interested in feedback on this preview, so that we can go forward with a 5.3.4 general release. -- 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: Tapestry and Clojure
I'm just learning Clojure, but I see a lot of potential and intend to move more of my back-end functionality to it over time. A way to use Clojure services in a Tapestry webapp would be ideal, and will fit great into a project I'm just planning at the moment. Since I'm considering it for future projects, I'm not concerned about porting back to past versions of Tapestry. Here is my enthusiastic vote for this direction! David On 6 June 2012 03:56, Howard Lewis Ship hls...@gmail.com wrote: People who run into me are always asking me Are you going to rewrite Tapestry in Scala? Or Clojure? Well, I'm not going to be rewriting Tapestry at this point, just improving it in place. However, I do want to do some more work with Clojure; I'm really excited by http://datomic.com/ for example, and the best way to leverage Datomic is, in my not very informed honest opinion, to use Clojure code to interface with the Datomic APIs. To that end, I've wanted to make it easy to combine Tapestry view logic with Clojure service logic. The challenge is that, to Java code, the Clojure space is basically a giant collection of objects all implementing the IFn interface; it's not clear what to inject or how to represent it in a meaningful way to Tapestry. Sure I could whip something together that would allow you to inject a function as IFn and you could call one of its many overloaded invoke() methods, but that doesn't feel right. Instead, the new alpha tapestry-clojure library (in the master branch) lets you do the following: Define an interface Map the interface to a Clojure namespace: simply add the @Namespace annotation Build a proxy so that each method invokes a Clojure function Each method name is mapped to a Clojure function in the namespace. It converts camel case to inline dashes .. thus a method named updateDatastore will be mapped to a function named update-datastore. If that's not sufficient, or you want to expose a function from elsewhere, the @FunctionName annotation can be used on a method to provide its specific name, or even a fully qualified name in another namespace. The ClojureBuilder service can be injected; it has a single method: T T build(ClassT interfaceType) The interface must have the @Namespace annotation. All of the methods must have non-void return types. You'll typically use it in a service builder method of a module: public static DatastoreAPI buildDatastoreAPI(ClojureBuilder builder) { return builder.build(DataStoreAPI.class); } That's it ... DatastoreAPI is now a service like any other, and can be injected into any service, page, component, or whatever. Currently, this in in 5.4, which is very early alpha. The code for this is very small, and could easily be ported back to 5.3, for 5.3.4. Any interest? -- 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: This could be because its template file could not be located
Turns out tml files weren't properly represented in the resource patterns box in the compiler section of IDEA. As a result, they weren't copied to the bin directory during compilation. I figured this out earlier but didn't get a chane to respond 'till now. It's always the last thing you check, isn't it. On Tue, Jun 5, 2012 at 4:47 PM, Howard Lewis Ship hls...@gmail.com wrote: See my notes in an adjacent thread. On Tue, Jun 5, 2012 at 1:51 PM, Ray Nicholus rnicho...@widen.com wrote: I'm starting a new T5 project, and am having some difficulty. For example, if I put my tml files alongside my java classes (com.mycompany.myproj.pages), when I startup my app, and navigate to a page, tapestry tells me that it cannot find the template file. If I then move the template file into my web dir, it can find it and everything seems to work. I don't want to put my template files in my web dir. Why is this not working for me? -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: [t5.3.1] TextField not handling a single space
Should I open an JIRA issue ? On Tue, Jun 5, 2012 at 8:11 PM, Muhammad Gelbana m.gelb...@gmail.comwrote: I did so before I sent this mail but I couldn't make use of them ! I can't see how the NullFieldStrategy can help me and I used this FieldTranslator which looked like it would help but it didn't. public FieldTranslatorString getTrans() { return new FieldTranslatorString() { public ClassString getType() { return String.class; } public String parse(String input) throws ValidationException { return input; } public String toClient(String value) { return value; } public void render(MarkupWriter writer) { } }; } Anyone ? On Tue, Jun 5, 2012 at 2:45 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Tue, 05 Jun 2012 08:42:14 -0300, Muhammad Gelbana m.gelb...@gmail.com wrote: Greetings to the developers of the lovely framework, tapestry5 Hi! I wrote a form with a single text field, this field is bound to a string object. When I enter a single or multiple spaces in this text field and submit the form, the obtained values is always null. Check the nulls and translate parameters of TextField in http://tapestry.apache.org/**current/apidocs/org/apache/** tapestry5/corelib/components/**TextField.htmlhttp://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/TextField.html . -- Thiago H. de Paula Figueiredo -- *Regards,* *Muhammad Gelbana Java Developer* -- *Regards,* *Muhammad Gelbana Java Developer*