Discussion:
Questions with Tapestry from a GWT developer's perspective
Xybrek
2011-12-02 07:44:00 UTC
Permalink
Hello,

I am really new to Tapestry, I just want to ask some questions before I
embark deeper with the framework (although I like T5 already)

My background is with GWT and jQuery, which in GWT, there is a thick UI
which communicates to the server through RPC to get data.

GWT is just the same with jQuery only that it uses Java-to-Javascript
and ajax calls are through RPC (at least for the most part)

With jQuery however, its much more low-level (I mean Javascript) we do
things in Javascript. Calls to the server and page manipulation.

However, with Tapestry it seems that the page is rendered from the
server side (which is pretty cool--like PHP)

So I wonder, how to deal with components with T5? In GWT I can create a
simple button and some textbox to create a form, style it with CSS. Add
some handlers to get text inputs and pass it on to the server.

With GWT create the whole web application by defining EntryPoints which
is a rendered page, which contains components I can style with CSS and
add function on the page that will pass data back and forth the UI and
the server.

I don't want to discuss details on how to do this with Tapestry I just
want to get some ideas as to which are possible and not possible with
the framework.

Can I create my own components and forms with my own CSS or there is a
set of components that can only be used?

Cheers.
Xybrek


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Jon Williams
2011-12-02 07:57:43 UTC
Permalink
Absolutely simple to make your own components with custom css. Hooks for
jQuery included too. Go boldly forward Xman!
Post by Xybrek
Hello,
I am really new to Tapestry, I just want to ask some questions before I
embark deeper with the framework (although I like T5 already)
My background is with GWT and jQuery, which in GWT, there is a thick UI
which communicates to the server through RPC to get data.
GWT is just the same with jQuery only that it uses Java-to-Javascript and
ajax calls are through RPC (at least for the most part)
With jQuery however, its much more low-level (I mean Javascript) we do
things in Javascript. Calls to the server and page manipulation.
However, with Tapestry it seems that the page is rendered from the server
side (which is pretty cool--like PHP)
So I wonder, how to deal with components with T5? In GWT I can create a
simple button and some textbox to create a form, style it with CSS. Add
some handlers to get text inputs and pass it on to the server.
With GWT create the whole web application by defining EntryPoints which is
a rendered page, which contains components I can style with CSS and add
function on the page that will pass data back and forth the UI and the
server.
I don't want to discuss details on how to do this with Tapestry I just
want to get some ideas as to which are possible and not possible with the
framework.
Can I create my own components and forms with my own CSS or there is a set
of components that can only be used?
Cheers.
Xybrek
------------------------------**------------------------------**---------
François Facon
2011-12-02 08:30:04 UTC
Permalink
Hi
A Demo that use Tapestry and JQuery http://tapestry5-jquery.com/
How to contib a new component for this Lib
https://github.com/got5/tapestry5-jquery/wiki/Creating-a-component-mixin-for-tapestry5-jquery

aslo a great contib to use GWT with Tapestry
http://code.google.com/p/trsvax-gmt/
check also http://jumpstart.doublenegative.com.au/jumpstart/ to learn
Tapestry by sample.

See U
François
Post by Jon Williams
Absolutely simple to make your own components with custom css. Hooks for
jQuery included too. Go boldly forward Xman!
Post by Xybrek
Hello,
I am really new to Tapestry, I just want to ask some questions before I
embark deeper with the framework (although I like T5 already)
My background is with GWT and jQuery, which in GWT, there is a thick UI
which communicates to the server through RPC to get data.
GWT is just the same with jQuery only that it uses Java-to-Javascript and
ajax calls are through RPC (at least for the most part)
With jQuery however, its much more low-level (I mean Javascript) we do
things in Javascript. Calls to the server and page manipulation.
However, with Tapestry it seems that the page is rendered from the server
side (which is pretty cool--like PHP)
So I wonder, how to deal with components with T5? In GWT I can create a
simple button and some textbox to create a form, style it with CSS. Add
some handlers to get text inputs and pass it on to the server.
With GWT create the whole web application by defining EntryPoints which is
a rendered page, which contains components I can style with CSS and add
function on the page that will pass data back and forth the UI and the
server.
I don't want to discuss details on how to do this with Tapestry I just
want to get some ideas as to which are possible and not possible with the
framework.
Can I create my own components and forms with my own CSS or there is a set
of components that can only be used?
Cheers.
Xybrek
------------------------------**------------------------------**---------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Thiago H. de Paula Figueiredo
2011-12-02 11:23:47 UTC
Permalink
Post by Xybrek
Hello,
Hi!
Post by Xybrek
I am really new to Tapestry, I just want to ask some questions before =
I =
Post by Xybrek
embark deeper with the framework (although I like T5 already)
Welcome! :)
Post by Xybrek
However, with Tapestry it seems that the page is rendered from the =
server side (which is pretty cool--like PHP)
Absolutely right. I wouldn't compare Tapestry and PHP because one is a =

framework based on Java and the other is a programming language but yes,=
=

HTML rendered server-side.
Post by Xybrek
So I wonder, how to deal with components with T5?
Quite easy. Create a class in the components page, create a template for=
=

it (optional, but very typical). You can also create CSS and JavaScript =
=

files specifically for it and make Tapestry include them automatically b=
y =

using the @Import annotation.

GWT and Tapestry are veeeeeeeeeeeeeeeeeeeeeeeeeeeeeery different =

frameworks. GWT is single-page and basically a client-side whole webapp =
in =

a single page, but provides hooks to communicate with server-side things=
. =

Tapestry is multi-page and basically server-side, but provides some =

JavaScript things and hooks to client-side code.
Post by Xybrek
In GWT I can create a simple button and some textbox to create a form,=
=
Post by Xybrek
style it with CSS. Add some handlers to get text inputs and pass it on=
=
Post by Xybrek
to the server.
Same for Tapestry, but implemented in a very different way.
Post by Xybrek
With GWT create the whole web application by defining EntryPoints whic=
h =
Post by Xybrek
is a rendered page,
Tapestry is completely different in this case. There are no entry points=
: =

instead, you have pages and, for some specific cases, dispatchers.
Post by Xybrek
which contains components I can style with CSS and add function on the=
=
Post by Xybrek
page that will pass data back and forth the UI and the server.
Same for Tapestry, but implemented in a very different way.
Post by Xybrek
Can I create my own components and forms with my own CSS
Yes! ;) In Tapestry, creating components is so easy you do that all the =
=

time.

Check Tapestry JumpStart =

(http://jumpstart.doublenegative.com.au/jumpstart/), specially the =

Creating Components section, and Tapestry Magic =

(http://tawus.wordpress.com/) for examples.

-- =

Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,=
=

and instructor
Owner, Ars Machina Tecnologia da Informa=C3=A7=C3=A3o Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Xybrek
2011-12-02 15:54:14 UTC
Permalink
Post by Thiago H. de Paula Figueiredo
Post by Xybrek
Hello,
Hi!
Post by Xybrek
I am really new to Tapestry, I just want to ask some questions before
I embark deeper with the framework (although I like T5 already)
Welcome! :)
Post by Xybrek
However, with Tapestry it seems that the page is rendered from the
server side (which is pretty cool--like PHP)
Absolutely right. I wouldn't compare Tapestry and PHP because one is a
framework based on Java and the other is a programming language but
yes, HTML rendered server-side.
Yah, that's what I mean. However I am not sure if with Tapestry I can
implement a way to process URL parameters such that the rendered page is
based on the URL parameter, like: http://mypage.com/user123 where,
user123 is a user id that is when accessed the rendered page will be
the user page. Something like that.
Post by Thiago H. de Paula Figueiredo
Post by Xybrek
So I wonder, how to deal with components with T5?
Quite easy. Create a class in the components page, create a template
for it (optional, but very typical). You can also create CSS and
JavaScript files specifically for it and make Tapestry include them
I see, thanks for the tip. Do you mean in the package where Layout.java
is located?
Post by Thiago H. de Paula Figueiredo
GWT and Tapestry are veeeeeeeeeeeeeeeeeeeeeeeeeeeeeery different
frameworks. GWT is single-page and basically a client-side whole
webapp in a single page, but provides hooks to communicate with
server-side things. Tapestry is multi-page and basically server-side,
but provides some JavaScript things and hooks to client-side code.
I am not really used to server-side page, but I am trying to catch the
idea.
Post by Thiago H. de Paula Figueiredo
Post by Xybrek
In GWT I can create a simple button and some textbox to create a
form, style it with CSS. Add some handlers to get text inputs and
pass it on to the server.
Same for Tapestry, but implemented in a very different way.
I see, anyway, what I mean by that is the loose-coupling of the UI
element to the server side function ("services"). I hope Tapestry UI
elements, although server-side, is loosely couple with "services"
Post by Thiago H. de Paula Figueiredo
Post by Xybrek
With GWT create the whole web application by defining EntryPoints
which is a rendered page,
Tapestry is completely different in this case. There are no entry
points: instead, you have pages and, for some specific cases,
dispatchers.
Post by Xybrek
which contains components I can style with CSS and add function on
the page that will pass data back and forth the UI and the server.
Same for Tapestry, but implemented in a very different way.
Post by Xybrek
Can I create my own components and forms with my own CSS
Yes! ;) In Tapestry, creating components is so easy you do that all
the time.
Check Tapestry JumpStart
(http://jumpstart.doublenegative.com.au/jumpstart/), specially the
Creating Components section, and Tapestry Magic
(http://tawus.wordpress.com/) for examples.
This is cool:
http://jumpstart.doublenegative.com.au/jumpstart/examples/component/creatingcomponents

However, where do I place the CSS? In the .tml file? Or somewhere else?

Thanks for the ideas.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Barry Books
2011-12-02 12:16:57 UTC
Permalink
GWT, Tapestry and jQuery are the only web development frameworks I use now.

I really like GWT but I don't use it on public sites. I'm certain that
you can it just requires more testing effort like what happens when it
runs on an IPhone. Even when I use GWT I have a Tapestry backend
because I usually have several GWT applications with some basic HTML
support pages (especially admin pages). I've done a few sensor
monitoring applications and I use GWT and Google Visualizations for
them.

When I do Tapestry work I head down the progressive enhancement route.
I build Tapestry components to render basic HTML then I create jQuery
mixins (widgets) and add them to the basic components to create things
like a tabbed interface. Now that I use the tapestry5-jquery module I
find myself using less GWT because I think Tapestry/jQuery development
is faster and easier. BeanEditForm is your friend. If you are careful
it's pretty easy to build and app that runs on anything.

So I'd say jump right in. Worst case you'll end up using both they are
made for each other and you can impress your friends by using the
Eclipse debugger to single step from the client to server and back all
in Java.

FYI: The trsvax-gmt module is mine but I have not worked on it in a
while. It allows you to use GWT components just like Tapestry
components and you can call Tapestry event handlers from GWT.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Xybrek
2011-12-02 15:42:52 UTC
Permalink
Post by Barry Books
GWT, Tapestry and jQuery are the only web development frameworks I use now.
I really like GWT but I don't use it on public sites. I'm certain that
you can it just requires more testing effort like what happens when it
runs on an IPhone. Even when I use GWT I have a Tapestry backend
because I usually have several GWT applications with some basic HTML
support pages (especially admin pages). I've done a few sensor
monitoring applications and I use GWT and Google Visualizations for
them.
Speaking of back-end, is you back-end loosely-coupled with the
front-end, I mean, is it something like a "service", I am planning to
migrate my full-blown GWT app, with services: connect, disconnect,
createAccount, etc. all connecting to another server. However, I haven't
actually worked with "services" with Tapestry.
Post by Barry Books
When I do Tapestry work I head down the progressive enhancement route.
I build Tapestry components to render basic HTML then I create jQuery
mixins (widgets) and add them to the basic components to create things
like a tabbed interface. Now that I use the tapestry5-jquery module I
find myself using less GWT because I think Tapestry/jQuery development
is faster and easier. BeanEditForm is your friend. If you are careful
it's pretty easy to build and app that runs on anything.
I don't know much about BeanEditForm, is it customizable, I mean, when I
did the tutorial, the edit form is wrapped with a yellow box? I mean,
when I do things in GWT, a registration form is made up of a panel with
input textbox widgets on it and some button like ok and cancel. I also
included a ReCaptcha widget ;-)

I am not sure if this is "easily" achievable with Tapestry just like
with GWT.

In any case, I just want to keep the loose-coupling that I have with my
GWT app when migrating to tapestry, that is the client side code and the
server side code is separate. Or, tapestry does not work that way?
Post by Barry Books
So I'd say jump right in. Worst case you'll end up using both they are
made for each other and you can impress your friends by using the
Eclipse debugger to single step from the client to server and back all
in Java.
Yah, I still have use with GWT, especially with web apps that are like
desktop app. I mean, like those enterprise apps which can easily live in
single-page app. However, for something that is multipage and works like
most web sites, I guess I will use T5

I haven't use Eclipse debugger for "client to server", can you share
some insights?
Post by Barry Books
FYI: The trsvax-gmt module is mine but I have not worked on it in a
while. It allows you to use GWT components just like Tapestry
components and you can call Tapestry event handlers from GWT.
Yah, I tried the demo, I guess it was trsvax-gmt. However, using less
GWT is more preferable with Tapestry, Tapestry/jquery might be better.
Post by Barry Books
---------------------------------------------------------------------
Cheers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Thiago H. de Paula Figueiredo
2011-12-02 16:06:58 UTC
Permalink
Speaking of back-end, is you back-end loosely-coupled with the =
front-end, I mean, is it something like a "service", I am planning to =
=
migrate my full-blown GWT app, with services: connect, disconnect, =
createAccount, etc. all connecting to another server. However, I haven=
't =
actually worked with "services" with Tapestry.
Tapestry-IoC services are the same as what Spring and EJB call beans and=
=

are back-end code. UI components are only coupled to the back-end if you=
=

program write them that way.
I don't know much about BeanEditForm, is it customizable, I mean, when=
I =
did the tutorial, the edit form is wrapped with a yellow box?
Yes, very customizable, and the styles are overridable by CSS.
I mean, when I do things in GWT, a registration form is made up of a =
panel with input textbox widgets on it and some button like ok and =
cancel. I also included a ReCaptcha widget ;-)
Tapestry users component composition, just like you described. =

BeanEditForm creates a full form, but you can use BeanEditor to quickly =
=

and easily generate form fields for the properties of a class.
I am not sure if this is "easily" achievable with Tapestry just like =
with GWT.
Yes.
In any case, I just want to keep the loose-coupling that I have with m=
y =
GWT app when migrating to tapestry, that is the client side code and t=
he =
server side code is separate. Or, tapestry does not work that way?
Tapestry works that way. Of course, the code you write needs to be =

loosely-coupled too. ;) Anything Tapestry provides out-of-the-box is *no=
t* =

coupled with anything in the back-end (which I'm considering here to be =
=

services, beans, databases, anything that isn't purely UI).

I guess the difficulty you'll eventuall have with Tapestry isn't with =

Tapestry itself, but for coming from a GWT background. It would be the =

same if you were learning any other non-GWT, non-Echo2, non-Echo3, =

non-single page web framework.

-- =

Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,=
=

and instructor
Owner, Ars Machina Tecnologia da Informa=C3=A7=C3=A3o Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@tapestry.apache.org
For additional commands, e-mail: users-***@tapestry.apache.org
Thiago H. de Paula Figueiredo
2011-12-02 16:06:54 UTC
Permalink
Yah, that's what I mean. However I am not sure if with Tapestry I can =
=
implement a way to process URL parameters such that the rendered page =
is =
based on the URL parameter, like: http://mypage.com/user123 where, =
user123 is a user id that is when accessed the rendered page will be =
=
the user page. Something like that.
Yep. You can do that easily with the page activation context =

(http://tapestry.apache.org/page-navigation.html) and if it isn't enough=
, =

you can use URL rewriting =

(http://blog.tapestry5.de/index.php/2010/09/06/new-url-rewriting-api/).
Quite easy. Create a class in the components page, create a template =
=
for it (optional, but very typical). You can also create CSS and =
JavaScript files specifically for it and make Tapestry include them =
I see, thanks for the tip. Do you mean in the package where Layout.jav=
a =
is located?
I see, anyway, what I mean by that is the loose-coupling of the UI =
element to the server side function ("services"). I hope Tapestry UI =
elements, although server-side, is loosely couple with "services"
They are. ;)
However, where do I place the CSS? In the .tml file? Or somewhere else=
?

In a separate file, then you include it on the page or component using =

@Import.

-- =

Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,=
=

and instructor
Owner, Ars Machina Tecnologia da Informa=C3=A7=C3=A3o Ltda.
http://www.arsmachina.com.br

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

Loading...