Re: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

2019-07-10 Thread Lance Java
13 years dude 13 years

On Thu, 4 Jul 2019, 11:05 am Emmanuel Sowah,  wrote:

> Lance,
>
> I am not hating Tapestry, I am only a messenger preaching the good news
> that the world has moved on and left behind antiquated frameworks like
> Tapestry. Even the founder, Howard Lewis Ship, the captain of this Tapestry
> ship, has long left this sinking ship. He is now using other better and
> modern frameworks. Damn, he even used Wicket on his client's project.
> I am not surprised Tapestry cult followers like you always want to
> persecute the messenger by calling me names. I am sure you would thank me
> in the future for opening your eyes.
>
> On Tue, Jul 2, 2019 at 11:04 PM Lance Java
>  wrote:
>
> > Emmanuel Sowah - I think you deserve some form of long service award.
> > You've been hating on Tapestry for over 13 years now. Way to hold a
> grudge
> > dude!
> >
> > https://wiki.apache.org/tapestry/Tapestry5Trolls
> >
> > On Wed, 19 Jun 2019, 10:18 am Emmanuel Sowah,  wrote:
> >
> > > Of course it's understandable that they are going to deprecate it. What
> > > kind of creatures are you still stuck to a failed and stone-age
> framework
> > > like Tapestry? Even the original creator, Howard Lewis Ship, has
> > abandoned
> > > it for better frameworks like React, Angular and Wicket. Guys, wake up
> > and
> > > stop wasting your time.
> > >
> > > On Tue, Jun 18, 2019 at 10:46 PM Nicolas Bouillon <
> nico...@bouillon.net>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > Not sure if many of you are using the Tapestry plugins of IntellJ
> > > Ultimate.
> > > >
> > > > I do and it's very handy to navigate fastly between components and
> for
> > > code
> > > > completion in templates.
> > > >
> > > >
> > > >
> > >
> >
> https://blog.jetbrains.com/idea/2019/06/plugin-deprecations-in-intellij-idea-v2019-2/
> > > >
> > > > Tapestry is my favorite framework, and I haven't found any
> replacement
> > > with
> > > > the killing features such as Live Class Reloading (natively) and
> > > excellent
> > > > error reporting.
> > > >
> > > > Keep up the good work.
> > > >
> > > > Nicolas.
> > > >
> > >
> >
>


Re: Jetbrains considers to deprecate Tapestry plugin in IntelliJ 2019.3

2019-07-02 Thread Lance Java
Emmanuel Sowah - I think you deserve some form of long service award.
You've been hating on Tapestry for over 13 years now. Way to hold a grudge
dude!

https://wiki.apache.org/tapestry/Tapestry5Trolls

On Wed, 19 Jun 2019, 10:18 am Emmanuel Sowah,  wrote:

> Of course it's understandable that they are going to deprecate it. What
> kind of creatures are you still stuck to a failed and stone-age framework
> like Tapestry? Even the original creator, Howard Lewis Ship, has abandoned
> it for better frameworks like React, Angular and Wicket. Guys, wake up and
> stop wasting your time.
>
> On Tue, Jun 18, 2019 at 10:46 PM Nicolas Bouillon 
> wrote:
>
> > Hi,
> >
> > Not sure if many of you are using the Tapestry plugins of IntellJ
> Ultimate.
> >
> > I do and it's very handy to navigate fastly between components and for
> code
> > completion in templates.
> >
> >
> >
> https://blog.jetbrains.com/idea/2019/06/plugin-deprecations-in-intellij-idea-v2019-2/
> >
> > Tapestry is my favorite framework, and I haven't found any replacement
> with
> > the killing features such as Live Class Reloading (natively) and
> excellent
> > error reporting.
> >
> > Keep up the good work.
> >
> > Nicolas.
> >
>


Re: ServerSocket from within Tapestry

2019-03-24 Thread Lance Java
You might be interested in tapestry-atmosphere and tapestry-cometd. Each
project is a tapestry wrapper for an underlying websocket implementation.
The aim of each library is to integrate websocket / push functionality into
your tapestry app without requiring any javascript. Instead you can use
annotated methods and zone-like updates in your tml.

https://github.com/uklance/tapestry-atmosphere
https://github.com/uklance/tapestry-cometd


On Wed, 20 Mar 2019, 7:53 am Christopher Dodunski, <
chrisfromtapes...@christopher.net.nz> wrote:

> A simple solution in the end, a retweaking of the 'IgnoredPathsFilter'...
>
> public static void contributeIgnoredPathsFilter(Configuration
> configuration) {
> configuration.add("/websocket/.*");
> }
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


users@tapestry.apache.org

2017-05-09 Thread Lance Java
There's tapestry-hibernate-core which only depends on tapestry-ioc.
tapestry-hibernate builds on top of this with web specific services

https://mvnrepository.com/artifact/org.apache.tapestry/tapestry-hibernate-core/5.4.3

On 9 May 2017 03:54, "Thomas Mayer"  wrote:

> Hello Thiago,
>
> thanks for your answer.
>
> The idea was to only use tapestry-ioc which is supposed to be usable as
> an isolated component with no dependency to tapestry-core.
>
> tapestry-hibernate, however, depends on tapestry-core, according to
> https://mvnrepository.com/artifact/org.apache.tapestry/
> tapestry-hibernate/5.4.3
> That's not necessarily a no-go for general usage, but "taints" my
> original concept.
>
> For my use case it would be perfectly fine to only use one Hibernate
> session throughout the project (no threading, etc.). The project itself
> does some batch processing (no web context, etc.).
>
> Should I ever need multiple Sessions, that's where @ServiceId could step
> in (still single threaded).
>
> Still, all of these considerations don't deal whith the original
> question why creating this Session service is failing so hard. At least
> good to know that my code should run in general. Thanks for that.
>
> Now, where is the missing part? Is it Tapestry-Ioc related or Hibernate
> related?
>
> If the code should run, but fails, then, maybe there is a bug/limitation
> somewhere which might be worth to get fixed.
>
> Best regards
> Thomas
>
> Am 09.05.2017 um 00:57 schrieb Thiago H. de Paula Figueiredo:
> > Hello!
> >
> > Why don't you just use tapestry-hibernate to let it deal with creating
> and
> > handling Hibernate sessions?
> > https://tapestry.apache.org/using-tapestry-with-hibernate.html
> >
> > Also, I believe your code may not be incorrect, but it's not good. Unless
> > you want only one Hibernate session for the whole application and you
> never
> > have threads in parallel using it, your code will be fail hard. Hibernate
> > sessions are not thread-safe and Tapestry-IoC services are singletons by
> > default. Your code doesn't tell T-IoC the service is per-thread.
> >
> > Also, why are you using @ServiceId? Tapestry-IoC services are usually
> > defined by their type, not by their id, and service ids are generally
> only
> > used when you have more than one service with the same type.
> >
> >
> > On Mon, May 8, 2017 at 2:56 AM, Thomas Mayer <
> thomas.ma...@student.kit.edu>
> > wrote:
> >
> >> Hi, this report/question is for
> >>
> >> tapestry-ioc 5.4.3
> >> hibernate-core 5.2.10.Final
> >> openjdk version "1.8.0_121"
> >> OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.
> >> 16.04.2-b13)
> >> OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
> >>
> >> I'm trying to have a ServiceId for a hibernate Session:
> >>
> >> @ServiceId("HibernateSession")
> >> public static Session buildHibernateSession(
> >> ObjectLocator objectLocator
> >> ) {
> >> return new Configuration()
> >> .configure("hibernate.cfg.xml")
> >> .buildSessionFactory()
> >> .openSession();
> >> }
> >>
> >> As soon as the HibernateSession is invoked by Tapestry-IOC, I get an
> >> error:  java.lang.ClassFormatError: Duplicate method name&signature in
> >> class file $Session_350f95bde0b5
> >>
> >> Please note thate I can serve the SessionFactory perfectly fine with
> >> Tapestry-IoC (just by omitting the "openSession()").
> >>
> >> Is there something wrong in the code above?
> >> Can someone reproduce it?
> >> Is this a bug in Tapestry-IoC?
> >> Is this a bug/limitation in Hibernate?
> >>
> >>
> >>
> >> 2017-05-08 07:31:02 DEBUG HibernateSession:261 - Creating proxy for
> >> service HibernateSession
> >> Exception in thread "main" java.lang.ClassFormatError: Duplicate method
> >> name&signature in class file $Session_350f95bde0b5
> >> at java.lang.ClassLoader.defineClass1(Native Method)
> >> at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
> >> at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
> >> at
> >> org.apache.tapestry5.internal.plastic.PlasticClassLoader.
> >> defineClassWithBytecode(PlasticClassLoader.java:52)
> >> at
> >> org.apache.tapestry5.internal.plastic.PlasticClassPool.
> >> realize(PlasticClassPool.java:160)
> >> at
> >> org.apache.tapestry5.internal.plastic.PlasticClassPool.
> >> realizeTransformedClass(PlasticClassPool.java:139)
> >> at
> >> org.apache.tapestry5.internal.plastic.PlasticClassImpl.
> createInstantiator(
> >> PlasticClassImpl.java:648)
> >> at
> >> org.apache.tapestry5.plastic.PlasticManager.createProxy(
> >> PlasticManager.java:253)
> >> at
> >> org.apache.tapestry5.ioc.internal.services.PlasticProxyFactoryImpl.
> >> createProxy(PlasticProxyFactoryImpl.java:68)
> >> at
> >> org.apache.tapestry5.ioc.internal.ModuleImpl.createProxyInstance(
> >> ModuleImpl.java:484)
> >> at
> >> org.apache.tapestry5.ioc.internal.ModuleImpl.
> createProxy(ModuleImpl.java:
> 

Re: Tapestry cometd with HTTPS

2017-04-30 Thread Lance Java
tapestry-cometd uses tapestry-offline under the hood to fool tapestry into
believing it was invoked via a request / response when it was actually
invoked via websockets.

I'm guessing you are rendering a link in your websocket flow. You'll need
to provide a few extra symbols to render links including the server name &
port. See the tapestry-offline readme for more information

https://github.com/uklance/tapestry-offline

On 30 Apr 2017 19:53, "Miguel Figueiredo"  wrote:

> Hi,
>
> I am testing a Tapestry application with HTTPS configuration.
> I did the dev configuration according to the documentation (
> https://tapestry.apache.org/https.html)
>
> public void contributeMetaDataLocator(MappedConfiguration String> configuration) {
> configuration.add(MetaDataConstants.SECURE_PAGE, "true");
> }
>
> public static void contributeServiceOverride(
> MappedConfiguration Object> configuration) {
> BaseURLSource source = new BaseURLSource() {
> public String getBaseURL(boolean secure) {
> String protocol = secure ? "https" : "http";
>
> int port = secure ? 8443 : 8080;
>
> return String.format("%s://localhost:%d", protocol, port);
> }
> };
>
> configuration.add(BaseURLSource.class, source);
> }
>
> Additionaly I have added the jetty configuration for SSL.
>
> All the normal requests work fine, but when I do a broadcast with a push
> manager, I get the following error:
>
> Caused by: java.lang.RuntimeException: Symbol 'tapestry-offline.serverName'
> is not defined.
> at
> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl$
> SymbolExpansion.expandSymbol(SymbolSourceImpl.java:136)
> at
> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl$
> SymbolExpansion.valueForSymbol(SymbolSourceImpl.java:99)
> at
> org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl.
> valueForSymbol(SymbolSourceImpl.java:214)
> at $SymbolSource_2086fa2c220a.valueForSymbol(Unknown Source)
> at
> org.apache.tapestry5.ioc.internal.services.SymbolObjectProvider.provide(
> SymbolObjectProvider.java:49)
> at
> org.apache.tapestry5.ioc.internal.services.MasterObjectProviderImpl$1.
> invoke(MasterObjectProviderImpl.java:52)
> at
> org.apache.tapestry5.ioc.internal.OperationTrackerImpl.
> invoke(OperationTrackerImpl.java:74)
> ... 67 more
>
> Note that this works file with HTTP.
>
> Can someone give me some help?
>
> Best regards,
> Miguel
>
>
> --
> Miguel Figueiredo
> Software Developer
>
> "I'm a pretty lazy person and am prepared to work quite hard in order to
> avoid work."
> -- Martin Fowler
>


RE: Creating an org.apache.tapestry5.dom.Document from client-side page source

2017-04-06 Thread Lance Java
Selenium has many features for verifying values in the clientside DOM by
xpath and other selectors. Best to look at some selenium tutorials first

On 6 Apr 2017 17:26, "Davide Vecchi"  wrote:

> OK, I did not know that about the Tapestry DOM libraries. That explains a
> few things, and it settles this, I will use something else.
>
> Thanks for the help.
>
>
> -Original Message-
> From: Lance Java [mailto:lance.j...@googlemail.com]
> Sent: Thursday, April 6, 2017 18:21
> To: Tapestry users 
> Subject: RE: Creating an org.apache.tapestry5.dom.Document from
> client-side page source
>
> Typically you'd use the tapestry dom only in production code (pages,
> components, mixins etc)
>
> For verifying html in selenium tests you'd usually use Jsoup or geb or
> something or maybe even the java xml libraries. But not the tapestry dom
> libraries.
>
>
> On 6 Apr 2017 17:16, "Davide Vecchi"  wrote:
>
> > Thanks Thiago, I will look into your suggestion, I actually think
> > htmlparser is even already used somewhere else in the application.
> > I'm actually using Selenium WebDriver, and it's true, it's
> > beautifullly suited for this.
> >
> >
> > -Original Message-
> > From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com]
> > Sent: Thursday, April 6, 2017 18:09
> > To: Tapestry users 
> > Subject: Re: Creating an org.apache.tapestry5.dom.Document from
> > client-side page source
> >
> > Isn't this scenario better suited for a web testing tool like Selenium
> > or WebDriver?
> >
> > If you really, really want to parse HTML into Tapestry DOM elements,
> > you can use the nu.validator.htmlparser library, which parses HTML
> > using HTML5 rules and presents itself as a SAX parser. You'll need to
> > subclass org.xml.sax.helpers.DefaultHandler and build the Tapestry DOM
> > elements inside its methods. Then you can do whatever you want with
> > it, including using XPath through tapestry-xpath, which I cannot
> recommend enough.
> >
> > On Thu, Apr 6, 2017 at 12:20 PM, Davide Vecchi  wrote:
> >
> > > Hi everybody
> > >
> > > I am writing a Selenium test to test a Tapestry 5.3.8 web app, and
> > > in that test I retrieved the whole client-side page source into a
> String.
> > > It's a regular HTML page generated by Tapestry. Nothing special
> > > about it, it starts with
> > >
> > > http://www.w3.org/1999/xhtml";> 
> > >
> > > and it ends with
> > >
> > > .. 
> > >
> > > I need to create an org.apache.tapestry5.dom.Document instance from
> > > that page source, manipulate its DOM, turn the resulting Document
> > > back into a string, and make assertions about this string.
> > >
> > > My problem is only that I can't seem to be able to do the first
> > > step, that is create the Document instance from my String containing
> > > the page
> > source.
> > >
> > > I tried MarkupWriter (its write() and writeRaw() methods):
> > >
> > >MarkupWriter writer = new MarkupWriterImpl();
> > >
> > >writer.write(htmlText); // writer.writeRaw(htmlText);
> > >
> > >Document document = writer.getDocument();
> > >
> > > but then document does not contain the DOM elements that were in
> > > htmlText (which is the String containing the page source), and
> > > document.getDocumentElement() returns null.
> > >
> > > I have tried other variations still with MarkupWriter, Document and
> > > all their methods that seemed related, but I got nothing.
> > >
> > > I'm sure I'm just missing something trivial. Does anyone know ?
> > >
> > > If possible I'd prefer a Tapestry solution, where the created object
> > > is an org.apache.tapestry5.dom.Document, but if it's necessary to
> > > get a org.w3c.dom.Document instead, or to use something else outside
> > > Tapestry, I would still go for it.
> > >
> > > Thanks in advance.
> > >
> > >
> >
> >
> > --
> > Thiago
> >
>


RE: Creating an org.apache.tapestry5.dom.Document from client-side page source

2017-04-06 Thread Lance Java
Typically you'd use the tapestry dom only in production code (pages,
components, mixins etc)

For verifying html in selenium tests you'd usually use Jsoup or geb or
something or maybe even the java xml libraries. But not the tapestry dom
libraries.


On 6 Apr 2017 17:16, "Davide Vecchi"  wrote:

> Thanks Thiago, I will look into your suggestion, I actually think
> htmlparser is even already used somewhere else in the application.
> I'm actually using Selenium WebDriver, and it's true, it's beautifullly
> suited for this.
>
>
> -Original Message-
> From: Thiago H. de Paula Figueiredo [mailto:thiag...@gmail.com]
> Sent: Thursday, April 6, 2017 18:09
> To: Tapestry users 
> Subject: Re: Creating an org.apache.tapestry5.dom.Document from
> client-side page source
>
> Isn't this scenario better suited for a web testing tool like Selenium or
> WebDriver?
>
> If you really, really want to parse HTML into Tapestry DOM elements, you
> can use the nu.validator.htmlparser library, which parses HTML using HTML5
> rules and presents itself as a SAX parser. You'll need to subclass
> org.xml.sax.helpers.DefaultHandler and build the Tapestry DOM elements
> inside its methods. Then you can do whatever you want with it, including
> using XPath through tapestry-xpath, which I cannot recommend enough.
>
> On Thu, Apr 6, 2017 at 12:20 PM, Davide Vecchi  wrote:
>
> > Hi everybody
> >
> > I am writing a Selenium test to test a Tapestry 5.3.8 web app, and in
> > that test I retrieved the whole client-side page source into a String.
> > It's a regular HTML page generated by Tapestry. Nothing special about
> > it, it starts with
> >
> > http://www.w3.org/1999/xhtml";> 
> >
> > and it ends with
> >
> > .. 
> >
> > I need to create an org.apache.tapestry5.dom.Document instance from
> > that page source, manipulate its DOM, turn the resulting Document back
> > into a string, and make assertions about this string.
> >
> > My problem is only that I can't seem to be able to do the first step,
> > that is create the Document instance from my String containing the page
> source.
> >
> > I tried MarkupWriter (its write() and writeRaw() methods):
> >
> >MarkupWriter writer = new MarkupWriterImpl();
> >
> >writer.write(htmlText); // writer.writeRaw(htmlText);
> >
> >Document document = writer.getDocument();
> >
> > but then document does not contain the DOM elements that were in
> > htmlText (which is the String containing the page source), and
> > document.getDocumentElement() returns null.
> >
> > I have tried other variations still with MarkupWriter, Document and
> > all their methods that seemed related, but I got nothing.
> >
> > I'm sure I'm just missing something trivial. Does anyone know ?
> >
> > If possible I'd prefer a Tapestry solution, where the created object
> > is an org.apache.tapestry5.dom.Document, but if it's necessary to get
> > a org.w3c.dom.Document instead, or to use something else outside
> > Tapestry, I would still go for it.
> >
> > Thanks in advance.
> >
> >
>
>
> --
> Thiago
>


Re: Creating an org.apache.tapestry5.dom.Document from client-side page source

2017-04-06 Thread Lance Java
Why on earth would you do that?

On 6 Apr 2017 16:20, "Davide Vecchi"  wrote:

Hi everybody

I am writing a Selenium test to test a Tapestry 5.3.8 web app, and in that
test I retrieved the whole client-side page source into a String. It's a
regular HTML page generated by Tapestry. Nothing special about it, it
starts with

http://www.w3.org/1999/xhtml";> 

and it ends with

.. 

I need to create an org.apache.tapestry5.dom.Document instance from that
page source, manipulate its DOM, turn the resulting Document back into a
string, and make assertions about this string.

My problem is only that I can't seem to be able to do the first step, that
is create the Document instance from my String containing the page source.

I tried MarkupWriter (its write() and writeRaw() methods):

   MarkupWriter writer = new MarkupWriterImpl();

   writer.write(htmlText); // writer.writeRaw(htmlText);

   Document document = writer.getDocument();

but then document does not contain the DOM elements that were in htmlText
(which is the String containing the page source), and
document.getDocumentElement() returns null.

I have tried other variations still with MarkupWriter, Document and all
their methods that seemed related, but I got nothing.

I'm sure I'm just missing something trivial. Does anyone know ?

If possible I'd prefer a Tapestry solution, where the created object is an
org.apache.tapestry5.dom.Document, but if it's necessary to get a
org.w3c.dom.Document instead, or to use something else outside Tapestry, I
would still go for it.

Thanks in advance.


RE: Remote debugging a Tapestry application

2017-04-05 Thread Lance Java
That's incorrect. Tapestry pages / components are byte code transformed
such that properties are stored in PerThreadValue instances. In development
mode tapestry duplicates the values into the bean properties to make
debugging easier.


On 5 Apr 2017 09:30, "Ankit Jain"  wrote:

> The problem you are talking about is independent of development/production/
> remotedebugging.
> You can use sysout or logger to trace the values as watch will not be able
> to show you the real value of global objects in the page.
>
> Note: I am assuming that you are trying to see the value of the global
> variable of the page in the watch dialog.
>
> -Original Message-
> From: Barry Books [mailto:trs...@gmail.com]
> Sent: Wednesday, April 5, 2017 5:10 AM
> To: Tapestry users
> Subject: Re: Remote debugging a Tapestry application
>
> I believe you will be able to see the values if you are in development
> mode.
>
> On Tuesday, April 4, 2017, g kuczera  wrote:
>
> > Hi everybody,
> > I wanted to speed up my work and try out the remote debugging from
> Eclipse.
> > It indeed works (I use jetty:run on localhost and then remote
> > debugging configuration from Eclipse), the breakpoints are hit. The
> > big problem is the wrong values of the pages' fields - all of them
> > equal null or other default value (eg. the boolean fields equal
> > false). After passing the field to the method, it's value is read
> correctly.
> >
> > I use Tapestry 5.3.7 and Eclipse Neon. The application is run in the
> > production mode and I have not yet tried the development mode (I have
> > some configuration problems, probably not connected with Tapestry). Is
> > there any difference in this case between these two modes?
> >
> > The project is managed by maven. The maven-compiler-plugin plugin is
> > in version 3.1 and is configured with settings:
> >   true
> >   lines,vars,source
> >
> > I think that my problem is connected with this three ead:
> > http://apache-tapestry-mailing-list-archives.1045711.
> > n5.nabble.com/Debugging-variables-td4296888.html
> >
> [Aspire Systems]
>
> This e-mail message and any attachments are for the sole use of the
> intended recipient(s) and may contain proprietary, confidential, trade
> secret or privileged information. Any unauthorized review, use, disclosure
> or distribution is prohibited and may be a violation of law. If you are not
> the intended recipient, please contact the sender by reply e-mail and
> destroy all copies of the original message.
>


Re: How to open a pdf file on click of an action link

2017-03-07 Thread Lance Java
You'll need to set:
response.setHeader("Content-Disposition", "attachment; filename=" +
fileName);

See StreamResponse usage in PDFLink.onPdf() here
http://t5stitch-lazan.rhcloud.com/pdflinkdemo

On 7 Mar 2017 08:47, "Gopi, Sreela"  wrote:

> Hello,
>
>Can anyone please tell me how to open a pdf file on click of an action
> link in Tapestry?
>
>
> Thank you,
> Sreela Gopi
>
>
>


Re: Loop of checkboxes in form

2017-01-23 Thread Lance Java
If you want to avoid http session you could maintain a hidden text field on
the page which also gets posted alongside the checkboxes. The text field
contains a comma separated list of the checkbox ids (or maybe just a count
if index based naming convention)

On 23 Jan 2017 10:07 a.m., "Nathan Quirynen" 
wrote:

> Hi,
>
> What is the best practice for showing a (dynamic) list of objects as
> checkboxes in a form and posting the selection. I have found some examples,
> but they all have the need of persisting data in the http session, which
> I'd like to avoid as much as possible. Or is this the only way to achieve
> this?
>
> An example I found: http://lombok.demon.co.uk/tape
> stry5Demo/test/components/checkboxgroupdemo
>
> Nathan
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Rendering block from Java

2017-01-06 Thread Lance Java
There's also the capture component
http://t5stitch-lazan.rhcloud.com/capturedemo

On 6 Jan 2017 5:17 p.m., "Nathan Quirynen" 
wrote:

> Hey,
>
> I'm not sure with blocks, but I do know that Lance (Tapestry committer)
> made a library to render pages and components in code. Maybe this can help
> you with your case?
>
> https://github.com/uklance/tapestry-offline
>
>
> Nathan
>
>
> Op 06/01/2017 om 18:12 schreef Jaroslav Ciml:
>
>> Hi,
>>
>> Is rendering of a block possible directly from Java code?
>>
>> I know that I can return a block from a rendering phase method:
>>
>> Object beginRender()
>> {
>>  if (someCondition) {
>>  return someBlock; // of type org.apache.tapestry5.Block
>>  }
>>  ...
>> }
>>
>> However, can I do something like
>>
>> Object beginRender(MarkupWriter writer)
>> {
>>  writer.write("Leading text");
>>  if (someBlock != null)
>>  {
>>  writer.renderBlock(someBlock); // this method does not actually
>> exist
>>  }
>>  writer.write("Trailing text");
>> }
>>
>> Thanks.
>> Jarda
>>
>> -
>> 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: Parameterized service injection

2016-12-15 Thread Lance Java
You should be able to use @InjectService assuming each has a unique id.

  @InjectService("s1")
  private MyService s1;

  @InjectService("s2")
  private MyService s2;



On 13 Dec 2016 7:31 a.m., "Andrus Adamchik"  wrote:

> From what I gather Tapestry 5.4 still does not support parameterized
> service injection? E.g. in the following example both s1 and s2 will map to
> the same DI key of the bare class:
>
>   @Inject
>   private MyService s1;
>
>   @Inject
>   private MyService s2;
>
> I am running Tapestry on a Bootique.io stack with underlying injection
> bridged to Google Guice, that supports the above style. So I am a bit
> crippled by this limitation. I may (or may not :)) have time to develop and
> contribute this functionality to Tapestry, but before I start digging any
> deeper, wanted to check whether this is already in the works (or perhaps I
> overlooked something obvious, and I simply need to revise my Guice to
> tapestry bridge)?
>
> Thanks for any insight.
>
> Andrus
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Submit form without t:form component

2016-12-08 Thread Lance Java
Perhaps the observe mixin could help you?
http://t5stitch-lazan.rhcloud.com/observedemo

On 8 Dec 2016 11:22 p.m., "David Diaz"  wrote:

> Hi guys,
>
> I was wondering if there was any way to submit a form without having a
> t:form component and retrieve the data being sent? (e.g ideally a map would
> be accessible and I could just retrieve that data).
>
> I need to support this functionality (dynamic forms) and currently I'm
> doing it by converting it to a JSON object and then sending the JSON object
> to the server in an event - I would rather not have to have my forms rely
> on Javascript to function.
>
> Thanks,
> David.
>


Re: WebSocket enpoint as a tapestry service

2016-10-27 Thread Lance Java
I'm guessing it's similar to this?
https://github.com/uklance/tapestry-atmosphere/blob/master/tapestry-atmosphere/src/main/java/org/lazan/t5/atmosphere/services/TapestryAtmosphereObjectFactory.java

On 27 Oct 2016 9:12 p.m., "Norman Franke"  wrote:

> I wanted to create a web chat application. I based it off of Atmosphere (
> http://async-io.org). I made a small contribution to that project to make
> integration with Tapestry easier (primarily for IoC.) It was enough to get
> it working for me. Atmosphere provides a nice JavaScript API for the client
> side and can fall back to pre-WebSocket technologies.
>
> -Norman
>
> > On Oct 26, 2016, at 4:39 PM, Cezary Biernacki 
> wrote:
> >
> > Hi John,
> > I am working on an application that uses both Tapestry and WebSockets.
> The
> > integration is quite easy. Write your endpoint class as a normal service,
> > so you can inject/request your other Tapestry-based services in usual
> way.
> > Then in your AppModule add startup method (see @Startup annotation), that
> > just register your websocket handling services in whatever  websocket
> stack
> > you are using (we use Jetty's WevSocketServlets).
> >
> > Cezary
> >
> >
> > On Wed, Oct 26, 2016 at 8:16 PM, Qbyte Consulting <
> qbyteconsult...@gmail.com
> >> wrote:
> >
> >> I want to develop a tapestry chat component that uses a WebSocket to
> handle
> >> real time text messages. I need to integrate so that users can see who
> is
> >> logged in to the Tapestry app.
> >>
> >> How would I make a class in a Tapestry app a WS endoint that can also
> >> access my apps Tapestry services as well as handle the WS client?
> >>
> >> John
> >>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: WebSocket enpoint as a tapestry service

2016-10-27 Thread Lance Java
I'd love to see tapestry support websockets out of the box, perhaps with a
swappable implementation (atmosphere, socksjs, cometd etc)

I've tried to uphold the "tapestry philosophy" in both implementations
using event-handlers, blocks and zones (they're actually a pushTarget
rather than a zone). If Tapestry were to support websockets out of the box
I'd argue it should implement a similar approach.

On 27 Oct 2016 7:40 a.m., "Peter Hvass"  wrote:

> I've been meaning to have a go with Lance's tapestry-atmosphere - seems
> very straightforward especially for teams with little time to roll their
> own!
>
> Kalle + Cezary - (if feasible - licenses, projects etc.) would it not be
> worth all of us jumping on Lance's library (for plugging in Atmosphere) and
> possibly submitting patches/fixes so we have one bulletproof and
> fully-featured Tapestrified approach to this?
>
> Is there an argument that this sort of push-related functionality should be
> built into Tapestry directly for a future version? Push and notifications
> are two headline features for an ever mobile-friendly web..
>
> Thanks,
> Peter
> On 27 October 2016 at 01:35, Kalle Korhonen 
> wrote:
>
> > It's relatively simple like Cezary says. The only potential issue is with
> > authenticating JSR 356 websockets, which may require a bit of gymnastics
> > depending on your needs. If you are using sessions, you can fetch
> > underlying (servlet) session from the handshake request (see
> > http://stackoverflow.com/questions/21888425/accessing-
> servletcontext-and-
> > httpsession-in-onmessage-of-a-jsr-356-serverendpo/27057359).
> > If you are using sessionless authentication (w/ JWT), you can pass the
> > bearer token around in the sub-protocol header,
> > namely Sec-WebSocket-Protocol (see
> > http://stackoverflow.com/questions/22383089/is-it-
> possible-to-use-bearer-
> > authentication-for-websocket-upgrade-requests/35108078
> > ).
> >
> > Kalle
> >
> > On Wed, Oct 26, 2016 at 2:27 PM, Lance Java 
> > wrote:
> >
> > > There's a chat demo in both tapestry-atmosphere and tapestry-cometd
> > >
> > > Atmosphere
> > > Demo: http://t5atmosphere-lazan.rhcloud.com/
> > > Source:
> > > https://github.com/uklance/tapestry-atmosphere/tree/
> > > master/tapestry-atmosphere-demo
> > >
> > > Cometd
> > > Demo: http://t5cometd-lazan.rhcloud.com/chat
> > > Source:
> > > https://github.com/uklance/tapestry-cometd/tree/master/
> > > tapestry-cometd-demo
> > >
> > > On 26 Oct 2016 7:16 p.m., "Qbyte Consulting" <
> qbyteconsult...@gmail.com>
> > > wrote:
> > >
> > > > I want to develop a tapestry chat component that uses a WebSocket to
> > > handle
> > > > real time text messages. I need to integrate so that users can see
> who
> > is
> > > > logged in to the Tapestry app.
> > > >
> > > > How would I make a class in a Tapestry app a WS endoint that can also
> > > > access my apps Tapestry services as well as handle the WS client?
> > > >
> > > > John
> > > >
> > >
> >
>


Re: WebSocket enpoint as a tapestry service

2016-10-26 Thread Lance Java
There's a chat demo in both tapestry-atmosphere and tapestry-cometd

Atmosphere
Demo: http://t5atmosphere-lazan.rhcloud.com/
Source:
https://github.com/uklance/tapestry-atmosphere/tree/master/tapestry-atmosphere-demo

Cometd
Demo: http://t5cometd-lazan.rhcloud.com/chat
Source:
https://github.com/uklance/tapestry-cometd/tree/master/tapestry-cometd-demo

On 26 Oct 2016 7:16 p.m., "Qbyte Consulting" 
wrote:

> I want to develop a tapestry chat component that uses a WebSocket to handle
> real time text messages. I need to integrate so that users can see who is
> logged in to the Tapestry app.
>
> How would I make a class in a Tapestry app a WS endoint that can also
> access my apps Tapestry services as well as handle the WS client?
>
> John
>


Re: Problem with POST requests

2016-09-27 Thread Lance Java
onActivate() will be invoked for GET and POST and even during link
generation (I think). You shouldn't do any "work" in this method. Better
yet, remove the method all together and use @PageActivationContext.

If you have "work" needed for render only you should use @SetupRender

On 27 Sep 2016 2:12 p.m., "Thiago H de Paula Figueiredo" 
wrote:

> Hi!
>
> Could you please post the code of your component and the page? I'm having a
> hard time understanding your scenario from your description.
> Are you using a component or page as code that will upload something
> to ElasticSearch when it is requested but not sending any response
> back to the browser?
>
> On Sun, 25 Sep 2016 09:56:24 -0300,  wrote:
>
> I'm using Elasticsearch, my first implementation involved processing a
>> user request (verifying that there facet filters are valid) in the request
>> chain and then sending a redirect short circuiting the request pipeline.
>> Now here's the problem. I moved the processing into a component to make it
>> more modular and way less fragile. The problem is the actual search/facet
>> filter happens during the GET request and it is injected into the
>> EventContext and when they hit the page the request result is assigned in
>> the onActivate event. The problem is on the POST request the page
>> components are still looking for those values  as if it was trying to
>> render the template. I just did a workaround and made a NullSearchRequest
>> value but it just seems like a hacky workaround and I keep having to check
>> if a value is null for properties that are never called on  that are never
>> used in a POST request. Anyone know a good work around?
>>
>> Sent from AOL Mobile Mail
>>
>
>
> --
> 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 Page activation context

2016-09-20 Thread Lance Java
FYI one bonus of using @PageActivationContext is that you automatically
have onPassivate() generated for you. If you declare onActivate() you'll
need to do this yourself

On 20 Sep 2016 5:56 p.m., "Thiago H de Paula Figueiredo" 
wrote:

> On Tue, 20 Sep 2016 13:24:08 -0300, Nathan Quirynen <
> nat...@pensionarchitects.be> wrote:
>
> |You can do something like the following: void onActivate(EventContext
>> eventContext) { |
>> ||if(eventContext.getCount() == 1) { ... } if(eventContext.getCount()
>> == 2) { ... } if(eventContext.getCount() == 3) { ... } ... |
>>
>> } |
>>
>
> Exactly. If you end up having more than one onActivate() in the same page
> class, you should instead have just one with a single EventContenxt
> 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
>
>


Re: Multiple Page activation context

2016-09-20 Thread Lance Java
Sorry... I spoke to soon. You want index=1 to be a string sometimes and a
long others? If you want to use @PageActivationContext you'll need to
declare as a string and parse to long yourself

On 20 Sep 2016 5:51 p.m., "Lance Java"  wrote:

> You don't need explicit nulls, it'll work with or without them.
>
> On 20 Sep 2016 5:46 p.m., "Adam X"  wrote:
>
>> Wow, you guys rock and support is great. I like
>> onActivate(EventContext eventContext). I like even better
>> @PageActivationContext annotation (I'm doing a new project on 5.4.1 so
>> I can use it).
>>
>> So in my earlier example, if I define this:
>>
>> @PageActivationContext(index=0) private String foo;
>> @PageActivationContext(index=1) private String bar;
>> @PageActivationContext(index=2) private Long id1;
>> @PageActivationContext(index=3) private Long id2;
>>
>> How do I create links? Can I do this:
>>
>> yo
>> bam
>>
>> ? Or do I have to explicitly pass null to keep indexes straight?
>>
>> yo
>> bam
>>
>> Adam
>>
>> On Tue, Sep 20, 2016 at 6:34 PM, Lance Java 
>> wrote:
>> > Correction: This feature was added in 5.4 (not 5.3)
>> >
>> > On 20 Sep 2016 5:29 p.m., "Lance Java" 
>> wrote:
>> >
>> >> @PageActivationContext supports multiple values thanks to the new index
>> >> property added in 5.3. Missing values will simply be null
>> >>
>> >> Eg:
>> >> @PageActivationContext(index=0) private String value0;
>> >> @PageActivationContext(index=1) private String value1;
>> >> @PageActivationContext(index=2) private String value2;
>> >>
>> >> More info: https://issues.apache.org/jira/browse/TAP5-2138
>> >>
>> >> On 20 Sep 2016 5:04 p.m., "Adam X"  wrote:
>> >>
>> >>> I would like to have multiple (overloaded) onActivate methods in my
>> >>> page but seems like Tapestry is always picking a method with fewest
>> >>> arguments.
>> >>>
>> >>> How can I achieve something like this?
>> >>>
>> >>> TargetPage {
>> >>>
>> >>> void onActivate(String foo, String bar) {
>> >>> }
>> >>>
>> >>> void onActivate(String foo, Long id1, Long id2) {
>> >>> }
>> >>> }
>> >>>
>> >>> yo
>> >>> bam
>> >>>
>> >>> Adam
>> >>>
>> >>> -
>> >>> 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: Multiple Page activation context

2016-09-20 Thread Lance Java
You don't need explicit nulls, it'll work with or without them.

On 20 Sep 2016 5:46 p.m., "Adam X"  wrote:

> Wow, you guys rock and support is great. I like
> onActivate(EventContext eventContext). I like even better
> @PageActivationContext annotation (I'm doing a new project on 5.4.1 so
> I can use it).
>
> So in my earlier example, if I define this:
>
> @PageActivationContext(index=0) private String foo;
> @PageActivationContext(index=1) private String bar;
> @PageActivationContext(index=2) private Long id1;
> @PageActivationContext(index=3) private Long id2;
>
> How do I create links? Can I do this:
>
> yo
> bam
>
> ? Or do I have to explicitly pass null to keep indexes straight?
>
> yo
> bam
>
> Adam
>
> On Tue, Sep 20, 2016 at 6:34 PM, Lance Java 
> wrote:
> > Correction: This feature was added in 5.4 (not 5.3)
> >
> > On 20 Sep 2016 5:29 p.m., "Lance Java" 
> wrote:
> >
> >> @PageActivationContext supports multiple values thanks to the new index
> >> property added in 5.3. Missing values will simply be null
> >>
> >> Eg:
> >> @PageActivationContext(index=0) private String value0;
> >> @PageActivationContext(index=1) private String value1;
> >> @PageActivationContext(index=2) private String value2;
> >>
> >> More info: https://issues.apache.org/jira/browse/TAP5-2138
> >>
> >> On 20 Sep 2016 5:04 p.m., "Adam X"  wrote:
> >>
> >>> I would like to have multiple (overloaded) onActivate methods in my
> >>> page but seems like Tapestry is always picking a method with fewest
> >>> arguments.
> >>>
> >>> How can I achieve something like this?
> >>>
> >>> TargetPage {
> >>>
> >>> void onActivate(String foo, String bar) {
> >>> }
> >>>
> >>> void onActivate(String foo, Long id1, Long id2) {
> >>> }
> >>> }
> >>>
> >>> yo
> >>> bam
> >>>
> >>> Adam
> >>>
> >>> -
> >>> 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: Multiple Page activation context

2016-09-20 Thread Lance Java
Correction: This feature was added in 5.4 (not 5.3)

On 20 Sep 2016 5:29 p.m., "Lance Java"  wrote:

> @PageActivationContext supports multiple values thanks to the new index
> property added in 5.3. Missing values will simply be null
>
> Eg:
> @PageActivationContext(index=0) private String value0;
> @PageActivationContext(index=1) private String value1;
> @PageActivationContext(index=2) private String value2;
>
> More info: https://issues.apache.org/jira/browse/TAP5-2138
>
> On 20 Sep 2016 5:04 p.m., "Adam X"  wrote:
>
>> I would like to have multiple (overloaded) onActivate methods in my
>> page but seems like Tapestry is always picking a method with fewest
>> arguments.
>>
>> How can I achieve something like this?
>>
>> TargetPage {
>>
>> void onActivate(String foo, String bar) {
>> }
>>
>> void onActivate(String foo, Long id1, Long id2) {
>> }
>> }
>>
>> yo
>> bam
>>
>> Adam
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>


Re: Multiple Page activation context

2016-09-20 Thread Lance Java
@PageActivationContext supports multiple values thanks to the new index
property added in 5.3. Missing values will simply be null

Eg:
@PageActivationContext(index=0) private String value0;
@PageActivationContext(index=1) private String value1;
@PageActivationContext(index=2) private String value2;

More info: https://issues.apache.org/jira/browse/TAP5-2138

On 20 Sep 2016 5:04 p.m., "Adam X"  wrote:

> I would like to have multiple (overloaded) onActivate methods in my
> page but seems like Tapestry is always picking a method with fewest
> arguments.
>
> How can I achieve something like this?
>
> TargetPage {
>
> void onActivate(String foo, String bar) {
> }
>
> void onActivate(String foo, Long id1, Long id2) {
> }
> }
>
> yo
> bam
>
> Adam
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Multiple Context Parameters

2016-09-18 Thread Lance Java
Assuming foo is a property you could also do

t:context="[foo,'true']" or t:context="[foo,true]"

https://tapestry.apache.org/property-expressions.html

On 18 Sep 2016 11:13 a.m., "Bob Harner"  wrote:

> Yes, that's the correct way to do it. I think you could also do
> t:context="foo,bar" if both foo and bar are properties (e.g. a getter for
> each).
> On Sep 17, 2016 3:24 PM, "Adam X"  wrote:
>
> > I'm not sure if I did this right but I introduced a getter in my page
> > class returning object array like this:
> >
> > public Object[] getFoo() {
> >  return new Object[] { tx.id, true };
> > }
> >
> > So this allows me to have a context that is partially dynamic
> > (transaction id) and partially static (literal):
> >
> > public void onAjax(String txId, String fmt) {
> > }
> >
> > This works.
> >
> > Adam
> >
> > On Sat, Sep 17, 2016 at 3:18 PM, Adam X  wrote:
> > > Hi,
> > >
> > > I have the following event link which works (with single context
> > parameter)
> > >
> > >  > > zone="payloadZone">raw
> > >
> > > In my page class I have the associated handler:
> > >
> > > public void onDoAjax(boolean format) {
> > > log.debug("{}", format);
> > > }
> > >
> > > Now, I'd like to add a second (dynamic) context parameter. By dynamic
> > > I mean a property from the Page class. What's the best way to do this?
> > >
> > > Adam
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > For additional commands, e-mail: users-h...@tapestry.apache.org
> >
> >
>


Re: Getting ID of an updated zone

2016-09-17 Thread Lance Java
If you want streaming updates to a page you might be interested in
tapestry-atmosphere or tapestry-cometd rather than 12 periodic updates on a
page.

https://github.com/uklance/tapestry-atmosphere
http://t5atmosphere-lazan.rhcloud.com/

https://github.com/uklance/tapestry-cometd
http://t5cometd-lazan.rhcloud.com/

On 17 Sep 2016 9:17 a.m., "Adam X"  wrote:

> Hi,
>
> I'm trying to wrap my head around the new 5.4 JS support. I have the
> following module which gets invoked whenever a zone is updated,
> however, I have 12 zones on my page periodically updated. I don't know
> at runtime which zone is updated, but I need to be notified about it.
>
> So I have the following module:
>
> define(["t5/core/dom", "t5/core/events"], function(dom, events) {
>
> return function() {
> dom.onDocument(events.zone.didUpdate, function() {
> alert('how can I get ID of a zone that was updated?');
> });
> }
> });
>
> I have a hard time figuring out how to pass the ID of a zone that was
> updated.
>
> Adam
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Tapestry ignoring expansions in HTML comments

2016-03-16 Thread Lance Java
http://tapestryjava.blogspot.co.uk/2013/12/tapestry-quicky-conditionalcomment.html
On 16 Mar 2016 5:42 a.m., "David Diaz"  wrote:

> Hi guys,
>
> I've been working at my Tapestry application for a while and I'm just
> cleaning it up and I'm currently ensuring compatibility with Internet
> Explorer 8+. This requires me to include IE8 specific shims/polyfills for
> certain javascript functions it's missing.
>
> I'm trying to do this in my Layout.tml:
>
>   
> 
> 
> 
>
> Tapestry Application
> 
> 
>   
>
> but tapestry doesn't replace the expansion with the actual location of the
> file in the generated source code...
>
> Is there any way to do this?
>
> Thanks,
> David.
>


RE: Making a grid's checkbox column preserve its checked state across pages

2016-02-20 Thread Lance Java
You might be able to do that with my observe mixin

http://t5stitch-lazan.rhcloud.com/observedemo
On 19 Feb 2016 1:41 p.m., "Davide Vecchi"  wrote:

> The way in which I was thinking to handle this for now was to act
> client-side on the change of a checkbox and send its checked state to the
> server via Ajax, without POSTing the form. The idea of saving the states in
> the client instead is interesting, I had not thought about it and I will
> definitely explore it.
>
> However my final goal is to avoid having to make changes (either client or
> server-side) in each page that has grids with checkboxes, and I was
> wondering if there was some existing functionality that I could exploit to
> somehow make the grid handle the checkbox states on its own without any
> "help" from the page the grid is in.
>
> Otherwise I'm considering modifying the Grid (or the GridPager or other
> component) so that the component is aware of having checkbox columns and
> saves the checkboxes states on paging, and restores them when going back to
> the same grid page. Any suggestion or observation about this would be
> welcome.
>
>
>
> -Original Message-
> From: Lance Java [mailto:lance.j...@googlemail.com]
> Sent: Friday, February 19, 2016 14:10
> To: Tapestry users 
> Subject: Re: Making a grid's checkbox column preserve its checked state
> across pages
>
> If you want the values serverside, you'll need to POST the form when
> changing pages. You might find this difficult to achieve as paging is
> currently done as a GET request.
>
> The simplest solution would be to add a change event listener clientside
> and store the values on the client until the form is submitted / saved. You
> might use a hidden text field for this.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: Making a grid's checkbox column preserve its checked state across pages

2016-02-19 Thread Lance Java
If you want the values serverside, you'll need to POST the form when
changing pages. You might find this difficult to achieve as paging is
currently done as a GET request.

The simplest solution would be to add a change event listener clientside
and store the values on the client until the form is submitted / saved. You
might use a hidden text field for this.
On 19 Feb 2016 9:19 a.m., "Davide Vecchi"  wrote:

> Hi everybody,
>
> The following is my scenario, I'm looking for suggestions about good ways
> to go about it.
>
> Many of my pages have grids, and many of these grids have columns whose
> content in each row is a checkbox.
>
> If the grid has many rows and so it gets divided into grid pages and it
> gets a Pager, if I check some checkboxes in the 1st page of the grid and
> then use the Pager to go to the 2nd page of the grid and then to go back to
> the 1st page, the checkboxes in the 1st page of the grid have lost their
> checked state and are all unchecked. I want the checkboxes to preserve
> their "checked" state while paging back and forth over the grid.
>
> The checkbox is created by a  tag in the page template, just before
> the  closing tag. F.ex. if the Java class is MyPage.java, the grid
> tag in MyPage.tml will contain:
>
> 
>
>  value="myRecord.myField"  />
>
> 
>
> In MyPage.java, myRecord is an instance field annotated with @Property .
>
> Currently I handle this by annotating myRecord with @Persist and making
> sure to save into it the state of each checkbox that the user changes, so
> when the user goes back to page 1 the checkboxes that were checked there
> are still checked.
>
> However this requires changes in MyPage.java, so if I want this behavior
> in other pages I must make the same changes in the Java classes of all
> those pages.
>
> I'm looking for a way to make changes in only one place and have this
> functionality in all the pages that have a grid, without having to make
> changes in all the pages. In case, I'm totally open to customizing
> Grid.java or GridPager.java or other classes.
>


Re: HibernateSessionManager and background threads

2015-11-01 Thread Lance Java
You'll need to @Inject the PerThreadManager and call cleanupThread() in the
finally block of the task(s).
On 1 Nov 2015 14:58, "Ilya Obshadko"  wrote:

> I have recently noticed in my GC logs that application leaks memory after
> running periodic background process which performs database operations. I'm
> suspicious of Hibernate not cleaning up after himself. So the question is:
> are there any specific techniques for using Hibernate in background
> processes (i.e. via PeriodicExecutor)?
>
> Any suggestions appreciated.
>
> --
> Ilya Obshadko
>


Re: How do I unit test Javascript in Tapestry applications?

2015-08-19 Thread Lance Java
A word of warning... Selenium tests can be very problematic and I'm sitting
on the fence as to whether they are actually worth the maintenance cost.

That being said, the tapestry build itself has comprehensive Selenium
tests. Have a look through the source code for examples.
On 17 Aug 2015 12:55, "Poggenpohl, Daniel" <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello,
>
> We're trying to test our Tapestry application. We know that we can test
> our pages with
> https://tapestry.apache.org/unit-testing-pages-or-components.html
>
> But how do we test the JavaScript we implemented? It would seem that we
> would need a Tapestry generated html page and then call the scripts somehow.
>
> How do you implement JavaScript testing?
>
> Regards,
> Daniel P.
>


Re: Multiple domains, one webapp

2015-08-04 Thread Lance Java
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: prefilling password

2015-08-04 Thread Lance Java
I've always considered this a bit of a security flaw. Using the javascript
console you can show the password in plain text.

Eg:

alert(document.getElementById('password').value);
On 3 Aug 2015 21:13, "Thiago H de Paula Figueiredo" 
wrote:

> On Mon, 03 Aug 2015 15:04:27 -0300, Christine 
> 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?
>>
>
> This is actually done by the browser, not Tapestry, which never prefills
> password fields. I believe you should add autocomplete="false" to your form
> or password field. More information here:
> https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
> .
>
> --
> 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: Forms created in a loop - problem with validation

2015-07-24 Thread Lance Java
I think this is caused by the field being reused in the loop. You might
need to recordError with a FieldSnapshot.

Example here
http://t5stitch-lazan.rhcloud.com/mapbindingdemo


Re: Ajaxformloop add row link max size.

2015-07-13 Thread Lance Java
You could put the add row link in a zone and update the zone with nothing
(via AjaxResponseRenderer) when the max is hit.


Re: Multi threading in a service

2015-07-08 Thread Lance Java
Seems like you're currently instantiating a WorkQueue calling
archiveQueue() then calling shutdownAndAwaitTermination() and discarding
the WorkQueue... Correct?

If you use ExecutorService.submit() instead of ExecutorService.execute()
you can call use the Future response and call Future.get() later to wait
for the work to finish.

I think if you refactored like this, WorkQueue could become a singleton and
you could probably get rid of shutdownAndAwaitTermination() all together.

Also, for any threading in tapestry, it's always best to @Inject
PerThreadManager and call cleanupThread() in a finally block of the
runnable (or use ParallelExecutor which does this for you). This will
cleanup any per thread values (eg hibernate session etc).
On 8 Jul 2015 19:01, "George Christman"  wrote:

> I'm wondering what the best approach would be to handle multi threading in
> a service so that I have other service classes available to me.
>
> I'm passing in PDFService, but I'd like to pass it in through constructor
> injection.
>
> I'm assuming I'd have to instantiate the pool within archiveQueue and not
> set a class variable followed by me binding WorkQueue to an interface? I
>
> Current Code
>
> public class WorkQueue {
>
> private final ExecutorService pool;
>
> private final PDFService pdfService;
>
> public WorkQueue(PDFService pdfService, int poolSize) {
> this.pdfService = pdfService;
> this.pool = Executors.newFixedThreadPool(poolSize);
> }
>
> public void archiveQueue(List timeSheets) {
> try {
> for (final TimeSheet timeSheet : timeSheets) {
> pool.execute(new Runnable() {
> @Override
> public void run() {
> pdfService.generatePDF(null, timeSheet);
> }
> });
> }
> } catch (Exception ex) {
> Logger.getLogger(WorkQueue.class.getName()).log(Level.SEVERE,
> null, ex);
> }
> }
>
> void shutdownAndAwaitTermination(ExecutorService pool) {
> pool.shutdown(); // Disable new tasks from being submitted
> try {
> // Wait a while for existing tasks to terminate
> if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
> pool.shutdownNow(); // Cancel currently executing tasks
> // Wait a while for tasks to respond to being cancelled
> if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
> System.err.println("Pool did not terminate");
> }
> }
> } catch (InterruptedException ie) {
> // (Re-)Cancel if current thread also interrupted
> pool.shutdownNow();
> // Preserve interrupt status
> Thread.currentThread().interrupt();
> }
> }
>
> }
>


Re: Tapestry 5.4 datefield on value changed

2015-07-08 Thread Lance Java
See the observe mixin here
http://t5stitch-lazan.rhcloud.com/observedemo


Re: Best method to reuse a TextField configuration

2015-06-19 Thread Lance Java
I think the problem is
publishParameters = "value"

If you want validate and type you need
publishParameters = "value,validate,type"


Re: Tapestry 5.3.7 - best way to customize Grid Pager

2015-06-03 Thread Lance Java
In my opinion the grid is trying to do a bit too much. It's a nice way to
quickly get started but you often need to reactor to a custom table.

It's possibly worth considering a more override friendly grid version 2.
The current implementation is hard to set custom html attributes (td/tr).
Customising headers is hard if you want to keep sorting behaviour. Etc etc.


Re: Ajax Exception Handling - How to use alerts component instead of different page.

2015-06-02 Thread Lance Java
This sounds quite specific to a single page, I'd use an event handler

public void onException(Throwable cause)

You can @Inject AlertManager to add alerts
You can @Inject Request to test request.isXhr()
You can @Inject AjaxResponseRenderer to update zones.


Re: AjaxUpload and BeanEditContext

2015-05-29 Thread Lance Java
Another option is adding a mixin to the AjaxUpload. And perhaps attach it
to every instance using a ComponentClassTransformWorker2 eg:
https://tawus.wordpress.com/2011/08/01/tapestry-mixins-classtransformations/


Re: AjaxUpload and BeanEditContext

2015-05-29 Thread Lance Java
You can probably contribute a ComponentEventRequestFilter to the
ComponentEventRequestHandler.

I always find the diagram at the bottom of this page useful
http://tapestry.apache.org/request-processing.html


Re: AW: Getting a client side id from my component zone (used in loop)

2015-05-27 Thread Lance Java
Can you explicitly generate your own clientids?

Eg:




Java

@Property
int index;

public String getMyZoneId() {
return "foo" + index;
}


Re: unit testing Tapestry Services (5.4)

2015-05-27 Thread Lance Java
The ApplicationStateManager is injected by TapestryModule.class you will
either need to add this module to the registry or mock the service in a
test module (eg using mockito). Or, you might choose to split your own
module into smaller logical groups (eg core and web) for easier testing.

You might also find the TapestryIOCJUnit4ClassRunner useful which is
specifically designed to unit test tapestry-ioc services, examples here:

https://github.com/apache/tapestry-5/blob/master/tapestry-ioc-junit/src/test/java/org/apache/tapestry5/ioc/junit/


Re: how to access client id of the component rendered later than the current one

2015-05-23 Thread Lance Java
Which component are we talking about here? Are you sure you're setting id
(not to be confused with t:id, the serverside component id).


Re: how to access client id of the component rendered later than the current one

2015-05-21 Thread Lance Java
If you're solving it by explicitly setting a data attribute, why can't you
just explicitly set the id?


Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Lance Java
Can you generate the clientId yourself and pass as a parameter into both
components?

Why do you need to know the clientId? If it's for a javascript selector can
you use a data- attribute instead?


Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Lance Java
As you've discovered... Tapestry replaces field access with Binding.get()
using plastic byte code magic. You can use a local variable to avoid
multiple gets.

Eg:

@BindParameter
private GridDataSource source;

...

GridDataSource sourceCopy = source;
doStuff(sourceCopy);
doMoreStuff(sourceCopy);


Re: Grid mixin: grid datasource get instancied on each use

2015-05-20 Thread Lance Java
The initial render of the grid occurs on a different request to the
"export" event. Tapestry does not maintain state between requests (unless
you explicitly @Persist which i wouldn't recommend).

Therefore it's perfectly reasonable for the GridDataSource to be invoked
once for the initial html render and again for the export.


Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Lance Java
Possibly a much simpler option is to explicitly provide a clientId




Re: how to access client id of the component rendered later than the current one

2015-05-20 Thread Lance Java
Can you include your template? Perhaps the two components are not within
the same heartbeat.

Depending on your use case, you might need a container component to invoke
a method on a child at some later stage. Take a look at parallel /
parallelContainer for inspiration

http://t5stitch-lazan.rhcloud.com/paralleldemo


Re: how to access client id of the component rendered later than the current one

2015-05-19 Thread Lance Java
Take a look at the Label component which uses @HeartbeatDeferred


Re: Grid mixin: grid datasource get instancied on each use

2015-05-15 Thread Lance Java
I'm not entirely sure the problem but it's likely caused by @BindParameter
which is likely invoking the binding each access.

Try

@InjectContainer Grid grid;

And grid.getDataSource().

This will give you an instance of CachingDataSource which should have the
lazy behaviour you want.


Re: JumpStart Edit example - prepareForSubmit event handler

2015-05-11 Thread Lance Java
I haven't really been following this thread... But tapestry uses byte code
manipulation magic to change component properties to PerThreadValues which
means the actual member variables are unused.

In development mode, tapestry mirrors the values to the member variables to
make debugging easier. In production mode this mirroring does not occur.


RE: Detect jqXHR.abort()

2015-05-08 Thread Lance Java
That looks like a really old version of jetty, try jetty 8 or 9.
On 8 May 2015 18:00, "Svein Erik Løken"  wrote:

> Fiddler2 reports that the request is aborted most of the time. But some
> request gets this warning from Fiddler2:
>
>
>
> 369 Content-Length mismatch: Request Header indicated 95 876 bytes,
> but client sent 65 536 bytes.
>
> 369 Failed to obtain request body. System.IO.InvalidDataException
> The request body did not contain the specified number of bytes. Got 65536,
> expected 95876
>
>
>
> This is the situation where _state = -13 and RequestParameter is null.
> The request should be thrown and never call any methods which can lead
> to unexpected result. Isn't this a security issue too?
>
>
>
> Maybe this is a jetty bug?
>
>
>
>
>
> <*groupId*>org.mortbay.jetty
> <*artifactId*>maven-jetty-plugin
> <*version*>6.1.16
>
>
>
> *From:* Lance Java [via Apache Tapestry Mailing List Archives] [mailto:
> ml-node+s1045711n5730616...@n5.nabble.com]
> *Sent:* 8. mai 2015 17:43
> *To:* Svein
> *Subject:* RE: Detect jqXHR.abort()
>
>
>
> Ah, sorry... It looks like the browser actually closes the connection on
> abort which is resulting in a partial request being sent to the server. I
> have no idea how to detect this (possibly different per container too).
>
> Since you've found a solution which doesn't abort I'd use that.
>
> Cheers,
> Lance.
>
> --
>
> *If you reply to this email, your message will be added to the discussion
> below:*
>
>
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Detect-jqXHR-abort-tp5730595p5730616.html
>
> To unsubscribe from users@tapestry.apache.org Mailing List Archives, click
> here
> <
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2375125&code=c3ZlaW5AamFjaWxsYS5ub3wyMzc1MTI1fC0xNTM4NzY2ODg4
> >
> .
> NAML
> <
> http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
> >
>


RE: Detect jqXHR.abort()

2015-05-08 Thread Lance Java
Ah, sorry... It looks like the browser actually closes the connection on
abort which is resulting in a partial request being sent to the server. I
have no idea how to detect this (possibly different per container too).

Since you've found a solution which doesn't abort I'd use that.

Cheers,
Lance.


Re: AW: Differences between prepareForRender and prepare - What kind of code goes where

2015-05-08 Thread Lance Java
http://tapestry.apache.org/5.3/apidocs/org/apache/tapestry5/EventConstants.html


Re: AW: Differences between prepareForRender and prepare - What kind of code goes where

2015-05-08 Thread Lance Java
onPrepare() any setup that should happen on render AND submit

onPrepareForSubmit() submit only setup

onPrepareForRender() render only setup
 On 8 May 2015 14:46, "Poggenpohl, Daniel" <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hi,
>
> I know of this page, but I can't seem to find the answer for "What kind of
> code would or would you not put in each handler?" there.
>
> Regards,
> Daniel P.
>
> -Ursprüngliche Nachricht-
> Von: Lance Java [mailto:lance.j...@googlemail.com]
> Gesendet: Freitag, 8. Mai 2015 15:03
> An: Tapestry users
> Betreff: Re: Differences between prepareForRender and prepare - What kind
> of code goes where
>
>
> http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>


Re: Differences between prepareForRender and prepare - What kind of code goes where

2015-05-08 Thread Lance Java
http://jumpstart.doublenegative.com.au/jumpstart/examples/navigation/whatiscalledandwhen


Re: ActionLink event handlers in Parent Page causing errors in Child

2015-05-08 Thread Lance Java
Tapestry validates all onXFromY() handlers to ensure that all Y's actually
exist. In your case, it looks like Y does not exist in the child page since
a different tml page is used. I can only assume this validation was
introduced after 5.0.

I consider actionlink to be deprecated, you should use eventlink instead
which is better for reuse as it allows different components to emit the
same event. If you were to switch to eventlink and use different events for
the two cases, the handler could exist on the parent page without failing
validation.


Re: Detect jqXHR.abort()

2015-05-07 Thread Lance Java
The server will know about an aborted request as it's too late, the request
has already been sent. Abort is a clientside concept AFAIK which stops the
client from waiting for the response / processing it.


Re: New service configuration type

2015-05-05 Thread Lance Java
Ok, so you don't think it should be a core concept but you also don't want
to build the tree yourself? Something's gotta give!

It's probably best to define the interface you'd like to interact with /
contribute to. I'm sure there's a tapestry-ioc friendly way to achieve what
you want.


Re: New service configuration type

2015-05-05 Thread Lance Java
I'm not convinced that this should be a core concept as it's likely to be
different case by case. The TypeCoercer and it's CoercionTuple are another
example of a tree like structure being built by an UnorderedConfiguration.

https://tapestry.apache.org/type-coercion.html
On 4 May 2015 13:14, "Charlouze"  wrote:

> Thanks for your input Lance, you pictured what i had in mind when i was
> talking about the workaround.
>
> But i want to know if adding a configuration type is something that is
> doable ?
>
> Le lun. 4 mai 2015 à 13:51, Lance Java  a
> écrit :
>
> > You could probably achieve this with an OrderedConfiguration
> >
> > Eg:
> >
> > public interface NodeConfig() {
> >public String getName();
> >public String getParentName(); //optional
> >public List getChildNames(); // optional
> > }
> >
> > After all contributions, you could build a tree of nodes by calculating
> > actual children combining getParentName() with getChildNames() where
> > appropriate. You could contribute multiple times to the same Node.
> >
>


Re: New service configuration type

2015-05-04 Thread Lance Java
You could probably achieve this with an OrderedConfiguration

Eg:

public interface NodeConfig() {
   public String getName();
   public String getParentName(); //optional
   public List getChildNames(); // optional
}

After all contributions, you could build a tree of nodes by calculating
actual children combining getParentName() with getChildNames() where
appropriate. You could contribute multiple times to the same Node.


Re: Exception "Parameter 'translate' of component is bound to null" on a field that has no 'translate' attribute.

2015-04-30 Thread Lance Java
If you want tapestry to use your translator as the default for all dates
you should contribute to TranslatorSource using a class (instead of
contributing by name to TranslatorAlternativesSource).

Otherwise, you could annotate individual date fields with
@Translate("dateTranslator") and leave your code as is.


Re: Customized display/edit blocks for components other than the grid

2015-04-30 Thread Lance Java
Are you aware that BeanEditor, BeanEditForm and BeanDisplay all obey the
BeanBlockSource?


Re: [T5.4] Problem with form fields in a loop

2015-04-30 Thread Lance Java
The problem is that the same field is reused for each loop iteration. See
here for a workaround using a FieldSnapshot to record the errors.

http://t5stitch-lazan.rhcloud.com/mapbindingdemo


Re: File upload with Tapestry-Stitch ProgressTask

2015-04-28 Thread Lance Java
I think you'd override the MultopartDecoder service by extending
MultipartDecoderImpl and implementing a custom createFileUpload(). You
could then call ServletFileUpload.setProgressListener(...) with a custom
listener.

The progress listener could store the bytes/percentage finished in a
session attribute the. You'd then have to start a clientside poll which
continues until 100%.

Sounds like a fun task, let me know if you have any success.


Re: Handle specific bubbled up validate event

2015-04-28 Thread Lance Java
The page sees the component as a black box and doesn't know about its
internal component structure. This encapsulation is by design. If you want
more specific events you'll need to trigger them from your component.


Re: jQuery/autocomplete

2015-04-27 Thread Lance Java
Hi Geoff, as stated on the demo, the observe mixin was inspired by zone
updater but with a few very handy differences:

1. Developers don't need to deal with request parameters. These are
converted to more user friendly event arguments.

2. You can pass multiple clientside field values. In the jump-start example
you could get rid of the @persist usage with this feature.

3. Optional context, you can use the same serverside event for multiple
observe instances or pass the loop index etc.

I realise that jumpstart has far greater kudos than stitch. Would you
consider adding these features to jumpstart?


Re: jQuery/autocomplete

2015-04-27 Thread Lance Java
Is your autocomplete a select component? If so you can set the 'zone'
attribute and handle the 'onChanged' event to update the zone.

There's also the observe mixin from tapestry-stitch (
http://t5stitch-lazan.rhcloud.com/observedemo). Note: This will require a
javascript tweak to work with jquery (currently prototype specific).


Re: Activation event handler regression after upgrading from 5.4-beta-22 to 5.4-beta-31

2015-04-22 Thread Lance Java
Possibly a sign you should be using composition instead of inheritance ;)


Re: Localise a page link

2015-04-20 Thread Lance Java
I think you can @Inject ThreadLocale and call ThreadLocale.setLocale(xxx).
 On 20 Apr 2015 10:09, "Geoff Callender" <
geoff.callender.jumpst...@gmail.com> wrote:

> I'm generating a page link with PageRenderLinkSource. No problem. Now I'd
> like to generate it for a specific locale.
>
> I've tried using LocalizationSetter#setNonPersistentLocaleFromLocaleName
> immediately before PageRenderLinkSource#createPageRenderLinkWithContext ,
> but it has no effect.
>
> The aim is to produce a PDF in a specific language with PhantomJS.
> PhantomJS is run in a command, with my page URL as a parameter. Without the
> locale in the URL, the page prints in the default language.
>
> Geoff
>
>


Re: "Parallel" component rendering

2015-04-18 Thread Lance Java
Updating this thread for future googlability. See this example for
executing work in parallel whilst rendering

http://t5stitch-lazan.rhcloud.com/paralleldemo


Re: parallel remote requests in Tapestry

2015-04-18 Thread Lance Java
This sounded like a fun challenge so I implemented it in tapestry-stitch
Demo here with source code: http://t5stitch-lazan.rhcloud.com/paralleldemo
Rendering all happens on the request thread, workers are invoked in
parallel.

Enjoy!


Re: Tapestry 5.4 bytecode manipulation

2015-04-17 Thread Lance Java
On second thought... Why would you want to swap out the the bytecode
provider?

With clientside javascript it makes sense to choose the provider since you
will be directly using jquery or prototype in your own code. Having a
single provider reduces the scripts downloaded by the client.

But with plastic, the whole idea is that you can do everything in plastic
and never need to reference the provider directly (ie ASM). Plastic
actually repackages ASM so that another library can include ASM without
conflicting. So, as a plastic user you don't need to care about the ASM
usage at all.


Re: Tapestry 5.4 bytecode manipulation

2015-04-17 Thread Lance Java
In theory, that's possible. Tapestry doesn't reference ASM classes, it's
only dependency is plastic. So in theory you could have a layer in plastic
to choose ASM or javassist as the "provider" (or another byte code
library).

I'd doubt that this is high priority for the tapestry team. I seem to
recall Howard mentioning that javassist was buggy and updates were very
slow to be implemented compared to ASM.

Perhaps if plastic was broken into it's own separate project outside of the
core tapestry source tree, the open source community could tweak it to be a
"provider agnostic" byte code manipulation language in a similar vein to
slf4j.


Re: parallel remote requests in Tapestry

2015-04-15 Thread Lance Java
For this to work, I think the actual rendering needs to happen on the
request thread.

See the gist here: https://gist.github.com/anonymous/379b3aae199147684841

By using the parallel component you can ask for an Invokable (which does
the 'work') and a binding (the property to set).
You would provide a body template for each 'parallel' instance which
ultimately references the property
The parallelContainer component would orchestrate the whole thing (using an
environmental)

1. Invokables are fired in parallel
2. Once all invokables have finished, the bindings is set with the result
(on the request thread)
3. Once the binding is set, the body (of each parallel component) can be
renderered (on the request thread)


Re: Grid and initial sort mixin Tapestry 5.4-beta28

2015-04-08 Thread Lance Java
Does this help?

http://stackoverflow.com/questions/18959365/tapestry-grid-default-sorting


Re: Refreshing tapestry grid content from another component.

2015-04-07 Thread Lance Java
> I tried triggering
resources.triggerEvent(InternalConstants.GRID_INPLACE_UPDATE,null, null);
from onUpEvent, that trigger from an event link inside the grid. But that
didn't seem to work

This is a common misconception. Your eventlink "inside" the grid is not a
child of the grid so the event won't bubble up to the grid. GridRows and
GridColumns are children of the grid component, blocks defined in your page
are not. This can be counterintuitive sometimes because the eventlink is a
child in the clientside dom/html but not in the serverside component model.


Re: Startup service needs Request

2015-04-03 Thread Lance Java
Correction, I meant getServletContext() not getServletRequest()
On 4 Apr 2015 07:37, "Lance Java"  wrote:

> @Inject ApplicationGlobals instead and call
> getServletRequest().getContextPath()
>


Re: Startup service needs Request

2015-04-03 Thread Lance Java
@Inject ApplicationGlobals instead and call
getServletRequest().getContextPath()


Re: SoftReferences to PageImpl can cause performance problems

2015-04-02 Thread Lance Java
You don't need to build the tapestry source.

Create a custom PageSource implementation by copy / paste / tweaking
PageSourceImpl (lookup source on github) and removing SoftReference usage.
Then use tapestry ioc to override the builtin PageSource service with your
custom impl.


Re: Can't access generate HTML file (probably not Tapestry-specific)

2015-03-26 Thread Lance Java
I don't really understand why you need the temp files? The normal approach
is to store the static template files somewhere (classpath or database etc)
but never actually store the merge results (template merged with context).

I think you should provide a page which returns a StreamResult which is the
merged html and serve that page in your iframe. No temp files needed, just
generate on the fly.

If you decide you want to cache the results to disk, use one of the many
cache implementations out there rather than rolling your own.
On 23 Mar 2015 22:51, "Poggenpohl, Daniel" <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello,
>
> perhaps you people can help me...my application has various resources
> deployed. Among them are a kind of HTML template files. I take the files,
> replace part of the contents of the file according to a certain syntax, and
> want to display the resulting html file in an iframe on a Tapestry page.
>
> To do this, I am currently creating temporary html files. I use the
> createTempFile method of java.nio.Files. Those temporary files are thus
> stored locally on each user's pc. But when I want to display the generated
> HTML file, I have to use File:// as a prefix, which probably
> doesn't work with my browser.
>
> How would you create temporary files inside the servlet container so that
> you could access them using ServletContext or whatever necessary?
>
> Regards,
> Daniel
>
> --
> Dipl. Inf. Daniel Poggenpohl, Fraunhofer-Institut für Software- und
> Systemtechnik ISST
> Compliance- und Sicherheitslösungen
> Emil-Figge-Straße 91, 44227 Dortmund, Germany
> Telefon: +49 (0) 231 / 9 76 77-323
> mailto: daniel.poggenp...@isst.fraunhofer.de daniel.poggenp...@isst.fraunhofer.de>
> http://www.isst.fraunhofer.de
>
>


Re: how to escape {{ symbols?

2015-03-23 Thread Lance Java
I'm guessing you could override the PageElementFactory with a custom
implementation. You could extend PageElementFactoryImpl and override
newExpansionElement. I'm guessing you might wrap Binding.get() to escape
"{{" if the binding type is String.
 On 19 Mar 2015 15:36, "Тимур Бухараев"  wrote:

> I use AngularJS and Tapestry 5.3 in my web project.
>
> The problem is next:
> 1. User inputs some data in text field, for example his profile
> description, and post it to server.
> 2. Profile description renders with tapestry variable:
> $description
> 3. if $description contains some text like this "{{
> alert("Hehe!"); }}", AngularJS starts interpret this, and
> it is a big security problem.
>
> Tapestry escapes standard html symbols: < replaces with < and so on. So
> if user inputs some html tags, tapestry decorates it and it is great. I
> want replace '{' symbol with {
>
> I found class AbstractMarkupModel in source, which doing this decorating
> work.
>
> The question is: how replace behavior of AbstractMarkupMode.encode to
> support decoration of {{ symbol?
>


Re: Tapestry 5.4 JavaScript support .... support request

2015-02-24 Thread Lance Java
You might be interested in the griddecorator mixin from tapestry-stitch

See the example here which adds a context sensitive alert to the "onclick"
of every row

https://t5stitch-lazan.rhcloud.com/griddecoratordemo
On 23 Feb 2015 18:39, "Poggenpohl, Daniel" <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello everyone,
>
> I'm trying to add some functionality to a grid:
>
> Every grid row should be an area where you can click to go to the details
> page of the row object.
>
> But enough of that, even a simple javascript like alert on click doesn't
> seem to work.
>
> The js is added via jss.addScript(), which is deprecated in 5.4 . Doing it
> this way doesn't seem to work. What happens is I apply the script via a
> @MixinAfter mixin in an afterRender-method and the page containing the grid
> displays the loading spinnerfor eternity.
>
> The javadoc says I should use modules and RequireJS. Is there an existing
> example how to do this?
>
> The project uses jquery as the provider.
>
> Regards,
> Daniel Poggenpohl
>


Re: AW: PDF Viewer component

2015-02-19 Thread Lance Java
Java
@Inject
private ComponentResources resources;

public void getPdfLink() {
   return resources.createPageLink("path/to/pdfpage", "someContext");
}

TML



Re: PDF Viewer component

2015-02-19 Thread Lance Java
Use an iframe to load the StreamResponse page embedded in an html page.
On 19 Feb 2015 13:35, "Poggenpohl, Daniel" <
daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello,
>
> I am trying to build a component which can be embedded in a page and has a
> path parameter. If the parameter is set, the component should show/render
> the file contents (a pdf). The StreamResponse class allows me to create a
> page containing a pdf that can be viewed. Is it possible to embed a viewer
> component in a page or does it depend on browser functionality so that I
> can't embed it?
>
> Regards,
> Daniel P.
>


Re: How to get container inside self written component

2015-02-19 Thread Lance Java
> Its working now as long my form components not rendered in loops or grids

Hmm... I'd call that broken ;)


Re: AW: How to get container inside self written component

2015-02-16 Thread Lance Java
In my opinion, @InjectContainer is a bit fragile. I think you're much
better off using the Environment or a component parameter. Let's consider a
future case where you want to render the child component in a loop (or
maybe an 'if' component). In this case the parent will be the loop/if and
it won't work without refactoring.
On 13 Feb 2015 19:11, "Thiago H de Paula Figueiredo" 
wrote:

> On Fri, 13 Feb 2015 16:44:52 -0200, Poggenpohl, Daniel <
> daniel.poggenp...@isst.fraunhofer.de> wrote:
>
>  Hello,
>> why don't you try @InjectContainer? Or give the necessary information via
>> parameters to the inner component?
>>
>
> Yep, an @InjectContainer private Object parentComponent; field will give
> you the parent component. You can change the field type and name, of
> course. :)
>
> I agree 200% with Daniel: you should avoid manipulating the parent
> component directly as much as possible, as you're coupling one component to
> another, making the inner one just working when used inside a given other
> component.
>
> You can pass information through parameters (recommended) or the
> Environment service (when parameters aren't enough).
>
> Cheers!
>
> --
> 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: Checkbox value for zone update

2015-01-26 Thread Lance Java
I'm guessing you have a javascript error on your page.

Are you using jquery or prototype? tapestry-stitch only works for
prototype. You'll need to tweak observe. js to get it to work with jquery
(eg observe() changed to on() etc)
On 26 Jan 2015 09:17, "Stephan Windmüller" <
stephan.windmuel...@tu-dortmund.de> wrote:

> On 23.01.2015, schrieb Lance Java wrote:
>
> > You could use the observe mixin from tapestry stitch. The mixin can fire
> a
> > zone update based on the change event, the current checkbox value can be
> > sent as the event context.
>
> Hey Lance,
>
> your project sounds very promising, thanks for the hint. But are you
> sure that is works with checkboxes? According to Chrome, there is no
> event listener registered for "change" with this code:
>
>
>  t:mixins="stitch/observe"
> clientEvent="click"
> event="updateLength"
> zone="resultZone"/>
>
> - Stephan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Checkbox value for zone update

2015-01-23 Thread Lance Java
You could use the observe mixin from tapestry stitch. The mixin can fire a
zone update based on the change event, the current checkbox value can be
sent as the event context.

http://t5stitch-lazan.rhcloud.com/observedemo
On 23 Jan 2015 12:33, "Stephan Windmüller" <
stephan.windmuel...@tu-dortmund.de> wrote:

> Hello,
>
> according to the Tapestry documentation, zones cannot be updated by
> checkboxes. I found some information on this topic, primarily in this
> mailing list, for how to circumvent this problem.
>
> My current approach is to use tapestry5-jquery:
>
>
>  value="ignoreLengthSelected"
> t:mixins="jquery/bind"
> bind.event="lengthChange"
> bind.eventtype="change"
> bind.zone="resultZone"/>
>
> public Object onValueChange() {
> return resultZone.getBody();
> }
>
>
> However, I do not know how to access the value of the checkbox.
> Injecting the component does not help because it does not provide
> methods to read the state. Adding a parameter to onValueChange also does
> not work.
>
> Does anyone know how to use a checkbox this way?
>
> TIA
>  Stephan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: PageRenderLinkSource failing in service when called by cron scheduler - Unable to delegate method invocation to property

2015-01-22 Thread Lance Java
Perhaps tapestry-offline could help
https://github.com/uklance/tapestry-offline
 On 20 Jan 2015 09:24, "George Christman"  wrote:

> I'm using T5 beta-25 and I have the following code and I'm noticing
> when the scheduler fires off my service, my PageRenderLinkSource does
> not work. If I manually fire it off through the admin with an
> actionlink, it works without issue.
>
> AppModule.class
>
> @Startup
> public static void initApplication(SchedulerService scheduler) {
> scheduler.init();
> }
>
> SchedulerService.class
>
> executor.addJob(new CronSchedule("0 09 4 * * ?"),
> "Cleanup Listings", () -> {
> try {
> System.out.println("sitemap");
> sitemap.buildSitemap();
> } catch (JAXBException | IOException ex) {
>
> Logger.getLogger(SchedulerServiceImpl.class.getName()).log(Level.SEVERE,
> null, ex);
> }
> });
>
>
> SitemapService.class
>
>private final PageRenderLinkSource linkSource;
>
> public SitemapImpl(PageRenderLinkSource linkSource) {
> this.linkSource = linkSource;
> }
>
> private void setSitemapXML(Class clazz, UrlSet urlset, Object[] object)
> {
> SitemapXML siteMapXML = new SitemapXML();
> System.out.println("link");
>
> Link link = linkSource.createPageRenderLinkWithContext(clazz,
> object);
> System.out.println(link.toAbsoluteURI());
>
> link.setSecurity(LinkSecurity.SECURE);
> siteMapXML.setChangefreq(ChangeFreq.ALWAYS.toString());
> siteMapXML.setLoc(link.toAbsoluteURI());
> siteMapXML.setPriority(0.5);
> urlset.getSitemaps().add(siteMapXML);
> }
>
> I'm seeing the following exception
> java.lang.NullPointerException: Unable to delegate method invocation
> to property 'request' of  RequestGlobals(org.apache.tapestry5.services.RequestGlobals)>, because
> the property is null.
>
> Any idea why this isn't working?
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Tapestry and Clojure

2014-12-30 Thread Lance Java
The logger is not a service and cannot be @Injected into IOC services.

You have probably seen that you can @Inject the logger into pages and
components. @Inject has been extended (perhaps hijacked) for components and
@Injected values can come from contributed InjectionProviders. See
CommonResourcesInjectionProvider for the Logger implementation.

More info here http://tapestry.apache.org/injection-in-detail.html
On 28 Dec 2014 11:16, "Ilya Obshadko"  wrote:

> On Sun, Dec 21, 2014 at 10:22 PM, Thiago H de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
> > On Thu, 18 Dec 2014 20:01:11 -0200, Ilya Obshadko <
> ilya.obsha...@gmail.com>
> > wrote:
> >
> >  One more question regarding ObjectLocator.
> >> Turns out it cannot resolve services like Logger, complaining that no
> >> service implements its interface.
> >> Could you suggest how to solve it?
> >>
> >
> > Have you tried getObject() instead of getService()? Logger isn't a
> > Tapestry-IoC service (unless you create it, of course), so you cannot use
> > getService() to get it.
> >
>
> getObject() on ObjectLocator service instance doesn't work as well. Are
> there any other methods to obtain logger service instance?
>
> --
> Ilya Obshadko
>


RE: Hibernate session tapestry atmosphere

2014-11-30 Thread Lance Java
tapestry-lanceuk-comet? lance-atmosphere? LOL... where do you guys come up
with this stuff?

It's tapestry-cometd or tapestry-atmosphere.


Re: alternative to tb/pager in T5.4

2014-11-29 Thread Lance Java
You might be interested in this
http://t5stitch-lazan.rhcloud.com/pagerdemo


RE: Adding chat rooms

2014-11-27 Thread Lance Java
> Do I have your permission for it?
I don't mind what you do with the libraries, fork away! If you come up with
something interesting / useful I'd be interested to hear about it.


Re: Adding chat rooms

2014-11-25 Thread Lance Java
I haven't actually written a chat module per se. I've written two libraries
that support push/comet (namely tapestry-atmosphere [1] and tapestry-cometd
[2]), both of which have a chat demo.

Which one of these libraries are you using?

Note: tapestry-atmosphere has a live demo of a multi-room chat running at
http://t5atmosphere-lazan.rhcloud.com/chatdemo

[1] https://github.com/uklance/tapestry-atmosphere
[2] https://github.com/uklance/tapestry-cometd


On 25 November 2014 at 11:48, Name Surname 
wrote:

> I am using chat room module from Lance and I would like to make more chat
> rooms, not just one. Can it be done?
>


Re: tapestry-hibernate session.save not working in service

2014-11-21 Thread Lance Java
I'm guessing you need to commit a transaction.

Either:
HibernateSessionManager.commit()

Or:
Session.getTransaction().commit()

Or:
@CommitAfter


Re: tapestry-katcha Failing

2014-11-18 Thread Lance Java
When the kaptcha is generated, the generated key is stored in the session
for verification. I'm guessing the session is lost between initial display
and verification. From memory your jsessionid is a cookie value. Are you
switching domains or something?

I'd inspect the request headers and make sure the jsessionid cookie header
is consistent between kaptcha view and verification.
 On 18 Nov 2014 21:02, "George Christman"  wrote:

> Hmm, I don't use sticky sessions, but why do you think this would be
> happening all of a sudden? btw lance, how does this work, is it suppose to
> store some type of cookie?
>
> On Tue, Nov 18, 2014 at 1:25 PM, Lance Java 
> wrote:
>
> > I'm guessing this is a session issue. Perhaps a session cookie issue? Or
> > clustering / session replication issue?
> >  On 18 Nov 2014 14:06, "George Christman" 
> wrote:
> >
> > > Yesterday I appeared to be having a lot of failures with kaptcha.
> > Sometimes
> > > the image would appear and sometimes it wouldn't. When it did appear,
> it
> > > would always fail saying the text didn't match even though it did. I
> > ended
> > > up just removing it until I could figure out the cause of it's failure.
> > It
> > > appears to have worked perfectly up until yesterday and the only thing
> I
> > > can think of is I upgraded Guava to a newer version, but other than
> that
> > I
> > > don't see where I made any changes. I followed the source back to
> > > com.google.code.kaptcha, but that was as far as I was able to get. Does
> > > someone know what might be causing kaptcha to fail like this?
> > >
> >
>
>
>
> --
> George Christman
> CEO
> www.CarDaddy.com
> P.O. Box 735
> Johnstown, New York
>


Re: tapestry-katcha Failing

2014-11-18 Thread Lance Java
I'm guessing this is a session issue. Perhaps a session cookie issue? Or
clustering / session replication issue?
 On 18 Nov 2014 14:06, "George Christman"  wrote:

> Yesterday I appeared to be having a lot of failures with kaptcha. Sometimes
> the image would appear and sometimes it wouldn't. When it did appear, it
> would always fail saying the text didn't match even though it did. I ended
> up just removing it until I could figure out the cause of it's failure. It
> appears to have worked perfectly up until yesterday and the only thing I
> can think of is I upgraded Guava to a newer version, but other than that I
> don't see where I made any changes. I followed the source back to
> com.google.code.kaptcha, but that was as far as I was able to get. Does
> someone know what might be causing kaptcha to fail like this?
>


  1   2   3   4   5   6   7   8   9   10   >