You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by iberck <ib...@gmail.com> on 2010/10/16 09:55:30 UTC

[T5] Complexity for simple things, where is the documentation?

I'm little confused with Tapestry

In another past post I asked how can I refresh my page with the server time:
http://tapestry.1045711.n5.nabble.com/T5-Refresh-1-second-Ajax-method-td3210194.html#a3210194

I only need refresh my page with the server time and I need to learn mixins,
ajax, zones, prototype, components, tapestry ajax methods (tapestry.js), ?

http://blog.bolkey.com/2010/05/creating-a-news-feed-in-tapestry-5/
why all this code for that simple issue?

I don't understand why there is this level of complexity... I see if you
want to learn tapestry also you need to learn necessarily Prototype and
download some source code to understand some things, I only see official
documentation with basic concepts by alphabet but what happend with specific
scenarios? the documentation is the source code? 
For example, where is the documentation for Tapestry.js use?

I only want help to have a better framework or understand this point...

Thank you for read me
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where-is-the-documentation-tp3214893p3214893.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: [T5] Complexity for simple things, where is the documentation?

Posted by ael <al...@dash.com.ph>.
JumpStart is the BEST Tapestry Documentation...

http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/javascript/zonewithoutyellowfade
http://jumpstart.doublenegative.com.au:8080/jumpstart/examples/javascript/zonewithoutyellowfade 

Good Luck...
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where-is-the-documentation-tp3214893p3216712.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: [T5] Complexity for simple things, where is the documentation?

Posted by Borut Bolčina <bo...@gmail.com>.
Thanks!

2011/1/8 Taha Hafeez <ta...@gmail.com>

> Hi Borut..
>
> With pleasure.
>
> var PeriodicAjaxUpdater = Class.create({
>   initialize:function(params){
>      this.element = $(params.element);
>      this.url = params.url;
>      this.period = params.period;
>      $T(this.element).zoneId = params.zone;
>      var self = this;
>      new PeriodicalExecuter(function(){
>         self.updateZone();
>         }, this.period);
>   },
>
>   updateZone:function(){
>      var zoneManager = Tapestry.findZoneManager(this.element);
>      if(!zoneManager){
>         return;
>      }
>
>      zoneManager.updateFromURL(this.url);
>   }
> });
>
> Had to search it using 'find' command on my laptop ... Seriously need to
> update my work at http://code.google.com/p/tapestry-addons
>
> regards
> Taha
>
>
> On Sat, Jan 8, 2011 at 12:41 PM, Borut Bolčina <borut.bolcina@gmail.com
> >wrote:
>
> > Taha,
> >
> > can you please post the PeriodicAjaxUpdater.js also?
> >
> > Cheers,
> > Borut
> >
> > 2010/10/17 Taha Hafeez <ta...@gmail.com>
> >
> > > May be this helps!
> > >
> > > //
> > > // Mixin
> > > //
> > > package tapestrydemo.mixins;
> > >
> > > import org.apache.tapestry5.ComponentResources;
> > > import org.apache.tapestry5.BindingConstants;
> > > import org.apache.tapestry5.services.javascript.JavaScriptSupport;
> > > import org.apache.tapestry5.ClientElement;
> > > import org.apache.tapestry5.annotations.Import;
> > > import org.apache.tapestry5.annotations.Environmental;
> > > import org.apache.tapestry5.annotations.InjectContainer;
> > > import org.apache.tapestry5.annotations.Parameter;
> > > import org.apache.tapestry5.ioc.annotations.Inject;
> > > import org.apache.tapestry5.json.JSONObject;
> > >
> > > @Import(library="PeriodicAjaxUpdater.js")
> > > public class PeriodicAjaxUpdater {
> > >   @Inject
> > >   private ComponentResources _componentResources;
> > >
> > >   @Environmental
> > >   private JavaScriptSupport _javaScriptSupport;
> > >
> > >   @Parameter(required=true, defaultPrefix=BindingConstants.LITERAL)
> > >   private String _event;
> > >
> > >   @Parameter
> > >   private Object[] _context;
> > >
> > >   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
> > >   private String _zone;
> > >
> > >   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
> > >   private int _period;
> > >
> > >   @InjectContainer
> > >   private ClientElement _container;
> > >
> > >   void afterRender(){
> > >      String url = _componentResources.createEventLink(_event,
> > > _context).toAbsoluteURI();
> > >      JSONObject params = new JSONObject();
> > >      params.put("url", url);
> > >      params.put("element", _container.getClientId());
> > >      params.put("zone", _zone);
> > >      params.put("period", _period);
> > >      _javaScriptSupport.addScript("new PeriodicAjaxUpdater(%s);",
> > > params.toString());
> > >   }
> > > }
> > >
> > > //A simple page
> > > <t:zone t:mixins='periodicAjaxUpdater' t:zone='timeZone' t:period='4'
> > > t:event='refresh' t:id='timeZone'>${today}</t:zone>
> > >
> > > //Page java
> > > public class Index {
> > >   @Component(id="timeZone")
> > >   private Zone _zone;
> > >
> > >   public java.util.Date getToday(){
> > >      return new java.util.Date();
> > >   }
> > >
> > >   Object onRefresh(){
> > >      return _zone.getBody();
> > >   }
> > > }
> > >
> > > regards
> > > Taha
> > >
> > >
> > >
> > > On Sun, Oct 17, 2010 at 3:09 AM, Thiago H. de Paula Figueiredo <
> > > thiagohp@gmail.com> wrote:
> > >
> > > > On Sat, 16 Oct 2010 18:30:15 -0300, iberck <ib...@gmail.com> wrote:
> > > >
> > > >  In this example,
> > > >> what happend if I want to learn mixins for create my own, where is
> the
> > > >> official documentation?
> > > >>
> > > >
> > > > http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html. I just
> > > went
> > > > to the T5.2 front page and searched for "mixin".
> > > >
> > > >
> > > >  Must I necessarily download and understand the source code of
> > > >> Autocompletemixin for learn?
> > > >>
> > > >
> > > > No, but it's a good thing to do. :)
> > > >
> > > >
> > > >  I think not all users are used to download the source code of the
> > > >> frameworks for learning
> > > >>
> > > >
> > > > I agree, but you can learn a lot from reading source code. ;)
> > > >
> > > > --
> > > > Thiago H. de Paula Figueiredo
> > > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> > developer,
> > > > and instructor
> > > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > > http://www.arsmachina.com.br
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > > For additional commands, e-mail: users-help@tapestry.apache.org
> > > >
> > > >
> > >
> >
>

Re: [T5] Complexity for simple things, where is the documentation?

Posted by Taha Hafeez <ta...@gmail.com>.
Hi Borut..

With pleasure.

var PeriodicAjaxUpdater = Class.create({
   initialize:function(params){
      this.element = $(params.element);
      this.url = params.url;
      this.period = params.period;
      $T(this.element).zoneId = params.zone;
      var self = this;
      new PeriodicalExecuter(function(){
         self.updateZone();
         }, this.period);
   },

   updateZone:function(){
      var zoneManager = Tapestry.findZoneManager(this.element);
      if(!zoneManager){
         return;
      }

      zoneManager.updateFromURL(this.url);
   }
});

Had to search it using 'find' command on my laptop ... Seriously need to
update my work at http://code.google.com/p/tapestry-addons

regards
Taha


On Sat, Jan 8, 2011 at 12:41 PM, Borut Bolčina <bo...@gmail.com>wrote:

> Taha,
>
> can you please post the PeriodicAjaxUpdater.js also?
>
> Cheers,
> Borut
>
> 2010/10/17 Taha Hafeez <ta...@gmail.com>
>
> > May be this helps!
> >
> > //
> > // Mixin
> > //
> > package tapestrydemo.mixins;
> >
> > import org.apache.tapestry5.ComponentResources;
> > import org.apache.tapestry5.BindingConstants;
> > import org.apache.tapestry5.services.javascript.JavaScriptSupport;
> > import org.apache.tapestry5.ClientElement;
> > import org.apache.tapestry5.annotations.Import;
> > import org.apache.tapestry5.annotations.Environmental;
> > import org.apache.tapestry5.annotations.InjectContainer;
> > import org.apache.tapestry5.annotations.Parameter;
> > import org.apache.tapestry5.ioc.annotations.Inject;
> > import org.apache.tapestry5.json.JSONObject;
> >
> > @Import(library="PeriodicAjaxUpdater.js")
> > public class PeriodicAjaxUpdater {
> >   @Inject
> >   private ComponentResources _componentResources;
> >
> >   @Environmental
> >   private JavaScriptSupport _javaScriptSupport;
> >
> >   @Parameter(required=true, defaultPrefix=BindingConstants.LITERAL)
> >   private String _event;
> >
> >   @Parameter
> >   private Object[] _context;
> >
> >   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
> >   private String _zone;
> >
> >   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
> >   private int _period;
> >
> >   @InjectContainer
> >   private ClientElement _container;
> >
> >   void afterRender(){
> >      String url = _componentResources.createEventLink(_event,
> > _context).toAbsoluteURI();
> >      JSONObject params = new JSONObject();
> >      params.put("url", url);
> >      params.put("element", _container.getClientId());
> >      params.put("zone", _zone);
> >      params.put("period", _period);
> >      _javaScriptSupport.addScript("new PeriodicAjaxUpdater(%s);",
> > params.toString());
> >   }
> > }
> >
> > //A simple page
> > <t:zone t:mixins='periodicAjaxUpdater' t:zone='timeZone' t:period='4'
> > t:event='refresh' t:id='timeZone'>${today}</t:zone>
> >
> > //Page java
> > public class Index {
> >   @Component(id="timeZone")
> >   private Zone _zone;
> >
> >   public java.util.Date getToday(){
> >      return new java.util.Date();
> >   }
> >
> >   Object onRefresh(){
> >      return _zone.getBody();
> >   }
> > }
> >
> > regards
> > Taha
> >
> >
> >
> > On Sun, Oct 17, 2010 at 3:09 AM, Thiago H. de Paula Figueiredo <
> > thiagohp@gmail.com> wrote:
> >
> > > On Sat, 16 Oct 2010 18:30:15 -0300, iberck <ib...@gmail.com> wrote:
> > >
> > >  In this example,
> > >> what happend if I want to learn mixins for create my own, where is the
> > >> official documentation?
> > >>
> > >
> > > http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html. I just
> > went
> > > to the T5.2 front page and searched for "mixin".
> > >
> > >
> > >  Must I necessarily download and understand the source code of
> > >> Autocompletemixin for learn?
> > >>
> > >
> > > No, but it's a good thing to do. :)
> > >
> > >
> > >  I think not all users are used to download the source code of the
> > >> frameworks for learning
> > >>
> > >
> > > I agree, but you can learn a lot from reading source code. ;)
> > >
> > > --
> > > Thiago H. de Paula Figueiredo
> > > Independent Java, Apache Tapestry 5 and Hibernate consultant,
> developer,
> > > and instructor
> > > Owner, Ars Machina Tecnologia da Informação Ltda.
> > > http://www.arsmachina.com.br
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
>

Re: [T5] Complexity for simple things, where is the documentation?

Posted by Borut Bolčina <bo...@gmail.com>.
Taha,

can you please post the PeriodicAjaxUpdater.js also?

Cheers,
Borut

2010/10/17 Taha Hafeez <ta...@gmail.com>

> May be this helps!
>
> //
> // Mixin
> //
> package tapestrydemo.mixins;
>
> import org.apache.tapestry5.ComponentResources;
> import org.apache.tapestry5.BindingConstants;
> import org.apache.tapestry5.services.javascript.JavaScriptSupport;
> import org.apache.tapestry5.ClientElement;
> import org.apache.tapestry5.annotations.Import;
> import org.apache.tapestry5.annotations.Environmental;
> import org.apache.tapestry5.annotations.InjectContainer;
> import org.apache.tapestry5.annotations.Parameter;
> import org.apache.tapestry5.ioc.annotations.Inject;
> import org.apache.tapestry5.json.JSONObject;
>
> @Import(library="PeriodicAjaxUpdater.js")
> public class PeriodicAjaxUpdater {
>   @Inject
>   private ComponentResources _componentResources;
>
>   @Environmental
>   private JavaScriptSupport _javaScriptSupport;
>
>   @Parameter(required=true, defaultPrefix=BindingConstants.LITERAL)
>   private String _event;
>
>   @Parameter
>   private Object[] _context;
>
>   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
>   private String _zone;
>
>   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
>   private int _period;
>
>   @InjectContainer
>   private ClientElement _container;
>
>   void afterRender(){
>      String url = _componentResources.createEventLink(_event,
> _context).toAbsoluteURI();
>      JSONObject params = new JSONObject();
>      params.put("url", url);
>      params.put("element", _container.getClientId());
>      params.put("zone", _zone);
>      params.put("period", _period);
>      _javaScriptSupport.addScript("new PeriodicAjaxUpdater(%s);",
> params.toString());
>   }
> }
>
> //A simple page
> <t:zone t:mixins='periodicAjaxUpdater' t:zone='timeZone' t:period='4'
> t:event='refresh' t:id='timeZone'>${today}</t:zone>
>
> //Page java
> public class Index {
>   @Component(id="timeZone")
>   private Zone _zone;
>
>   public java.util.Date getToday(){
>      return new java.util.Date();
>   }
>
>   Object onRefresh(){
>      return _zone.getBody();
>   }
> }
>
> regards
> Taha
>
>
>
> On Sun, Oct 17, 2010 at 3:09 AM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
> > On Sat, 16 Oct 2010 18:30:15 -0300, iberck <ib...@gmail.com> wrote:
> >
> >  In this example,
> >> what happend if I want to learn mixins for create my own, where is the
> >> official documentation?
> >>
> >
> > http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html. I just
> went
> > to the T5.2 front page and searched for "mixin".
> >
> >
> >  Must I necessarily download and understand the source code of
> >> Autocompletemixin for learn?
> >>
> >
> > No, but it's a good thing to do. :)
> >
> >
> >  I think not all users are used to download the source code of the
> >> frameworks for learning
> >>
> >
> > I agree, but you can learn a lot from reading source code. ;)
> >
> > --
> > Thiago H. de Paula Figueiredo
> > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> > and instructor
> > Owner, Ars Machina Tecnologia da Informação Ltda.
> > http://www.arsmachina.com.br
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>

Re: [T5] Complexity for simple things, where is the documentation?

Posted by Taha Hafeez <ta...@gmail.com>.
May be this helps!

//
// Mixin
//
package tapestrydemo.mixins;

import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.services.javascript.JavaScriptSupport;
import org.apache.tapestry5.ClientElement;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.json.JSONObject;

@Import(library="PeriodicAjaxUpdater.js")
public class PeriodicAjaxUpdater {
   @Inject
   private ComponentResources _componentResources;

   @Environmental
   private JavaScriptSupport _javaScriptSupport;

   @Parameter(required=true, defaultPrefix=BindingConstants.LITERAL)
   private String _event;

   @Parameter
   private Object[] _context;

   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
   private String _zone;

   @Parameter(defaultPrefix=BindingConstants.LITERAL, required=true)
   private int _period;

   @InjectContainer
   private ClientElement _container;

   void afterRender(){
      String url = _componentResources.createEventLink(_event,
_context).toAbsoluteURI();
      JSONObject params = new JSONObject();
      params.put("url", url);
      params.put("element", _container.getClientId());
      params.put("zone", _zone);
      params.put("period", _period);
      _javaScriptSupport.addScript("new PeriodicAjaxUpdater(%s);",
params.toString());
   }
}

//A simple page
<t:zone t:mixins='periodicAjaxUpdater' t:zone='timeZone' t:period='4'
t:event='refresh' t:id='timeZone'>${today}</t:zone>

//Page java
public class Index {
   @Component(id="timeZone")
   private Zone _zone;

   public java.util.Date getToday(){
      return new java.util.Date();
   }

   Object onRefresh(){
      return _zone.getBody();
   }
}

regards
Taha



On Sun, Oct 17, 2010 at 3:09 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Sat, 16 Oct 2010 18:30:15 -0300, iberck <ib...@gmail.com> wrote:
>
>  In this example,
>> what happend if I want to learn mixins for create my own, where is the
>> official documentation?
>>
>
> http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html. I just went
> to the T5.2 front page and searched for "mixin".
>
>
>  Must I necessarily download and understand the source code of
>> Autocompletemixin for learn?
>>
>
> No, but it's a good thing to do. :)
>
>
>  I think not all users are used to download the source code of the
>> frameworks for learning
>>
>
> I agree, but you can learn a lot from reading source code. ;)
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: [T5] Complexity for simple things, where is the documentation?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sat, 16 Oct 2010 18:30:15 -0300, iberck <ib...@gmail.com> wrote:

> In this example,
> what happend if I want to learn mixins for create my own, where is the
> official documentation?

http://tapestry.apache.org/tapestry5.2-dev/guide/mixins.html. I just went  
to the T5.2 front page and searched for "mixin".

> Must I necessarily download and understand the source code of
> Autocompletemixin for learn?

No, but it's a good thing to do. :)

> I think not all users are used to download the source code of the  
> frameworks for learning

I agree, but you can learn a lot from reading source code. ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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


RE: [T5] Complexity for simple things, where is the documentation?

Posted by Jim O'Callaghan <jc...@yahoo.co.uk>.
For your specific use case, displaying the server time on the page, would
you not be better off to initialize a value to the current server time upon
initial page display, and then use a JS widget to increment/refresh the time
field on the client side?  This would save a lot of unnecessary network
traffic, unless there is a compelling reason to have absolute
synchronization between what is displayed and the actual time on the server.
The variance would be sub one second with this approach, and you would not
require zone updating etc.

Regards,
Jim.

-----Original Message-----
From: iberck [mailto:iberck@gmail.com] 
Sent: 16 October 2010 22:30
To: users@tapestry.apache.org
Subject: Re: [T5] Complexity for simple things, where is the documentation?


Thank you very much for your time and your responses

In this example, 
what happend if I want to learn mixins for create my own, where is the
official documentation?
Must I necessarily download and understand the source code of
Autocompletemixin for learn?

I think not all users are used to download the source code of the frameworks
for learning

-- 
View this message in context:
http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where-
is-the-documentation-tp3214893p3215542.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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



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


Re: [T5] Complexity for simple things, where is the documentation?

Posted by iberck <ib...@gmail.com>.
Thank you very much for your time and your responses

In this example, 
what happend if I want to learn mixins for create my own, where is the
official documentation?
Must I necessarily download and understand the source code of
Autocompletemixin for learn?

I think not all users are used to download the source code of the frameworks
for learning

-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where-is-the-documentation-tp3214893p3215542.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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


Re: [T5] Complexity for simple things, where is the documentation?

Posted by "Vangel V. Ajanovski" <aj...@ii.edu.mk>.
If you ONLY want to refresh your whole page every 1 second you can do it
in many ways. Without Tapestry. One is with a pretty simple javascript,
like for example in this guide:
http://www.quackit.com/javascript/javascript_refresh_page.cfm

Usually you would not use xx megabytes of special software libraries
that can work in gazillion of customized ways for building a web site
with only 3 simple web pages? Right. So if you ask a question on the
mailing list of such a software framework, people will generally think
that you need something special and will give you some more complex
examples that would work in various scenarios.

In 10/16/2010 09:55 AM, iberck wrote:
> In another past post I asked how can I refresh my page with the server time:
> http://tapestry.1045711.n5.nabble.com/T5-Refresh-1-second-Ajax-method-td3210194.html#a3210194



Re: [T5] Complexity for simple things, where is the documentation?

Posted by Josh Canfield <jo...@gmail.com>.
> I'm little confused with Tapestry
That's pretty normal when you are learning something new.

> In another past post I asked how can I refresh my page with the server time:
> http://tapestry.1045711.n5.nabble.com/T5-Refresh-1-second-Ajax-method-td3210194.html#a3210194
Yeah... I'm going to come off a little harsh here but you are trying
to do something that is pretty silly on several fronts, including
scalability and correctness (it may take more than a second for the
response to get back to you.) It makes me jump to the conclusion that
you don't have a lot of experience in web technologies, which will
make learning Tapestry that much harder.

> I only need refresh my page with the server time and I need to learn mixins,
> ajax, zones, prototype, components, tapestry ajax methods (tapestry.js), ?

When what you are asking for doesn't exist in the framework and you
are going to do it in the framework you are going to have to build it.
This is going to require that you know how the framework does things
and to some degree what technologies that it uses and how they work.

There is a bunch of stuff about tapestry that you need to know to
build what you want:
* how to create a page
* that a Zone is how you update partial pages
* how to get the Zone in your page
* how to create and trigger an event
* how to update a zone from an event
* how to do that periodically.

Everything but that last piece (that I'm aware of) are pretty core to
using the framework for any purpose, and documented.

in the java class for the page:

 @Component
    private Zone serverTime;

    public Block onUpdateTime() {
        return serverTime.getBody();
    }

    public Date getTime() {
        return new Date();
    }

in the template:

Server Time:
<t:zone t:id="servertime">
    ${time}
</t:zone>

<t:eventlink t:id="updatelink" event="updateTime"
zone="servertime">Update</t:eventlink>

<script type="text/javascript">
    new PeriodicalExecuter(function() {
        $('updatelink').fire(Tapestry.TRIGGER_ZONE_UPDATE_EVENT)
    }, 5);
</script>

> http://blog.bolkey.com/2010/05/creating-a-news-feed-in-tapestry-5/
> why all this code for that simple issue?

The two mixins from that blog posts would be great additions to the
core (periodic update and zone appending instead of replacing). I'm
not seeing a lot of code here though. I'd say tapestry provided a
pretty good set of features to enable this type of functionality, and
the author made good use of what was available.

> I don't understand why there is this level of complexity...
First, Tapestry isn't done yet :) There are places where Tapestry can
be improved, and that will always be true (what project is ever
done?). But the honest truth is that Software Engineering is hard work
and requires learning lots of paradigms and patterns; that's why we
get paid so much! ;) We'll keep trying to make the framework easier to
use, but it will never be everything to everyone.

> For example, where is the documentation for Tapestry.js use?
Documentation is definitely an issue, and it's being actively worked
on at the moment. It's open source, if you don't like how it's done
submit a patch (Ok, so submitting a patch only really works if you get
a committer who cares, or as the time to care, about the problem you
are trying to solve... but it's a good exercise!). For me I actually
go to the source before I even google or check the website for a
solution. Generally what I'm trying to do is close to things that are
already in the core. For instance, in order to write the
PeriodicalExecutor code I peeked into tapestry.js to see how a link
was connected to a zone, and found that I could fire an event to
update the zone... I also peeked into prototype.js to see what it
already had to wrap window.setTimeout...

> I only want help to have a better framework or understand this point...
Me too :)

Josh

On Sat, Oct 16, 2010 at 12:55 AM, iberck <ib...@gmail.com> wrote:
>
> I'm little confused with Tapestry
>
> In another past post I asked how can I refresh my page with the server time:
> http://tapestry.1045711.n5.nabble.com/T5-Refresh-1-second-Ajax-method-td3210194.html#a3210194
>
> I only need refresh my page with the server time and I need to learn mixins,
> ajax, zones, prototype, components, tapestry ajax methods (tapestry.js), ?
>
> http://blog.bolkey.com/2010/05/creating-a-news-feed-in-tapestry-5/
> why all this code for that simple issue?
>
> I don't understand why there is this level of complexity... I see if you
> want to learn tapestry also you need to learn necessarily Prototype and
> download some source code to understand some things, I only see official
> documentation with basic concepts by alphabet but what happend with specific
> scenarios? the documentation is the source code?
> For example, where is the documentation for Tapestry.js use?
>
> I only want help to have a better framework or understand this point...
>
> Thank you for read me
> --
> View this message in context: http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where-is-the-documentation-tp3214893p3214893.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

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


Re: [T5] Complexity for simple things, where is the documentation?

Posted by Inge Solvoll <in...@gmail.com>.
You won't find any simpler solutions to this in other frameworks either. If
you want to create a page that refreshes itself with the serve time
periodically, you can't avoid at least some knowledge about how AJAX works
in general. You may avoid javascript by using Google Web Toolkit, but that
has its own learning curve.

The solution to your problem here is very simple and requires a minimal
amount of digging from your side. Just create a script that uses
Ajax.Updater from prototype, and generate a link on the server side that you
can use to trigger an event on your java class. See Autocompleter mixin from
tapestry for a very good example. Once you've learned this rather simple
technique, you won't need much else.

Tapestry's strength here is that it enables you to make a nice wrapping out
of your specialized component, so later on you can find your script, your
html and your java files packaged together in a nice module doing a very
simple thing and nothing else.

See my blog for some more simple examples. http://tinybits.blogspot.com/

On Sat, Oct 16, 2010 at 9:55 AM, iberck <ib...@gmail.com> wrote:

>
> I'm little confused with Tapestry
>
> In another past post I asked how can I refresh my page with the server
> time:
>
> http://tapestry.1045711.n5.nabble.com/T5-Refresh-1-second-Ajax-method-td3210194.html#a3210194
>
> I only need refresh my page with the server time and I need to learn
> mixins,
> ajax, zones, prototype, components, tapestry ajax methods (tapestry.js), ?
>
> http://blog.bolkey.com/2010/05/creating-a-news-feed-in-tapestry-5/
> why all this code for that simple issue?
>
> I don't understand why there is this level of complexity... I see if you
> want to learn tapestry also you need to learn necessarily Prototype and
> download some source code to understand some things, I only see official
> documentation with basic concepts by alphabet but what happend with
> specific
> scenarios? the documentation is the source code?
> For example, where is the documentation for Tapestry.js use?
>
> I only want help to have a better framework or understand this point...
>
> Thank you for read me
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/T5-Complexity-for-simple-things-where-is-the-documentation-tp3214893p3214893.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>