T5 object provider problem

2009-07-25 Thread haipeng du
For object provider, here is the java doc:
*Type Parameters:*T - *Parameters:*objectType - the expected object type
annotationProvider - provides access to annotations (typically, the field or
parameter to which an injection-related annotation is attached); annotations
on the field or parameter may also be used when resolving the desired object
locator - locator for the *context* in which the provider is being used *
Returns:*the requested object, or null if this object provider can not
supply an object The problem is here:
 if my object provider really want to inject null to object, how could I do?
As I understand, if I return null, the IOC will try to find other providers
to inject it and throw exception. So I have no way to inject null to object.
That does not make sense at all.

Thanks.

-- 
Haipeng Du
Salt Lake City


T5 TextField and Hidden problems

2009-07-07 Thread haipeng du
I have TextField component which is disabled when template is rendered. It
will be enabled from javascript and submit data to server. But the data
change is not bound back to server. I must render TextField as enabled to
get data back and I can not use javascript to change the status. Is that
true? If yes, it does not make any sense.
Also, for hidden field, it does not render id attribute for me with input
type=hidden t:type=hidden id=someId value=someValue / if I change
id=someId to t:id=someId, it will render name attribute instead of id
attribute.
Thanks.

-- 
Haipeng Du
Salt Lake City


T5 Grid Error

2009-06-30 Thread haipeng du
(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:550)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:890)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:743)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:215)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:407)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:421)
at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520)

Here is my grid template:
t:grid source=displayedCompanies lean=true t:id=companyList
row=rowCompany rowsPerPage=10 add=address
include=companyName,active, contactPhone,
expirationDate,createdBy

reorder=active,companyName,contactPhone,expirationDate,createdBy,address 
I can not understand why I got index error? How could I fix it.
Thanks.
-- 
Haipeng Du
Salt Lake City


T5 Module methods call

2009-06-29 Thread haipeng du
I have my own service module class under my services sub package to set up
my application configuration. There is one method to set up application
defaults, it is called corrected,

public void contributeApplicationDefaults(MappedConfigurationString,
String configuration){
configuration.add(SymbolConstants.PRODUCTION_MODE, false);
configuration.add(tapestry.page-pool.active-window, 100 m);
configuration.add(tapestry.page-pool.hard-limit, 30);
//configuration.add(tapestry.exception-report-page,
MyErrorPage);
configuration.add(tapestry.file-check-interval, 10s);

//customized symbol
configuration.add(web.root, /salesTrack/);
System.out.println(change application default);
}

but this one is not called:
 public static void contributeIgnoredPathsFilter(ConfigurationString
configuration)
  {
configuration.add(/dwr/.*);
configuration.add(/scripts/.*);
configuration.add(/logout);

  }
Why?

-- 
Haipeng Du
Salt Lake City


Re: T5 Module methods call

2009-06-29 Thread haipeng du
Thanks for your reply. As I understand, I do no need to create such service
from my module class. There is one tapestry service called
IgnoredPathsFilter already. Also, from url:
http://tapestry.apache.org/tapestry5.1/guide/conf.html , it does not talk
about to create such service when I have contributeIgnoredPathsFilter(
ConfigurationString
 configuration);
Thanks.


On Mon, Jun 29, 2009 at 1:15 PM, nille hammer
tapestry.nilleham...@winfonet.eu wrote:

 Hi Haipeng,

  but this one is not called:
   public static void contributeIgnoredPathsFilter(ConfigurationString
  configuration)
{
  configuration.add(/dwr/.*);
  configuration.add(/scripts/.*);
  configuration.add(/logout);
 
}
 The contribution method is called by a builder method for a service that
 accepts your configuration as method parameter. I assume you want to build a
 service that implements  RequestFilter. So do you have sth. like the
 following in your module class?

 public  RequestFilter buildIgnoredPathsFilter(final CollectionString
 contributions) {
return new IgnoredPathsFilter(contributions);
 }

 Regards, nillehammer

 ==
 http://www.winfonet.eu

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




-- 
Haipeng Du
Salt Lake City


Re: T5 Module methods call

2009-06-29 Thread haipeng du
Thanks Thiago. That makes sense.

On Mon, Jun 29, 2009 at 2:44 PM, haipeng du haipen...@gmail.com wrote:

 Thanks for your reply. As I understand, I do no need to create such service
 from my module class. There is one tapestry service called
 IgnoredPathsFilter already. Also, from url:
 http://tapestry.apache.org/tapestry5.1/guide/conf.html , it does not talk
 about to create such service when I have 
 contributeIgnoredPathsFilter(ConfigurationString
  configuration);
 Thanks.


 On Mon, Jun 29, 2009 at 1:15 PM, nille hammer
 tapestry.nilleham...@winfonet.eu wrote:

 Hi Haipeng,

  but this one is not called:
   public static void contributeIgnoredPathsFilter(ConfigurationString
  configuration)
{
  configuration.add(/dwr/.*);
  configuration.add(/scripts/.*);
  configuration.add(/logout);
 
}
 The contribution method is called by a builder method for a service that
 accepts your configuration as method parameter. I assume you want to build a
 service that implements  RequestFilter. So do you have sth. like the
 following in your module class?

 public  RequestFilter buildIgnoredPathsFilter(final CollectionString
 contributions) {
return new IgnoredPathsFilter(contributions);
 }

 Regards, nillehammer

 ==
 http://www.winfonet.eu

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




 --
 Haipeng Du
 Salt Lake City




-- 
Haipeng Du
Salt Lake City


T5 remove prototype and scriptaculous

2009-06-28 Thread haipeng du
There are some conflict with prototype and scriptaculous on my page. Is that
possible to remove these javascript loading for specific pages?
Thanks.

-- 
Haipeng Du
Salt Lake City


T5 ajax examples

2009-06-27 Thread haipeng du
What is the good reference for ajax in T5? I did not find any good
documentation from T5 website.
Thanks.

-- 
Haipeng Du
Salt Lake City


T5 change grid column header label

2009-06-26 Thread haipeng du
How could I change label for grid header and keep the sorting function.

-- 
Haipeng Du
Salt Lake City


life cycle for page render

2009-06-22 Thread haipeng du
In my page, I have one requirement to keep data in the request cycle and
discard it after response sent back. I will not use @Persist as it is not.
But, when I try to trace request processing, I got following when I click
submit button
(1) page attach method called
(2) event method is called
(3) page detach method is called (this time, it has already clean all
variables that are not marked as @Persist)
(4) page attach method called again
(5) Page detach method called again.
I wonder why attaching and detaching called twice, how could I keep my
variables in the first time calling.
Thanks.

-- 
Haipeng Du
Salt Lake City


T5 life cycle for page render

2009-06-22 Thread haipeng du
On Mon, Jun 22, 2009 at 2:18 PM, haipeng du haipen...@gmail.com wrote:

 In my page, I have one requirement to keep data in the request cycle and
 discard it after response sent back. I will not use @Persist as it is not.
 But, when I try to trace request processing, I got following when I click
 submit button
 (1) page attach method called
 (2) event method is called
 (3) page detach method is called (this time, it has already clean all
 variables that are not marked as @Persist)
 (4) page attach method called again
 (5) Page detach method called again.
 I wonder why attaching and detaching called twice, how could I keep my
 variables in the first time calling.
 Thanks.

 --
 Haipeng Du
 Salt Lake City




-- 
Haipeng Du
Salt Lake City


Re: T5 disable loading specified module

2009-06-21 Thread haipeng du
It is not true. T5 provide module auto loading if from your MAINFEST file,
you give the module class name, you can refer
http://tapestry.apache.org/tapestry5.1/tapestry-ioc/autoload.html

On Sat, Jun 20, 2009 at 9:30 PM, Angelo Chen angelochen...@yahoo.com.hkwrote:


 I think if it is not specified in the AddModule, it should not be loaded.
 of
 course if T5's module and it has auto binding, then it will be loaded as
 long as it is linked.


 flyabovesun wrote:
 
  How could I configure Tapestry so that specified modules will not be auto
  loaded into service.
  Thanks.
 
  --
  Haipeng Du
  Salt Lake City
 
 

 --
 View this message in context:
 http://www.nabble.com/T5-disable-loading-specified-module-tp24131216p24131282.html
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
Haipeng Du
Salt Lake City


Re: T5 tapestry spring

2009-06-17 Thread haipeng du
I found one way to fix this problem. But I am not sure if that is good one.
(1) create one class to implement ObjectProvider
public class TapestrySpringBeanProvider implements ObjectProvider {



@Override
public T T provide(ClassT clazz, AnnotationProvider ap,
ObjectLocator locator) {
// you can use any annotation you like
Id id = ap.getAnnotation(Id.class);
if ( id == null )
return null;
String beanName = id.value();
ApplicationContext context =
locator.getService(ApplicationContext.class);
return (T) context.getBean(beanName);
}

}

(2) from your module class, add following method:

 public static void
contributeMasterObjectProvider(OrderedConfigurationObjectProvider config){
 config.override(SpringBean,new TapestrySpringBeanProvider());
 }

(3) inject your spring bean like
@Inject
@Id(beanId)
private BaseDAO baseDAO

It works for me now.

On Wed, Jun 17, 2009 at 1:40 AM, Otho taa...@googlemail.com wrote:

 I had a similar problem. Maybe this thread helps you:


 http://www.nabble.com/T-5.1-How-to-inject-Spring-beans-by-name--td22934788.html

 2009/6/17 haipeng du haipen...@gmail.com

  I try to inject spring beans to page class with
  @Inject
  @Id(baseDAO)
  private BaseDAO baseDAO
 
  It still gave me that Spring context contains 14 beans assignable to
 type
  xx.BaseDAO
 
  what should I do for this.
 
  --
  Haipeng Du
  Salt Lake City
 




-- 
Haipeng Du
Salt Lake City


T5 tapestry spring

2009-06-16 Thread haipeng du
I try to inject spring beans to page class with
@Inject
@Id(baseDAO)
private BaseDAO baseDAO

It still gave me that Spring context contains 14 beans assignable to type
xx.BaseDAO

what should I do for this.

-- 
Haipeng Du
Salt Lake City


Re: best book for T5

2009-06-15 Thread haipeng du
+1. For sure, many people have second language. After English or German
version is ready, we can translate to different languages. To make tapestry
to be popular, we must support it. I love tapestry.

On Mon, Jun 15, 2009 at 10:01 AM, Craig St. Jean craigstj...@gmail.comwrote:

 +1

 On Mon, Jun 15, 2009 at 11:14 AM, Paulo Marcelo paulo.marc...@gmail.com
 wrote:

  +1
 
  Paulo Marcelo
 
  He who asks is a fool for five minutes, but he who does not ask
  remains a fool forever.
 
  Chinese Proverb
 
 
  2009/6/15 Thiago H. de Paula Figueiredo thiag...@gmail.com
 
   +1. The more books, the better. :)
  
   --
   Thiago
  
   -
   To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
   For additional commands, e-mail: users-h...@tapestry.apache.org
  
  
 




-- 
Haipeng Du
Salt Lake City


best book for T5

2009-06-11 Thread haipeng du
What is the best book for T5. Tutorial from t5 website is too simple.
Thanks.

-- 
Haipeng Du
Salt Lake City


Re: change persist property value in component

2008-05-11 Thread haipeng du
Do you have guide for Tapestry 4?
Thanks.

On Sat, May 10, 2008 at 2:46 PM, Toby Hobson [EMAIL PROTECTED]
wrote:

 Do you want to change the value of a persistent property? Many methods are
 called during the lifecycle of a page, see
 http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html

 Toby

 - Original Message 
 From: haipeng du [EMAIL PROTECTED]
 To: users@tapestry.apache.org
 Sent: Saturday, 10 May, 2008 9:37:27 PM
 Subject: change persist property value in component

 How could I change Persist property value in component? Which method will
 be
 called in component before page is rendered.
 Thanks.

 --
 Haipeng Du
 Salt Lake City






-- 
Haipeng Du
Salt Lake City


change persist property value in component

2008-05-10 Thread haipeng du
How could I change Persist property value in component? Which method will be
called in component before page is rendered.
Thanks.

-- 
Haipeng Du
Salt Lake City


tapestry 4 to focus on specified field

2007-03-02 Thread haipeng du

How could I set up form and field to make tapestry form focus on specified
field. In the form, it is only one parameter called focus which is
boolean. It should have parameter that takes a list of fields name or id for
focus order. Does t4 have that?
Thanks a lot.


--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City


Re: tapestry 4 to focus on specified field

2007-03-02 Thread haipeng du

I know these. But I just think that may be useful and helpful to add focus
fields order list to form.

On 3/2/07, Howard Lewis Ship [EMAIL PROTECTED] wrote:


Tapestry will add JavaScript to focus on the first field that has an
error. If no fields are in error, then the first required field. If no
required fields, then the first field, period.

The focus parameter is used when you have multiple forms on one page,
and want to control which one gets to take focus.

On 3/2/07, haipeng du [EMAIL PROTECTED] wrote:
 How could I set up form and field to make tapestry form focus on
specified
 field. In the form, it is only one parameter called focus which is
 boolean. It should have parameter that takes a list of fields name or id
for
 focus order. Does t4 have that?
 Thanks a lot.


 --
 Haipeng Du
 Software Engineer
 Comphealth,
 Salt Lake City



--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City


Re: ajaxsubmit

2007-01-29 Thread haipeng du

Thanks a lot. I try to use EventListener. But I got problem to load dojo
tapestry javascript package. I unjar the tapestry-4.1.1 framework jar file
and copy dojo folder to my js folder. It still complains that Could not load
'tapestry.event'; last tried '__package__.js? I checked dojo folder, there
is no tapestry folder. Do you have some suggestion?
Thanks a lot.

On 1/25/07, Leffel, Daniel [EMAIL PROTECTED] wrote:


What version of Tapestry are you using? I highly suggest 4.1.1 or a 
4.1.2snapshot and leveraging the event listener to make the AjaxSubmit happen.

I was using a prior version of Tapestry with Tacos and found that using
the AjaxSubmit component caused the form to post back in a non-ajax way. The
documentation could be a little more clear here, because what I discovered
was the form was posting through AJAX and THEN was posting back in a
non-AJAX way.

If you use a version prior to 4.1, you need to block that action. The
EventListener makes it all much easier by allowing you to force an Ajax
postback on components that aren't submit components (i.e. a plain old
button).



From: haipeng du [mailto:[EMAIL PROTECTED]
Sent: Thu 1/25/2007 4:31 PM
To: tapestry-user@jakarta.apache.org
Subject: ajaxsubmit



Hi, guys,
When I try to use AjaxSubmit, sometimes, that button dose not just do ajax
call. It submits form(not the ajax call) one time after I click it several
times. I do not know why? Does somebody else have the same problem?

--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City


tapestry.even has properties

2007-01-29 Thread haipeng du

I configure event lister like :
 @EventListener(events=onblur, elements=table1Field, async=true)

and I got error when field event is fired
tapestry.event has no properties
http://localhost:9090/mmtransfer/js/dojo/dojo.js
Line 15

what do I missed for this?
--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City


autocompleter can not use EventListener

2007-01-29 Thread haipeng du

I try bind one EventLister to an autocomplter. But it does not work. How
could I listen onblur or onfocus for autocompleter?
Thanks a lot

--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City