Re: Future of Tapestry

2017-01-05 Thread Stephen Nutbrown
For what it's worth,. I'm a spring boot developer by day, but in my spare
time I've put together a few sites using t5 including a personal wedding
website and socialwage.com and it is nice for these kinds of projects,
which don't require a single page app or an API consumed by mobiles (which
it can do, but I prefer spring for that).

For a web framework I've found it to be fantastic and would use it again in
a heartbeat. It "just works" and I've found very few problems.



On 5 Jan 2017 19:54, "Thiago H. de Paula Figueiredo" 
wrote:

On Thu, Jan 5, 2017 at 1:47 PM,  wrote:

> Hi all,
>

Hello!


> I discover recently Tapestry and it's for me a great Framework but my boss
> tells me that his end is near ...
>

What's the actual scenario? If you're going to write something which isn't
a single-page application in Java,
I think Tapestry is the best option out there.


> and the github https://git1-us-west.apache.org/repos/asf?p=tapestry-5.
> git;a=summary has less and less activities
>

Well, it doesn't mean the project is near its end.

1) Software only really dies when no one else is using it or when it's not
available anymore.

2) Open-source software only really dies when the source code is lost.
Tapestry is an Apache Software Foundation project, so its source won't be
lost as long as the Foundation exists, and it's pretty alive and strong.

Anyway, Tapestry 5 is a mature project (it started around 2006, based on
ideas and concepts already used in previous versions), so it got to a state
in which there's not much to be done yet. Important bugs are already fixed,
it already has a solid, battle-tested, very flexible foundation which
allows you to do lots of amazing things with amazing productivity (live
class reloading is awesome and a huge time saver when developing Java
webapps).

The Tapestry team made a conscious decision to avoid creating more
subprojects for more specific stuff. There's no shortage of third-party
modules and integrations for Tapestry (the web framework) and Tapestry-IoC
(the IoC framework, which can be used independently of the web framework).


> Could you tell me if this Framework will continue to be maintained ? When
> the next version 5.5 will be delivered ?
>

It will continue being maintained. As in almost all other open-source
projects, 5.5 will be released when it's ready to be released.
Do you need any specific features not provided in 5.4?

and responsive interface
>

Responsive interfaces, IMHO, are more of how you build the frontend,
specially styling with CSS and a little bit of JavaScript, than the
backend. Tapestry is more focused in the backend while still having
frontend stuff.

I also agree with the very insightful points made by Peter and Bob.

Feel free to ask further questions and welcome to the Tapestry mailing
list. :)

--
Thiago


Re: Hyphens in URL possible?

2016-05-02 Thread Stephen Nutbrown
Carlos,

Many thanks for this - this is absolutely fantastic. Thank you for the
effort of posting this and the help. It'll take me a little bit of time to
digest it and fully understand how I can apply this to our exact project,
but it looks like everything I need is here!

Many thanks again, I really appreciate it.
Stephen Nutbrown

On 2 May 2016 at 11:38, Carlos Montero Canabal <
carlosmonterocana...@gmail.com> wrote:

> Yes. I do it in many webapps.
>
> AppModule:
>
> @Contribute(PageRenderLinkTransformer.class)
> @Primary
> public static void provideURLRewriting(final
> OrderedConfiguration configuration) {
>
> configuration.addInstance(
> “MyLinkTransformer", MyLinkTransformer.class);
> }
>
> For simple pages (without context), I have a utility class with
> logicalPage name and the names into various languages (Spanish and English
> in the example) for better SEO on each language:
>
> private class PageLinkTransFormer {
>
> private final String logical;
>
> private final String linkEs;
>
> private final String linkEn;
>
> public PageLinkTransFormer(final String logical, final
> String linkEs, final String linkEn) {
> super();
> this.logical = logical;
> this.linkEs = linkEs;
> this.linkEn = linkEn;
> }
>
> public String getLogical() {
> return logical;
> }
>
> public String getLinkEs() {
> return linkEs;
> }
>
> public String getLinkEn() {
> return linkEn;
> }
>
> }
>
>
> And the MyLinkTransformer Service (in the example, I have the pages
> DevolucionesPage, AvisoLegalPage and SizeGuidePage):
>
> public class MyLinkTransformer implements
> PageRenderLinkTransformer {
>
> private static final String DEVOLUCIONES_LOGICAL_PAGE_NAME =
> "Devoluciones";
>
> private static final String DEVOLUCIONES_PAGE_URL_ES =
> "/envios-devoluciones-cuidados";
>
> private static final String DEVOLUCIONES_PAGE_URL_EN =
> "/delivery-return-cares";
>
> private static final String AVISO_LEGAL_LOGICAL_PAGE_NAME =
> "AvisoLegal";
>
> private static final String AVISO_LEGAL_PAGE_URL_ES =
> "/aviso-legal";
>
> private static final String AVISO_LEGAL_PAGE_URL_EN =
> "/disclaimer";
>
> private static final String SIZE_GUIDE_LOGICAL_PAGE_NAME =
> "SizeGuide";
>
> private static final String SIZE_GUIDE_PAGE_URL_ES =
> "/guia-tallas";
>
> private static final String SIZE_GUIDE_PAGE_URL_EN = "/size-guide";
>
> private final List links;
>
> @Inject
> private PageRenderLinkSource pageRenderLinkSource;
>
> @Inject
> private ContextValueEncoder contextValueEncoder;
>
> @Inject
> private ThreadLocale threadLocale;
>
> @Inject
> private PersistentLocale persistentLocale;
>
> public MyLinkTransformer() {
>
> links = new
> ArrayList();
>
> links.add(new PageLinkTransFormer(
> DEVOLUCIONES_LOGICAL_PAGE_NAME,
> DEVOLUCIONES_PAGE_URL_ES,
> DEVOLUCIONES_PAGE_URL_EN));
>
> links.add(new PageLinkTransFormer(
> AVISO_LEGAL_LOGICAL_PAGE_NAME,
> AVISO_LEGAL_PAGE_URL_ES,
> AVISO_LEGAL_PAGE_URL_EN));
>
> links.add(new PageLinkTransFormer(
> SIZE_GUIDE_LOGICAL_PAGE_NAME,
> SIZE_GUIDE_PAGE_URL_ES,
> SIZE_GUIDE_PAGE_URL_EN));
>
> }
>
> @Override
> public Link transformPageRenderLink(final Link defaultLink, final
> PageRenderRequestParameters parameters) {
>
> LOGGER.trace("transformPageRenderLink {} ({})",
> parameters.getLogicalPageName(), defaultLink.toAbsoluteURI());
>
> final String locale = threadLocale.getLocale().toString();
> for (final PageLinkTransFormer link : links) {
> if
> (link.getLogical().equals(parameters.getLogicalPageName())) {
> if ("es".equals(locale

Hyphens in URL possible?

2016-05-02 Thread Stephen Nutbrown
Hi,

I am working on a tapestry project and someone has asked me to change the
URLs to include hyphens which they believe will improve SEO.

As per https://support.google.com/webmasters/answer/76329?hl=en, it's
supposedly good practise to "Consider using punctuation in your URLs. The
URL *http://www.example.com/green-dress.html
* is much more useful to us
than *http://www.example.com/greendress.html
*. We recommend that you use
hyphens (-) instead of underscores (_) in your URLs."

So, let's say I have a page called: GreenDress, which has a GreenDress.java
and a GreenDress.tml.

Is there any way I can change that to "Green-Dress"? I'm not sure a hyphen
is even a valid character in a Java class name, so I assume there is
another way to do it?

Thanks,
Steve


Re: Tapestry is a sinking Ship

2016-02-12 Thread Stephen Nutbrown
The only reason you email the Tapestry users group is because Tapestry
Users has many subscribers.

The only reason Tapestery Users has many subscribers is because Tapestry is
not dead.



On 12 February 2016 at 22:00, David Taylor 
wrote:

> If Tapestry is so terrible, why waste all the energy? Just to be obnoxious?
>
> We would abandon Tapestry tomorrow if it weren't so bloody fast and easy
> to extend.
>
>
> emailsig On 2/12/2016 3:53 PM, Thiago H de Paula Figueiredo wrote:
>
>> On Fri, 12 Feb 2016 17:19:28 -0200, Emmanuel Sowah 
>> wrote:
>>
>> Hi Tapestry sect,
>>>
>>
>>
>> The state of Tapestry now is very bad, as Howard and all the other
>>> commiters have abandoned it.
>>>
>>
>> This is not true. Just check Jira and the Git logs.
>>
>> Even Thiago has secretly abandoned Tapestry.
>>>
>>
>> I have not, and you're telling a lie.
>>
>> I'm just answering this troll because of the lies he keeps on spreading,
>> which are bordering on defamation.
>>
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Tapestry 5 jobs, the value of learning to use T5 and transferable skills.

2015-10-01 Thread Stephen Nutbrown
Hi,

I feel this discussion belongs in the users group, although it is not all
directly related to Tapestry - it's related in some way or another and I
felt this community would be best positioned to talk about it. I have no
specific questions, this is intended more as a discussion/experience thread
(if that's allowed).

About 3 years ago, I began my first web project as part of my own work -
not for any company, just for some sites I needed to set up to support some
of my research. Perhaps naively, as a new user of Java EE (but experienced
with Java SE), I googled the net for "Simple to use java web frameworks"
and similar searches until I came across Tapestry. Some good reviews around
the internet and some good posts from Howard on SO lead me to running the
getting started tutorial and was amazed how easy it was - I was able to put
my Java SE knowledge straight into practise without knowing anything about
various xml files, or even the difference between a servlet, container and
application server, what CDI is or any of that. Everything was (and is)
running nicely on a jetty server. Whenever I became stuck, i'd go to the T5
documentation and read about how to use @Persist or @Sessionstate, or
perhaps how to work with services and injecting them or how to set up
Tapestry-hibernate - these kind of things (Or i'd ask here, and.. many
thank you's to the people of this mailing list for so much help).

Move on 3 years and I am fairly comfortable with Tapestry and have several
small projects (again, just for me, not a company or work). I then begin to
wonder if I've perhaps fallen into a trap of Tapestry5 being my golden
hammer - I see a web project, I think oh that would be easy using T5, my
favourite, and get started right away (Unless it requires CMS systems etc
in which case.. Joomla/Wordpress/Drupal). This is perhaps not efficient,
but fine until you begin a job search and use a big job site (monster.com)
and search the word "Tapestry5".

*"Sorry, no "tapestry5" jobs were found that match your criteria"*

Oh, I see. Well, that's not too bad - I see there are lots of companies
looking for java EE developers and in particular, (oddly to me), running
Wildfly stacks (formerly JBoss) and using RESTEasy etc.

These look entirely new to me, but then when you look a bit further you see
actually that @Inject is common (part of CDI and specified in JSR), session
beans (which I consider like session state) is a fairly normal concept, the
annotations for hibernate are of course all the same and actually..
Tapestry users are using a huge amount of the same set of tools, interfaces
and annotations as users of other stacks or frameworks. I see
@ApplicationScope and realise that it's a singleton, similar to if I added
it from a module and that I can then inject into pages. All very nice. At
this point I learn that actually whilst learning to use Tapestry5, mainly
through T5s documentation I have learnt an awful lot more - how to use
hibernate (and I learnt some elsewhere too), how to use maven, how to set
up jetty... how to inject things, what session state is and how things are
persisted.

I suppose my overall comment and question is.. how many of you work in jobs
where you use Tapestry5, and how many of you have tried to transition to T5
from a stack like wildfly, or from T5 to something like wildfly, and how
did you find it. How did you work on that transition? Why are there so very
few T5 jobs out there (In my limited opinion, hence the golden hammer, T5
is the best thing since sliced bread). I think perhaps one of my
missunderstandings is that I attribute many things which are actually part
of Java EE or other libraries/frameworks that T5 uses to T5 itself, without
realising that what I am actually working with is very common.

I wonder if anyone else has had similar experiences, or if anyone has any
advice for a Tapestry5 person who learnt effectively everything from the
documentation and mailing list to moving to other technologies.


Thanks, almost any discussion is welcome :).


Re: Debugging Tapestry with IntelliJ IDEA

2015-08-25 Thread Stephen Nutbrown
Just to confirm it also works fine here too. I've found IntelliJ to be
absolutely fantastic so far. I'm running it using jetty but I know there is
an option for tomcat... I don't know if that could make a difference?
On 25 Aug 2015 11:33 am, Chris Poulsen mailingl...@nesluop.dk wrote:

 It works fine with IDEA here. A possibility could be that you are running
 in production mode?

 On Tue, Aug 25, 2015 at 12:04 PM, Poggenpohl, Daniel 
 daniel.poggenp...@isst.fraunhofer.de wrote:

  Hello everyone,
 
  we are evaluating IntelliJ IDEA for development and so far it has been
  quite good.
  But the Tapestry specifics seem to hinder further evaluation.
  Does anyone here use IntelliJ for development?
 
  When we debug code, page properties are always seen as having a null
  value instead of the proxy that Eclipse used to show. What are we doing
  wrong?
 
  Regards,
  Daniel P.
 



Re: Multiple domains, one webapp

2015-08-10 Thread Stephen Nutbrown
This looks really good and will be really helpful to lots of people - thank
you!
I've had a look and have learnt some things from it myself, however I have
a few questions.

Is the @ImportModule(CommonModule.class) required?

Instead of that I have something like this in my pom.xml
plugin
   groupIdorg.apache.maven.plugins/groupId
   artifactIdmaven-jar-plugin/artifactId
   configuration
   archive
 manifestEntries

 
Tapestry-Module-Classesorg.example.happylib.services.HappyModule/Tapestry-Module-Classes
 /manifestEntries
   /archive
   /configuration
   /plugin

But of course I had the problem that it doesn't seem to run my
contributeHibernateEntityPackageManager in HappyModule to add my entities
package (in my common module) to hibernate - maybe this is why. I'm away
from my work PC so I will have to check next time.

Also, is AppModule here needed?
https://github.com/sveine/tapestry-multi-module-demo/blob/master/common/src/main/java/com/demo/commonlib/services/AppModule.java

If we do have to put @ImportModule(CommonModule.class) in the non-common
appmodules then it means that if we grab a module from some library or
repository that we need to know the name of the module which needs to be
imported for it to work (i'm sure this can't be right).

There is a good chance my understanding is wrong, but in my understanding
it's best to have the module be auto loaded without it needing importing,
simply by adding it to the classpath (or pom.xml), otherwise the main
projects need to know about the details of how the shared module work.

On 10 August 2015 at 15:51, Svein-Erik Løken sv...@jacilla.no wrote:

 
   Read about URL rewriting at
   https://tapestry.apache.org/url-rewriting.html, but cannot figure out
   how this can solve my question of how to access assets from javascript.
 
  Pass the asset URLs from Tapestry to JavaScript.
 

 Thank you Thiago!



 I have created a project for people who want a quick start with a
 multi-module tapestry/maven project.

 https://github.com/sveine/tapestry-multi-module-demo


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



Re: Multiple domains, one webapp

2015-08-10 Thread Stephen Nutbrown
Thank you also Thiago! You are all awesome and so is tapestry :)
On 10 Aug 2015 18:19, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Mon, 10 Aug 2015 13:04:25 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 This looks really good and will be really helpful to lots of people -
 thank you!


 +1!

 Is the @ImportModule(CommonModule.class) required?


 For multi-module development with the common module project open and
 live-class-reloadable, yes. If you're just adding the common module JAR to
 the main project (or any project using it as a dependency) as a JAR
 directly, no. You can use both @ImportModule/@SubModule and the manifest
 entry at the same time without problems: Tapestry-IoC will only include one
 module class once no matter how many different times and ways you include
 it.

 But of course I had the problem that it doesn't seem to run my
 contributeHibernateEntityPackageManager in HappyModule to add my entities
 package (in my common module) to hibernate - maybe this is why. I'm away
 from my work PC so I will have to check next time.


 That's why.

 Also, is AppModule here needed?

 https://github.com/sveine/tapestry-multi-module-demo/blob/master/common/src/main/java/com/demo/commonlib/services/AppModule.java


 If you main webapp project has anything Tapestry-IoC-related, like
 declaring services, contributing to them, decorating them or advising them,
 yes.

 If we do have to put @ImportModule(CommonModule.class) in the non-common
 appmodules then it means that if we grab a module from some library or
 repository that we need to know the name of the module which needs to be
 imported for it to work (i'm sure this can't be right).


 Yes, but you'll only use that when you have the library open as a project
 in your IDE. Remember, you still should add the manifest file entry to your
 library JARs.

 There is a good chance my understanding is wrong, but in my understanding
 it's best to have the module be auto loaded without it needing importing,
 simply by adding it to the classpath (or pom.xml), otherwise the main
 projects need to know about the details of how the shared module work.


 Same sentence above. Use both when developing in parallel.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Multiple domains, one webapp

2015-08-05 Thread Stephen Nutbrown
This one:

https://tapestry.apache.org/component-libraries.html

There are a few issues, if someone has a chance to edit them i'll just list
them here:


1) It says:

You will need to modify the Tapestry release version number (5.2.0 in the
listing above) to reflect the current version of Tapestry when you create
your component library.

The tapestry version in the example pom is 5.4-beta-28. There are two
problems here - mainly that the text is wrong, but also that i'm not sure
if we should have beta releases in the documentation. I assume that's ok
though which brings about the next issue


2) The @Path annotation is relative to the HappyIcon.class file; it should
be stored in the project under
src/main/resources/org/example/happylib/components.

Whilst this will work, you will then get a log saying that images should be
under the META-INF/assets directory.


3) This page has not yet been fully updated for Tapestry 5.4. Things are
different and simpler in 5.4 than in previous releases.
This contradicts the pom example a little, I think the documentation should
probably be updated and this removed. It worked mostly (with the above
differences) fine for me on 5.4


4)The example pom points at : http://snapshots.repository.codehaus.org/

I think this is no longer there and neither is the other repo it points at:
http://archiva.openqa.org/repository/releases/

Another quick question - In my project I was using beta 32 from staging
here:

https://repository.apache.org/content/groups/staging/


It then seemed to then be removed and replaced by 33, but when I update to
use 33 I kept getting an issue saying maven could not read the jar file so
I had to go back to beta-26 where it seemed to work again. I'm not sure if
anyone else experienced something similar.

I suppose we shouldn't be using the staging repository for anything other
than testing, where is the actual official repository for full releases? I
always seem to have similar problems. I notice beta 26 is available here:
http://mvnrepository.com/artifact/org.apache.tapestry

5)It would be nice, although perhaps not the focus of the T5 documentation,
to show how this module can be referenced from another project using the
pom.xml. I'm sure many others are looking at this with that in mind,
particularly as many of the examples use mvn.
I found I was able to add this to my other project, and so long as I had
installed the happylib using mvn clean install, I could use:

dependency

groupIdorg.example/groupId

artifactIdhappylib/artifactId

version1.0-SNAPSHOT/version

/dependency

Eventually I suppose I am going to need a top level pom which compiles both
of these together. I'm not quite sure about how maven works here, as
ultimately it means for anyone building my project they currently need to
manually build and install happylib first for maven to know about it, but
this detail may not be required for the documentation (I think it's a nice
to have though)

I can't attach the .zip of the project with gmail as it says there is some
security problem, however I have uploaded it here for now in case it can be
attached to the documentation (probably worth checking it first):
www.spindroid.co.uk/shared.zip


Of course now this is set up, to go back to my original issue - I am going
to put the hibernate entities in this happy lib and sort out the naming of
it, then I can reference it from my two web apps. I will need to contribute
something to say where the hibernate entities are but I did see some
documentation about that and it should look a little vur like this:
public static void
contributeHibernateEntityPackageManager(ConfigurationString
configuration) {
configuration.add(com.my.package.myentities);
}

Thanks,

Steve


On 4 Aug 2015 23:14, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Tue, 04 Aug 2015 18:15:20 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Thanks. I have got the example set up from the documentation for the happy
 lib.  I found some bits that seemed not quite right along the way.


 Which ones? If there's anything wrong on the documentation, we should fix
 it.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




RE: Multiple domains, one webapp

2015-08-05 Thread Stephen Nutbrown
Seems to be working for me too! Thanks.

The only issue I am having is that my code for hibernate doesn't seem to
work quite as expexted. Ideally, this should be picked up from the happylib

public static void
contributeHibernateEntityPackageManager(ConfigurationString
configuration) {
configuration.add(com.my.package.myentities);
}

However I am finding it only seems to work for me if it's in the main
projects AppModule.java, perhaps I have configured something wrong, or
perhaps this has to be in app module rather than in my shared jar?

I've put the hibernate entities that are shared between the projects in
there and so ideally the code should be in the shared library rather than
duplicated in both webapps (although it works as it is... any ideas what
may cause that?)

Thanks,
Steve
On 5 Aug 2015 21:42, Svein-Erik Løken sv...@jacilla.no wrote:

 WOW! Multi-module in Tapestry with Live Class Reloading is fantastic!
 Thanks for pointing me in the right direction Thiago!

 To get live class reloading work for the common module in IntelliJ: Open
 Project Structure, Project Settings  Modules. Select the common module 
 Paths  Compiler output. Set Output path to the same path as the main
 project output path.

 I have created a multi-module maven demo project for test and
 documentation. A page in the main project includes a component-class from
 the common module. I have demo of using assets (img and js-modules) and IoC
 service. Everything works with Live Class Reloading.

 I am using a top-level pom (dependencyManagement, pluginManagement,
 properties), a modules pom (maven-root), the main project (war), and the
 common module (jar).

 The main project and common module is both created from mvn
 -DarchetypeArtifactId=quickstart ..., with necessary modification.

 I have documented all steps to make everything working in IntelliJ (plugin
 configuration etc).


 
  As long as the compiler target folder of the included
  library/module/subproject is included in the classpath of the main
  project, regardless of what tool you're using, live class reloading will
  work after a class in the library/module/subproject is recompiled. Maybe
  Eclipse makes it easier because it compiles automatically on save. I
 don't
  know how IDEA handles this.
 
 
  --
  Thiago H. de Paula Figueiredo
  Tapestry, Java and Hibernate consultant and developer
  http://machina.com.br

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




Re: Multiple domains, one webapp

2015-08-04 Thread Stephen Nutbrown
Hi,

Many thanks for all of your thoughts on this. I have chosen to go with
having a common project as a jar and setting up maven to build this project
first and use it as a dependency for the other two. This means i'll be able
to put the various entities in there that are shared between both web
applications. I am not *too* concerned about live class reloading if it's
only for the shared JAR since it will contain mainly only entities and it
doesn't take long whilst developing to just hit run again if I can't
figure out a better way. I would imagine these entities will remain
relatively static throughout the restructing as they are mapped to database
tables using hibernate and everything currently works, they are just going
to be moved.

Another factor in deciding to use this approach is that I have been told we
are having one side of the website launch before the other and this
division of the projects into separate web apps makes it slightly easier.

I'm looking at the documentation at he moment for how to create a jar file
for tapestry to use and I intend to use the documentation here:
https://tapestry.apache.org/component-libraries.html

I did spot that it says clearly at the top: This page has not yet been
fully updated for Tapestry 5.4. Things are different and simpler in 5.4
than in previous releases. but i'm going to have to just run with it and
find out what those changes are as I go along.

I think long term, having them split into two webapps that just share the
same model (the database and various entities) makes most sense. In the
meantime, whilst making this decision I have been working on the front end,
but after a while of reading up I am thinking (for us) this is the best
solution.

Any light on what the documentation is hinting at with the updates for that
page would be fantastic if anyone has any ideas.

Thanks,
Steve

On 4 August 2015 at 15:40, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Tue, 04 Aug 2015 10:27:01 -0300, Svein-Erik Løken sv...@jacilla.no
 wrote:

  4) You can't use Tapestry's Live Class Reloading on any class in the
  common
  JAR (e.g. Tapestry IOC service implementation classes).
 
  I think 4) is the biggest downside in a multi-module project. Do you
  think Tapestry can do a Live Class Reloading of the common JAR included
  with contributeCoreLibComponentClasses?

 If this is about Eclipse (I'm not sure about other IDEs, since I haven't
 used any besides Eclipse for many years), if you have all the projects
 open at the same time, you can use live class reloading on all of them at
 the same, and I do this all the time.


 Really! I am using IntelliJ IDEA Ultimate and NEED this functionality.
 Today I need to recompile all maven projects and restart jetty for every
 change to components and JavaScript modules (all resources) in the common
 JAR.


 If you're including your common project as a JAR in the classpath of your
 main project, live class reloading will never work. On the other hand, if
 you include your common project's target folder (where the .class files are
 generated) in the classpath of your main project, it should work. I'm sure
 there's a way of doing that in IDEA. There has to be one. IDEA would suck
 if there wasn't, and apparently IDEA is the opposite of suck. :)

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Multiple domains, one webapp

2015-08-04 Thread Stephen Nutbrown
It's checked by default on my Eclipse Lunar - I haven't used it yet as i'm
just diving into making this shared module to see how it goes.

Thanks,
Steve

On 4 August 2015 at 16:15, Lance Java lance.j...@googlemail.com wrote:

 Further from Thiagos connents...

 In eclipse, when using the m2e plugin you can right click on a project

 Properties - Maven - Resolve dependencies from Workplace projects

 This is flagged on by default. Perhaps intellij has a similar configuration
 option?

 It's rare that eclipse can do something that intellij cant.



Re: Multiple domains, one webapp

2015-08-04 Thread Stephen Nutbrown
Thanks. I have got the example set up from the documentation for the happy
lib.  I found some bits that seemed not quite right along the way. Perhaps
it is possible to attach full working examples to the documentation as a
zip or git repo. I am happy to attach it here for reference, any chance
someone can update it in the documentation?

Thanks,
Steve
On 4 Aug 2015 19:29, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Tue, 04 Aug 2015 12:19:40 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 It's checked by default on my Eclipse Lunar - I haven't used it yet as i'm
 just diving into making this shared module to see how it goes.


 As long as the compiler target folder of the included
 library/module/subproject is included in the classpath of the main project,
 regardless of what tool you're using, live class reloading will work after
 a class in the library/module/subproject is recompiled. Maybe Eclipse makes
 it easier because it compiles automatically on save. I don't know how IDEA
 handles this.


 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: prefilling password

2015-08-03 Thread Stephen Nutbrown
Hi,

I think it will only prefill it if the password is persisted. I would think
the best solution is not to persist the password with @Persist.

Thanks,
Steve

On 3 August 2015 at 19:04, Christine myli...@christine.nl wrote:


 I have a form with a password field. It gets pre-filled with a previously
 used password string. How can I prevent the browser and/or Tapestry from
 putting a value in the password field?

 dagdag
 Christine

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




Re: Multiple domains, one webapp

2015-07-30 Thread Stephen Nutbrown
Thanks for the advice. I'll go with this. I will look into how to create a
module which I can use in both webapps, and I will need to find a reliable
way to connect both of the webapps to the same (amazon RDS) database
without running out of connections etc (I believe this will just mean
working with the hibernate config).

In the long run, I do think this is the best approach, although as we
currently have ~70 pages and around 10 services, i'm sure you can imagine
why I was a little hesitant to start chopping things out of it, but I
suppose this number of pages and services is all the more reason to split
it into two webapps.

One benefit of having a single webapp is hosting prices, as it's with
Amazon on an EC2 instance - it means we will now have two EC2 instances
unless I can figure out a way to get them both on one - I am sure this is
possible but perhaps not particularly easy.

Thanks again for all the help - I know what I have to do, it's just going
to be quite an effort (no fault of T5 - it's a huge change to the direction
of the project).



On 30 July 2015 at 21:45, Norman Franke nor...@myasd.com wrote:

 Or have two instances of the same application with some configuration
 parameter to tell it which version it should be.

 Norman Franke
 Answering Service for Directors, Inc.
 www.myasd.com http://www.myasd.com/



  On Jul 30, 2015, at 4:12 PM, Thiago H de Paula Figueiredo 
 thiag...@gmail.com wrote:
 
  On Thu, 30 Jul 2015 16:19:50 -0300, Dimitris Zenios 
 dimitris.zen...@gmail.com wrote:
 
  I would definitely split it into two web applications with a common
  tapestry module.Any other way will result to a mess.
 
  Agreed, as that's basically two distinct web applications which just
 happen to be in the same server, even if they have shared code.
 
  If it was the same web application but with different domains and data,
 you can use URL rewriting to make them work out of the same webapp
 instance. My (incomplete, but working) Eloquentia blogging engine does
 that: https://github.com/thiagohp/eloquentia. It can serve two or more
 different blogs, each from its own different domain, in the same webapp
 instance. It can also have subdomains for tags (domain.com for general
 stuff and tapestry.domain.com for tapestry-specific posts, for example).
 
  --
  Thiago H. de Paula Figueiredo
  Tapestry, Java and Hibernate consultant and developer
  http://machina.com.br
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
  For additional commands, e-mail: users-h...@tapestry.apache.org
 




Multiple domains, one webapp

2015-07-30 Thread Stephen Nutbrown
Hi,

To cut a long story short, I have a website running using tapestry which
has two main areas, we will call them Client accounts and Partner
accounts. The powers that be have now decided the best way forwards is to
split this into two separate domains, let's call them www.clients.com and
www.partners.com.

All of the logic and services are set up at the moment and hibernate is
used which accesses one database. Splitting them up is going to be tricky,
as both of the sites need access to the same, up to date database. Ideally
I can serve both these pages from the same webapp, and just say for example
put pages for clients.com in the pages.clients package and put pages for
partner.com in the partner.clients package, that way they can both make
use of the database, it'll be up to date, and we have to maintain only one
webapp and we don't need to duplicate lots of things or split everything up
in the backend.

Has anyone done something similar, and if so, is there a sensible structure
you would recommend?

I am thinking the most tricky page is the index, so I would have this page
redirect to /clients or /partner by returning the correct page from
onActivate. This would however mean that the page would be
partners.com/partner and clients.com/client but this is OK.

Then, perhaps each page in the clients package can inherit from some base
class which pretty much checks the request to make sure it's on clients.com
and not partners.com (if it is, it can redirect). The same for the
partners.com site.

All in all, I can see this becoming rather messy so i'm looking for any
advice within Tapestry how may be best to do this.

Any help is really appreciated,

Thanks,


Form recorded error disappearing

2015-07-25 Thread Stephen Nutbrown
Hi,

I have a simple form with one field which takes in a code. This code is to
identify guests at our wedding, the security of it isn't really paramount.

We would like to be able to have users enter the code into the form, OR
scan a QR code. The QR code points to an address, e.g

www.foo.com/1234

The onActivate method picks up that 1234 and gets an Invite object if one
exists with that code. If not, I would like to record an error on the form,
the code looks like this:

@SessionState(create = false)
Invitation invite;

@Component(id = pinform)
private Form form;

@Component(id = pinNumber)
private TextField pinNumberField;

public Object onActivate(Invitation invite) {
this.invite = invite;
if(invite != null){
return Wedding.class;
}else{
form.recordError(pinNumberField, Sorry, this number is not valid.);
return null;
}
}

Although this does pick up the wedding and the else is fired for an
incorrect pin, the recorded error does not show.

My onValidate method (for if someone actually submits the form rather than
scanning a QR code) works and looks like this:

public void onValidateFromPinForm() {
invite = dao.find(Invitation.class, pinNumber);
if (invite == null) {
form.recordError(pinNumberField, Sorry, this number is not valid.);
}
}

public Object onSuccessFromPinForm() {
return Wedding.class;
}

How can I persist the error on the form from the onActivate method? I have
tried using @Persist, this throws an exception:

Field form of class com.wedding.steveandstacey.pages.Index can not be
claimed by @org.apache.tapestry5.annotations.Persist as it is already
claimed by @org.apache.tapestry5.annotations.Component.

Any ideas?

Thanks,
Steve


Re: Ajaxformloop add row link max size.

2015-07-24 Thread Stephen Nutbrown
I'd just like to close the loop a little bit as in the end I asked this on
SO also. Here is a link to the same question with an answer. It's not
ideal, but for my use case it's ok.

http://stackoverflow.com/questions/31518944/tapestry5-ajaxformloop-limit-number-of-rows/31619004#31619004

On 15 July 2015 at 16:25, Stephen Nutbrown steves...@gmail.com wrote:

 Hi,

 Thank you for your reply Lance, sorry I didn't see it sooner. I still
 haven't managed to fix this, but I have done some experimenting and i'm not
 sure if it's due to my misunderstanding (most likely) or some bug.

 My ajaxformloop now looks like this:

 div class=col-sm-6 t:type=ajaxformloop t:id=formloop
 source=invite.people value=guest
   div class=formgroup
   t:label for=name/
   t:textfield t:id=name value=guest.name t:validate=required,
 maxlength=50/
   /div

   div class=formgroup
   t:label for=music/
   t:textfield t:id=music value=guest.music/
   /div
   div class=formgroup
   t:label for=attending/
   t:select t:id=attending value=guest.attending
 model=attendingModel t:encoder=attendingEncoder/
   /div
   div class=formgroup
   t:label for=drink /
   t:select t:id=drink value=guest.drink model=drinkModel
 t:encoder=drinkEncoder/
   /div
   div class=formgroup
   t:label for=chocolate /
   t:select t:id=chocolate value=guest.chocolate
 model=chocolateModel t:encoder=chocolateEncoder/
   /div
   t:removerowlinkRemove/t:removerowlink
   div t:type=zone t:id=addRowZone id=addRowZone
   p:addRow
   t:addrowlinkAdd a plus one/t:addrowlink
   /p:addRow
   /div
   /div
   div class=col-sm-12
   button t:type=submit /
   /div



 One thing I notice, is that as soon as I add the zone around the addRow
 link, my add row link changes from saying Add a plus one to Add row.
 This makes me think tapestry is no longer picking up my add row link, and
 is instead adding it's own? I think this as if I remove the addrow link
 entirely, this is exactly what I get (the same result).

 So my plan is to update that zone with an empty body. I'm not quite sure
 how to do this, but as you mention AjaxResponseRenderer seems like the way
 forwards, so I do this:

 @Inject
 private AjaxResponseRenderer ajaxResponseRenderer;
 @InjectComponent
 private Zone addRowZone;

 My onAddRowFromFormLoop needs to return a Person object so I cannot
 return anything special, but looking at the ajaxResponseRenderer I don't
 know how I can update the contents of my addRowZone. Currently it looks
 like this:

 Object onAddRowFromFormLoop() {
 Person person = null;
 if (moreGuestsAllowed()) {
 person = new Person();
 invite.getPeople().add(person);
 person.setInvite(invite);
 dao.create(person);
 dao.update(invite);
 return person;
 }

 //ajaxResponseRenderer.addRender(addRowZone,
 addRowZone);
 return person;
 }

 I have also tried putting a t:if around the addrow link and then updating
 the zone using the above line (I assumed it would re-render it, i'm not
 quite sure) - this didn't work and I was left still with the Add row
 rather than the Add a plus one link.

 Any ideas why my Add a plus one addrowlink is lost as soon as I put it
 in the zone? I put some test text Hello just inside the zone before
 p:addRow add row link and this showed correctly, however if I put that
 inside the p:addRow then it does not show and on inspecting the source of
 the page produced, it isn't there at all.

 So it looks to me like the zone shows, but the addrow link inside it does
 not. Is this a bug, or just me?

 Any help is really appreciated.

 Thanks,
 Steve

 On 13 July 2015 at 20:47, Stephen Nutbrown steves...@gmail.com wrote:

 Hi!

 Wohoo, I'm getting married next year and I'm currently in the process of
 setting up a small wedding website for my guests to RSVP. However, I have a
 small problem which I'm sure has a simple solution, I just can't see it.

 I have an ajaxformloop for the guests to add +1s. Some have more
 allocated than others (eg some have kids etc). I'm using the form to
 collect names for placemats and drink preferences etc.

 I have a value from an Invite object  which represents the max number of
 guests for the invite. My ajaxformloop should only let them add that many
 guests using the add row link.

 I've tried returning null from my onAddNewRow event and it didn't like
 that.

 I've also tried putting a t:if around the add new row link, however this
 doesn't work, probably because it's ajax and doesn't update this part.

 Is there a max size parameter or something similar for the add row link
 or the ajaxformloop? Or perhaps there is another easy way, I'm sure there
 will be but I can't spot it.

 Thanks,
 Steve





Re: Ajaxformloop add row link max size.

2015-07-15 Thread Stephen Nutbrown
Hi,

Thank you for your reply Lance, sorry I didn't see it sooner. I still
haven't managed to fix this, but I have done some experimenting and i'm not
sure if it's due to my misunderstanding (most likely) or some bug.

My ajaxformloop now looks like this:

div class=col-sm-6 t:type=ajaxformloop t:id=formloop
source=invite.people value=guest
  div class=formgroup
  t:label for=name/
  t:textfield t:id=name value=guest.name t:validate=required,
maxlength=50/
  /div

  div class=formgroup
  t:label for=music/
  t:textfield t:id=music value=guest.music/
  /div
  div class=formgroup
  t:label for=attending/
  t:select t:id=attending value=guest.attending model=attendingModel
t:encoder=attendingEncoder/
  /div
  div class=formgroup
  t:label for=drink /
  t:select t:id=drink value=guest.drink model=drinkModel
t:encoder=drinkEncoder/
  /div
  div class=formgroup
  t:label for=chocolate /
  t:select t:id=chocolate value=guest.chocolate model=chocolateModel
t:encoder=chocolateEncoder/
  /div
  t:removerowlinkRemove/t:removerowlink
  div t:type=zone t:id=addRowZone id=addRowZone
  p:addRow
  t:addrowlinkAdd a plus one/t:addrowlink
  /p:addRow
  /div
  /div
  div class=col-sm-12
  button t:type=submit /
  /div



One thing I notice, is that as soon as I add the zone around the addRow
link, my add row link changes from saying Add a plus one to Add row.
This makes me think tapestry is no longer picking up my add row link, and
is instead adding it's own? I think this as if I remove the addrow link
entirely, this is exactly what I get (the same result).

So my plan is to update that zone with an empty body. I'm not quite sure
how to do this, but as you mention AjaxResponseRenderer seems like the way
forwards, so I do this:

@Inject
private AjaxResponseRenderer ajaxResponseRenderer;
@InjectComponent
private Zone addRowZone;

My onAddRowFromFormLoop needs to return a Person object so I cannot
return anything special, but looking at the ajaxResponseRenderer I don't
know how I can update the contents of my addRowZone. Currently it looks
like this:

Object onAddRowFromFormLoop() {
Person person = null;
if (moreGuestsAllowed()) {
person = new Person();
invite.getPeople().add(person);
person.setInvite(invite);
dao.create(person);
dao.update(invite);
return person;
}

//ajaxResponseRenderer.addRender(addRowZone, addRowZone);
return person;
}

I have also tried putting a t:if around the addrow link and then updating
the zone using the above line (I assumed it would re-render it, i'm not
quite sure) - this didn't work and I was left still with the Add row
rather than the Add a plus one link.

Any ideas why my Add a plus one addrowlink is lost as soon as I put it in
the zone? I put some test text Hello just inside the zone before
p:addRow add row link and this showed correctly, however if I put that
inside the p:addRow then it does not show and on inspecting the source of
the page produced, it isn't there at all.

So it looks to me like the zone shows, but the addrow link inside it does
not. Is this a bug, or just me?

Any help is really appreciated.

Thanks,
Steve

On 13 July 2015 at 20:47, Stephen Nutbrown steves...@gmail.com wrote:

 Hi!

 Wohoo, I'm getting married next year and I'm currently in the process of
 setting up a small wedding website for my guests to RSVP. However, I have a
 small problem which I'm sure has a simple solution, I just can't see it.

 I have an ajaxformloop for the guests to add +1s. Some have more allocated
 than others (eg some have kids etc). I'm using the form to collect names
 for placemats and drink preferences etc.

 I have a value from an Invite object  which represents the max number of
 guests for the invite. My ajaxformloop should only let them add that many
 guests using the add row link.

 I've tried returning null from my onAddNewRow event and it didn't like
 that.

 I've also tried putting a t:if around the add new row link, however this
 doesn't work, probably because it's ajax and doesn't update this part.

 Is there a max size parameter or something similar for the add row link or
 the ajaxformloop? Or perhaps there is another easy way, I'm sure there will
 be but I can't spot it.

 Thanks,
 Steve



Ajaxformloop add row link max size.

2015-07-13 Thread Stephen Nutbrown
Hi!

Wohoo, I'm getting married next year and I'm currently in the process of
setting up a small wedding website for my guests to RSVP. However, I have a
small problem which I'm sure has a simple solution, I just can't see it.

I have an ajaxformloop for the guests to add +1s. Some have more allocated
than others (eg some have kids etc). I'm using the form to collect names
for placemats and drink preferences etc.

I have a value from an Invite object  which represents the max number of
guests for the invite. My ajaxformloop should only let them add that many
guests using the add row link.

I've tried returning null from my onAddNewRow event and it didn't like
that.

I've also tried putting a t:if around the add new row link, however this
doesn't work, probably because it's ajax and doesn't update this part.

Is there a max size parameter or something similar for the add row link or
the ajaxformloop? Or perhaps there is another easy way, I'm sure there will
be but I can't spot it.

Thanks,
Steve


Re: Tree expansion

2015-06-12 Thread Stephen Nutbrown
Hi,

I believe this should be pretty much the same as it was here:

http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/T5-3-1-How-to-expand-all-the-tree-nodes-td5702736.html

Thanks,
Steve

On 29 May 2015 at 06:48, Cheng Zhang charlesdenverj...@gmail.com wrote:
 Thank you for your answer. What method can I use to expand a node? Thanks.

 On Thu, May 28, 2015 at 12:22 AM, Charlouze m...@charlouze.com wrote:
 Hey!

 I think you have to iterate through all the tree nodes to expand them one
 at a time.

 Cheers,
 Charles

 Le mer 27 mai 2015 23:19, Cheng Zhang charlesdenverj...@gmail.com a
 écrit :

 Hi,

 I plan to use Tree component in my next project. The Tree has a
 clearExpansions() to collapse all its nodes. Conversely, I was
 wondering how to expand a tree or a node of a tree. Thanks.

 Charles Zhang

 -
 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


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



Re: Handling the fileuploadexception

2015-06-11 Thread Stephen Nutbrown
Hi again, apologies for multiple posts.

I would actually really be interested in a file type validator as I am
currently doing this on the server too - in the onValidateFromX, which
fires after the upload has happened.
I'll wait for some feedback on this one before creating a file type
validator, but I will do that too (taking into account any notes on
this one).
Perhaps these two together could be added to Tapestry-Uploads or as a
separate dependency. I would think that any site which has upload
functionality wants to have something to stop massive files being
uploaded, and I would also expect that clearing the form is
problematic for most of those sites, so i'm still a bit surprised this
hasn't been an issue for anyone else.

Thanks,
Steve

On 11 June 2015 at 21:51, Stephen Nutbrown steves...@gmail.com wrote:
 Hello!

 I am back, and with a working solution. Before using this solution for
 any of your own projects, please take the following into
 consideration:

 - I am not an experienced javascript developer, i've done my best to
 hack something together based on tapestrys own validation.js and the
 stackoverflow post which was linked to.

 - I haven't tested it on all browsers, but it should be supported on
 all modern browsers (as per the other article I linked to), and I have
 set the clientside validation to accept it if the required support
 isn't there - the server side validation will catch it but it's more
 efficient to catch it client side.

 - I have absolutely no clue how to package this up into a .jar file to
 make it easier to distribute, ideally it would be nice if this is
 taken as a proof of concept and added to tapestry-upload, or if it was
 made into a .jar which was distributed on maven - unfortunately this
 would be a bit of a learning curve for me and i'm so busy it's
 unbelievable. Of course if you have the time to take my code and do
 that with it, please do and share it - do with it whatever you want.
 One day I would like to be a Tapestry contributor, but it'll take me a
 while to be ready.

 That said, here it is (I'm sure Thiago or someone else will probably
 correct some parts if it's wrong):

 - maxfilesize.js (attached) belongs in src/main/resources/META-INF/modules

 - MaxUploadSize.java belongs where you want to place it, I put it in a
 validators package, so for me it is
 src/main/java/com/football/news/validators, but for you it will be
 src/main/java/your/project/package

 - I added the following line to my app.properties
 (src/main/webapp/WEB-INF/app.properties), perhaps there is a better
 properties file for this:
 data-validate-filesize=The file size is too big.

 - I contributed the validator in my AppModule, like this:

 public static void
 contributeFieldValidatorSource(MappedConfigurationString, Validator
 configuration, final JavaScriptSupport javaScriptSupport) {
 configuration.add(fileSizeValidator, new
 MaxUploadSize(Integer.class, UploadedFile.class,
 data-validate-filesize, javaScriptSupport));
 }

 I'm trying to help others by uploading this, but please take my
 solution with a pinch of salt, some parts of tapestry are still some
 unknown magic to me.

 Any feedback is really appreciated, it will help people seeing this in
 future and will also help me to update my local version. I would think
 a filetype validator similar to this one would also be possible.

 Thanks,
 Steve

 On 10 June 2015 at 08:52, Stephen Nutbrown steves...@gmail.com wrote:
 Hi,

 Yes, copying and adapting one for the validators is exactly what I did
 in the end using the twitter library they have. However, I found it a
 bit difficult to do because the current validator seems to use a
 coffee script (Something i'm not familiar with, I struggle with JS as
 it is!). So I ended up getting the validator.js from running my T5
 program and downloading it (I'm sure there is a better way, but  I
 couldn't find this .js file otherwise), and then I had to figure out
 how to use require.js properly as I wasn't used to it. I'm sure now I
 know how to do it, it'll be easy enough, but when I did the twitter
 one it actually took me a fair bit of time to figure out how to do it
 - but I got there in the end.

 Perhaps when I make this i'll note down some steps and I can post them
 somewhere to make it easier for other people. It might be a few days
 until I get the time, but i'll certainly do that.

 Thanks,
 Steve



 On 10 June 2015 at 01:38, Thiago H de Paula Figueiredo
 thiag...@gmail.com wrote:
 On Tue, 09 Jun 2015 19:01:33 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,


 Hi!


 I saw some posts on StackOverflow about validating files using
 JavaScript's
 files api (it looks fairly new so may not be suitable for projects which
 need to support old browsers):


 https://www.google.co.uk/url?sa=tsource=webrct=jei=omB3Vb_MKKi07QbRvoDYBQurl=http://stackoverflow.com/questions/3717793/javascript-file-upload-size-validationved=0CB0QFjAAusg=AFQjCNGck_7qB8b7VzFExHQM72vzF6JxZAsig2=XgAbDcP

Re: [OT] Hosting

2015-06-11 Thread Stephen Nutbrown
Hi,

I'm using amazon aws on their free tier which is free for a year, then I
don't think too expensive after but it's worth checking out if it's just
for dev or staging for now.

At the moment my project is mainly just me messing around and isn't
anything serious,  but it seems a lot faster than I expected.
sufc.football, swfc.football, nottinghamforest.football and afcb.football
all point to one Web app on amazon, using hibernate which connects to
Amazon rds (also free for now).

I've also used ovh and they've been really good, you get ssh access and
pretty much free rein to set up whatever you like. For my last project we
set it up to pull our project from bitbucket when we committed to master,
build it and run it,  it was very nice to have the freedom to set that up,
with Amazon I think that kind of thing may be more difficult but I just
upload the war file via their website and it does the rest.

I have a friend using digital river too,  I'm sure they have some kind of
student promotion and they seem really happy,  I've not used them though.
If you do happen to be a student,  it may be worth doing a bit of googling
for student offers.

Thanks,
Steve
 On 11 Jun 2015 02:54, Kalle Korhonen kalle.o.korho...@gmail.com wrote:

 Thanks Thiago. I'd be happy to give you a referral if it checks out. How do
 they not describe on the features page if SSH access is included. But I
 trust you. I hate comparing providers because they never tell you the same
 information (best yet, don't tell how much memory is allocated...) SSD is
 certainly valuable (another thing providers don't mention unless they offer
 it). However, doesn't seem to beat interserver's pricing of $6/month (for
 1024MB RAM). I'm fine with OpenVZ rather than KVM.

 Kalle

 On Wed, Jun 10, 2015 at 6:35 PM, Thiago H de Paula Figueiredo 
 thiag...@gmail.com wrote:

  Hello, Kalle!
 
  I use Digital Ocean and I like it very much. Full Linux VPS with root
  access starting at 5 dollars per month for 512 MB of RAM, 20 GB of SSD
  storage and 1 TB of transfer.
 
  shamelessPlugHere's my referral URL:
  https://www.digitalocean.com/?refcode=112272022761/shamelessPlug :D
 
 
  On Wed, 10 Jun 2015 20:58:15 -0300, Kalle Korhonen 
  kalle.o.korho...@gmail.com wrote:
 
   It's that time again. I need a cheap hosting for development  testing
 of
  a
  low memory profile T5 app. Prices of VPS plans have been dropping in
  recent
  years. I'm rather suspicious of ultra-low ($2-$5/month) shared Tomcat
  plans
  but could try out one that's found to be reliable. I've used Tektonic's
  VPS
  for different things for years but looks like there are cheaper
  alternatives today, for example http://www.interserver.net/vps/. Can
  anybody recommend anything else? AWS is not a good option for me as the
  instance will be doing something all the time. Openshift is too
  restrictive, I need more control on the container configuration.
 Jelastic
  is my favorite by far in terms of flexibility but too expensive for this
  type.
 
  Kalle
 
 
 
  --
  Thiago H. de Paula Figueiredo
  Tapestry, Java and Hibernate consultant and developer
  http://machina.com.br
 



Re: Handling the fileuploadexception

2015-06-10 Thread Stephen Nutbrown
Hi,

Yes, copying and adapting one for the validators is exactly what I did
in the end using the twitter library they have. However, I found it a
bit difficult to do because the current validator seems to use a
coffee script (Something i'm not familiar with, I struggle with JS as
it is!). So I ended up getting the validator.js from running my T5
program and downloading it (I'm sure there is a better way, but  I
couldn't find this .js file otherwise), and then I had to figure out
how to use require.js properly as I wasn't used to it. I'm sure now I
know how to do it, it'll be easy enough, but when I did the twitter
one it actually took me a fair bit of time to figure out how to do it
- but I got there in the end.

Perhaps when I make this i'll note down some steps and I can post them
somewhere to make it easier for other people. It might be a few days
until I get the time, but i'll certainly do that.

Thanks,
Steve



On 10 June 2015 at 01:38, Thiago H de Paula Figueiredo
thiag...@gmail.com wrote:
 On Tue, 09 Jun 2015 19:01:33 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,


 Hi!


 I saw some posts on StackOverflow about validating files using
 JavaScript's
 files api (it looks fairly new so may not be suitable for projects which
 need to support old browsers):


 https://www.google.co.uk/url?sa=tsource=webrct=jei=omB3Vb_MKKi07QbRvoDYBQurl=http://stackoverflow.com/questions/3717793/javascript-file-upload-size-validationved=0CB0QFjAAusg=AFQjCNGck_7qB8b7VzFExHQM72vzF6JxZAsig2=XgAbDcP-E8-daXfAyP0tEg


 Interesting! Thanks! I learned something new today . . .

 Some time ago I implemented a client side twitter validator to check the
 length of text field values (it gets a bit complicated because links
 count as fewer characters etc).


 Twitter has a JS library that does this character counting, so it's just a
 matter of copying and adapting the MaxLength validator from Tapestry.

 I can have a go at doing the same for the
 fileuploader and can put whatever I make up on github somewhere.


 Don't forget to post an announcement here. :)

 It won't
 work on old browsers as per:

 https://www.google.co.uk/url?sa=tsource=webrct=jei=Y2F3Vbf0IIet7AarkoLgBAurl=http://caniuse.com/fileapived=0CB0QFjAAusg=AFQjCNEufMjex_NEpHKkWV7k-pakFWDNJQsig2=-hTtFzGroBPZc9w0v1bGIA

 I'm a bit surprised that this doesn't exist,


 What's this? :)


 I thought it would and so I

 expected that I was doing something horribly wrong. I'll come back when I
 have it working as it may help others.

 Thanks,
 Steve
  On 9 Jun 2015 20:06, Thiago H de Paula Figueiredo thiag...@gmail.com
 wrote:

 On Tue, 09 Jun 2015 14:39:54 -0300, Stephen Nutbrown
 steves...@gmail.com
 wrote:

  Hi Thiago,



 Hi!


 That's interesting. Perhaps the documentation wants updating. It says:
 Note the importance of return this;. A void event handler method, or
 one that returns null, will result in the FileUploadException being
 reported to the user as an uncaught runtime exception.

 https://tapestry.apache.org/uploading-files.html


 Not returning this isn't just for uploading exceptions: it's for all
 event handler methods, so I don't think it makes sense to put this
 warning
 in uploading-files.html.

 In your original code, returning this, if you annotated your field with
 @Persist(PersistenceConstants.FLASH), the message would appear. In this
 very case, it appears to be the right thing to do (return this), as
 otherwise Tapestry still considers the event as not handled and the
 generic
 exception handling is used.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

 -
 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



Handling the fileuploadexception

2015-06-09 Thread Stephen Nutbrown
Hi,

I have a page with a form on, one field is a FileUpload. It takes a
while for the user to fill out this form. The validation is set to
limit the upload to 500kb, I have done this by adding this to the
AppModule:

  configuration.add(UploadSymbols.FILESIZE_MAX, 50);


When the file is too large, an exception is thrown and a page event is
triggered which looks a bit like this:

Object onUploadException(FileUploadException ex) {
message = The file is too large, please resize it to be less than 500kb.;
return this;
}

I'm following the information in the documentation
here:https://tapestry.apache.org/uploading-files.html

My two problems/questions are:
1- If I record an error on the form using something like:
createForm.recordError(Your file is too big);
This does not show. I have worked around this by adding a message
property which is checked and if it's not null, we show it on the
page. It is persisted with the Flash strategy, this seems to work, but
isn't ideal as it would be nice to have all the validation done in the
same way.

2- It then clears the form. Unfortunately the other parts of the form
are not persisted. Perhaps this is because T5 cut stopped the client
finishing the POST request (maybe a good thing), I am not sure. Is
there anything that can be done to persist the rest of the data so the
user doesn't then need to do everything again?

I think ideally (what I envisage) is some client side validation of
the file size which means the request is never sent, so we don't need
to worry about persistance, and perhaps we can show the error on the
field itself (just like how validate works on other fields, like
validate=required, but for this perhaps validate=50.

Is this possible? I would think this is a fairly normal requirement,
so i'd be surprised if it's not already somehow done.

Thanks,
Steve

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



Re: Handling the fileuploadexception

2015-06-09 Thread Stephen Nutbrown
Hi,

If I change it to void I get an uncaught exception and I end up going
to my custom exception page (This just says something went wrong, logs
the exception and returns the user to the homepage).

If there is no client side validation for the fileupload, is it
possible (and not too difficult) for me to create one for the file
upload component?

Thanks,
Steve

On 9 June 2015 at 18:39, Stephen Nutbrown steves...@gmail.com wrote:
 Hi Thiago,

 That's interesting. Perhaps the documentation wants updating. It says:
 Note the importance of return this;. A void event handler method, or
 one that returns null, will result in the FileUploadException being
 reported to the user as an uncaught runtime exception.

 https://tapestry.apache.org/uploading-files.html

 Perhaps if I change it to void it may keep my values, i'll give it a try.

 Thanks,
 Steve

 On 9 June 2015 at 18:25, Thiago H de Paula Figueiredo
 thiag...@gmail.com wrote:
 On Tue, 09 Jun 2015 14:05:49 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,


 Hi!

 Object onUploadException(FileUploadException ex) {
 message = The file is too large, please resize it to be less than
 500kb.;
 return this;
 }


 Never return this in an event handler unless you want to force a
 redirection. Return null or void.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

 -
 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: Handling the fileuploadexception

2015-06-09 Thread Stephen Nutbrown
Hi Thiago,

That's interesting. Perhaps the documentation wants updating. It says:
Note the importance of return this;. A void event handler method, or
one that returns null, will result in the FileUploadException being
reported to the user as an uncaught runtime exception.

https://tapestry.apache.org/uploading-files.html

Perhaps if I change it to void it may keep my values, i'll give it a try.

Thanks,
Steve

On 9 June 2015 at 18:25, Thiago H de Paula Figueiredo
thiag...@gmail.com wrote:
 On Tue, 09 Jun 2015 14:05:49 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,


 Hi!

 Object onUploadException(FileUploadException ex) {
 message = The file is too large, please resize it to be less than
 500kb.;
 return this;
 }


 Never return this in an event handler unless you want to force a
 redirection. Return null or void.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

 -
 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: Handling the fileuploadexception

2015-06-09 Thread Stephen Nutbrown
Hi,

I saw some posts on StackOverflow about validating files using JavaScript's
files api (it looks fairly new so may not be suitable for projects which
need to support old browsers):

https://www.google.co.uk/url?sa=tsource=webrct=jei=omB3Vb_MKKi07QbRvoDYBQurl=http://stackoverflow.com/questions/3717793/javascript-file-upload-size-validationved=0CB0QFjAAusg=AFQjCNGck_7qB8b7VzFExHQM72vzF6JxZAsig2=XgAbDcP-E8-daXfAyP0tEg

Some time ago I implemented a client side twitter validator to check the
length of text field values (it gets a bit complicated because links count
as fewer characters etc). I can have a go at doing the same for the
fileuploader and can put whatever I make up on github somewhere. It won't
work on old browsers as per:
https://www.google.co.uk/url?sa=tsource=webrct=jei=Y2F3Vbf0IIet7AarkoLgBAurl=http://caniuse.com/fileapived=0CB0QFjAAusg=AFQjCNEufMjex_NEpHKkWV7k-pakFWDNJQsig2=-hTtFzGroBPZc9w0v1bGIA

I'm a bit surprised that this doesn't exist, I thought it would and so I
expected that I was doing something horribly wrong. I'll come back when I
have it working as it may help others.

Thanks,
Steve
 On 9 Jun 2015 20:06, Thiago H de Paula Figueiredo thiag...@gmail.com
wrote:

 On Tue, 09 Jun 2015 14:39:54 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

  Hi Thiago,


 Hi!


 That's interesting. Perhaps the documentation wants updating. It says:
 Note the importance of return this;. A void event handler method, or
 one that returns null, will result in the FileUploadException being
 reported to the user as an uncaught runtime exception.

 https://tapestry.apache.org/uploading-files.html


 Not returning this isn't just for uploading exceptions: it's for all
 event handler methods, so I don't think it makes sense to put this warning
 in uploading-files.html.

 In your original code, returning this, if you annotated your field with
 @Persist(PersistenceConstants.FLASH), the message would appear. In this
 very case, it appears to be the right thing to do (return this), as
 otherwise Tapestry still considers the event as not handled and the generic
 exception handling is used.

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

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




Re: Customizing the Tree Component

2015-05-26 Thread Stephen Nutbrown
Hi,

Just to add to this - I've done this before and it works, however the
code is old and I don't think I have it (It's an old project which
never launched).

However, if you go here:
http://jumpstart.doublenegative.com.au/jumpstart/examples/component/treebrowse/tree-sprites.png

You can see the CSS in tree.css, and all you really need to do is
override the background-image and background-position. Currently it's
using:
SPAN.t-tree-icon to set the background image to url(tree-sprites.png)

You can see this file here:
http://jumpstart.doublenegative.com.au/jumpstart/assets/51b9b1f301896216/core/tree-sprites.png

Then it's using the background position on the nodes to get the right
part of the image:
SPAN.t-tree-icon.t-leaf-node
background-position: -32px -16px

If you want to change these, you may want an image for each node type,
put them in your assets somewhere, override the background-image from
tree.css and add in your own background images on the
SPAN.t-tree-icon.t-leaf-node and SPAN.t-tree-icon. Depending on your
version of Tapestry I think these may have changed (i'm not sure), but
generally, poking around in the developer tools for Chrome (or any
browser) makes finding the CSS attributes which you want to override
very easy to find.

Make sure your own CSS is added after the tapestry CSS file and it
should work fine.

What are the other changes you needed?

Hope this helps,

On 26 May 2015 at 09:41, Dmitry Gusev dmitry.gu...@gmail.com wrote:
 Hi,

 using CSS?

 On Tue, May 26, 2015 at 11:29 AM, Poggenpohl, Daniel 
 daniel.poggenp...@isst.fraunhofer.de wrote:

 Hello everyone,

 we want to customize the Tapestry tree component.
 One of our first problems is to change the icons used in leaves and nodes.
 How could we do that?

 Regards,
 Daniel P.




 --
 Dmitry Gusev

 AnjLab Team
 http://anjlab.com

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



Re: tml reloading

2015-05-23 Thread Stephen Nutbrown
Hi,

I'm fairly new to Tapestry myself, so i'm sure Dmitry will correct me
if i'm wrong.

If you have no flags, it is set as production mode by default. The
DevelopmentModule class is only used if you are in Development mode
(which is set by that flag). So, changing things in that class won't
affect anything unless you are in development mode.

You also have an AppModule class, which I believe is for any mode.

Please see the section titled Setting Execution Modes:
http://tapestry.apache.org/configuration.html

If the tapestry.execution-mode is not declared, Tapestry will
automatically look for the tapestry.production-modules parameter,
because “production” is the default tapestry.execution-mode value.

Thanks,

On 23 May 2015 at 18:05, Veit Guna veit.g...@gmx.de wrote:
 Hi.

 That did the trick, thanks!

 But I'm wondering, why it wasn't enabled before. The archetype creates a
 Class called DevelopmentModule.
 In there one can find something like:

 configuration.add(SymbolConstants.PRODUCTION_MODE, false);

 So I pretended, that production is false == development mode is on :).

 But I'm glad it is working now. Thanks again!

 Regards,
 Veit

 Am 23.05.2015 um 18:46 schrieb Stephen Nutbrown:
 Hi,

 Can you try adding this argument:

  -Dtapestry.execution-mode=development

 Thanks,
 Steve

 On 23 May 2015 at 16:58, Veit Guna veit.g...@gmx.de wrote:
 Hi.

 I'm a new user of tapestry and struggling to get tml files reloaded
 during development.
 I'm using Tomcat 8 with JDK 7 and the tapestry archetype demo using
 version 5.3.8.

 I've configured a tomcat server within Eclipse WTP and normally using
 other web development
 frameworks it's enough to save a file and it gets automatically
 published to tomcat
 without a redeployment. So it uses HCR unter the hood. Simply reloading
 the page and
 voila. That works with classes and resources (pages etc.). Tomcat is
 started in Debug mode.

 With tapestry, the class reloading works, but not with the .tml files.
 If I look at the
 internal deployment location of WTP (under .metadata), I can see that
 the resources
 get replaced correctly by Eclipse. But tapestry doesn't pick them up.

 I've also tried -Dorg.apache.tapestry.disable-caching=true on container
 start, but without
 luck.

 I want to avoid deploying via maven, restarting tomcat or reloading the
 context.

 Does anybody have a clue what I'm missing?

 Regards,
 Veit




 -
 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



 -
 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: tml reloading

2015-05-23 Thread Stephen Nutbrown
Hi,

Can you try adding this argument:

 -Dtapestry.execution-mode=development

Thanks,
Steve

On 23 May 2015 at 16:58, Veit Guna veit.g...@gmx.de wrote:
 Hi.

 I'm a new user of tapestry and struggling to get tml files reloaded
 during development.
 I'm using Tomcat 8 with JDK 7 and the tapestry archetype demo using
 version 5.3.8.

 I've configured a tomcat server within Eclipse WTP and normally using
 other web development
 frameworks it's enough to save a file and it gets automatically
 published to tomcat
 without a redeployment. So it uses HCR unter the hood. Simply reloading
 the page and
 voila. That works with classes and resources (pages etc.). Tomcat is
 started in Debug mode.

 With tapestry, the class reloading works, but not with the .tml files.
 If I look at the
 internal deployment location of WTP (under .metadata), I can see that
 the resources
 get replaced correctly by Eclipse. But tapestry doesn't pick them up.

 I've also tried -Dorg.apache.tapestry.disable-caching=true on container
 start, but without
 luck.

 I want to avoid deploying via maven, restarting tomcat or reloading the
 context.

 Does anybody have a clue what I'm missing?

 Regards,
 Veit




 -
 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.4 beta 28] Date and time picker

2015-05-04 Thread Stephen Nutbrown
Hi,

Thank you Akshay  Dimitris.

Just a quick note on the things I have now tried, and the outcome.
I tried Ashkay's example but seemed to run into some problems, mainly
that I don't know exactly where to put this code as it is using a js
module, the function is also anonymous so I was a bit stuck/confused.

I then put an alert inside the function passed to the scanner:
 dom.scanner([data-component-type='DateTimeField'], function(container) {
alert('running function');
  
   
}

I see this runs once for each row on the form to begin with, but does
no run again when adding a new row. E.g, if I have 2 rows, it runs
twice, I press add row, it does not run again (but I now have 3 rows).
The new row is the one which contains the field which doesn't seem
show the picker on click.

I then updated from 5.4-beta-28 to 5.4-beta-31, this didn't seem to work.

This is what I get in the console of Google Chrome developer tools:


= When the page loads =
Loading 0 libraries
console.js:104 Executing 7 inits
console.js:104 Invoking t5/core/pageinit:focus(price)
console.js:104 Loaded module t5/core/forms
console.js:104 Loaded module t5/core/form-fragment
console.js:104 Loaded module t5/core/validation
console.js:104 Loaded module t5/core/ajaxformloop
console.js:104 Loaded module bootstrap/alert
console.js:104 Loaded module datetimefield
console.js:104 All inits executed

 When I then click Add Row ==
console.js:104 Executing 3 inits
console.js:104 Loaded module datetimefield
console.js:104 Loaded module t5/core/validation
console.js:104 Loaded module t5/core/ajaxformloop
console.js:104 All inits executed


Looking in the events listeners part of Google chrome developer tools,
I can see the original one has two additional event listeners which
the new one doesn't. These are called dp and mousedown.

Perhaps the order in which these are initialised matter here, should
the datetimefield be after the validation/ajaxformloop?

Thanks,
Steve

On 4 May 2015 at 11:08, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 Also can you please update to latest tapestry 5.4-beta-31

 I think there was a bug that looks like that and got fixed.

 On Mon, May 4, 2015 at 1:04 PM, Dimitris Zenios dimitris.zen...@gmail.com
 wrote:

 Javascript is using dom.scanner function which should execute on every
 zone change.Just like the DateField

 Can you please check whether the function passed to dom.scanner is
 executed when you add or remove rows?

 On Mon, May 4, 2015 at 2:42 AM, akshay akshayestat...@gmail.com wrote:

 Hi Stephen,

 You can try something like this:-
   @Inject
   private AjaxResponseRenderer ajaxResponseRenderer;


  ajaxResponseRenderer.addRender(YOUR ZONE);
 ajaxResponseRenderer.addCallback(new JavaScriptCallback() {

   @Override
   public void run(JavaScriptSupport javascriptSupport) {

 javascriptSupport.require(YOUR JS FILE).invoke(function to be
 invoked);


   }
 });

 Best Regards
 Akshay

 On Mon, May 4, 2015 at 1:38 AM, Stephen Nutbrown steves...@gmail.com
 wrote:

  I tried adding this to the DateTimeField without much luck:
 
  @AfterRender
  void afterRender(){
  javascriptSupport.require(datetimefield);
  }
 
  I don't think this has any effect since the js is already loaded once,
  and i'm not 100% certain that this is the problem either.
 
  On 4 May 2015 at 00:35, Stephen Nutbrown steves...@gmail.com wrote:
   Hi,
  
   I have a quick question (and this isn't anything to do with your code,
   which is fantastic) - it's more to do with how Tapestry handles an
   AjaxFormLoop.
  
   I have this component inside an ajax form loop. When I add a new row,
   it will add in a new component (of type DateTimeField).
  
   However, although the DateTimeField from the previous rows works fine,
   the new one doesn't. I get the feeling this is because the javascript
   wants to be re-initialised - we want to run DateTimeField.js again?
  
   I'm struggling a little bit to find out exactly why this is. There are
   no console errors (either to the java output or JS console), so I
   assume the event handler isn't added to the newly added row.
  
   Any ideas on how I would go about doing that?
  
   I noticed something similar going on with Tapestry's DateField, so i'm
   sure this isn't to do with the component. If I refresh the page, the
   newly added row works fine.
  
   Thanks,
   Steve
  
   On 3 May 2015 at 15:59, Stephen Nutbrown steves...@gmail.com wrote:
   Hi Dimitris,
  
   That's extremely kind and generous of you, thank you! I owe you a few
   beers, if you happen to have a paypal address hooked up to your email
   account I can send you a little something (Not much as I'm currently
 a
   student myself, but just to buy yourself a few beers on me).
  
   Cheers,
   Steve
  
   C
  
   On 3 May 2015 at 11:28, Dimitris Zenios dimitris.zen...@gmail.com
  wrote:
   Sure I will put them here as an attachment so

Re: [T5.4 beta 28] Date and time picker

2015-05-04 Thread Stephen Nutbrown
Hi,

Just to add to that - when I press remove row, this function also is
not called (at least, the alert doesn't show). Only when the page
loads.

Thanks,
Steve

On 4 May 2015 at 11:56, Stephen Nutbrown steves...@gmail.com wrote:
 Hi,

 Thank you Akshay  Dimitris.

 Just a quick note on the things I have now tried, and the outcome.
 I tried Ashkay's example but seemed to run into some problems, mainly
 that I don't know exactly where to put this code as it is using a js
 module, the function is also anonymous so I was a bit stuck/confused.

 I then put an alert inside the function passed to the scanner:
  dom.scanner([data-component-type='DateTimeField'], function(container) {
 alert('running function');
   

 }

 I see this runs once for each row on the form to begin with, but does
 no run again when adding a new row. E.g, if I have 2 rows, it runs
 twice, I press add row, it does not run again (but I now have 3 rows).
 The new row is the one which contains the field which doesn't seem
 show the picker on click.

 I then updated from 5.4-beta-28 to 5.4-beta-31, this didn't seem to work.

 This is what I get in the console of Google Chrome developer tools:


 = When the page loads =
 Loading 0 libraries
 console.js:104 Executing 7 inits
 console.js:104 Invoking t5/core/pageinit:focus(price)
 console.js:104 Loaded module t5/core/forms
 console.js:104 Loaded module t5/core/form-fragment
 console.js:104 Loaded module t5/core/validation
 console.js:104 Loaded module t5/core/ajaxformloop
 console.js:104 Loaded module bootstrap/alert
 console.js:104 Loaded module datetimefield
 console.js:104 All inits executed

  When I then click Add Row ==
 console.js:104 Executing 3 inits
 console.js:104 Loaded module datetimefield
 console.js:104 Loaded module t5/core/validation
 console.js:104 Loaded module t5/core/ajaxformloop
 console.js:104 All inits executed
 

 Looking in the events listeners part of Google chrome developer tools,
 I can see the original one has two additional event listeners which
 the new one doesn't. These are called dp and mousedown.

 Perhaps the order in which these are initialised matter here, should
 the datetimefield be after the validation/ajaxformloop?

 Thanks,
 Steve

 On 4 May 2015 at 11:08, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 Also can you please update to latest tapestry 5.4-beta-31

 I think there was a bug that looks like that and got fixed.

 On Mon, May 4, 2015 at 1:04 PM, Dimitris Zenios dimitris.zen...@gmail.com
 wrote:

 Javascript is using dom.scanner function which should execute on every
 zone change.Just like the DateField

 Can you please check whether the function passed to dom.scanner is
 executed when you add or remove rows?

 On Mon, May 4, 2015 at 2:42 AM, akshay akshayestat...@gmail.com wrote:

 Hi Stephen,

 You can try something like this:-
   @Inject
   private AjaxResponseRenderer ajaxResponseRenderer;


  ajaxResponseRenderer.addRender(YOUR ZONE);
 ajaxResponseRenderer.addCallback(new JavaScriptCallback() {

   @Override
   public void run(JavaScriptSupport javascriptSupport) {

 javascriptSupport.require(YOUR JS FILE).invoke(function to be
 invoked);


   }
 });

 Best Regards
 Akshay

 On Mon, May 4, 2015 at 1:38 AM, Stephen Nutbrown steves...@gmail.com
 wrote:

  I tried adding this to the DateTimeField without much luck:
 
  @AfterRender
  void afterRender(){
  javascriptSupport.require(datetimefield);
  }
 
  I don't think this has any effect since the js is already loaded once,
  and i'm not 100% certain that this is the problem either.
 
  On 4 May 2015 at 00:35, Stephen Nutbrown steves...@gmail.com wrote:
   Hi,
  
   I have a quick question (and this isn't anything to do with your code,
   which is fantastic) - it's more to do with how Tapestry handles an
   AjaxFormLoop.
  
   I have this component inside an ajax form loop. When I add a new row,
   it will add in a new component (of type DateTimeField).
  
   However, although the DateTimeField from the previous rows works fine,
   the new one doesn't. I get the feeling this is because the javascript
   wants to be re-initialised - we want to run DateTimeField.js again?
  
   I'm struggling a little bit to find out exactly why this is. There are
   no console errors (either to the java output or JS console), so I
   assume the event handler isn't added to the newly added row.
  
   Any ideas on how I would go about doing that?
  
   I noticed something similar going on with Tapestry's DateField, so i'm
   sure this isn't to do with the component. If I refresh the page, the
   newly added row works fine.
  
   Thanks,
   Steve
  
   On 3 May 2015 at 15:59, Stephen Nutbrown steves...@gmail.com wrote:
   Hi Dimitris,
  
   That's extremely kind and generous of you, thank you! I owe you a few
   beers, if you happen to have a paypal address hooked up to your email
   account I can send you

Re: [T5.4 beta 28] Date and time picker

2015-05-04 Thread Stephen Nutbrown
When I remove, the console says:

Executing 0 inits
console.js:104 All inits executed

Thanks,
Steve

On 4 May 2015 at 12:04, Stephen Nutbrown steves...@gmail.com wrote:
 Hi,

 Just to add to that - when I press remove row, this function also is
 not called (at least, the alert doesn't show). Only when the page
 loads.

 Thanks,
 Steve

 On 4 May 2015 at 11:56, Stephen Nutbrown steves...@gmail.com wrote:
 Hi,

 Thank you Akshay  Dimitris.

 Just a quick note on the things I have now tried, and the outcome.
 I tried Ashkay's example but seemed to run into some problems, mainly
 that I don't know exactly where to put this code as it is using a js
 module, the function is also anonymous so I was a bit stuck/confused.

 I then put an alert inside the function passed to the scanner:
  dom.scanner([data-component-type='DateTimeField'], function(container) {
 alert('running function');
   

 }

 I see this runs once for each row on the form to begin with, but does
 no run again when adding a new row. E.g, if I have 2 rows, it runs
 twice, I press add row, it does not run again (but I now have 3 rows).
 The new row is the one which contains the field which doesn't seem
 show the picker on click.

 I then updated from 5.4-beta-28 to 5.4-beta-31, this didn't seem to work.

 This is what I get in the console of Google Chrome developer tools:


 = When the page loads =
 Loading 0 libraries
 console.js:104 Executing 7 inits
 console.js:104 Invoking t5/core/pageinit:focus(price)
 console.js:104 Loaded module t5/core/forms
 console.js:104 Loaded module t5/core/form-fragment
 console.js:104 Loaded module t5/core/validation
 console.js:104 Loaded module t5/core/ajaxformloop
 console.js:104 Loaded module bootstrap/alert
 console.js:104 Loaded module datetimefield
 console.js:104 All inits executed

  When I then click Add Row ==
 console.js:104 Executing 3 inits
 console.js:104 Loaded module datetimefield
 console.js:104 Loaded module t5/core/validation
 console.js:104 Loaded module t5/core/ajaxformloop
 console.js:104 All inits executed
 

 Looking in the events listeners part of Google chrome developer tools,
 I can see the original one has two additional event listeners which
 the new one doesn't. These are called dp and mousedown.

 Perhaps the order in which these are initialised matter here, should
 the datetimefield be after the validation/ajaxformloop?

 Thanks,
 Steve

 On 4 May 2015 at 11:08, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 Also can you please update to latest tapestry 5.4-beta-31

 I think there was a bug that looks like that and got fixed.

 On Mon, May 4, 2015 at 1:04 PM, Dimitris Zenios dimitris.zen...@gmail.com
 wrote:

 Javascript is using dom.scanner function which should execute on every
 zone change.Just like the DateField

 Can you please check whether the function passed to dom.scanner is
 executed when you add or remove rows?

 On Mon, May 4, 2015 at 2:42 AM, akshay akshayestat...@gmail.com wrote:

 Hi Stephen,

 You can try something like this:-
   @Inject
   private AjaxResponseRenderer ajaxResponseRenderer;


  ajaxResponseRenderer.addRender(YOUR ZONE);
 ajaxResponseRenderer.addCallback(new JavaScriptCallback() {

   @Override
   public void run(JavaScriptSupport javascriptSupport) {

 javascriptSupport.require(YOUR JS FILE).invoke(function to be
 invoked);


   }
 });

 Best Regards
 Akshay

 On Mon, May 4, 2015 at 1:38 AM, Stephen Nutbrown steves...@gmail.com
 wrote:

  I tried adding this to the DateTimeField without much luck:
 
  @AfterRender
  void afterRender(){
  javascriptSupport.require(datetimefield);
  }
 
  I don't think this has any effect since the js is already loaded once,
  and i'm not 100% certain that this is the problem either.
 
  On 4 May 2015 at 00:35, Stephen Nutbrown steves...@gmail.com wrote:
   Hi,
  
   I have a quick question (and this isn't anything to do with your code,
   which is fantastic) - it's more to do with how Tapestry handles an
   AjaxFormLoop.
  
   I have this component inside an ajax form loop. When I add a new row,
   it will add in a new component (of type DateTimeField).
  
   However, although the DateTimeField from the previous rows works fine,
   the new one doesn't. I get the feeling this is because the javascript
   wants to be re-initialised - we want to run DateTimeField.js again?
  
   I'm struggling a little bit to find out exactly why this is. There are
   no console errors (either to the java output or JS console), so I
   assume the event handler isn't added to the newly added row.
  
   Any ideas on how I would go about doing that?
  
   I noticed something similar going on with Tapestry's DateField, so i'm
   sure this isn't to do with the component. If I refresh the page, the
   newly added row works fine.
  
   Thanks,
   Steve
  
   On 3 May 2015 at 15:59, Stephen Nutbrown steves...@gmail.com wrote:
   Hi Dimitris

Re: [T5.4 beta 28] Date and time picker

2015-05-04 Thread Stephen Nutbrown
Hi,

Thanks again Dimitris. I really really appreciate your help, it's now
fixed - I got there in the end, and it's looking very good too.

Just a few things which may help anyone else who comes across this issue:

I've spent a fair bit of time looking up exactly how to override that
js (I found several links to threads like this, but not much in the
documentation: 
http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/5-4-beta-2-Two-JavaScript-Errors-Quick-Fixes-td5725545.html).
The documentation seems to just say that it is possible, but not
really how to do it (perhaps an improvement for another day).

I think I have done this correctly now (for anyone else who comes
across this thread, this is in my AppModule):

@Contribute(ModuleManager.class)
public static void overrideCoreModules(AssetSource assetSource,
MappedConfigurationString, JavaScriptModuleConfiguration
configuration) {
Resource ajaxFormLoop =
assetSource.resourceForPath(/META-INF/modules/ajaxformloop.js);
configuration.add(t5/core/ajaxformloop,new
JavaScriptModuleConfiguration(ajaxFormLoop));
}

I can see the file updated (I can see it by viewing the sources from
the browser), however I now get this in my console (And nothing
appears to happen when I click add row)

:8080/webapp/modules.gz/t5/core/ajaxformloop.js:52 Uncaught
ReferenceError: eeventthis is not defined

In ajaxformloop.js I changed line 52: eeventthis to this (I'm not
good with js with js is just based on looking at other modules - so I
am guessing this is a typo).

This seems to fix it!

Thank you for all of the help Dimitris, I have certainly learned a few
things. Hopefully this thread will be useful to anyone else with the
same issues too.
I'm going to spend a bit of time looking through the datetimefield
code to understand it, it all looks sensible so I don't think it'll
take me long.

Thank you again, all your help has been fantastic.

Thanks,
Steve


On 4 May 2015 at 13:54, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 The problem lies within tapestry ajaxformloop javascript file

 The events.zone.didUpdate is not triggered on the new element but on the
 addRowButton (insertionPoint) resulting on the scanner to not be
 executed.Until this gets fixed you can override tapestry core ajaxformloop
 file with the one I have attached

 Thanks
 Dimitris Zenios


 On Mon, May 4, 2015 at 2:16 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 When I remove, the console says:

 Executing 0 inits
 console.js:104 All inits executed

 Thanks,
 Steve

 On 4 May 2015 at 12:04, Stephen Nutbrown steves...@gmail.com wrote:
  Hi,
 
  Just to add to that - when I press remove row, this function also is
  not called (at least, the alert doesn't show). Only when the page
  loads.
 
  Thanks,
  Steve
 
  On 4 May 2015 at 11:56, Stephen Nutbrown steves...@gmail.com wrote:
  Hi,
 
  Thank you Akshay  Dimitris.
 
  Just a quick note on the things I have now tried, and the outcome.
  I tried Ashkay's example but seemed to run into some problems, mainly
  that I don't know exactly where to put this code as it is using a js
  module, the function is also anonymous so I was a bit stuck/confused.
 
  I then put an alert inside the function passed to the scanner:
   dom.scanner([data-component-type='DateTimeField'],
  function(container) {
  alert('running function');

 
  }
 
  I see this runs once for each row on the form to begin with, but does
  no run again when adding a new row. E.g, if I have 2 rows, it runs
  twice, I press add row, it does not run again (but I now have 3 rows).
  The new row is the one which contains the field which doesn't seem
  show the picker on click.
 
  I then updated from 5.4-beta-28 to 5.4-beta-31, this didn't seem to
  work.
 
  This is what I get in the console of Google Chrome developer tools:
 
 
  = When the page loads =
  Loading 0 libraries
  console.js:104 Executing 7 inits
  console.js:104 Invoking t5/core/pageinit:focus(price)
  console.js:104 Loaded module t5/core/forms
  console.js:104 Loaded module t5/core/form-fragment
  console.js:104 Loaded module t5/core/validation
  console.js:104 Loaded module t5/core/ajaxformloop
  console.js:104 Loaded module bootstrap/alert
  console.js:104 Loaded module datetimefield
  console.js:104 All inits executed
 
   When I then click Add Row ==
  console.js:104 Executing 3 inits
  console.js:104 Loaded module datetimefield
  console.js:104 Loaded module t5/core/validation
  console.js:104 Loaded module t5/core/ajaxformloop
  console.js:104 All inits executed
  
 
  Looking in the events listeners part of Google chrome developer tools,
  I can see the original one has two additional event listeners which
  the new one doesn't. These are called dp and mousedown.
 
  Perhaps the order in which these are initialised matter here, should
  the datetimefield be after the validation/ajaxformloop?
 
  Thanks,
  Steve
 
  On 4 May 2015

Re: [T5.4 beta 28] Date and time picker

2015-05-04 Thread Stephen Nutbrown
Hi,

Fantastic - thank you. I've updated my AppModule with this change.

I appreciate all your help,
Thanks,
Steve

On 4 May 2015 at 18:04, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 HI

 Your contribution to ModuleManager is correct.It will be better though to
 inject the resource

 Like this
 @Contribute(ModuleManager.class)
 public static void overrideCoreModules(
 MappedConfigurationString, JavaScriptModuleConfigurationconfiguration,
 @Path(META-INF/modules/ajaxformloop.js) Resource ajaxFormLoop
 ) {
 configuration.add(t5/core/ajaxformloop,new
 JavaScriptModuleConfiguration(ajaxFormLoop));
 }

 Also your change to this was correct.It was supposed to be
 this.Something went wrong on copy paste.I am reattaching the fixed
 ajaxformloop



 On Mon, May 4, 2015 at 7:31 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,

 Thanks again Dimitris. I really really appreciate your help, it's now
 fixed - I got there in the end, and it's looking very good too.

 Just a few things which may help anyone else who comes across this issue:

 I've spent a fair bit of time looking up exactly how to override that
 js (I found several links to threads like this, but not much in the
 documentation:
 http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/5-4-beta-2-Two-JavaScript-Errors-Quick-Fixes-td5725545.html).
 The documentation seems to just say that it is possible, but not
 really how to do it (perhaps an improvement for another day).

 I think I have done this correctly now (for anyone else who comes
 across this thread, this is in my AppModule):

 @Contribute(ModuleManager.class)
 public static void overrideCoreModules(AssetSource assetSource,
 MappedConfigurationString, JavaScriptModuleConfiguration
 configuration) {
 Resource ajaxFormLoop =
 assetSource.resourceForPath(/META-INF/modules/ajaxformloop.js);
 configuration.add(t5/core/ajaxformloop,new
 JavaScriptModuleConfiguration(ajaxFormLoop));
 }

 I can see the file updated (I can see it by viewing the sources from
 the browser), however I now get this in my console (And nothing
 appears to happen when I click add row)

 :8080/webapp/modules.gz/t5/core/ajaxformloop.js:52 Uncaught
 ReferenceError: eeventthis is not defined

 In ajaxformloop.js I changed line 52: eeventthis to this (I'm not
 good with js with js is just based on looking at other modules - so I
 am guessing this is a typo).

 This seems to fix it!

 Thank you for all of the help Dimitris, I have certainly learned a few
 things. Hopefully this thread will be useful to anyone else with the
 same issues too.
 I'm going to spend a bit of time looking through the datetimefield
 code to understand it, it all looks sensible so I don't think it'll
 take me long.

 Thank you again, all your help has been fantastic.

 Thanks,
 Steve


 On 4 May 2015 at 13:54, Dimitris Zenios dimitris.zen...@gmail.com wrote:
  The problem lies within tapestry ajaxformloop javascript file
 
  The events.zone.didUpdate is not triggered on the new element but on the
  addRowButton (insertionPoint) resulting on the scanner to not be
  executed.Until this gets fixed you can override tapestry core
  ajaxformloop
  file with the one I have attached
 
  Thanks
  Dimitris Zenios
 
 
  On Mon, May 4, 2015 at 2:16 PM, Stephen Nutbrown steves...@gmail.com
  wrote:
 
  When I remove, the console says:
 
  Executing 0 inits
  console.js:104 All inits executed
 
  Thanks,
  Steve
 
  On 4 May 2015 at 12:04, Stephen Nutbrown steves...@gmail.com wrote:
   Hi,
  
   Just to add to that - when I press remove row, this function also is
   not called (at least, the alert doesn't show). Only when the page
   loads.
  
   Thanks,
   Steve
  
   On 4 May 2015 at 11:56, Stephen Nutbrown steves...@gmail.com wrote:
   Hi,
  
   Thank you Akshay  Dimitris.
  
   Just a quick note on the things I have now tried, and the outcome.
   I tried Ashkay's example but seemed to run into some problems,
   mainly
   that I don't know exactly where to put this code as it is using a js
   module, the function is also anonymous so I was a bit
   stuck/confused.
  
   I then put an alert inside the function passed to the scanner:
dom.scanner([data-component-type='DateTimeField'],
   function(container) {
   alert('running function');
 
  
   }
  
   I see this runs once for each row on the form to begin with, but
   does
   no run again when adding a new row. E.g, if I have 2 rows, it runs
   twice, I press add row, it does not run again (but I now have 3
   rows).
   The new row is the one which contains the field which doesn't seem
   show the picker on click.
  
   I then updated from 5.4-beta-28 to 5.4-beta-31, this didn't seem to
   work.
  
   This is what I get in the console of Google Chrome developer tools:
  
  
   = When the page loads =
   Loading 0 libraries
   console.js:104 Executing 7 inits
   console.js:104 Invoking t5/core/pageinit:focus(price)
   console.js:104 Loaded module t5

Re: [T5.4 beta 28] Date and time picker

2015-05-03 Thread Stephen Nutbrown
I tried adding this to the DateTimeField without much luck:

@AfterRender
void afterRender(){
javascriptSupport.require(datetimefield);
}

I don't think this has any effect since the js is already loaded once,
and i'm not 100% certain that this is the problem either.

On 4 May 2015 at 00:35, Stephen Nutbrown steves...@gmail.com wrote:
 Hi,

 I have a quick question (and this isn't anything to do with your code,
 which is fantastic) - it's more to do with how Tapestry handles an
 AjaxFormLoop.

 I have this component inside an ajax form loop. When I add a new row,
 it will add in a new component (of type DateTimeField).

 However, although the DateTimeField from the previous rows works fine,
 the new one doesn't. I get the feeling this is because the javascript
 wants to be re-initialised - we want to run DateTimeField.js again?

 I'm struggling a little bit to find out exactly why this is. There are
 no console errors (either to the java output or JS console), so I
 assume the event handler isn't added to the newly added row.

 Any ideas on how I would go about doing that?

 I noticed something similar going on with Tapestry's DateField, so i'm
 sure this isn't to do with the component. If I refresh the page, the
 newly added row works fine.

 Thanks,
 Steve

 On 3 May 2015 at 15:59, Stephen Nutbrown steves...@gmail.com wrote:
 Hi Dimitris,

 That's extremely kind and generous of you, thank you! I owe you a few
 beers, if you happen to have a paypal address hooked up to your email
 account I can send you a little something (Not much as I'm currently a
 student myself, but just to buy yourself a few beers on me).

 Cheers,
 Steve

 C

 On 3 May 2015 at 11:28, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 Sure I will put them here as an attachment so everybody can see it

 You will also need to
 1.Put the datetimepicker library inside META-INF/modules/datetime/.
 2.Put the datetimepicker css inside  META-INF/assets/other/css/.

 The example I have attached is using Java 8 LocalDateTime but it can be
 adopted in order to use java.util.Date

 Thanks
 Dimitris Zenios

 On Fri, May 1, 2015 at 9:41 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi Dimitris,

 Wow, as it happens that's the exact same one I was having problems
 implementing!

 It would be awesome to have some kind of tapestry5 component
 marketplace. Perhaps another thing for another day.
 I feel very cheeky asking, but would you be up for (able to) send me
 the code, i'd be more than happy to pay for a few drinks for you?

 Thanks,
 Steve

 On 1 May 2015 at 11:24, Dimitris Zenios dimitris.zen...@gmail.com wrote:
  For tapestry 5.4 i have been using this javascript library
  https://eonasdan.github.io/bootstrap-datetimepicker/
 
  and a custom component extending AbstractField
 
 
 
 
  On Fri, May 1, 2015 at 1:15 PM, Stephen Nutbrown steves...@gmail.com
  wrote:
 
  Hi,
 
  I have been looking for a date + time picker for Tapestry. I'd like a
  form component which will bind to a java.util.Date object, and asks
  for a time as well as a date.
 
  I haven't had much luck, i've found bits of code here and there for
  older versions of tapestry. I would have thought this component would
  be one which comes with Tapestry out of the box, as I would think it's
  a common requirement.
 
  I tried to create my own component which extends AbstractField, based
  on the source code I can see for the
 
 
  http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/DateField.html#line.52
  but I ran in to some issues (I think perhaps I just didn't have enough
  patience, I will need to revisit it if I am to try again - it's a bit
  of a learning curve for me).
 
  Is there a simpler way to do this? Am I going in the right direction
  trying to create a new component which extends AbstractField? If there
  was one that is known to work on the latest versions of tapestry and
  with jQuery as the js provider (or not requiring jQuery/Prototype), I
  would really appreciate a link. If not, any guidance on if my approach
  is sensible, if it is.. i'll just try again this evening.
 
 
  Any help is really appreciated.
  Thanks,
 
  -
  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




 -
 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.4 beta 28] Date and time picker

2015-05-03 Thread Stephen Nutbrown
Hi,

I have a quick question (and this isn't anything to do with your code,
which is fantastic) - it's more to do with how Tapestry handles an
AjaxFormLoop.

I have this component inside an ajax form loop. When I add a new row,
it will add in a new component (of type DateTimeField).

However, although the DateTimeField from the previous rows works fine,
the new one doesn't. I get the feeling this is because the javascript
wants to be re-initialised - we want to run DateTimeField.js again?

I'm struggling a little bit to find out exactly why this is. There are
no console errors (either to the java output or JS console), so I
assume the event handler isn't added to the newly added row.

Any ideas on how I would go about doing that?

I noticed something similar going on with Tapestry's DateField, so i'm
sure this isn't to do with the component. If I refresh the page, the
newly added row works fine.

Thanks,
Steve

On 3 May 2015 at 15:59, Stephen Nutbrown steves...@gmail.com wrote:
 Hi Dimitris,

 That's extremely kind and generous of you, thank you! I owe you a few
 beers, if you happen to have a paypal address hooked up to your email
 account I can send you a little something (Not much as I'm currently a
 student myself, but just to buy yourself a few beers on me).

 Cheers,
 Steve

 C

 On 3 May 2015 at 11:28, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 Sure I will put them here as an attachment so everybody can see it

 You will also need to
 1.Put the datetimepicker library inside META-INF/modules/datetime/.
 2.Put the datetimepicker css inside  META-INF/assets/other/css/.

 The example I have attached is using Java 8 LocalDateTime but it can be
 adopted in order to use java.util.Date

 Thanks
 Dimitris Zenios

 On Fri, May 1, 2015 at 9:41 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi Dimitris,

 Wow, as it happens that's the exact same one I was having problems
 implementing!

 It would be awesome to have some kind of tapestry5 component
 marketplace. Perhaps another thing for another day.
 I feel very cheeky asking, but would you be up for (able to) send me
 the code, i'd be more than happy to pay for a few drinks for you?

 Thanks,
 Steve

 On 1 May 2015 at 11:24, Dimitris Zenios dimitris.zen...@gmail.com wrote:
  For tapestry 5.4 i have been using this javascript library
  https://eonasdan.github.io/bootstrap-datetimepicker/
 
  and a custom component extending AbstractField
 
 
 
 
  On Fri, May 1, 2015 at 1:15 PM, Stephen Nutbrown steves...@gmail.com
  wrote:
 
  Hi,
 
  I have been looking for a date + time picker for Tapestry. I'd like a
  form component which will bind to a java.util.Date object, and asks
  for a time as well as a date.
 
  I haven't had much luck, i've found bits of code here and there for
  older versions of tapestry. I would have thought this component would
  be one which comes with Tapestry out of the box, as I would think it's
  a common requirement.
 
  I tried to create my own component which extends AbstractField, based
  on the source code I can see for the
 
 
  http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/DateField.html#line.52
  but I ran in to some issues (I think perhaps I just didn't have enough
  patience, I will need to revisit it if I am to try again - it's a bit
  of a learning curve for me).
 
  Is there a simpler way to do this? Am I going in the right direction
  trying to create a new component which extends AbstractField? If there
  was one that is known to work on the latest versions of tapestry and
  with jQuery as the js provider (or not requiring jQuery/Prototype), I
  would really appreciate a link. If not, any guidance on if my approach
  is sensible, if it is.. i'll just try again this evening.
 
 
  Any help is really appreciated.
  Thanks,
 
  -
  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




 -
 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.4 beta 28] Date and time picker

2015-05-03 Thread Stephen Nutbrown
Hi Dimitris,

That's extremely kind and generous of you, thank you! I owe you a few
beers, if you happen to have a paypal address hooked up to your email
account I can send you a little something (Not much as I'm currently a
student myself, but just to buy yourself a few beers on me).

Cheers,
Steve

C

On 3 May 2015 at 11:28, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 Sure I will put them here as an attachment so everybody can see it

 You will also need to
 1.Put the datetimepicker library inside META-INF/modules/datetime/.
 2.Put the datetimepicker css inside  META-INF/assets/other/css/.

 The example I have attached is using Java 8 LocalDateTime but it can be
 adopted in order to use java.util.Date

 Thanks
 Dimitris Zenios

 On Fri, May 1, 2015 at 9:41 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi Dimitris,

 Wow, as it happens that's the exact same one I was having problems
 implementing!

 It would be awesome to have some kind of tapestry5 component
 marketplace. Perhaps another thing for another day.
 I feel very cheeky asking, but would you be up for (able to) send me
 the code, i'd be more than happy to pay for a few drinks for you?

 Thanks,
 Steve

 On 1 May 2015 at 11:24, Dimitris Zenios dimitris.zen...@gmail.com wrote:
  For tapestry 5.4 i have been using this javascript library
  https://eonasdan.github.io/bootstrap-datetimepicker/
 
  and a custom component extending AbstractField
 
 
 
 
  On Fri, May 1, 2015 at 1:15 PM, Stephen Nutbrown steves...@gmail.com
  wrote:
 
  Hi,
 
  I have been looking for a date + time picker for Tapestry. I'd like a
  form component which will bind to a java.util.Date object, and asks
  for a time as well as a date.
 
  I haven't had much luck, i've found bits of code here and there for
  older versions of tapestry. I would have thought this component would
  be one which comes with Tapestry out of the box, as I would think it's
  a common requirement.
 
  I tried to create my own component which extends AbstractField, based
  on the source code I can see for the
 
 
  http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/DateField.html#line.52
  but I ran in to some issues (I think perhaps I just didn't have enough
  patience, I will need to revisit it if I am to try again - it's a bit
  of a learning curve for me).
 
  Is there a simpler way to do this? Am I going in the right direction
  trying to create a new component which extends AbstractField? If there
  was one that is known to work on the latest versions of tapestry and
  with jQuery as the js provider (or not requiring jQuery/Prototype), I
  would really appreciate a link. If not, any guidance on if my approach
  is sensible, if it is.. i'll just try again this evening.
 
 
  Any help is really appreciated.
  Thanks,
 
  -
  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




 -
 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.4 beta 28] Date and time picker

2015-05-02 Thread Stephen Nutbrown
Hi Dimitris,

Wow, as it happens that's the exact same one I was having problems
implementing!

It would be awesome to have some kind of tapestry5 component
marketplace. Perhaps another thing for another day.
I feel very cheeky asking, but would you be up for (able to) send me
the code, i'd be more than happy to pay for a few drinks for you?

Thanks,
Steve

On 1 May 2015 at 11:24, Dimitris Zenios dimitris.zen...@gmail.com wrote:
 For tapestry 5.4 i have been using this javascript library
 https://eonasdan.github.io/bootstrap-datetimepicker/

 and a custom component extending AbstractField




 On Fri, May 1, 2015 at 1:15 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,

 I have been looking for a date + time picker for Tapestry. I'd like a
 form component which will bind to a java.util.Date object, and asks
 for a time as well as a date.

 I haven't had much luck, i've found bits of code here and there for
 older versions of tapestry. I would have thought this component would
 be one which comes with Tapestry out of the box, as I would think it's
 a common requirement.

 I tried to create my own component which extends AbstractField, based
 on the source code I can see for the

 http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/DateField.html#line.52
 but I ran in to some issues (I think perhaps I just didn't have enough
 patience, I will need to revisit it if I am to try again - it's a bit
 of a learning curve for me).

 Is there a simpler way to do this? Am I going in the right direction
 trying to create a new component which extends AbstractField? If there
 was one that is known to work on the latest versions of tapestry and
 with jQuery as the js provider (or not requiring jQuery/Prototype), I
 would really appreciate a link. If not, any guidance on if my approach
 is sensible, if it is.. i'll just try again this evening.


 Any help is really appreciated.
 Thanks,

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



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



[T5.4 beta 28] Date and time picker

2015-05-01 Thread Stephen Nutbrown
Hi,

I have been looking for a date + time picker for Tapestry. I'd like a
form component which will bind to a java.util.Date object, and asks
for a time as well as a date.

I haven't had much luck, i've found bits of code here and there for
older versions of tapestry. I would have thought this component would
be one which comes with Tapestry out of the box, as I would think it's
a common requirement.

I tried to create my own component which extends AbstractField, based
on the source code I can see for the
http://tapestry.apache.org/5.3/apidocs/src-html/org/apache/tapestry5/corelib/components/DateField.html#line.52
but I ran in to some issues (I think perhaps I just didn't have enough
patience, I will need to revisit it if I am to try again - it's a bit
of a learning curve for me).

Is there a simpler way to do this? Am I going in the right direction
trying to create a new component which extends AbstractField? If there
was one that is known to work on the latest versions of tapestry and
with jQuery as the js provider (or not requiring jQuery/Prototype), I
would really appreciate a link. If not, any guidance on if my approach
is sensible, if it is.. i'll just try again this evening.


Any help is really appreciated.
Thanks,

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



Re: W3c Validation stray input tags

2015-04-27 Thread Stephen Nutbrown
Hi Thiago, thanks for your reply!

It looks like I was confused about the doctypes and namespaces. I
finally got it fixed, thank you!

For anyone else who stumbled across this thread, I was looking for the
latest version here:
http://mvnrepository.com/artifact/org.apache.tapestry
It looks like mvnrepository.com is not always up to date with the latest.

Thank you Thiago for pointing me to the more up-to-date git
repository. As soon as I get a chance i'll see if I can update to the
latest version again as it looks like there have been a lot of updates
since beta 28. Actually, this link is fantastic for keeping up to date
with what is going on. Thankyou :).

Steve

On 27 April 2015 at 13:38, Thiago H de Paula Figueiredo
thiag...@gmail.com wrote:
 On Sun, 26 Apr 2015 09:02:17 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,


 Hi!

 The version of Tapestry I am using is: 5.4-beta-26, which I believe is
 the latest.


 No, it's not. Looking at
 https://git1-us-west.apache.org/repos/asf?p=tapestry-5.git, you can see the
 latest one is beta 31. Anyway, beta 26 was created after TAP5-2071's fix.
 Anyway #2, I think you're not actually using the HTML5 doctype so the fix is
 applied to your HTML output:

 !DOCTYPE html
 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_4.xsd;
 xmlns:p=tapestry:parameter

 This way, you're requesting XHTML output, as you have the XHTML namespace
 declaration, which isn't the same as HTML5 at all. Please try this:

 !DOCTYPE html

 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_4.xsd;
 xmlns:p=tapestry:parameter

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br


 -
 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



W3c Validation stray input tags

2015-04-26 Thread Stephen Nutbrown
Hi,

I have this in my TML file:
input t:type=textfield type=email class=form-control input-sm
t:id=emailAddress placeholder=Enter email
t:value=emailAddress/

This renders are:
input placeholder=Enter email id=emailAddress class=form-control
form-control input-sm name=emailAddress type=email/input

The issue here is the input tag should close like this instead:
input placeholder=Enter email id=emailAddress class=form-control
form-control input-sm name=emailAddress type=email/

Therefore, I get a W3C validation issue:
Line 109, Column 115: Stray end tag input.

This seems to be a problem already reported and (apparently) fixed, it
is listed here:
https://issues.apache.org/jira/browse/TAP5-2071

However it says that this was fixed in Tapestry 5.4.

The version of Tapestry I am using is: 5.4-beta-26, which I believe is
the latest.

I'm wondering how I go about fixing this. I haven't delved into the
Tapestry source code and don't really want to have some patch which
works just on my version, currently I just use maven to grab the
tapestry dependency and I'm not too confident changing the tapestry
source code myself (mainly as I figure this will give me a headache
when I update).

Is there an easy way to fix this, or perhaps a more up to date build I
can get from maven?
I'm currently using:
dependency
groupIdorg.apache.tapestry/groupId
artifactIdtapestry-hibernate/artifactId
version${tapestry-release-version}/version
/dependency

With tapestry-release-version5.4-beta-26/tapestry-release-version

Thanks,
Steve

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



Re: W3c Validation stray input tags

2015-04-26 Thread Stephen Nutbrown
Following some guide here
http://stackoverflow.com/questions/2555845/how-to-update-maven-repository-in-eclipse

I was able to finally get it running 5.4 beta 28, however I have the
same issue still. I'm not really sure what else to try (I have the
same doctype and almost the same .tml as the example).

Finally, I was able to fix it, thanks for your help pointing me to the
example (it helped me get there in the end).

The doctype I had at the top of my layout.tml, but not my index.tml.

So it seems that the doctype needs specifying on every component and page.

I notice I also need to add this to every component else I cannot use
t: or p: within the component, and sometimes this adds additional
html tags into the middle of my page:
html
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_4.xsd;
xmlns:p=tapestry:parameter

Is there a way use t: and p: inside a component without adding
another html tag at the top?

Thanks,
Steve


On 26 April 2015 at 14:05, Stephen Nutbrown steves...@gmail.com wrote:
 I also notice if I actually remove the / from my input in the .tml, like 
 this:

 input t:type=textfield type=email class=form-control input-sm
 t:id=emailAddress placeholder=Enter email
 t:value=emailAddress

 I get this error:

 Exception assembling root component of page Exception: Failure
 parsing template
 classpath:com/promotemybrand/webapplication/components/Layout.tml: The
 element type input must be terminated by the matching end-tag
 /input.

 The error message itself is not correct.

 I have also tried remoiving my input tag altogether from my tml and
 just using t:textfield like the example:

 t:textfield type=email class=form-control input-sm
 t:id=emailAddress placeholder=Enter email
 t:value=emailAddress/

 The page renders, but with this:
 input placeholder=Enter email id=emailAddress class=form-control
 form-control input-sm name=emailAddress type=email/input

 On 26 April 2015 at 13:57, Stephen Nutbrown steves...@gmail.com wrote:
 Hi Chris,

 Thanks. Seems very off that I am having this issue. This is what I
 have at the top of mine layouts .tml file, which I think should be
 correct:

 !DOCTYPE html

 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_4.xsd;
 xmlns:p=tapestry:parameter


 When I view the source of the page it produces, it starts:
 !DOCTYPE html
 html data-debug-enabled=true data-locale=en
 xmlns=http://www.w3.org/1999/xhtml;

 But i'm still getting the same problems. As far as the tapestry
 version, this is what is confusing me:
 https://www.dropbox.com/s/ps68uzfqu4cng6t/Capture.PNG?dl=0

 I have cleaned the project and ran a maven update but i'm still
 getting this. I'm wondering if updating the tapestry version to beta
 28 will pull in the fix? Perhaps it is because I am on a slightly
 older version.

 Thanks,





 On 26 April 2015 at 13:38, Chris Poulsen mailingl...@nesluop.dk wrote:
 It works as far as I know, its probably a code error. A guess could be that
 you do not have the correct doctype in your pages.

 http://jumpstart.doublenegative.com.au/jumpstart7/examples/component/html5inputtypes
 outputs html5 inputs if you need an online example.

 --
 Chris

 On Sun, Apr 26, 2015 at 2:36 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,

 Just an update, I found there is a newer version of Tapestry,
 5.4-beta28 which I have updated my POM.xml to. I can see it should be
 pulling in the latest version by looking at the dependency hierarchy,
 but I still get this on startup:

  __  __ 
 /_  __/__   ___ ___ / /___ __  / __/
  / / / _ `/ _ \/ -_|_-/ __/ __/ // / /__ \
 /_/  \_,_/ .__/\__/___/\__/_/  \_, / //
 /_/   /___/  5.4-beta-26 (development mode)

 As well as the problem with the input tags. Perhaps for some reason I
 am having trouble updating, or is there an issue with the tapestry
 version number?

 Thanks,
 Steve

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



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



Re: W3c Validation stray input tags

2015-04-26 Thread Stephen Nutbrown
I also notice if I actually remove the / from my input in the .tml, like this:

input t:type=textfield type=email class=form-control input-sm
t:id=emailAddress placeholder=Enter email
t:value=emailAddress

I get this error:

Exception assembling root component of page Exception: Failure
parsing template
classpath:com/promotemybrand/webapplication/components/Layout.tml: The
element type input must be terminated by the matching end-tag
/input.

The error message itself is not correct.

I have also tried remoiving my input tag altogether from my tml and
just using t:textfield like the example:

t:textfield type=email class=form-control input-sm
t:id=emailAddress placeholder=Enter email
t:value=emailAddress/

The page renders, but with this:
input placeholder=Enter email id=emailAddress class=form-control
form-control input-sm name=emailAddress type=email/input

On 26 April 2015 at 13:57, Stephen Nutbrown steves...@gmail.com wrote:
 Hi Chris,

 Thanks. Seems very off that I am having this issue. This is what I
 have at the top of mine layouts .tml file, which I think should be
 correct:

 !DOCTYPE html

 html xmlns=http://www.w3.org/1999/xhtml;
 xmlns:t=http://tapestry.apache.org/schema/tapestry_5_4.xsd;
 xmlns:p=tapestry:parameter


 When I view the source of the page it produces, it starts:
 !DOCTYPE html
 html data-debug-enabled=true data-locale=en
 xmlns=http://www.w3.org/1999/xhtml;

 But i'm still getting the same problems. As far as the tapestry
 version, this is what is confusing me:
 https://www.dropbox.com/s/ps68uzfqu4cng6t/Capture.PNG?dl=0

 I have cleaned the project and ran a maven update but i'm still
 getting this. I'm wondering if updating the tapestry version to beta
 28 will pull in the fix? Perhaps it is because I am on a slightly
 older version.

 Thanks,





 On 26 April 2015 at 13:38, Chris Poulsen mailingl...@nesluop.dk wrote:
 It works as far as I know, its probably a code error. A guess could be that
 you do not have the correct doctype in your pages.

 http://jumpstart.doublenegative.com.au/jumpstart7/examples/component/html5inputtypes
 outputs html5 inputs if you need an online example.

 --
 Chris

 On Sun, Apr 26, 2015 at 2:36 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,

 Just an update, I found there is a newer version of Tapestry,
 5.4-beta28 which I have updated my POM.xml to. I can see it should be
 pulling in the latest version by looking at the dependency hierarchy,
 but I still get this on startup:

  __  __ 
 /_  __/__   ___ ___ / /___ __  / __/
  / / / _ `/ _ \/ -_|_-/ __/ __/ // / /__ \
 /_/  \_,_/ .__/\__/___/\__/_/  \_, / //
 /_/   /___/  5.4-beta-26 (development mode)

 As well as the problem with the input tags. Perhaps for some reason I
 am having trouble updating, or is there an issue with the tapestry
 version number?

 Thanks,
 Steve

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



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



W3c Validation stray input tags

2015-04-26 Thread Stephen Nutbrown
Hi,

I have this in my TML file:
input t:type=textfield type=email class=form-control input-sm
t:id=emailAddress placeholder=Enter email
t:value=emailAddress/

This renders are:
input placeholder=Enter email id=emailAddress class=form-control
form-control input-sm name=emailAddress type=email/input

The issue here is the input tag should close like this instead:
input placeholder=Enter email id=emailAddress class=form-control
form-control input-sm name=emailAddress type=email/

Therefore, I get a W3C validation issue:
Line 109, Column 115: Stray end tag input.

This seems to be a problem already reported and (apparently) fixed, it
is listed here:
https://issues.apache.org/jira/browse/TAP5-2071

However it says that this was fixed in Tapestry 5.4.

The version of Tapestry I am using is: 5.4-beta-26, which I believe is
the latest.

I'm wondering how I go about fixing this. I haven't delved into the
Tapestry source code and don't really want to have some patch which
works just on my version, currently I just use maven to grab the
tapestry dependency and I'm not too confident changing the tapestry
source code myself (mainly as I figure this will give me a headache
when I update).

Is there an easy way to fix this, or perhaps a more up to date build I
can get from maven?
I'm currently using:
dependency
groupIdorg.apache.tapestry/groupId
artifactIdtapestry-hibernate/artifactId
version${tapestry-release-version}/version
/dependency

With tapestry-release-version5.4-beta-26/tapestry-release-version

Thanks,
Steve

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



Re: W3c Validation stray input tags

2015-04-26 Thread Stephen Nutbrown
Hi Chris,

Thanks. Seems very off that I am having this issue. This is what I
have at the top of mine layouts .tml file, which I think should be
correct:

!DOCTYPE html

html xmlns=http://www.w3.org/1999/xhtml;
xmlns:t=http://tapestry.apache.org/schema/tapestry_5_4.xsd;
xmlns:p=tapestry:parameter


When I view the source of the page it produces, it starts:
!DOCTYPE html
html data-debug-enabled=true data-locale=en
xmlns=http://www.w3.org/1999/xhtml;

But i'm still getting the same problems. As far as the tapestry
version, this is what is confusing me:
https://www.dropbox.com/s/ps68uzfqu4cng6t/Capture.PNG?dl=0

I have cleaned the project and ran a maven update but i'm still
getting this. I'm wondering if updating the tapestry version to beta
28 will pull in the fix? Perhaps it is because I am on a slightly
older version.

Thanks,





On 26 April 2015 at 13:38, Chris Poulsen mailingl...@nesluop.dk wrote:
 It works as far as I know, its probably a code error. A guess could be that
 you do not have the correct doctype in your pages.

 http://jumpstart.doublenegative.com.au/jumpstart7/examples/component/html5inputtypes
 outputs html5 inputs if you need an online example.

 --
 Chris

 On Sun, Apr 26, 2015 at 2:36 PM, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi,

 Just an update, I found there is a newer version of Tapestry,
 5.4-beta28 which I have updated my POM.xml to. I can see it should be
 pulling in the latest version by looking at the dependency hierarchy,
 but I still get this on startup:

  __  __ 
 /_  __/__   ___ ___ / /___ __  / __/
  / / / _ `/ _ \/ -_|_-/ __/ __/ // / /__ \
 /_/  \_,_/ .__/\__/___/\__/_/  \_, / //
 /_/   /___/  5.4-beta-26 (development mode)

 As well as the problem with the input tags. Perhaps for some reason I
 am having trouble updating, or is there an issue with the tapestry
 version number?

 Thanks,
 Steve

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



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



Re: W3c Validation stray input tags

2015-04-26 Thread Stephen Nutbrown
Hi,

Just an update, I found there is a newer version of Tapestry,
5.4-beta28 which I have updated my POM.xml to. I can see it should be
pulling in the latest version by looking at the dependency hierarchy,
but I still get this on startup:

 __  __ 
/_  __/__   ___ ___ / /___ __  / __/
 / / / _ `/ _ \/ -_|_-/ __/ __/ // / /__ \
/_/  \_,_/ .__/\__/___/\__/_/  \_, / //
/_/   /___/  5.4-beta-26 (development mode)

As well as the problem with the input tags. Perhaps for some reason I
am having trouble updating, or is there an issue with the tapestry
version number?

Thanks,
Steve

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



Quick question - structure for 125 static pages

2014-09-22 Thread Stephen Nutbrown
Hello,

I am wondering the best way to structure this within Tapestry 5 - I
can see lots of ways, but i'm trying to consider the best way.

I have the requirement to make approximately 125 pages (or rather, 1
page with a possible 125 different sets of data). Each page is a short
tutorial which has on it:
- A description
- An example of source code of something done badly
- An example of the same piece of code improved.
- A link to some documentation.

There is already an existing Tapestry application running on the
server, but I need to add these 125 tutorials.

All of the information for each one is to be stored in text files,
probably stored in src/main/webapp/tutorials, but I am not quite sure
where exactly to put them yet.

The next thing is that I would like to read the argument from the URL
- this isn't a problem (e.g
something.com/tutorials/?tutorial=ifstatements ). This means I don't
need to make the 125 pages, but can use the passed param to find the
correct data to show on the page. I've done this before and i'm fine
with this part.

So my main questions are:
- How do I make it so that Tapestry will cache these text files to
avoid reading them each and every time the page is loaded? One option
I think is to use @Cached and to load all of the data in to some kind
of list of tutorial objects. I can then pick the correct object from
the list to show on the page. Or should I be doing this as a service?
(http://tapestry.apache.org/defining-tapestry-ioc-services.html)
- Is this worth doing? I would think the pages will be viewed fairly regularly.
- is src/main/webapp/tutorials a sensible place to store them?
- Should I be doing this totally differently? It's going to take me a
while to write these pages, so I really don't want to have to do it
again.

Thanks - any suggestions are really appreciated.

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



Re: Quick question - structure for 125 static pages

2014-09-22 Thread Stephen Nutbrown
Thankyou Robert - Following your advice I spent some time looking in
to how to do it as a service. So far I have found this, which seems to
be extremely similar:
http://wiki.apache.org/tapestry/Tapestry5HowToReadAFileFromContext

Thanks for your help.


On 22 September 2014 11:28, Robert Zeigler robert.zeig...@roxanemy.com wrote:
 I would almost certainly code the retrieval as a service. It'll make it 
 easier to test the core retrieval logic. Depending on the need to allow later 
 editing of the content, I would think about whether the content would be 
 better stored in a DB.

 Robert

 GATAATGCTATTTCTTTAACGAA

 On Sep 22, 2014, at 2:32 AM, Stephen Nutbrown steves...@gmail.com wrote:

 Hello,

 I am wondering the best way to structure this within Tapestry 5 - I
 can see lots of ways, but i'm trying to consider the best way.

 I have the requirement to make approximately 125 pages (or rather, 1
 page with a possible 125 different sets of data). Each page is a short
 tutorial which has on it:
 - A description
 - An example of source code of something done badly
 - An example of the same piece of code improved.
 - A link to some documentation.

 There is already an existing Tapestry application running on the
 server, but I need to add these 125 tutorials.

 All of the information for each one is to be stored in text files,
 probably stored in src/main/webapp/tutorials, but I am not quite sure
 where exactly to put them yet.

 The next thing is that I would like to read the argument from the URL
 - this isn't a problem (e.g
 something.com/tutorials/?tutorial=ifstatements ). This means I don't
 need to make the 125 pages, but can use the passed param to find the
 correct data to show on the page. I've done this before and i'm fine
 with this part.

 So my main questions are:
 - How do I make it so that Tapestry will cache these text files to
 avoid reading them each and every time the page is loaded? One option
 I think is to use @Cached and to load all of the data in to some kind
 of list of tutorial objects. I can then pick the correct object from
 the list to show on the page. Or should I be doing this as a service?
 (http://tapestry.apache.org/defining-tapestry-ioc-services.html)
 - Is this worth doing? I would think the pages will be viewed fairly 
 regularly.
 - is src/main/webapp/tutorials a sensible place to store them?
 - Should I be doing this totally differently? It's going to take me a
 while to write these pages, so I really don't want to have to do it
 again.

 Thanks - any suggestions are really appreciated.

 -
 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


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



Couldn't find bundle for base name orgapache.tapestry5.ioc.internal.IOCStrings, local en_US

2014-09-16 Thread Stephen Nutbrown
Hi,

I have a T5 webapp which I am currently running using jetty on windows
which works as expected. I am building the project using maven and
running it using mvn jetty:run. However, I can (and have) tried
installing jetty and building it into a .war and deploying it that
way.

Whichever way I do it, on the Linux server I am able to see the home
page. When I then submit a form (the login form), I get an exception
which I don't get on Windows. I am really stuck trying to figure out
the problem. I would appreciate any guidance if possible.

I have previously ran T5 webapps on this server without a problem, but
the exception seems to suggest something about locale? This isn't a
project which was created by myself, but I have the job of moving it
to the linux server. I have been looking to see if there is any use of
message: but I cannot see anything which would suggest anything
dependant on a particular locale (Strings are just in the tml file).

Thanks,
Steve

Here is the trace:

HTTP ERROR 500

Problem accessing /project/index.loginform. Reason:

Server Error

Caused by:

java.lang.ExceptionInInitializerError
at 
org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:64)
at 
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
at 
org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
at 
org.apache.tapestry5.ioc.internal.PerThreadOperationTracker.invoke(PerThreadOperationTracker.java:87)
at org.apache.tapestry5.ioc.internal.RegistryImpl.invoke(RegistryImpl.java:1124)
at 
org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator.createObject(OperationTrackingObjectCreator.java:49)
at 
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.obtainObjectFromCreator(JustInTimeObjectCreator.java:66)
at 
org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:54)
at $RequestExceptionHandler_122c7565f8ec3f.delegate(Unknown Source)
at $RequestExceptionHandler_122c7565f8ec3f.handleRequestException(Unknown
Source)
at 
org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:42)
at $RequestHandler_122c7565f8ec42.service(Unknown Source)
at 
org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:902)
at $RequestHandler_122c7565f8ec42.service(Unknown Source)
at 
org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:892)
at $RequestHandler_122c7565f8ec42.service(Unknown Source)
at 
org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:90)
at $RequestHandler_122c7565f8ec42.service(Unknown Source)
at $RequestHandler_122c7565f8ec36.service(Unknown Source)
at 
org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:253)
at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53)
at $HttpServletRequestHandler_122c7565f8ec38.service(Unknown Source)
at 
org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
at $HttpServletRequestHandler_122c7565f8ec38.service(Unknown Source)
at 
org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
at $HttpServletRequestFilter_122c7565f8ec34.service(Unknown Source)
at $HttpServletRequestHandler_122c7565f8ec38.service(Unknown Source)
at 
org.apache.tapestry5.services.TapestryModule$1.service(TapestryModule.java:852)
at $HttpServletRequestHandler_122c7565f8ec38.service(Unknown Source)
at $HttpServletRequestHandler_122c7565f8ec32.service(Unknown Source)
at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:171)
at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1489)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:517)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:138)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:564)
at 
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:213)
at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1097)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:446)
at 
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:175)
at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1031)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
at 
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:200)
at 
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109)
at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:445)
at 

Re: Couldn't find bundle for base name orgapache.tapestry5.ioc.internal.IOCStrings, local en_US

2014-09-16 Thread Stephen Nutbrown
Thanks Lance - I will check that first. I did fix one occurrence of
that already but think I got them.

I also wonder if this exception is could actually caused when I try to
show an error message on the password field of the login form like
this:

loginForm.recordError(passwordField,
Invalid user name or password.);

This is because when I look in the log which is created by jetty, I
can see some more interesting details which I hadn't seen before:

2014-09-16 17:35:32.346:INFO:oejs.ServerConnector:main: Started
ServerConnector@21ab{HTTP/1.1}{0.0.0.0:80}
[ERROR] TapestryModule.ClientDataEncoder The symbol
'tapestry.hmac-passphrase' has not been configured. This is used to
configure hash-based message authentication of Tapestry data stored in
forms, or in the URL. You application is less secure, and more
vulnerable to denial-of-service attacks, when this symbol is not
configured.
[INFO] AppModule.TimingFilter Request time: 4209 ms
[ERROR] ioc.Registry access denied (java.net.SocketPermission
127.0.0.1:1099 connect,resolve)
[ERROR] ioc.Registry Operations trace:
[ERROR] ioc.Registry [ 1] Triggering event 'action' on Index:loginform
[ERROR] ioc.Registry [ 2] Triggering event 'validate' on Index:loginform
[INFO] AppModule.TimingFilter Request time: 115 ms
[ERROR] ioc.Registry access denied (java.util.PropertyPermission
tapestry.exception-report-page read)
[ERROR] ioc.Registry Operations trace:
[ERROR] ioc.Registry [ 1] Realizing service RequestExceptionHandler
[ERROR] ioc.Registry [ 2] Instantiating service
RequestExceptionHandler implementation via
org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler(RequestPageCache,
PageResponseRenderer, Logger, String, Response) (at
DefaultRequestExceptionHandler.java:53) via
org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
TapestryModule.java:308)
[ERROR] ioc.Registry [ 3] Creating plan to instantiate
org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler
via public 
org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler(org.apache.tapestry5.internal.services.RequestPageCache,org.apache.tapestry5.internal.services.PageResponseRenderer,org.slf4j.Logger,java.lang.String,org.apache.tapestry5.services.Response)
[ERROR] ioc.Registry [ 4] Determining injection value for parameter #4
(java.lang.String)
[ERROR] ioc.Registry [ 5] Resolving object of type java.lang.String
using MasterObjectProvider
2014-09-16 17:35:45.343:WARN:oejs.ServletHandler:qtp447326139-16:
Error for /studentportal/index.loginform
java.lang.ExceptionInInitializerError

Actually what happens (or should) is that the onValidate method calls
a method on an object which resides on a server, using RMI to check
the credentials. If the credentials are accepted, there is no error
recorded on the loginForm and so onSuccess is called. If there is some
error (including permission problems or RMI problems), then it should
record the error message so onSuccess is not called. Since the RMI
server is not running, the user should not be able to validate. On my
windows machine this is fine, I just get an error message

On 16 September 2014 17:33, Lance Java lance.j...@googlemail.com wrote:
 Linux file system is case sensitive whereas windows is not. I'm guessing
 you have a tml file where the case of the tml filename does not match the
 class name.
  On 16 Sep 2014 17:27, Stephen Nutbrown steves...@gmail.com wrote:

 Hi,

 I have a T5 webapp which I am currently running using jetty on windows
 which works as expected. I am building the project using maven and
 running it using mvn jetty:run. However, I can (and have) tried
 installing jetty and building it into a .war and deploying it that
 way.

 Whichever way I do it, on the Linux server I am able to see the home
 page. When I then submit a form (the login form), I get an exception
 which I don't get on Windows. I am really stuck trying to figure out
 the problem. I would appreciate any guidance if possible.

 I have previously ran T5 webapps on this server without a problem, but
 the exception seems to suggest something about locale? This isn't a
 project which was created by myself, but I have the job of moving it
 to the linux server. I have been looking to see if there is any use of
 message: but I cannot see anything which would suggest anything
 dependant on a particular locale (Strings are just in the tml file).

 Thanks,
 Steve

 Here is the trace:

 HTTP ERROR 500

 Problem accessing /project/index.loginform. Reason:

 Server Error

 Caused by:

 java.lang.ExceptionInInitializerError
 at
 org.apache.tapestry5.ioc.internal.RecursiveServiceCreationCheckWrapper.createObject(RecursiveServiceCreationCheckWrapper.java:64)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackingObjectCreator$1.invoke(OperationTrackingObjectCreator.java:45)
 at
 org.apache.tapestry5.ioc.internal.OperationTrackerImpl.invoke(OperationTrackerImpl.java:74)
 at
 org.apache.tapestry5

Re: Couldn't find bundle for base name orgapache.tapestry5.ioc.internal.IOCStrings, local en_US

2014-09-16 Thread Stephen Nutbrown
Oh, I see. I found it. It took me nearly 3 or 4 hours.

Lessons learnt:
- Always look at the full log from jetty, not just what is shown on the page.
- Make sure filenames are capitalised correctly (Thanks Lance).
- Check that somebody else hasn't changed the required security manager using:
System.setSecurityManager(new RMISecurityManager())

Although, I am not quite sure why this works on Windows and not Linux,
it was unnecessary and removing it fixed the problem. The log showing
Access Denied made me start questioning permissions. I'm also not
sure why this code was there, as the security policy is set through VM
args.

Thanks Lance, I really appreciate your help!


On 16 September 2014 18:01, Stephen Nutbrown steves...@gmail.com wrote:
 Thanks Lance - I will check that first. I did fix one occurrence of
 that already but think I got them.

 I also wonder if this exception is could actually caused when I try to
 show an error message on the password field of the login form like
 this:

 loginForm.recordError(passwordField,
 Invalid user name or password.);

 This is because when I look in the log which is created by jetty, I
 can see some more interesting details which I hadn't seen before:

 2014-09-16 17:35:32.346:INFO:oejs.ServerConnector:main: Started
 ServerConnector@21ab{HTTP/1.1}{0.0.0.0:80}
 [ERROR] TapestryModule.ClientDataEncoder The symbol
 'tapestry.hmac-passphrase' has not been configured. This is used to
 configure hash-based message authentication of Tapestry data stored in
 forms, or in the URL. You application is less secure, and more
 vulnerable to denial-of-service attacks, when this symbol is not
 configured.
 [INFO] AppModule.TimingFilter Request time: 4209 ms
 [ERROR] ioc.Registry access denied (java.net.SocketPermission
 127.0.0.1:1099 connect,resolve)
 [ERROR] ioc.Registry Operations trace:
 [ERROR] ioc.Registry [ 1] Triggering event 'action' on Index:loginform
 [ERROR] ioc.Registry [ 2] Triggering event 'validate' on Index:loginform
 [INFO] AppModule.TimingFilter Request time: 115 ms
 [ERROR] ioc.Registry access denied (java.util.PropertyPermission
 tapestry.exception-report-page read)
 [ERROR] ioc.Registry Operations trace:
 [ERROR] ioc.Registry [ 1] Realizing service RequestExceptionHandler
 [ERROR] ioc.Registry [ 2] Instantiating service
 RequestExceptionHandler implementation via
 org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler(RequestPageCache,
 PageResponseRenderer, Logger, String, Response) (at
 DefaultRequestExceptionHandler.java:53) via
 org.apache.tapestry5.services.TapestryModule.bind(ServiceBinder) (at
 TapestryModule.java:308)
 [ERROR] ioc.Registry [ 3] Creating plan to instantiate
 org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler
 via public 
 org.apache.tapestry5.internal.services.DefaultRequestExceptionHandler(org.apache.tapestry5.internal.services.RequestPageCache,org.apache.tapestry5.internal.services.PageResponseRenderer,org.slf4j.Logger,java.lang.String,org.apache.tapestry5.services.Response)
 [ERROR] ioc.Registry [ 4] Determining injection value for parameter #4
 (java.lang.String)
 [ERROR] ioc.Registry [ 5] Resolving object of type java.lang.String
 using MasterObjectProvider
 2014-09-16 17:35:45.343:WARN:oejs.ServletHandler:qtp447326139-16:
 Error for /studentportal/index.loginform
 java.lang.ExceptionInInitializerError

 Actually what happens (or should) is that the onValidate method calls
 a method on an object which resides on a server, using RMI to check
 the credentials. If the credentials are accepted, there is no error
 recorded on the loginForm and so onSuccess is called. If there is some
 error (including permission problems or RMI problems), then it should
 record the error message so onSuccess is not called. Since the RMI
 server is not running, the user should not be able to validate. On my
 windows machine this is fine, I just get an error message

 On 16 September 2014 17:33, Lance Java lance.j...@googlemail.com wrote:
 Linux file system is case sensitive whereas windows is not. I'm guessing
 you have a tml file where the case of the tml filename does not match the
 class name.
  On 16 Sep 2014 17:27, Stephen Nutbrown steves...@gmail.com wrote:

 Hi,

 I have a T5 webapp which I am currently running using jetty on windows
 which works as expected. I am building the project using maven and
 running it using mvn jetty:run. However, I can (and have) tried
 installing jetty and building it into a .war and deploying it that
 way.

 Whichever way I do it, on the Linux server I am able to see the home
 page. When I then submit a form (the login form), I get an exception
 which I don't get on Windows. I am really stuck trying to figure out
 the problem. I would appreciate any guidance if possible.

 I have previously ran T5 webapps on this server without a problem, but
 the exception seems to suggest something about locale? This isn't a
 project which was created by myself, but I have the job of moving

Re: Tapestry ioc/registry startup exception?

2014-09-02 Thread Stephen Nutbrown
Hi,

I had this exact same question and problem, and found changing the JDK
to use 7 instead of 8 fixed it.

However, this seems to do it even when I download a snapshot of
Tapestry and run using JDK 8, is there any documentation anywhere with
any requirements and instructions on how to use JDK 8?  For my
project, I have just settled with using JDK 7, but that isn't
necessarily ideal.

Thanks,




On 2 September 2014 11:37, Lance Java lance.j...@googlemail.com wrote:
 It's caused by asm.ClassReader. Which jvm version and tapestry version are
 you using? Tapestry has only recently added support for java 8 (asm5).

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



Javascript returned inside Zone isn't executed (eval?)

2014-05-22 Thread Stephen Nutbrown
Hi,

Sorry for asking two questions in as many days but I have become stuck
again. I've done a fair bit of searching and I think I understand the
problem, but I don't know how to fix it.

I have a DirectoryViewer component and a MediaViewer component
which I created. The directory viewer will show a list of file names.
It has a MediaViewer component inside it which is responsible for
displaying the last selected file. This works fine.

The DirectoryViewer uses a zone for showing the MediaViewer like this:
t:zone t:id=MediaViewZone id=MediaViewZone
t:MediaViewer fileToShow=fileToShow/
/t:zone

When a user clicks on a filename link, the fileToShow is updated and
the zone is then also updated:
It looks like this:

Object onActionFromFileSelection(File file) {
this.fileToShow = file;
return MediaViewZone.getBody(); // AJAX request, return zone's own body
}

This is fine too. It is important that the whole page does not refresh
between selecting different files as this would be rather irritating.

The MediaViewer then has 3 blocks which are delegated to a method to
check the type of media. At the moment, this can be a text, a pdf or
an image (more later i'm sure). If it is text, it will be pretty
printed (It will be source code of some sort). If it is a pdf, it will
be displayed in an object tag and if it is an image, I would like to
use a javascript library to give zoom functionality etc.

Everything is good until this point, and it's going to get worse if I
don't understand how to fix it.
So when the block selected is a image, the block will be changed
depending on the media type, for an image it looks like this:

 t:block id=image

 section id=focal
 h1Use the mousewheel to zoom on a focal point/h1
 div class=parent
   div class=panzoom
image src=${FileLink}/
   /div
 /div

 div class=buttons
   button class=zoom-inZoom In/button
   button class=zoom-outZoom Out/button
   input type=range class=zoom-range/input
   button class=resetReset/button
 /div
 script src=${context:layout/js/jquery.mousewheel.run.js}/script
   /section

/t:block

That script which is inside the block is sent to the browser, but it
never runs. From what I understand, this is because eval() needs to be
called. If I hit ctrl F5, the script will be loaded and evaluated, and
other than some bugs in my javascript, it works. Looking further I
find links like this:
http://technify.me/user-experience/javascript/executing-javascript-in-an-ajax-response/
which suggest eval() needs to be called.

I see in the prototype documentation something about setting
evalScripts: true, but I have no idea where I would change this in my
application (http://api.prototypejs.org/ajax/Ajax/Updater/).

So I am a bit stuck. Perhaps it is my design (sending js via ajax)
which is bad, or perhaps there is some simple way to do it.

Any help is really appreciated, and, as I am still relatively new to
Tapestry  any comments on anything I have done which I shouldn't be
doing or am doing well, (probably in terms of nesting components like
that) would help massively.

Thanks,

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



Re: Javascript returned inside Zone isn't executed (eval?)

2014-05-22 Thread Stephen Nutbrown
Hi again,

A quick update. Actually I find when I look in the source in Google
Chrome, I can see this:

section id=focal
h1Use the mousewheel to zoom on a focal point/h1
div class=parent
div class=panzoom
img src=/util/filestreamresponse/DHjg5sVppy
/div
/div
div class=buttons
button class=zoom-inZoom In/button
button class=zoom-outZoom Out/button
input class=zoom-range type=range
button class=resetReset/button
/div
/section

The whole script tag disappears! However, if I press ctrl and F5 (so
it refreshes the page but not by sending through a zone), the script
is showing:

section id=focal
h1Use the mousewheel to zoom on a focal point/h1
div class=parent style=overflow: hidden; position: relative;
div class=panzoom style=-webkit-transform: matrix(0.9, 0, 0, 0.9,
0, 0); -webkit-backface-visibility: hidden; -webkit-transform-origin:
50% 50%; cursor: move;
img src=/util/filestreamresponse/E1hOV7ggPM
/div
/div
div class=buttons
button class=zoom-inZoom In/button
button class=zoom-outZoom Out/button
input class=zoom-range type=range step=0.05 min=0.1 max=1
button class=resetReset/button
/div
script 
src=/assets/1.0-SNAPSHOT-DEV/ctx/layout/js/jquery.mousewheel.run.js/script/section

So, for some reason it appears that using zones and updating the body
is causing the script to not be sent, and therefore (perhaps also
because eval isn't called, I don't know), it is missing from the page.
Any ideas why the script gets stripped out somewhere?

Thanks,
Steve


On 22 May 2014 10:14, Stephen Nutbrown steves...@gmail.com wrote:
 Hi,

 Sorry for asking two questions in as many days but I have become stuck
 again. I've done a fair bit of searching and I think I understand the
 problem, but I don't know how to fix it.

 I have a DirectoryViewer component and a MediaViewer component
 which I created. The directory viewer will show a list of file names.
 It has a MediaViewer component inside it which is responsible for
 displaying the last selected file. This works fine.

 The DirectoryViewer uses a zone for showing the MediaViewer like this:
 t:zone t:id=MediaViewZone id=MediaViewZone
 t:MediaViewer fileToShow=fileToShow/
 /t:zone

 When a user clicks on a filename link, the fileToShow is updated and
 the zone is then also updated:
 It looks like this:

 Object onActionFromFileSelection(File file) {
 this.fileToShow = file;
 return MediaViewZone.getBody(); // AJAX request, return zone's own body
 }

 This is fine too. It is important that the whole page does not refresh
 between selecting different files as this would be rather irritating.

 The MediaViewer then has 3 blocks which are delegated to a method to
 check the type of media. At the moment, this can be a text, a pdf or
 an image (more later i'm sure). If it is text, it will be pretty
 printed (It will be source code of some sort). If it is a pdf, it will
 be displayed in an object tag and if it is an image, I would like to
 use a javascript library to give zoom functionality etc.

 Everything is good until this point, and it's going to get worse if I
 don't understand how to fix it.
 So when the block selected is a image, the block will be changed
 depending on the media type, for an image it looks like this:

  t:block id=image

  section id=focal
  h1Use the mousewheel to zoom on a focal point/h1
  div class=parent
div class=panzoom
 image src=${FileLink}/
/div
  /div

  div class=buttons
button class=zoom-inZoom In/button
button class=zoom-outZoom Out/button
input type=range class=zoom-range/input
button class=resetReset/button
  /div
  script src=${context:layout/js/jquery.mousewheel.run.js}/script
/section

 /t:block

 That script which is inside the block is sent to the browser, but it
 never runs. From what I understand, this is because eval() needs to be
 called. If I hit ctrl F5, the script will be loaded and evaluated, and
 other than some bugs in my javascript, it works. Looking further I
 find links like this:
 http://technify.me/user-experience/javascript/executing-javascript-in-an-ajax-response/
 which suggest eval() needs to be called.

 I see in the prototype documentation something about setting
 evalScripts: true, but I have no idea where I would change this in my
 application (http://api.prototypejs.org/ajax/Ajax/Updater/).

 So I am a bit stuck. Perhaps it is my design (sending js via ajax)
 which is bad, or perhaps there is some simple way to do it.

 Any help is really appreciated, and, as I am still relatively new to
 Tapestry  any comments on anything I have done which I shouldn't be
 doing or am doing well, (probably in terms of nesting components like
 that) would help massively.

 Thanks,

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



Displaying an ArrayList of strings in a form using TextFields

2014-05-20 Thread Stephen Nutbrown
Hello,

I also posted this on StackOverflow (SO), but it seems that the forum
is more active for these questions than SO. I'd really appreciate any
help. Here is the SO question, and the problem below (the same as it
is on SO).

http://stackoverflow.com/questions/23756438/tapestry-5-edit-arraylist-of-strings


I have a Result object (named result), and inside that object is an
arraylist of strings (named action), as well as some other values.

I can make a text area to edit values of the Result object like this:

input t:type=TextArea t:id=feedback t:value=result.someValue /

This works fine. However, I would like to show a text field for each
of the Strings in the ArrayList within the result object

I can create a loop like this:

t:loop t:source=result.action t:value=currentAction
index=indexProp t:formstate=ITERATION
   ${currentAction}
/t:loop

This will show me on the screen all of the actions (that is great,
half way there). However I want these to be editable using a
TextField.

I have tried several things, none of which have worked how I wanted.
However, to help explain and as an example of what I have tried, this
is what I have:


t:loop t:source=result.action t:value=currentAction
index=indexProp t:formstate=ITERATION
input t:type=TextField t:value=result.action.indexProp/
/t:loop

This won't work because (as far as I know), this is the same as
getResult().getAction.getIndexProp. So I tried

input t:type=TextField t:value=result.action.${indexProp}/


This doesn't work either, although it shows the correct number of
TextFields, it does not link them up properly (they just say inside
them result.action.0 and result.action.1.


Any help is much appreciated.

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



Re: Displaying an ArrayList of strings in a form using TextFields

2014-05-20 Thread Stephen Nutbrown
Hi Thilo,

Thank you for your reply and for taking the time - I really do appreciate it.

I did come across that first link when I was searching, but the issue
would be that it requires a lot more work for doing something which I
thought would be straight forwards. However, if I do it properly, then
this form can be used in several places in the application. I think
the best way would be for me to create this as a component which
handles everything to do with editing the result object, and pass the
result object in, I can name it something along the lines of
resultEditor. I would then use the ajaxloop within the component.
That way whenever I want to show the result objects details and allow
it to be edited (this could be used in a few places), I can just use
this component which will be responsible for updating the result
object.

I just wanted to check with you that doing that seems like a sensible
way forwards?

As for the cheapo idea, although I do like it, unfortunately the text
fields may want changing to text areas (as they may not be short) so
if they risk going on to two lines then it becomes a bit of a
nightmare for users seeing where the end of lines really are.

If you think the first way is the way to go, i'll put in the time to
create it as a separate component with an ajax loop in it. It seems
odd that it can't be done in a simpler way, just displaying each
String in the ArrayList as a separate text field/area.

Thanks,
Steve

On 20 May 2014 13:35, Thilo Tanner thilo.tan...@reprisk.com wrote:
 Hi Stephen,

 If you want one separate text field per ArrayList value, I suggest you take a 
 look at the FormLoop component:

 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1

 (The JumpStart sample app is a very good starting point to learn about T5 
 components)

 The component allows you to add and remove rows dynamically. If you store 
 your values in the database, you either have to replace all values after the 
 submit or you should keep track of the changes using a holder object:

 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloopwithholders1

 Depending on your use case, you can also go for a cheapo solution and create 
 a text area for your values. When you render the form, you fill it with one 
 value per line and after the submit you split the user input line-by-line.

 Please feel free to ask, if you have questions concerning the FormLoop.

 Best,
 Thilo


 
 From: Stephen Nutbrown steves...@gmail.com
 Sent: Tuesday, May 20, 2014 14:14
 To: Tapestry users
 Subject: Displaying an ArrayList of strings in a form using TextFields

 Hello,

 I also posted this on StackOverflow (SO), but it seems that the forum
 is more active for these questions than SO. I'd really appreciate any
 help. Here is the SO question, and the problem below (the same as it
 is on SO).

 http://stackoverflow.com/questions/23756438/tapestry-5-edit-arraylist-of-strings


 I have a Result object (named result), and inside that object is an
 arraylist of strings (named action), as well as some other values.

 I can make a text area to edit values of the Result object like this:

 input t:type=TextArea t:id=feedback t:value=result.someValue /

 This works fine. However, I would like to show a text field for each
 of the Strings in the ArrayList within the result object

 I can create a loop like this:

 t:loop t:source=result.action t:value=currentAction
 index=indexProp t:formstate=ITERATION
${currentAction}
 /t:loop

 This will show me on the screen all of the actions (that is great,
 half way there). However I want these to be editable using a
 TextField.

 I have tried several things, none of which have worked how I wanted.
 However, to help explain and as an example of what I have tried, this
 is what I have:


 t:loop t:source=result.action t:value=currentAction
 index=indexProp t:formstate=ITERATION
 input t:type=TextField t:value=result.action.indexProp/
 /t:loop

 This won't work because (as far as I know), this is the same as
 getResult().getAction.getIndexProp. So I tried

 input t:type=TextField t:value=result.action.${indexProp}/


 This doesn't work either, although it shows the correct number of
 TextFields, it does not link them up properly (they just say inside
 them result.action.0 and result.action.1.


 Any help is much appreciated.

 -
 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


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

Re: Displaying an ArrayList of strings in a form using TextFields

2014-05-20 Thread Stephen Nutbrown
Hi Thiago, thanks for the help!

I appreciate your comments and thank you for taking the time to help.
The loop which you posted does show the text fields exactly as I want
them (and they are pre populated with the original values from the
array list of strings), but when I submit the form, the updated values
are not in the result object. When the user arrives at the page, there
are already values in the array list, the user may then edit them and
submit the form.

In my OnSuccessFromSubmitResults method, I check to see if the
result.action list has changed (at the moment I simply print these out
to the console so I can see which ones are there). It is showing me
the original values which were in the list, which suggests it didn't
set the value. If I was to do what I am wanting it to do in java, it
would have to be: result.getAction().set(index, somethingTheyEntered);

But i'm not sure if Tapestry can do that this easily?



Thanks,
Steve


On 20 May 2014 14:08, Thiago H de Paula Figueiredo thiag...@gmail.com wrote:
 On Tue, 20 May 2014 09:14:08 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hello,


 Hi!


 t:loop t:source=result.action t:value=currentAction
 index=indexProp t:formstate=ITERATION
 input t:type=TextField t:value=result.action.indexProp/
 /t:loop


 The prop binding (the default one) doesn't support using list or array
 indexes.


 This won't work because (as far as I know), this is the same as
 getResult().getAction.getIndexProp. So I tried

 input t:type=TextField t:value=result.action.${indexProp}/


 Never, never, ever use ${} when passing parameters. In 100% of the times,
 it's either completely wrong or completely useless.

 Try this:


 t:loop t:source=result.action t:value=currentAction
  input t:type=TextField t:value=currentAction/
 /t:loop

 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br


 -
 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: Displaying an ArrayList of strings in a form using TextFields

2014-05-20 Thread Stephen Nutbrown
Hi Thilo,

Thanks for this. I tried Thiago's solution and had some problems with
it not remembering the values which were set. I'm not entirely sure
why that is.
I think creating a component is the ideal solution, but it seemed a
little overkill at first.

I also noticed on StackOverflow that someone (Lance Java) posted a
useful response that I need to try, but I do think it's going to have
to go into it's own component and I need to study ajax loops, although
being able to add/remove rows isn't entirely necessary for the project
at the moment.

Thanks,
Steve

On 20 May 2014 14:21, Thilo Tanner thilo.tan...@reprisk.com wrote:
 Hi Stephen,

 I strongly encourage you to create a component for your result editor. This 
 helps encapsulating the editor code, which de-clutter your page class / 
 template. Tapestry components are very elegant and easy to re-use.

 If the number of values in your ArrayList is constant, you can use Thiago's 
 approach and use the Loop component to create the text fields. In case the 
 number of values should be adjustable, I think you're better off using 
 AjaxFormLoop.

 Best,
 Thilo

 
 From: Stephen Nutbrown steves...@gmail.com
 Sent: Tuesday, May 20, 2014 15:02
 To: Tapestry users
 Subject: Re: Displaying an ArrayList of strings in a form using TextFields

 Hi Thilo,

 Thank you for your reply and for taking the time - I really do appreciate it.

 I did come across that first link when I was searching, but the issue
 would be that it requires a lot more work for doing something which I
 thought would be straight forwards. However, if I do it properly, then
 this form can be used in several places in the application. I think
 the best way would be for me to create this as a component which
 handles everything to do with editing the result object, and pass the
 result object in, I can name it something along the lines of
 resultEditor. I would then use the ajaxloop within the component.
 That way whenever I want to show the result objects details and allow
 it to be edited (this could be used in a few places), I can just use
 this component which will be responsible for updating the result
 object.

 I just wanted to check with you that doing that seems like a sensible
 way forwards?

 As for the cheapo idea, although I do like it, unfortunately the text
 fields may want changing to text areas (as they may not be short) so
 if they risk going on to two lines then it becomes a bit of a
 nightmare for users seeing where the end of lines really are.

 If you think the first way is the way to go, i'll put in the time to
 create it as a separate component with an ajax loop in it. It seems
 odd that it can't be done in a simpler way, just displaying each
 String in the ArrayList as a separate text field/area.

 Thanks,
 Steve

 On 20 May 2014 13:35, Thilo Tanner thilo.tan...@reprisk.com wrote:
 Hi Stephen,

 If you want one separate text field per ArrayList value, I suggest you take 
 a look at the FormLoop component:

 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloop1

 (The JumpStart sample app is a very good starting point to learn about T5 
 components)

 The component allows you to add and remove rows dynamically. If you store 
 your values in the database, you either have to replace all values after the 
 submit or you should keep track of the changes using a holder object:

 http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formloopwithholders1

 Depending on your use case, you can also go for a cheapo solution and create 
 a text area for your values. When you render the form, you fill it with one 
 value per line and after the submit you split the user input line-by-line.

 Please feel free to ask, if you have questions concerning the FormLoop.

 Best,
 Thilo


 
 From: Stephen Nutbrown steves...@gmail.com
 Sent: Tuesday, May 20, 2014 14:14
 To: Tapestry users
 Subject: Displaying an ArrayList of strings in a form using TextFields

 Hello,

 I also posted this on StackOverflow (SO), but it seems that the forum
 is more active for these questions than SO. I'd really appreciate any
 help. Here is the SO question, and the problem below (the same as it
 is on SO).

 http://stackoverflow.com/questions/23756438/tapestry-5-edit-arraylist-of-strings


 I have a Result object (named result), and inside that object is an
 arraylist of strings (named action), as well as some other values.

 I can make a text area to edit values of the Result object like this:

 input t:type=TextArea t:id=feedback t:value=result.someValue /

 This works fine. However, I would like to show a text field for each
 of the Strings in the ArrayList within the result object

 I can create a loop like this:

 t:loop t:source=result.action t:value=currentAction
 index=indexProp t:formstate=ITERATION
${currentAction}
 /t:loop

 This will show me on the screen all of the actions

Re: Displaying an ArrayList of strings in a form using TextFields

2014-05-20 Thread Stephen Nutbrown
Hello,

Thank you again Thiago, Thilo and Java Lance over on StackOverflow - I
posted a link there to this mailing list thread so anyone can follow
if they come searching for the same issue.

Adding formState=interation did the trick, the Result object was
already persisted.

I have learnt a few things from this:
1- Putting things in components is generally very strongly advised. I
have around 10 at the moment, but there are certainly a lot of things
which I should move in to components to make the project easier to
manage. It is rather likely that at some stage soon I will be
re-factoring my whole project (which is rather large, consisting of 59
classes (10 components,  18 pages, 9 entities, several utility
classes and some services). I finally have some time to be working on
this project rather than being pulled  in lots of directions, so now
is the time (It has suffered from lots of cheapo solutions this last
few months).

2- I now know what formState=interaction is. Following the advice I
looked it up here:
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/corelib/LoopFormState.html

3- I owe the community a great deal of thanks :)

Thank you! You have made my day.
Steve

On 20 May 2014 14:32, Thiago H de Paula Figueiredo thiag...@gmail.com wrote:
 On Tue, 20 May 2014 10:23:22 -0300, Stephen Nutbrown steves...@gmail.com
 wrote:

 Hi Thiago, thanks for the help!


 Hi!


 I appreciate your comments and thank you for taking the time to help.
 The loop which you posted does show the text fields exactly as I want
 them (and they are pre populated with the original values from the
 array list of strings), but when I submit the form, the updated values
 are not in the result object. When the user arrives at the page, there
 are already values in the array list, the user may then edit them and
 submit the form.


 Try adding formState=interation, so Loop will get the edited list from
 your code again. Of course, this list should be the exact same instance used
 when you're rendering the form. The form submission is in a different
 request from the page rendering, so you either need to get the list again or
 @Persist the list or the object to which this list belongs. See the JavaDoc
 for LoopFormState or more details.


 --
 Thiago H. de Paula Figueiredo
 Tapestry, Java and Hibernate consultant and developer
 http://machina.com.br

 -
 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