Tristate property (true/false/null)

2008-03-03 Thread Steph

I try to handle a tristate property (true/false/null) with a radiogroup :

   
   true
   false
   not defined
   

but the selection of "not defined" set my property to true.
Is there a specific way to handle null values ?

Stephane



Injection of Spring bean aliases as services in Tapestry pages

2008-03-02 Thread Steph

I can easily inject a service A defined in Spring like that :
   
in my tap pages :
   @Inject
   @Service("A")
   private MyObject a;
That works fine.

But if i declare in Spring an alias B on my bean A :
   
when i try to inject my bean B in my tap pages :
   @Inject
   @Service("B")
   private MyObject b;
Tapestry can't find this service  and i get the following exception :
org.apache.tapestry.internal.services.TransformationException: Error 
obtaining injected value for field 
com.cariboonetworks.ads.pages.MyPage.b: Service id 'B' is not defined by 
any module.


Any idea ??

Stephane
  


T5 : Form with synchronous Submit and asynchronous components

2008-02-29 Thread Steph
How can a form in Tap 5.0.11 include asynchronous components (select, 
checkbox, ...) which update the form itself and a synchronous submit 
which redirects on another page in its onSuccess event ?


Stephane


T5 : Dependant dropdown boxes

2008-02-29 Thread Steph
Has anyone already tried to implement dependant dropdown boxes with the 
Ajax features of Tapestry 5.0.11 ?
I would like to implement a component to get a user address (country, 
zipcode, city) and i would like to present the user the cities according 
to the zipcode and the country just filled.


Any ideas ?

Stephane


Re: Event bubbling

2008-02-18 Thread Steph

Each time a piece of information is rendered several times in a page.
Say for example in a contact list. Each contact is displayed by a 
component including 'remove', 'update', 'details' links.
I already know what you will say ... "move the handler from the page to 
the component" ;-)


But, in the point of view of application architecture, i'm not sure that 
it is a good thing to split in different components the functions which 
manage the same piece of informations.
In the contact list sample, my component won't be able to manage the 
creation of a new contact. So i will end up with the CRUD functions of 
my contact split in the page displaying the contacts and the component 
displaying a contact details.


If i could handle all events in the page, my page would be able to 
encompass all the contact management functions ...



Davor Hrg a écrit :

please say more about your use case,
maybe a different approach can help :)

Davor Hrg

On Feb 18, 2008 10:47 AM, Steph <[EMAIL PROTECTED]> wrote:
  

Thanks Davor for the explanation.
I understand the event type is intact but can you confirm me that i
can't make a distinction between all the events bubbling from B in my C
component ?
In practice, if i have 2 actionlinks A and A' in my B component. I don't
know from which actionlink comes an "action" event bubbling from B in my
page C and so the handling of these events can't be made at the page
level ... It's quite annoying for a frequent use case.

Davor Hrg a écrit :



the event type is intact,
but the source changes

onSubmitFromA
onSubmitFromB

onActionFromA
onActionFromB


On Feb 18, 2008 10:26 AM, Steph <[EMAIL PROTECTED]> wrote:

  

Thanks Howard,
But if my event from A is seen as "FromB" in component C, all events
from components B are melted and one can't handle a specific event !
Shouldn't we be able to differ events from their id or at least from
their type from Form, Links, ... ?

Howard Lewis Ship a écrit :




This simply isn't how its done. Once an event bubbles up from
component A to container B to container C, it will appear as "FromB"
in the methods of C.  Is that clear?  This is explicitly to enforce
that component implementations are private to the component, such that
a component (A or B) may change its structure, including the ids of
embedded components, without requiring changes outside the component.

On Feb 16, 2008 6:24 AM, Steph <[EMAIL PROTECTED]> wrote:


  

I've achieved to handle the event of my component in its container by
changing the event handler like this :
@OnEvent(component="the_name_of_my_component_in_the_container")

So i can handle now all the events bubbling from my component.
But what if i just want to handle the event of my 'detaillink' in the
component ?

I've tried something like that :
@OnEvent(component="the_name_of_my_component_in_the_container.detaillink")

without success ...

Any advice is welcome

Stephane

Steph a écrit :





Hi,

I've got a strange behavior in event bubbling ...

I have an actionlink in a component :

Show
details ...

If I write an event handler in the component, the event is handle
correctly :

@OnEvent (component="detaillink")
Object detailLink(Long id) {
   ... do the handling based on the id and return a page to redirect
to ...
}

But if i move this handler (with no modifications) from the component
to the page that includes the component, the handler is never called ...
According to the documentation, i thought that event bubbling implies
that the handlers of the container of my component should be parsed ...

Thanks in advance for any advice.

Stephane




  


  

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


  


DateField localization

2008-02-18 Thread Steph

How do we set the format of the DateField component ?
I can't find any information or sample on that subject ...

Thanks in advance ?


Re: Event bubbling

2008-02-18 Thread Steph

Thanks Davor for the explanation.
I understand the event type is intact but can you confirm me that i 
can't make a distinction between all the events bubbling from B in my C 
component ?
In practice, if i have 2 actionlinks A and A' in my B component. I don't 
know from which actionlink comes an "action" event bubbling from B in my 
page C and so the handling of these events can't be made at the page 
level ... It's quite annoying for a frequent use case.


Davor Hrg a écrit :

the event type is intact,
but the source changes

onSubmitFromA
onSubmitFromB

onActionFromA
onActionFromB


On Feb 18, 2008 10:26 AM, Steph <[EMAIL PROTECTED]> wrote:
  

Thanks Howard,
But if my event from A is seen as "FromB" in component C, all events
from components B are melted and one can't handle a specific event !
Shouldn't we be able to differ events from their id or at least from
their type from Form, Links, ... ?

Howard Lewis Ship a écrit :



This simply isn't how its done. Once an event bubbles up from
component A to container B to container C, it will appear as "FromB"
in the methods of C.  Is that clear?  This is explicitly to enforce
that component implementations are private to the component, such that
a component (A or B) may change its structure, including the ids of
embedded components, without requiring changes outside the component.

On Feb 16, 2008 6:24 AM, Steph <[EMAIL PROTECTED]> wrote:

  

I've achieved to handle the event of my component in its container by
changing the event handler like this :
@OnEvent(component="the_name_of_my_component_in_the_container")

So i can handle now all the events bubbling from my component.
But what if i just want to handle the event of my 'detaillink' in the
component ?

I've tried something like that :
@OnEvent(component="the_name_of_my_component_in_the_container.detaillink")

without success ...

Any advice is welcome

Stephane

Steph a écrit :




Hi,

I've got a strange behavior in event bubbling ...

I have an actionlink in a component :

Show
details ...

If I write an event handler in the component, the event is handle
correctly :

@OnEvent (component="detaillink")
Object detailLink(Long id) {
   ... do the handling based on the id and return a page to redirect
to ...
}

But if i move this handler (with no modifications) from the component
to the page that includes the component, the handler is never called ...
According to the documentation, i thought that event bubbling implies
that the handlers of the container of my component should be parsed ...

Thanks in advance for any advice.

Stephane



  



  


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

  


Re: Event bubbling

2008-02-18 Thread Steph

Thanks Howard,
But if my event from A is seen as "FromB" in component C, all events 
from components B are melted and one can't handle a specific event ! 
Shouldn't we be able to differ events from their id or at least from 
their type from Form, Links, ... ?


Howard Lewis Ship a écrit :

This simply isn't how its done. Once an event bubbles up from
component A to container B to container C, it will appear as "FromB"
in the methods of C.  Is that clear?  This is explicitly to enforce
that component implementations are private to the component, such that
a component (A or B) may change its structure, including the ids of
embedded components, without requiring changes outside the component.

On Feb 16, 2008 6:24 AM, Steph <[EMAIL PROTECTED]> wrote:
  

I've achieved to handle the event of my component in its container by
changing the event handler like this :
@OnEvent(component="the_name_of_my_component_in_the_container")

So i can handle now all the events bubbling from my component.
But what if i just want to handle the event of my 'detaillink' in the
component ?

I've tried something like that :
@OnEvent(component="the_name_of_my_component_in_the_container.detaillink")

without success ...

Any advice is welcome

Stephane

Steph a écrit :



Hi,

I've got a strange behavior in event bubbling ...

I have an actionlink in a component :

Show
details ...

If I write an event handler in the component, the event is handle
correctly :

@OnEvent (component="detaillink")
Object detailLink(Long id) {
   ... do the handling based on the id and return a page to redirect
to ...
}

But if i move this handler (with no modifications) from the component
to the page that includes the component, the handler is never called ...
According to the documentation, i thought that event bubbling implies
that the handlers of the container of my component should be parsed ...

Thanks in advance for any advice.

Stephane


  




  


Re: Event bubbling

2008-02-16 Thread Steph
I've achieved to handle the event of my component in its container by 
changing the event handler like this :

@OnEvent(component="the_name_of_my_component_in_the_container")

So i can handle now all the events bubbling from my component.
But what if i just want to handle the event of my 'detaillink' in the 
component ?


I've tried something like that :
@OnEvent(component="the_name_of_my_component_in_the_container.detaillink")

without success ...

Any advice is welcome

Stephane

Steph a écrit :

Hi,

I've got a strange behavior in event bubbling ...

I have an actionlink in a component :

Show 
details ...


If I write an event handler in the component, the event is handle 
correctly :


@OnEvent (component="detaillink")
Object detailLink(Long id) {
   ... do the handling based on the id and return a page to redirect 
to ...

}

But if i move this handler (with no modifications) from the component 
to the page that includes the component, the handler is never called ...
According to the documentation, i thought that event bubbling implies 
that the handlers of the container of my component should be parsed ...


Thanks in advance for any advice.

Stephane




Event bubbling

2008-02-16 Thread Steph

Hi,

I've got a strange behavior in event bubbling ...

I have an actionlink in a component :

Show 
details ...


If I write an event handler in the component, the event is handle 
correctly :


@OnEvent (component="detaillink")
Object detailLink(Long id) {
   ... do the handling based on the id and return a page to redirect to ...
}

But if i move this handler (with no modifications) from the component to 
the page that includes the component, the handler is never called ...
According to the documentation, i thought that event bubbling implies 
that the handlers of the container of my component should be parsed ...


Thanks in advance for any advice.

Stephane



Re: how to access components pages ???

2008-02-16 Thread Steph

You just have to inject :

   @Inject
   private ComponentResources componentResources;

Then, you access page properties like this :

   componentResources.getPage().get

Stephane

Mohammad Shamsi a écrit :

Hi,

i wanna access to a components page, from component code.
i wanna to know the page name, access page class and its properties form a
component this used in class.



  


T5 : How to get a Page in a Dispatcher ?

2008-02-05 Thread Steph

Hi all,

I have implemented a Dispatcher based on the wiki solution provided by 
Chris Lewis in order to check the authentication of the users on several 
pages of my application.
But instead of check the access rights of a user based on the URL, i 
would like to check it against the Page instance (say on the presence of 
a @Private annotation put on the page).

Has anybody a clue to get the page instance in the dispatcher ?

Thanks in advance.

Stephane


T5 : declaration of pages and components packages from a library

2008-01-08 Thread Steph
Hi all,

I need to import in my tap5 project a library which includes tap5 pages
and components.
But when i try to extend a page from the library in my project, i get
the following exception :

java.lang.RuntimeException: Base class com.mylibrary.pages.FramePage
(super class of com.myproject.pages.Start) is not in a controlled
package and is therefore not valid. You should try moving the class to
package com.myproject.base.

Should i declare the 'pages' and 'components' directories of my library
in the tapestry.app-package context of my web.xml ? If yes, what is the
syntax to do such a declaration ?

Thanks in advance.

Stephane


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



Re: [T5] 5.0.7 - Help with log4j.properties file

2008-01-08 Thread Steph
How do you get your logger in your code ?
The injection
@Inject
private Logger log;
is only useable in Tapestry pages, components, ...
It will log nothing in your other classes managed by Spring, Hibernate, ...
Outside of Tapestry, you should use something like the line below to use
slf4j :
private final Logger log = LoggerFactory.getLogger(YourClass.class);

Stephane

Andy Huhn a écrit :
> Hi Buckofive,
>
> Here are a couple of relevant lines from my log4j.properties file.  My
> file is in src/main/resources:
>
> log4j.logger.org.hibernate=info
>
> ### log HQL query parser activity
> #log4j.logger.org.hibernate.hql.ast.AST=info
>
> ### log just the SQL
> log4j.logger.org.hibernate.SQL=debug
>
> This seems to be logging what I expect.
>
> Andy
>
> On Mon, 2008-01-07 at 15:07 -0800, buckofive wrote:
>   
>> Is no one else having issues logging 3rd party libraries?  I am unable to get
>> any hibernate or spring logs.  I have tried creating several different
>> tapestry test projects using the 5.0.7 archetype but with I still get
>> nothing.  They all seem to only log tapestry framework and "my pages" logs. 
>> Could someone who has success logging hibernate post their log4j.properties
>> file? Please. Pretty Please ... with sugar on top.
>>
>> thanks,
>> B
>>
>>
>>
>> buckofive wrote:
>> 
>>> Hi all,
>>>
>>> I'm stuck at the moment trying to get log4j to log any 3rd party
>>> libraries.  It seems to work fine for classes within my web project(ie
>>> page classes etc.) and if I set the root level to debug I get what looks
>>> like mostly  web container statements.  Any help would be much
>>> appreciated.  
>>>
>>> Here is a very basic version of my log4j.properties file:
>>>
>>> [code]
>>> log4j.rootCategory=WARN, A1
>>>
>>> # A1 is set to be a ConsoleAppender. 
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> # A1 uses PatternLayout.
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>> log4j.appender.A1.layout.ConversionPattern=[%p] %c{1} %m%n
>>>
>>> log4j.category.org.apache.tapestry.TapestryFilter=info
>>> log4j.category.org.apache.tapestry=error
>>> log4j.category.tapestry=error
>>>
>>> log4j.category.com.jpa=error
>>>
>>> # Service category names are the name of the defining module class
>>> # and then the service id.
>>> log4j.category.com.jpa.services.AppModule.TimingFilter=info
>>>
>>> log4j.category.org.hibernate=debug
>>>
>>> [/code]
>>>
>>>
>>> Whats weird is these settings works fine in a non-tapestry application.  I
>>> created my project with the tapestry 5.0.7 archetype and my file is
>>> located in \src\main\resources\log4j.properties.  Am I missing
>>> something or doing something wrong?
>>>
>>> thanks in advance,
>>> B
>>>
>>>
>>>   
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>   


Re: What's heartbeat ?

2008-01-07 Thread Steph
Your code Gabriel work as well without heartbeats ... ;-)

Stephane

Gabriel Landais a écrit :
> Michael Courcy a écrit :
>> If you look at this exemple :  TreeGridComponent
>> http://tapestry5-treegrid.googlecode.com/svn/trunk/tapestry5-treegrid/src/main/java/org/codelutin/tapestry/components/TreeGrid.java
>>
>> a hearbeat.begin is called in beginRender and heartbeat.end is called
>> in afterRender but you can never read a call to defer, so can you
>> explain why the author of this component call begin and end ? I
>> really can't explain myself.
> I've based my component on
> 
> and  without
> really understanding how it heartbeat works... As I don't use defer, I
> don't even know if it is useful...
> Gabriel
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

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



Re: [T5] tapestry-spring and WebApplicationContext

2007-11-20 Thread Steph
Yes, i've set this configuration.
But my injection of the WebApplicationContext is not in a page but in
another class. Is it a problem ?

Stephane

Ezra Epstein a écrit :
> And your web.xml file has:
>
> 
>   
> org.springframework.web.context.ContextLoaderListener
> 
>
> And if the application context .xml files aren't in the standard place and 
> named the standard way you've also included:
>
> 
> contextConfigLocation
> 
> 
>
> ?
>
> Steph <[EMAIL PROTECTED]> wrote: I've tried this but my WebApplicationContext 
> is null ...
>
> Stephane
>
>
> SergeEby a �crit :
>   
>> Hi,
>>
>> Just import and inject the WAC in your page:
>>
>> import org.springframework.web.context.WebApplicationContext;
>>
>> class Foo {
>>
>> ...
>>  @Inject
>>  private WebApplicationContext  wac;
>>
>> ...
>> }
>>
>>
>>
>>
>> /Serge
>>
>>
>>
>> cyrille37 wrote:
>>   
>> 
>>> Fidel Chavarria a �crit :
>>> 
>>>   
>>>> Hi
>>>> I think this willhelp you,
>>>> http://tapestry.apache.org/tapestry5/tapestry-spring/
>>>>   
>>>>   
>>>> 
>>> Thanks,
>>> but if you had read my mail, I should see that I'm talked about this page.
>>>
>>> In this page in "Limitations" chapter it is writte that we can't inject 
>>> Spring session bean but we have to retreive the WebApplicationContext 
>>> and use it.
>>> But I don't know howto retreive this so famous WebApplicationContext 
>>> when I'm in a tapestry code page or component.
>>>
>>> cyrille.
>>> 
>>>   
>>>> cyrille37 wrote:
>>>>   
>>>>   
>>>> 
>>>>> Hi,
>>>>>
>>>>> In the T5 tapestry-spring documentation it is writed to don't use other 
>>>>> Spring beans than Singleton ones.
>>>>> Inject the WebApplicationContext instead.
>>>>> http://tapestry.apache.org/tapestry5/tapestry-spring/
>>>>>
>>>>> But howto inject the WebApplicationContext ?
>>>>>
>>>>> thanks
>>>>> cyrille
>>>>>
>>>>> -
>>>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>>>
>>>>>
>>>>>
>>>>> 
>>>>> 
>>>>>   
>>>>   
>>>>   
>>>> 
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>>
>>> 
>>>   
>>   
>> 
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>   


Re: [T5] tapestry-spring and WebApplicationContext

2007-11-19 Thread Steph
I've tried this but my WebApplicationContext is null ...

Stephane


SergeEby a écrit :
> Hi,
>
> Just import and inject the WAC in your page:
>
> import org.springframework.web.context.WebApplicationContext;
>
> class Foo {
>
> ...
>  @Inject
>  private WebApplicationContext  wac;
>
> ...
> }
>
>
>
>
> /Serge
>
>
>
> cyrille37 wrote:
>   
>> Fidel Chavarria a écrit :
>> 
>>> Hi
>>> I think this willhelp you,
>>> http://tapestry.apache.org/tapestry5/tapestry-spring/
>>>   
>>>   
>> Thanks,
>> but if you had read my mail, I should see that I'm talked about this page.
>>
>> In this page in "Limitations" chapter it is writte that we can't inject 
>> Spring session bean but we have to retreive the WebApplicationContext 
>> and use it.
>> But I don't know howto retreive this so famous WebApplicationContext 
>> when I'm in a tapestry code page or component.
>>
>> cyrille.
>> 
>>> cyrille37 wrote:
>>>   
>>>   
 Hi,

 In the T5 tapestry-spring documentation it is writed to don't use other 
 Spring beans than Singleton ones.
 Inject the WebApplicationContext instead.
 http://tapestry.apache.org/tapestry5/tapestry-spring/

 But howto inject the WebApplicationContext ?

 thanks
 cyrille

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



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

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



Re: T5 : Event system

2007-11-15 Thread Steph
Is there a version number or deadline already planned for this
functionality ?

Thiago H de Paula Figueiredo a écrit :
> On Wed, 14 Nov 2007 08:13:53 -0200, Stephane Decleire
> <[EMAIL PROTECTED]> wrote:
>
>> I've tried without success to add an "onchange" event on a select box
>> without firing the submit of the form.
>>
>> @OnEvent(value="onChange", component="mySelect")
>> private String select() {
>> log.info("new item selected");
>> return null;
>> }
>
> AFAIK, the binding of methods to Javascript events is not implemented
> yet.
>


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



Re: T5 : Event system

2007-11-14 Thread Steph

Stephane Decleire a écrit :
I've tried without success to add an "onchange" event on a select box 
without firing the submit of the form.


@OnEvent(value="onChange", component="mySelect")
private String select() {
   log.info("new item selected");
   return null;
}

Did i miss something or is the only way to get an event on a select is 
to submit the form ?

Thanks in advance.

Stephane

It seems that my need is similar to Martin ... (onchange event from a 
select).


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