Re: Tapestry 5 service configuration

2007-10-15 Thread Chris Lewis

Hi Peter

1) I think the general opinion on this is that a service and an aso are 
completely different animals. I can't think of a situation where I'd 
ever want an aso to be a service (or vice versa), but that's just me. If 
there is a way to do this, someone else will need to chime in.


2) @Inject it. Assuming you bound or built your service, you can simply 
inject it using @Inject as the general type (usually an interface) of 
object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:

Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use @ApplicationState in 
this case).


2. How do you retrieve a service object that has been contributed to 
the framework


Thanks
Peter

-
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, Hibernate and Underscores.

2007-10-15 Thread Davor Hrg
maybe you missed the point here,

never mind the reason I use the _ prefix ..
the problem was with hibernate, not with tapestry

Davor Hrg

On 10/15/07, Christian Gruber [EMAIL PROTECTED] wrote:

 Tapestry doesn't require _ prefixes, mind you.  That's a Howard M.
 Lewis Ship-ism.  (actually, I have it too from my NeXTSTEP days.)
 It's not mandatory, however, so on your persistent objects, you could
 use the typical pattern and annotate your properties, if that's how
 you want to do it.  Tapestry will (it seems) do its magic on
 properties taht are annotated regardless of their prefix, because it's
 the annotation that matters, not the variable name.

 Christian.

 On 14-Oct-07, at 4:17 PM, Davor Hrg wrote:

  hi,
 
  I've tried to adopt underscores for private fields,
  so the the tutorial got mixed when I've created that page with
  AngeloChen.
 
  I'll check tomorow if this is true, but I belive you
  can avoid this problem by not putting annotations
  on the fields and putting them on the getters or setters instead
 
  @Id
  private long _id;
 
  public getId()...
  public setId()...
 
  in this example hibernate will see annotation on the field
  and see it as _id
 
  if you change the code to
 
  private long _id;
 
  @Id
  public getId()...
  public setId()...
 
  in this example hibernate will see annotation on the getter
  and see it as id when get is stripped
 
  !Beware. if you put annotations both on fields and getters
  hibernate will loose some of them
 
 
  I'll find some time and fix the code to adopt one convention
 
  Davor Hrg
 
 
 
 
 
 
  On 10/13/07, Angelo Chen [EMAIL PROTECTED] wrote:
 
 
  Hi Olivier,
 
  In that tutorial the only place with underscore is _session, the
  entities
  for hibernate do not have underscore, I prefer this way, it looks
  normal
  when u do some sql/hql queries, but for Tapestry variables ,seems
  to me, a
  unspoken rule here is to prefix underscore.
 
  A.C.
 
 
  Olivier-36 wrote:
 
 
  Hi,
 
 
  I followed the small tutorial on using hibernate with T5 here
  http://wiki.apache.org/tapestry/Tapestry5HowToUseTapestryHibernate
  and
  it
  worked like a charm. Thank you to whoever wrote this!
 
  The example uses underscores for some private fields and sometimes
  not.
  Now
  I want to use this in my entities but then Hibernate generates
  incorrect
  column names. Isn't there a way for tuning this in the configuration
  file
  or something? If someone has that info, please share it with me!
 
 
  Thank you in advance,
  Olivier
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  View this message in context:
 
 http://www.nabble.com/T5%3A-Tapestry%2C-Hibernate-and-Underscores.-tf4614534.html#a13188869
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  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: Tapestry 5 service configuration

2007-10-15 Thread Kristian Marinkovic
hi peter,

ASOs that have a (non-empty) constructor can be instantiated by 
contributing to the ApplicationStateManager service. Please see
the thread for the source. if you contribute to this service you can 
still use the @ApplicationState annotation.

http://www.nabble.com/-T5-Question-on-ASO-configuration-tf3399851.html#a9469215

g,
kris




Chris Lewis [EMAIL PROTECTED] 
15.10.2007 08:09
Bitte antworten an
Tapestry users users@tapestry.apache.org


An
Tapestry users users@tapestry.apache.org
Kopie

Thema
Re: Tapestry 5 service configuration






Hi Peter

1) I think the general opinion on this is that a service and an aso are 
completely different animals. I can't think of a situation where I'd 
ever want an aso to be a service (or vice versa), but that's just me. If 
there is a way to do this, someone else will need to chime in.

2) @Inject it. Assuming you bound or built your service, you can simply 
inject it using @Inject as the general type (usually an interface) of 
object, and Tapestry IoC will resolve it for you.

sincerely,
chris

Peter Stavrinides wrote:
 Hi all,

 Following on from a previous post on this subject I have some 
 questions on Tapestry 5 IoC:

 1. How do you register an ASO as a service if you have to provide 
 arguments to the constructor (i.e. you cannot use @ApplicationState in 
 this case).

 2. How do you retrieve a service object that has been contributed to 
 the framework

 Thanks
 Peter

 -
 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: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides

Hi Chris

I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:

Hi Peter

1) I think the general opinion on this is that a service and an aso 
are completely different animals. I can't think of a situation where 
I'd ever want an aso to be a service (or vice versa), but that's just 
me. If there is a way to do this, someone else will need to chime in.


2) @Inject it. Assuming you bound or built your service, you can 
simply inject it using @Inject as the general type (usually an 
interface) of object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:

Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use @ApplicationState 
in this case).


2. How do you retrieve a service object that has been contributed to 
the framework


Thanks
Peter

-
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: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides

Thanks for this Kristian, exactly what I wanted!

cheers,
Peter

Kristian Marinkovic wrote:

hi peter,

ASOs that have a (non-empty) constructor can be instantiated by 
contributing to the ApplicationStateManager service. Please see
the thread for the source. if you contribute to this service you can 
still use the @ApplicationState annotation.


http://www.nabble.com/-T5-Question-on-ASO-configuration-tf3399851.html#a9469215

g,
kris




Chris Lewis [EMAIL PROTECTED] 
15.10.2007 08:09

Bitte antworten an
Tapestry users users@tapestry.apache.org


An
Tapestry users users@tapestry.apache.org
Kopie

Thema
Re: Tapestry 5 service configuration






Hi Peter

1) I think the general opinion on this is that a service and an aso are 
completely different animals. I can't think of a situation where I'd 
ever want an aso to be a service (or vice versa), but that's just me. If 
there is a way to do this, someone else will need to chime in.


2) @Inject it. Assuming you bound or built your service, you can simply 
inject it using @Inject as the general type (usually an interface) of 
object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:
  

Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use @ApplicationState in 
this case).


2. How do you retrieve a service object that has been contributed to 
the framework


Thanks
Peter

-
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: Tapestry 5 service configuration

2007-10-15 Thread MavenMan



Peter Stavrinides wrote:
 
 Hi Chris
 ApplicationStateManager  is a service , I also think a service and an aso 
 are completely different thing.
 
 in a word, It is a concept problem. 
 
 
 are completely different 
 
 
 
 I am no expert on T5, but strongly disagree with you.
 
 Peter
 
 Chris Lewis wrote:
 Hi Peter

 1) I think the general opinion on this is that a service and an aso 
 are completely different animals. I can't think of a situation where 
 I'd ever want an aso to be a service (or vice versa), but that's just 
 me. If there is a way to do this, someone else will need to chime in.

 2) @Inject it. Assuming you bound or built your service, you can 
 simply inject it using @Inject as the general type (usually an 
 interface) of object, and Tapestry IoC will resolve it for you.

 sincerely,
 chris

 Peter Stavrinides wrote:
 Hi all,

 Following on from a previous post on this subject I have some 
 questions on Tapestry 5 IoC:

 1. How do you register an ASO as a service if you have to provide 
 arguments to the constructor (i.e. you cannot use @ApplicationState 
 in this case).

 2. How do you retrieve a service object that has been contributed to 
 the framework

 Thanks
 Peter

 -
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-service-configuration-tf4624618.html#a13208221
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Form submission fails only after the 1st time, T4.1.3 bug?

2007-10-15 Thread Nikolaos Konstantinou
I am facing this strange behaviour if Tapestry 4.1.3:

I have a form, declared in the .page as:

  component id=quoteForm type=Form
binding name=listener value=listener:quoteSubmit/
binding name=delegate value=beans.validationDelegate/
binding name=method value='get'/
binding name=success value=listener:quoteSubmit/
  /component

In the .xhtml file, I place a PropertySelection component (model and value
are ok).
  component id=selectCountry type=PropertySelection
binding name=model value=countrySelectionModel/
binding name=value value=selectedCountryId/
  /component

The problem is that I want to submit the form when the user changes the
value of the drop-down list.
Till Tapestry 3.0 -- as far as I'm aware of -- there was a
submitOnChange=true  that worked fine.

How can this be done in Tapestry 4.1.*?
I tried writing
onchange=javascript:this.form.submit(); at the PropertySelection component


select jwcid=selectCountry onchange=javascript:this.form.submit();

but it only works once(!). What I mean is that the first time the user
selects something, everything works, the form gets submitted and the page
gets refreshed.
When I try for the second time, I get a blank screen without any debug
message and sometimes (after small modifications) the The connection to the
server was reset message! Shouldn't Tapestry produce some kind of a
warning?

The listener code is

public IPage quoteSubmit(IRequestCycle cycle) {

System.out.println(SelectedCountryId:  + getSelectedCountryId());

System.out.println(nkons Debug check QUOTE_SUBMIT  +
getSelectedSubmitComponent());
if (QUOTE_SUBMIT.equals(getSelectedSubmitComponent())) {

.
  return some_other_page;
   } else {
this.setSelectedLocationId(null);
return this;
}

The application server is jboss 4.2.1
I would appreciate any ideas


T5:passing parameter from a nested layout component

2007-10-15 Thread Angelo Chen

Hi,

I have a nested layout component and I'd like to pass a parameter from the
child to the parent, here are the codes/templates:

The parent component:

template:
html xmlns:t=...
headtitle${title}/title/head
body
t:body/t:body
/body
/html

public class MLayout {
@Parameter
private String _title;
public String getTitle() {return  _title;}
public void setTitle(String title) {this._title = title;}
}

To use the above layout, I can do something as follow, passing the title as
parameter:

t:mlayout  t:title=literal:My Page xmlns:t=...
/t:mlayou

So far so good, Now I have a need to create another layout component from
the MLayout, let's call it MLayoutNew:  

public class MLayoutNew {
}

template is:
t:mlayout  xmlns:t=... 
t:body/t:body
/t:mlayout  

To use this nested layout component, I have following template:
t:mlayoutNew  t:title=literal:My Page new xmlns:t=...
/t:mlayoutNew  

but the title is blank, any helps? Thanks,
A.C.


-- 
View this message in context: 
http://www.nabble.com/T5%3Apassing-parameter-from-a-nested-layout-component-tf4625129.html#a13208405
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: Form submission fails only after the 1st time, T4.1.3 bug?

2007-10-15 Thread Patrick Klein

Hello,

javascript: is not needed, just
   onChange=this.form.submit();

Regards,
   Patrick

I am facing this strange behaviour if Tapestry 4.1.3:

I have a form, declared in the .page as:

  component id=quoteForm type=Form
binding name=listener value=listener:quoteSubmit/
binding name=delegate value=beans.validationDelegate/
binding name=method value='get'/
binding name=success value=listener:quoteSubmit/
  /component

In the .xhtml file, I place a PropertySelection component (model and value
are ok).
  component id=selectCountry type=PropertySelection
binding name=model value=countrySelectionModel/
binding name=value value=selectedCountryId/
  /component

The problem is that I want to submit the form when the user changes the
value of the drop-down list.
Till Tapestry 3.0 -- as far as I'm aware of -- there was a
submitOnChange=true  that worked fine.

How can this be done in Tapestry 4.1.*?
I tried writing
onchange=javascript:this.form.submit(); at the PropertySelection component


select jwcid=selectCountry onchange=javascript:this.form.submit();

but it only works once(!). What I mean is that the first time the user
selects something, everything works, the form gets submitted and the page
gets refreshed.
When I try for the second time, I get a blank screen without any debug
message and sometimes (after small modifications) the The connection to the
server was reset message! Shouldn't Tapestry produce some kind of a
warning?

The listener code is

public IPage quoteSubmit(IRequestCycle cycle) {

System.out.println(SelectedCountryId:  + getSelectedCountryId());

System.out.println(nkons Debug check QUOTE_SUBMIT  +
getSelectedSubmitComponent());
if (QUOTE_SUBMIT.equals(getSelectedSubmitComponent())) {

.
  return some_other_page;
   } else {
this.setSelectedLocationId(null);
return this;
}

The application server is jboss 4.2.1
I would appreciate any ideas

  



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



Re: Form submission fails only after the 1st time, T4.1.3 bug?

2007-10-15 Thread Nikolaos Konstantinou
Hello,

I managed to solve it. The problem was the line at the listener:
this.setSelectedLocationId(null);
that was setting the selectedLocation to null. Why I asked before was
because I was facing a behaviour without any produced messages, so I didn't
know where to begin. In the beginning of the listener I had a
System.out.println(SelectedCountryId:  + getSelectedCountryId());
that wasn't printing anything (not even a null exception).
I found the solution ad hoc after all but anyway, thanks for the quick reply

On 10/15/07, Patrick Klein [EMAIL PROTECTED] wrote:

 Hello,

 javascript: is not needed, just
 onChange=this.form.submit();

 Regards,
 Patrick
  I am facing this strange behaviour if Tapestry 4.1.3:
 
  I have a form, declared in the .page as:
 
component id=quoteForm type=Form
  binding name=listener value=listener:quoteSubmit/
  binding name=delegate value=beans.validationDelegate/
  binding name=method value='get'/
  binding name=success value=listener:quoteSubmit/
/component
 
  In the .xhtml file, I place a PropertySelection component (model and
 value
  are ok).
component id=selectCountry type=PropertySelection
  binding name=model value=countrySelectionModel/
  binding name=value value=selectedCountryId/
/component
 
  The problem is that I want to submit the form when the user changes the
  value of the drop-down list.
  Till Tapestry 3.0 -- as far as I'm aware of -- there was a
  submitOnChange=true  that worked fine.
 
  How can this be done in Tapestry 4.1.*?
  I tried writing
  onchange=javascript:this.form.submit(); at the PropertySelection
 component
 
 
  select jwcid=selectCountry onchange=javascript:this.form.submit();
 
  but it only works once(!). What I mean is that the first time the user
  selects something, everything works, the form gets submitted and the
 page
  gets refreshed.
  When I try for the second time, I get a blank screen without any debug
  message and sometimes (after small modifications) the The connection to
 the
  server was reset message! Shouldn't Tapestry produce some kind of a
  warning?
 
  The listener code is
 
  public IPage quoteSubmit(IRequestCycle cycle) {
 
  System.out.println(SelectedCountryId:  +
 getSelectedCountryId());
 
  System.out.println(nkons Debug check QUOTE_SUBMIT  +
  getSelectedSubmitComponent());
  if (QUOTE_SUBMIT.equals(getSelectedSubmitComponent())) {
  
  .
return some_other_page;
 } else {
  this.setSelectedLocationId(null);
  return this;
  }
 
  The application server is jboss 4.2.1
  I would appreciate any ideas
 
 


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




-- 
Nikolaos Konstantinou
PhD Student - Research Assistant
Homepage: http://www.cn.ntua.gr/~nkons


Re: [T5] Recommended naming of configurations

2007-10-15 Thread [EMAIL PROTECTED]
在 Sun, 14 Oct 2007 23:40:38 +0800,Howard Lewis Ship [EMAIL PROTECTED] 写 
道:



Where I dropped the ball here, in a minor way, is that it should be
contributeTo as a prefix, or perhaps configure.  It's a prefix on the
*service* being configured or contributed to.  So I would choose option  
#2

or #3.

I wonder if there's some value in something like:

@Contribute(FooBar.class)
public void whatWouldYouCallThis(ConfigurationFooBarDatum  
configuration) {

... }

This is heading a bit backwards from my initial goals, of naming  
conventions
over annotations, and raises the question of the convention for naming  
such

methods, but it would allow for more pleasing names such as
contributeLoggingFilter (with the annotation) vs.
contributeRequestHandler (which gives no indication what is being
contributed).



I like contributeTo, and like @Contribute too.



On 10/12/07, Dan Adams [EMAIL PROTECTED] wrote:


Let's say you have a service that allows multiple contributions. One of
the contributions is simply a list of other objects (say an ordered
configuration). What is the naming convention for the configuration
point for that list of objects? For instance, lets say you want to have
a list of FooBars contributed. Which of the following is recommended:

contributeFooBars()

contributeFooBarManager()

contributeMasterFooBar()

or would you recommend something else entirely? I think I like the first
one simply because it more readable in the modules that are
contributing.

--
Dan Adams
Senior Software Engineer
Interactive Factory
617.235.5857


-
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: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides
A concept problem? really?? now I am curious as to what this concept 
problem actually, is could you explain it.


Peter

MavenMan wrote:


Peter Stavrinides wrote:
  

Hi Chris
ApplicationStateManager  is a service , I also think a service and an aso 
are completely different thing.


in a word, It is a concept problem. 




are completely different 
  


I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:


Hi Peter

1) I think the general opinion on this is that a service and an aso 
are completely different animals. I can't think of a situation where 
I'd ever want an aso to be a service (or vice versa), but that's just 
me. If there is a way to do this, someone else will need to chime in.


2) @Inject it. Assuming you bound or built your service, you can 
simply inject it using @Inject as the general type (usually an 
interface) of object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:
  

Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use @ApplicationState 
in this case).


2. How do you retrieve a service object that has been contributed to 
the framework


Thanks
Peter

-
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]






  



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



T5: Setting properties to null

2007-10-15 Thread Hugo Palma
It seems that properties associated with form fields are never set to 
null even if the submitted is empty. This would be ok if the property 
was coerced into a String as i could simply check for an empty String. 
The problem is different when it's coerced to an Integer or to a Double 
because if the user submits an empty form field the page get's the 
Integer or Double representing 0.


I've tracked the problem down to the TypeCoercer implementation. The 
given implementation coerces null values into the default value of a 
type. So if you want to coerce a null to a Double if return 0.0d instead 
of just null.
I'm not sure if this is actually intended behavior and there's probably 
an easy way through configuration or something to solve my use case or 
if it's a bug.


Any ideas ?


Re: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides
As far as I'm concerned service is an ugly word everyone likes to throw 
around, what you are really dealing with is the concept of persistence 
with Pojo's using Inversion of Control.


Peter Stavrinides wrote:
A concept problem? really?? now I am curious as to what this concept 
problem actually, is could you explain it.


Peter

MavenMan wrote:


Peter Stavrinides wrote:

Hi Chris
ApplicationStateManager is a service , I also think a service and an 
aso are completely different thing.


in a word, It is a concept problem.

are completely different 


I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:

Hi Peter

1) I think the general opinion on this is that a service and an aso 
are completely different animals. I can't think of a situation 
where I'd ever want an aso to be a service (or vice versa), but 
that's just me. If there is a way to do this, someone else will 
need to chime in.


2) @Inject it. Assuming you bound or built your service, you can 
simply inject it using @Inject as the general type (usually an 
interface) of object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:

Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use 
@ApplicationState in this case).


2. How do you retrieve a service object that has been contributed 
to the framework


Thanks
Peter

-
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]








-
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: Setting properties to null

2007-10-15 Thread Nick Westgate

This was changed a month ago by Howard. There's already a complaint
attached to the closed issue:
https://issues.apache.org/jira/browse/TAPESTRY-1648

Perhaps it should be re-opened and re-examined.

Cheers,
Nick.


Hugo Palma wrote:
It seems that properties associated with form fields are never set to 
null even if the submitted is empty. This would be ok if the property 
was coerced into a String as i could simply check for an empty String. 
The problem is different when it's coerced to an Integer or to a Double 
because if the user submits an empty form field the page get's the 
Integer or Double representing 0.


I've tracked the problem down to the TypeCoercer implementation. The 
given implementation coerces null values into the default value of a 
type. So if you want to coerce a null to a Double if return 0.0d instead 
of just null.
I'm not sure if this is actually intended behavior and there's probably 
an easy way through configuration or something to solve my use case or 
if it's a bug.


Any ideas ?



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



Re: T5:passing parameter from a nested layout component

2007-10-15 Thread Angelo Chen

problem solved, what needed is, I create a setTitle/getTitle in the
MlayoutNew.java as well, then :
t:Mlayout  t:title=title/t:Mlayout


Angelo Chen wrote:
 
 

-- 
View this message in context: 
http://www.nabble.com/T5%3Apassing-parameter-from-a-nested-layout-component-tf4625129.html#a13209886
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Setting properties to null

2007-10-15 Thread Hugo Palma

Thanks, i've added a comment to the issue.

Nick Westgate wrote:

This was changed a month ago by Howard. There's already a complaint
attached to the closed issue:
https://issues.apache.org/jira/browse/TAPESTRY-1648

Perhaps it should be re-opened and re-examined.

Cheers,
Nick.


Hugo Palma wrote:
It seems that properties associated with form fields are never set to 
null even if the submitted is empty. This would be ok if the property 
was coerced into a String as i could simply check for an empty 
String. The problem is different when it's coerced to an Integer or 
to a Double because if the user submits an empty form field the page 
get's the Integer or Double representing 0.


I've tracked the problem down to the TypeCoercer implementation. The 
given implementation coerces null values into the default value of a 
type. So if you want to coerce a null to a Double if return 0.0d 
instead of just null.
I'm not sure if this is actually intended behavior and there's 
probably an easy way through configuration or something to solve my 
use case or if it's a bug.


Any ideas ?



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




Re: Tapestry 5 service configuration

2007-10-15 Thread MavenMan

I just to say maybe the concept problem is you are  dealing with is the
concept of persistence 
with Pojo's using Inversion of Control , so you are mixed-up. many folk have
talk about the good of ioc 
.Now could you give me a explain of how t5 manage the service and aso? 

Peter Stavrinides wrote:
 
 As far as I'm concerned service is an ugly word everyone likes to throw 
 around, what you are really dealing with is the concept of persistence 
 with Pojo's using Inversion of Control.
 
 Peter Stavrinides wrote:
 A concept problem? really?? now I am curious as to what this concept 
 problem actually, is could you explain it.

 Peter

 MavenMan wrote:

 Peter Stavrinides wrote:
 Hi Chris
 ApplicationStateManager is a service , I also think a service and an 
 aso are completely different thing.

 in a word, It is a concept problem.

 are completely different 

 I am no expert on T5, but strongly disagree with you.

 Peter

 Chris Lewis wrote:
 Hi Peter

 1) I think the general opinion on this is that a service and an aso 
 are completely different animals. I can't think of a situation 
 where I'd ever want an aso to be a service (or vice versa), but 
 that's just me. If there is a way to do this, someone else will 
 need to chime in.

 2) @Inject it. Assuming you bound or built your service, you can 
 simply inject it using @Inject as the general type (usually an 
 interface) of object, and Tapestry IoC will resolve it for you.

 sincerely,
 chris

 Peter Stavrinides wrote:
 Hi all,

 Following on from a previous post on this subject I have some 
 questions on Tapestry 5 IoC:

 1. How do you register an ASO as a service if you have to provide 
 arguments to the constructor (i.e. you cannot use 
 @ApplicationState in this case).

 2. How do you retrieve a service object that has been contributed 
 to the framework

 Thanks
 Peter

 -
 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]






 -
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tapestry-5-service-configuration-tf4624618.html#a13210596
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



T5: tapestry-spring v tapestry-acegi

2007-10-15 Thread Christian Gorbach

hi all,

has somebody managed to set up a project with tapestry-spring and
tapestry-acegi together? As soon as i add the tapestryspring filter to
web.xml, tapestry-acegi doesn't work anymore (based on the acegi demo app
from robin)

snip
Exception constructing service 'RememberMeServices': Error invoking service
builder method
nu.localhost.tapestry.acegi.services.SecurityModule.build(UserDetailsService,
String) (at SecurityModule.java:198) (for service 'RememberMeServices'): No
service implements the interface
org.acegisecurity.userdetails.UserDetailsService.
/snip 

anyone?

regards
c)hristian
-- 
View this message in context: 
http://www.nabble.com/T5%3A-tapestry-spring-v-tapestry-acegi-tf4626390.html#a13210597
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Binding to sub-properties

2007-10-15 Thread Jesse Merriman
(Tapestry newb, using 4.1.3, maybe answered before but I couldn't find it.)

Is it possible to bind to a sub-property? Eg, this works:

  Home.html:
  input jwcid=@TextField value=ognl:num /

  Home.java:
  public abstract class Home extends BasePage implements PageBeginRender {
public abstract int getNum();
public abstract void setNum(int num);
...
  }

This does not work:

  Home.html:
  input jwcid=@TextField value=ognl:foo.num /
or
  input jwcid=@TextField value=ognl:getFoo().num /

  public abstract class Home extends BasePage implements PageBeginRender {
public abstract Wrapper getFoo();
public abstract void setFoo(Wrapper wrap);
...
  }

  public class Wrapper {
private int num;
public int getNum() { return num; }
public void setNum(int n) { num = n; }
  }

The reason I'd like to do this is to collect the values of a number of
inputs
into one object to simplify some other areas of code.

Thanks,
Jesse


Re: Tapestry 5 service configuration

2007-10-15 Thread Chris Lewis
An overused word it may be, but it has a fairly concrete meaning in 
Tapestry. It feels like its getting a tad warm, so please allay any 
fires brewing. I'm no expert in T5 either, but the notion of object 
persistence is /not at all/ intrinsic to what services are. A service 
may provide a mechanism for such persistence (like tapestry-hibernate), 
but services exist for a generic reason - to provide functionality to 
your application.
What parts? Pages, components, domain objects, other services, etc etc. 
tapestry-hibernate provides a direct service implementation for object 
persistence. Components  or pages may use this directly, or you may have 
an ORM abstraction layer in your app. They are simply about functionality.
The persistence I think you are talking about is application state - 
tying an object to a certain user (session). Such objects are your ASOs, 
but they are not themselves services. They are managed by a service 
(ApplicationStateManager). An ASO would be something like a User object 
that holds data you would expect (user name, real name, etc). It's a 
domain object, not a service. The object used to authenticate the user 
(and thus provide that object) might be a service.
Of course services are sometimes scoped per-thread, meaning that each 
request (and therefore each requesting client) gets a copy instantiated 
just for it. I guess its feasible that you could tie such a service to a 
specific request as an ASO, but again this isn't what services do. 
Pardon my rambling, but the real issue just became clear. In theory 
(yes, theory), application state is just that: state. State is data, not 
behavior. Services encapsulate behavior. Sure, there may be pragmatic 
reasons for blurring the lines, but that is the conceptual difference 
and is worth noting (even if sometimes violated for the sake of pragmatism).


sincerely, and hopefully not confusingly,
chris

Peter Stavrinides wrote:
As far as I'm concerned service is an ugly word everyone likes to 
throw around, what you are really dealing with is the concept of 
persistence with Pojo's using Inversion of Control.


Peter Stavrinides wrote:
A concept problem? really?? now I am curious as to what this concept 
problem actually, is could you explain it.


Peter

MavenMan wrote:


Peter Stavrinides wrote:

Hi Chris
ApplicationStateManager is a service , I also think a service and 
an aso are completely different thing.


in a word, It is a concept problem.

are completely different 


I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:

Hi Peter

1) I think the general opinion on this is that a service and an 
aso are completely different animals. I can't think of a situation 
where I'd ever want an aso to be a service (or vice versa), but 
that's just me. If there is a way to do this, someone else will 
need to chime in.


2) @Inject it. Assuming you bound or built your service, you can 
simply inject it using @Inject as the general type (usually an 
interface) of object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:

Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use 
@ApplicationState in this case).


2. How do you retrieve a service object that has been contributed 
to the framework


Thanks
Peter

- 


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]








-
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: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides
Since you are confused by the question, let me rephrase it in a 
different way then:


1. How do you register an ASO with the IoC managed container (or registry if you prefer that word) if you have to provide 
arguments in the constructor (i.e. you cannot use 
@ApplicationState in this case).




MavenMan wrote:

I just to say maybe the concept problem is you are  dealing with is the
concept of persistence 
with Pojo's using Inversion of Control , so you are mixed-up. many folk have
talk about the good of ioc 
.Now could you give me a explain of how t5 manage the service and aso? 


Peter Stavrinides wrote:
  
As far as I'm concerned service is an ugly word everyone likes to throw 
around, what you are really dealing with is the concept of persistence 
with Pojo's using Inversion of Control.


Peter Stavrinides wrote:

A concept problem? really?? now I am curious as to what this concept 
problem actually, is could you explain it.


Peter

MavenMan wrote:
  

Peter Stavrinides wrote:


Hi Chris
ApplicationStateManager is a service , I also think a service and an 
aso are completely different thing.


in a word, It is a concept problem.

  
are completely different 


I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:
  

Hi Peter

1) I think the general opinion on this is that a service and an aso 
are completely different animals. I can't think of a situation 
where I'd ever want an aso to be a service (or vice versa), but 
that's just me. If there is a way to do this, someone else will 
need to chime in.


2) @Inject it. Assuming you bound or built your service, you can 
simply inject it using @Inject as the general type (usually an 
interface) of object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:


Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to provide 
arguments to the constructor (i.e. you cannot use 
@ApplicationState in this case).


2. How do you retrieve a service object that has been contributed 
to the framework


Thanks
Peter

-
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]



  

-
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: Tapestry 5 service configuration

2007-10-15 Thread Robert Zeigler

Use the ApplicationStateManager?

@Inject
ApplicationStateManager _manager;

MyObject foo = new MyObject(someArguments);
_manager.set(MyObject.class,foo);

Cheers,

Robert

On Oct 15, 2007, at 10/156:58 AM , Peter Stavrinides wrote:

Since you are confused by the question, let me rephrase it in a  
different way then:


1. How do you register an ASO with the IoC managed container (or  
registry if you prefer that word) if you have to provide arguments  
in the constructor (i.e. you cannot use @ApplicationState in this  
case).




MavenMan wrote:
I just to say maybe the concept problem is you are  dealing with  
is the
concept of persistence with Pojo's using Inversion of Control , so  
you are mixed-up. many folk have
talk about the good of ioc .Now could you give me a explain of how  
t5 manage the service and aso?

Peter Stavrinides wrote:

As far as I'm concerned service is an ugly word everyone likes to  
throw around, what you are really dealing with is the concept of  
persistence with Pojo's using Inversion of Control.


Peter Stavrinides wrote:

A concept problem? really?? now I am curious as to what this  
concept problem actually, is could you explain it.


Peter

MavenMan wrote:


Peter Stavrinides wrote:


Hi Chris
ApplicationStateManager is a service , I also think a service  
and an aso are completely different thing.


in a word, It is a concept problem.



are completely different

I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:


Hi Peter

1) I think the general opinion on this is that a service and  
an aso are completely different animals. I can't think of a  
situation where I'd ever want an aso to be a service (or vice  
versa), but that's just me. If there is a way to do this,  
someone else will need to chime in.


2) @Inject it. Assuming you bound or built your service, you  
can simply inject it using @Inject as the general type  
(usually an interface) of object, and Tapestry IoC will  
resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:


Hi all,

Following on from a previous post on this subject I have  
some questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to  
provide arguments to the constructor (i.e. you cannot use  
@ApplicationState in this case).


2. How do you retrieve a service object that has been  
contributed to the framework


Thanks
Peter

--- 
--

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]




--- 
--

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]



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



Re: Binding to sub-properties

2007-10-15 Thread Jesse Merriman
Crap, sorry for the double-post. Didn't realize this list accepted messages
from unsubscribed addresses.

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



Re: OT: Different type of MVC

2007-10-15 Thread adasal
Yes, I have worked with a system like this, though not as complete as what
you describe.
I wasn't intimately acquainted with it but what seemed to have been
implemented was a repository for the attributes that should be used when,
for instance, controlling rendering. What was interesting was that this
complete design by the time I came to look at it, was not being used as
various maintainers had circumvented the structure. This meant that there
was little benefit to learning the implementation since, while older code
conformed, newer code didn't. A sorry mess! I think there are various
points. 1. is how desirable that sort of impl is in the first place. That is
to find, learn and change. 2. Open Source can have a credibility and weight
to it that comes by virtue of it being Open Source.
Adam

On 14/10/2007, Howard Lewis Ship [EMAIL PROTECTED] wrote:

 Because it is perfectly shared and uniform, reasonable to cache (portions
 in
 memory), uniformly accessible from multiple machines, etc.

 However, such systems rarely get other aspects right, like coordinating
 code
 changes with content changes, or providing adequate history (equivalent to
 Subversion).

 On 10/14/07, Andrea Chiumenti [EMAIL PROTECTED] wrote:
 
  I always wonder why some ppl want to use a db like a file system.
 
  On 10/13/07, Renat Zubairov [EMAIL PROTECTED] wrote:
  
   I've worked once with the application where all content, e.g. HTML,
   Javascript, CSS was put in the DB. Not very good idea .
  
   Renat
  
   On 12/10/2007, Daniel Jue [EMAIL PROTECTED] wrote:
Hi all, this is not Tapestry related, but since people here keep up
with the cutting edge frameworks, I'm wondering if you've ever heard
of something like this:
   
I've been invited to work on an internal company application (that
 we
resell) that is totally database driven.  As in, the _entire_ web
application is generated with only PL/SQL!  I don't know whether to
 be
scared or amazed.  I talked to the creator, and he said they
implemented an entire Struts-like MVC with session handling.  The
application is not to the point where it builds itself, like a CMS
(Joomla, etc)-- things like Javascript are written and then packed
into the db.
   
Just curious if there is anything else out there like that (or used
 to
be like that!)
   
Daniel
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
   --
   Best regards,
   Renat Zubairov
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 



 --
 Howard M. Lewis Ship
 Partner and Senior Architect at Feature50

 Creator Apache Tapestry and Apache HiveMind



Re: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides

Thanks Robert, I think I have my answer now.

Robert Zeigler wrote:

Use the ApplicationStateManager?

@Inject
ApplicationStateManager _manager;

MyObject foo = new MyObject(someArguments);
_manager.set(MyObject.class,foo);

Cheers,

Robert

On Oct 15, 2007, at 10/156:58 AM , Peter Stavrinides wrote:

Since you are confused by the question, let me rephrase it in a 
different way then:


1. How do you register an ASO with the IoC managed container (or 
registry if you prefer that word) if you have to provide arguments in 
the constructor (i.e. you cannot use @ApplicationState in this case).




MavenMan wrote:

I just to say maybe the concept problem is you are dealing with is the
concept of persistence with Pojo's using Inversion of Control , so 
you are mixed-up. many folk have
talk about the good of ioc .Now could you give me a explain of how 
t5 manage the service and aso?

Peter Stavrinides wrote:

As far as I'm concerned service is an ugly word everyone likes to 
throw around, what you are really dealing with is the concept of 
persistence with Pojo's using Inversion of Control.


Peter Stavrinides wrote:

A concept problem? really?? now I am curious as to what this 
concept problem actually, is could you explain it.


Peter

MavenMan wrote:


Peter Stavrinides wrote:


Hi Chris
ApplicationStateManager is a service , I also think a service 
and an aso are completely different thing.


in a word, It is a concept problem.



are completely different

I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:


Hi Peter

1) I think the general opinion on this is that a service and an 
aso are completely different animals. I can't think of a 
situation where I'd ever want an aso to be a service (or vice 
versa), but that's just me. If there is a way to do this, 
someone else will need to chime in.


2) @Inject it. Assuming you bound or built your service, you 
can simply inject it using @Inject as the general type (usually 
an interface) of object, and Tapestry IoC will resolve it for you.


sincerely,
chris

Peter Stavrinides wrote:


Hi all,

Following on from a previous post on this subject I have some 
questions on Tapestry 5 IoC:


1. How do you register an ASO as a service if you have to 
provide arguments to the constructor (i.e. you cannot use 
@ApplicationState in this case).


2. How do you retrieve a service object that has been 
contributed to the framework


Thanks
Peter

- 


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]





-
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]



-
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]



T5: Pluggable javascript libraries?

2007-10-15 Thread Olivier

Hi,


Is it easily possible to use another javascript library in stead of
prototype? Is anyone trying to do something like that? I, for one, have
more experience with jQuery than Prototype (and I like it better) so it
would be cool to have a tapestry with jQuery in stead of Prototype.


Regards,
Olivier



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



Re: Tapestry 5 service configuration

2007-10-15 Thread lasitha
Actually, it may be easier to contribute to the
ApplicationStateManager instead of having it injected and
getting/setting from it yourself.

See the section on 'Configuring ASOs' here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html

Cheers, lasitha.

On 10/15/07, Peter Stavrinides [EMAIL PROTECTED] wrote:
 Thanks Robert, I think I have my answer now.

 Robert Zeigler wrote:
  Use the ApplicationStateManager?
 
  @Inject
  ApplicationStateManager _manager;
 
  MyObject foo = new MyObject(someArguments);
  _manager.set(MyObject.class,foo);
 
  Cheers,
 
  Robert
 
  On Oct 15, 2007, at 10/156:58 AM , Peter Stavrinides wrote:
 
  Since you are confused by the question, let me rephrase it in a
  different way then:
 
  1. How do you register an ASO with the IoC managed container (or
  registry if you prefer that word) if you have to provide arguments in
  the constructor (i.e. you cannot use @ApplicationState in this case).
 
 
 
  MavenMan wrote:
  I just to say maybe the concept problem is you are dealing with is the
  concept of persistence with Pojo's using Inversion of Control , so
  you are mixed-up. many folk have
  talk about the good of ioc .Now could you give me a explain of how
  t5 manage the service and aso?
  Peter Stavrinides wrote:
 
  As far as I'm concerned service is an ugly word everyone likes to
  throw around, what you are really dealing with is the concept of
  persistence with Pojo's using Inversion of Control.
 
  Peter Stavrinides wrote:
 
  A concept problem? really?? now I am curious as to what this
  concept problem actually, is could you explain it.
 
  Peter
 
  MavenMan wrote:
 
  Peter Stavrinides wrote:
 
  Hi Chris
  ApplicationStateManager is a service , I also think a service
  and an aso are completely different thing.
 
  in a word, It is a concept problem.
 
 
  are completely different
  I am no expert on T5, but strongly disagree with you.
 
  Peter
 
  Chris Lewis wrote:
 
  Hi Peter
 
  1) I think the general opinion on this is that a service and an
  aso are completely different animals. I can't think of a
  situation where I'd ever want an aso to be a service (or vice
  versa), but that's just me. If there is a way to do this,
  someone else will need to chime in.
 
  2) @Inject it. Assuming you bound or built your service, you
  can simply inject it using @Inject as the general type (usually
  an interface) of object, and Tapestry IoC will resolve it for you.
 
  sincerely,
  chris
 
  Peter Stavrinides wrote:
 
  Hi all,
 
  Following on from a previous post on this subject I have some
  questions on Tapestry 5 IoC:
 
  1. How do you register an ASO as a service if you have to
  provide arguments to the constructor (i.e. you cannot use
  @ApplicationState in this case).
 
  2. How do you retrieve a service object that has been
  contributed to the framework
 
  Thanks
  Peter
 
  -
 
  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]
 
 
 
 
  -
  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]
 
 
  -
  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: Does tapestry need an IntegerPropertySelectionModel ?

2007-10-15 Thread Ken nashua

Hi Jesse,

Did this weekends checkins for OGNL address this?

Just curious. Thanks if you got time to reply.

Best regards
Ken in nashua

From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: RE: Does tapestry need an IntegerPropertySelectionModel ?
Date: Fri, 12 Oct 2007 15:34:05 -0400








Thanks Jesse...

I will give your stuff a shot... but am already building/trying an 
IntegerPropertySelectionModel right now to see if it induces the proper 
coercian.

I am happy to try any new builds/patches you submit. It would be nice to know 
when it happens.

Thanks for your patience.

Best regards
Ken in nashua

package org.trails.util;

import org.apache.tapestry.form.IPropertySelectionModel;

public class IntegerPropertySelectionModel implements IPropertySelectionModel
{
private Integer[] _set;

public IntegerPropertySelectionModel(Integer[] set)
{
_set = set;
}

public String getLabel(int index)
{
return _set[index].toString();
}

public Object getOption(int index)
{

return _set[index];
}

public int getOptionCount()
{
return _set.length;
}

public String getValue(int index)
{
return _set[index].toString();
}

public boolean isDisabled(int index)
{
return false;
}

public Object translateValue(String value)
{
for (Integer e : _set)
{
if (e.toString().equals(value))
return e;
}

return null;
}
}


From: [EMAIL PROTECTED]
To: users@tapestry.apache.org
Subject: Does tapestry need an IntegerPropertySelectionModel ?
Date: Fri, 12 Oct 2007 15:12:14 -0400








I am trying to operate a PropertySelection that uses an array of strings but 
their content are numbers.

private static final String[] tableSizeOptions = new String[] { 
 1, 2, 3
};

I am assuming OGNL is smart enough to coerce these during render cycle on IF 
conditions that attempt to perform arithmetic.

NOT the case... see stack trace below.

Do I need to implement an IntegerPropertySelectionModel for this to operate 
properly?

Best regards
Ken in nashua

2007-10-12 15:01:00,575 [btpool0-2] ERROR 
org.apache.tapestry.services.impl.HiveMindExpressionCompiler - Error generating 
OGNL getter for expression (index % tableSize) == 0 with root [EMAIL 
PROTECTED]/galleryWidget] and body:
{ return  ($w) ((ognl.OgnlOps.equal( ($w) ((($Gallery_17)$2).getIndex() % 
(($Gallery_17)$2).getTableSize() ), ($w)  0)));}
org.apache.hivemind.ApplicationRuntimeException: Unable to add method 
java.lang.Object get(ognl.OgnlContext, java.lang.Object) to class 
$ASTEq_1159596f3b2: [source error] invalid types for %
at org.apache.tapestry.enhance.ClassFabImpl.addMethod(ClassFabImpl.java:278)
at 
org.apache.tapestry.services.impl.HiveMindExpressionCompiler.compileExpression(HiveMindExpressionCompiler.java:176)
at ognl.OgnlRuntime.compileExpression(OgnlRuntime.java:523)


Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it 
now!

Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it 
now!

_
Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews

T5: wiki on creating a transparent access control system

2007-10-15 Thread Chris Lewis
There have been many messages about how to implement a user access 
control system (logging in, restricting access, etc). I asked such a 
question on this list a while ago, and have since found what seems to be 
an excellent way of implementing an access control system. The best part 
is, your pages are completely ignorant of the whole process. No methods 
to call, no interface to implement, no parent class - just pure blissful 
ignorance. I've written a wiki explaining how to create a dispatcher and 
halt/allow a request to continue - check it out here:


http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher

The article doesn't answer all the questions, but what I feel are the 
bigger ones are covered. Feedback most welcome, and even more welcome on 
the IRC CHANNEL - #tapestry - irc.freenode.net (chrislewis).


sincerely,
chris

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



can i change locale manually or not ???

2007-10-15 Thread Mohammad Shamsi
i was read in tapestry localization guide that : Tapestry does not yet
support changing the locale, but that will be available shortly.

but in wiki T5 Howto, i read a guide to changing locale  in tapestry, look
at code :

@Inject
private PersistentLocale persistentLocale;

public void onActionFromChangeLocale(String language)
{
persistentLocale.set(new Locale(language));
}


but change locale here, don't effect on my pages :( , any idea ?

-- 
sincerely yours
M. H. Shamsi


Updating Dialog in AJAX requests

2007-10-15 Thread Stephane Decleire

Hi,

Does anybody has an idea why the content of such dialog boxes is not refreshed 
when the form in the dialog box is submitted ?

Case 1 :

div jwcid=[EMAIL PROTECTED] hidden=ognl:true style=display:none;
 form jwcid=[EMAIL PROTECTED] async=true updateComponents={'signonDialog'} 
success=listener:attemptLogin
   ...
 /form
/div

Case 2 :

div jwcid=[EMAIL PROTECTED] hidden=ognl:true style=display:none;
 div id=signonBloc
 form jwcid=[EMAIL PROTECTED] async=true updateComponents={'signonBloc'} 
success=listener:attemptLogin
   ...
 /form
 /div
/div

Case 3 :

div jwcid=[EMAIL PROTECTED] hidden=ognl:true style=display:none;
 form jwcid=[EMAIL PROTECTED] async=true updateComponents={'signonForm'} 
success=listener:attemptLogin
   ...
 /form
/div

I have read the Tapestry Dojo Dialog component documentation and watched out 
for the gotchas but i can't find a way to refresh my Dialog box on submit ...

Thanks in advance for any help.

Stephane



T5: refreshing page when there is an error

2007-10-15 Thread Angelo Chen

Hi,

I notice that when an error is recorded thru recordError, refreshing the
form will not erase the error messages unlike when form was rejected by
validator where pressing refresh in the browser can errase the errors and go
back to the initial form screen, here is the code
 public void onValidate() throws EncoderException {
 _form.recordError(test error);
 }

if this error is shown in the form, it will be there forever even you
restart the browser, any hint?
A.C.
-- 
View this message in context: 
http://www.nabble.com/T5%3A-refreshing-page-when-there-is-an-error-tf4627982.html#a13214217
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5: Pluggable javascript libraries?

2007-10-15 Thread Chris Lewis
Unfortunately this is probably a bit of a pain to do. If you were to do 
this you'd probably have to do the following:


1) add jquery to the Tap source (easy)
2) add your own PageRenderSupport implementation to use jquery (easy)
3) rewrite tapestry.js so that it behaves the same but has the same 
interface as the original based on prototype (time consuming)


That may be all. If you embark on this do share.

chris

Olivier wrote:

Hi,


Is it easily possible to use another javascript library in stead of
prototype? Is anyone trying to do something like that? I, for one, have
more experience with jQuery than Prototype (and I like it better) so it
would be cool to have a tapestry with jQuery in stead of Prototype.


Regards,
Olivier



-
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: Tapestry 5 service configuration

2007-10-15 Thread Peter Stavrinides

My previous post contained this code:
@Inject
private ComponentResources resources_;

  public void contributeApplicationStateManager(
   MappedConfigurationClass, ApplicationStateContribution
configuration) {
   ApplicationStateCreatorBreadCrumbs creator = new
ApplicationStateCreatorBreadCrumbs() {
   public BreadCrumbs create() {
   return new BreadCrumbs(resources_);
   }
   };

   configuration.add(BreadCrumbs.class, new
ApplicationStateContribution(
   session, creator));
   }

I had originally tried it like this, but couldn't figure out how to set 
service properties correctly, resources_ kept turning up null.


lasitha wrote:

Actually, it may be easier to contribute to the
ApplicationStateManager instead of having it injected and
getting/setting from it yourself.

See the section on 'Configuring ASOs' here:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/appstate.html

Cheers, lasitha.

On 10/15/07, Peter Stavrinides [EMAIL PROTECTED] wrote:
  

Thanks Robert, I think I have my answer now.

Robert Zeigler wrote:


Use the ApplicationStateManager?

@Inject
ApplicationStateManager _manager;

MyObject foo = new MyObject(someArguments);
_manager.set(MyObject.class,foo);

Cheers,

Robert

On Oct 15, 2007, at 10/156:58 AM , Peter Stavrinides wrote:

  

Since you are confused by the question, let me rephrase it in a
different way then:

1. How do you register an ASO with the IoC managed container (or
registry if you prefer that word) if you have to provide arguments in
the constructor (i.e. you cannot use @ApplicationState in this case).



MavenMan wrote:


I just to say maybe the concept problem is you are dealing with is the
concept of persistence with Pojo's using Inversion of Control , so
you are mixed-up. many folk have
talk about the good of ioc .Now could you give me a explain of how
t5 manage the service and aso?
Peter Stavrinides wrote:

  

As far as I'm concerned service is an ugly word everyone likes to
throw around, what you are really dealing with is the concept of
persistence with Pojo's using Inversion of Control.

Peter Stavrinides wrote:



A concept problem? really?? now I am curious as to what this
concept problem actually, is could you explain it.

Peter

MavenMan wrote:

  

Peter Stavrinides wrote:



Hi Chris
ApplicationStateManager is a service , I also think a service
and an aso are completely different thing.

in a word, It is a concept problem.


  

are completely different


I am no expert on T5, but strongly disagree with you.

Peter

Chris Lewis wrote:

  

Hi Peter

1) I think the general opinion on this is that a service and an
aso are completely different animals. I can't think of a
situation where I'd ever want an aso to be a service (or vice
versa), but that's just me. If there is a way to do this,
someone else will need to chime in.

2) @Inject it. Assuming you bound or built your service, you
can simply inject it using @Inject as the general type (usually
an interface) of object, and Tapestry IoC will resolve it for you.

sincerely,
chris

Peter Stavrinides wrote:



Hi all,

Following on from a previous post on this subject I have some
questions on Tapestry 5 IoC:

1. How do you register an ASO as a service if you have to
provide arguments to the constructor (i.e. you cannot use
@ApplicationState in this case).

2. How do you retrieve a service object that has been
contributed to the framework

Thanks
Peter

-

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]




  

-
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]


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

  

-
To unsubscribe, e-mail: 

RE: Does tapestry need an IntegerPropertySelectionModel ?

2007-10-15 Thread Ken nashua

Just some feedback...Nothing works with latest OGNL build.Best regardsKen in 
nashuan exception has occurred.


You may continue by restarting the session.




[ +/- ] Exception:
Unable to update OGNL expression 'parsed OGNL expression' of
[EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
(StaticBinding[2]) may not be updated. 

org.apache.tapestry.BindingException



Unable
to update OGNL expression 'parsed OGNL expression' of
[EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
(StaticBinding[2]) may not be updated.



binding:
ExpressionBinding[Home/galleryWidget tableSize]


location:
classpath:/org/trails/demo/components/Gallery.jwc, line 
12, column 467
8   !-- property name=tableSize persist=session/ --
9   !-- property name=pagingSpan persist=session/ --
10
11  component id=tableSizeSelect type=PropertySelection 
inherit-informal-parameters=true
12  binding name=value value=tableSize/
13  binding name=model value=tableSizeModel/
14  /component
15
16  component id=pagingSpanSelect type=PropertySelection
17  binding name=value value=pagingSpan/



 

 



[ +/- ] Exception:
Unable to update OGNL expression 'parsed OGNL expression' of
[EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
(StaticBinding[2]) may not be updated. 

org.apache.hivemind.ApplicationRuntimeException



Unable
to update OGNL expression 'parsed OGNL expression' of
[EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
(StaticBinding[2]) may not be updated.



component:
[EMAIL PROTECTED]/galleryWidget]


location:
context:/WEB-INF/Home.html, line 94 div 
id=page.title
5   span jwcid=@Insert value=Listings/
6   /div
7   /h1
8
9   div jwcid=[EMAIL PROTECTED]:Gallery
10  collectionType=ognl:@[EMAIL PROTECTED]
11  component=galleryWidget
12  collectionContentParm=collectionContent
13  autoPagingContentParm=autoPagingContent
14  tableSize=2



 

 



[ +/- ] Exception:
   Binding with value 2 (StaticBinding[2]) may not be updated.



org.apache.tapestry.BindingException



Binding with value 2 (StaticBinding[2]) may not be 
updated.



binding:
StaticBinding[2]


location:
context:/WEB-INF/Home.html, line 94 div 
id=page.title
5   span jwcid=@Insert value=Listings/
6   /div
7   /h1
8
9   div jwcid=[EMAIL PROTECTED]:Gallery
10  collectionType=ognl:@[EMAIL PROTECTED]
11  component=galleryWidget
12  collectionContentParm=collectionContent
13  autoPagingContentParm=autoPagingContent
14  tableSize=2







Stack Trace:






org.apache.tapestry.binding.AbstractBinding.createReadOnlyBindingException(AbstractBinding.java:115)

org.apache.tapestry.binding.AbstractBinding.setObject(AbstractBinding.java:66)

$Gallery_17.setTableSize($Gallery_17.java)

$ASTProperty_115a46b08c2.set($ASTProperty_115a46b08c2.java)

org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.write(ExpressionEvaluatorImpl.java:175)

$ExpressionEvaluator_115a46b0873.write($ExpressionEvaluator_115a46b0873.java)

org.apache.tapestry.binding.ExpressionBinding.setObject(ExpressionBinding.java:223)

$PropertySelection_18.setValue($PropertySelection_18.java)


Re: Tapestry 5 service configuration

2007-10-15 Thread Howard Lewis Ship
I have some expertise in Tapestry, and I side with Chris.

An ASO is a global object that is associated with a particular user,
typically via the user's HttpSession.  It doesn't have a service interface,
as it is typically a POJO.  Because it doesn't have an interface, Tapesty
doesn't create a proxy for the ASO.

In most cases, the ASO is a true POJO (a true POJO has a public
non-arguments constructor) in which case Tapestry can manage the ASO
entirely, creating it as necessary.  To be honest, since the ASO code was
written, Tapestry has gotten smarter, and could probably operate on a more
complicated constructor using the normal autobuild approach.  This would
allow injection of services into an ASO ... which is dangerous, because
service proxies are not serializable, and an ASO typically must be.

You can also explicitly define the ASO, which gives you an opportunity to
provide the code to instantiate the ASO.  This is what you currently do if
your ASO doesn't have a simple constructor.

If you need to access an ASO from a component, you use the @ApplicationState
annotation, which marks a field as being linked to an ASO.

If a service needs access to an ASO, it must inject the ApplicationState, it
must obtain the ASO from the ApplicationStateManager.

http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/services/ApplicationStateManager.html



On 10/15/07, Peter Stavrinides [EMAIL PROTECTED] wrote:

 Hi Chris

 I am no expert on T5, but strongly disagree with you.

 Peter

 Chris Lewis wrote:
  Hi Peter
 
  1) I think the general opinion on this is that a service and an aso
  are completely different animals. I can't think of a situation where
  I'd ever want an aso to be a service (or vice versa), but that's just
  me. If there is a way to do this, someone else will need to chime in.
 
  2) @Inject it. Assuming you bound or built your service, you can
  simply inject it using @Inject as the general type (usually an
  interface) of object, and Tapestry IoC will resolve it for you.
 
  sincerely,
  chris
 
  Peter Stavrinides wrote:
  Hi all,
 
  Following on from a previous post on this subject I have some
  questions on Tapestry 5 IoC:
 
  1. How do you register an ASO as a service if you have to provide
  arguments to the constructor (i.e. you cannot use @ApplicationState
  in this case).
 
  2. How do you retrieve a service object that has been contributed to
  the framework
 
  Thanks
  Peter
 
  -
  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]




-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind


Re: OT: Different type of MVC

2007-10-15 Thread Andrea Chiumenti
Howard,
you know better then me that there are other ways to cache resources ;-p

On 10/14/07, Howard Lewis Ship [EMAIL PROTECTED] wrote:

 Because it is perfectly shared and uniform, reasonable to cache (portions
 in
 memory), uniformly accessible from multiple machines, etc.

 However, such systems rarely get other aspects right, like coordinating
 code
 changes with content changes, or providing adequate history (equivalent to
 Subversion).

 On 10/14/07, Andrea Chiumenti [EMAIL PROTECTED] wrote:
 
  I always wonder why some ppl want to use a db like a file system.
 
  On 10/13/07, Renat Zubairov [EMAIL PROTECTED] wrote:
  
   I've worked once with the application where all content, e.g. HTML,
   Javascript, CSS was put in the DB. Not very good idea .
  
   Renat
  
   On 12/10/2007, Daniel Jue [EMAIL PROTECTED] wrote:
Hi all, this is not Tapestry related, but since people here keep up
with the cutting edge frameworks, I'm wondering if you've ever heard
of something like this:
   
I've been invited to work on an internal company application (that
 we
resell) that is totally database driven.  As in, the _entire_ web
application is generated with only PL/SQL!  I don't know whether to
 be
scared or amazed.  I talked to the creator, and he said they
implemented an entire Struts-like MVC with session handling.  The
application is not to the point where it builds itself, like a CMS
(Joomla, etc)-- things like Javascript are written and then packed
into the db.
   
Just curious if there is anything else out there like that (or used
 to
be like that!)
   
Daniel
   
   
 -
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
  
   --
   Best regards,
   Renat Zubairov
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 



 --
 Howard M. Lewis Ship
 Partner and Senior Architect at Feature50

 Creator Apache Tapestry and Apache HiveMind



Re: T5: Tapestry, Hibernate and Underscores.

2007-10-15 Thread Christian Gruber
I did not.  The problem was not with hibernate.  The problem was that  
you used hibernate annotations (JPA annotations, actually) in a way  
other than their documented intent.  If you annotate a field _foo,  
then the property name will be _foo according to hibernate, regardless  
of accessors.  You can override the automatic column designation with  
@Column but by default, it'll look for a column named _foo.  You can  
also solve it by either annotating the getter (as mentioned  
elsewhere), or by renaming your variable to not use the _.  Where am I  
misunderstanding?  My comments about tapestry were only that you could  
avoid using _foo style and tapestry would continue to work.


Anyway, this is a hibernate configuration question, not a tapestry  
question, so we should kill this thread on this list anyway.


Christian.

On 15-Oct-07, at 2:29 AM, Davor Hrg wrote:


maybe you missed the point here,

never mind the reason I use the _ prefix ..
the problem was with hibernate, not with tapestry

Davor Hrg

On 10/15/07, Christian Gruber [EMAIL PROTECTED] wrote:


Tapestry doesn't require _ prefixes, mind you.  That's a Howard M.
Lewis Ship-ism.  (actually, I have it too from my NeXTSTEP days.)
It's not mandatory, however, so on your persistent objects, you could
use the typical pattern and annotate your properties, if that's how
you want to do it.  Tapestry will (it seems) do its magic on
properties taht are annotated regardless of their prefix, because  
it's

the annotation that matters, not the variable name.

Christian.

On 14-Oct-07, at 4:17 PM, Davor Hrg wrote:


hi,

I've tried to adopt underscores for private fields,
so the the tutorial got mixed when I've created that page with
AngeloChen.

I'll check tomorow if this is true, but I belive you
can avoid this problem by not putting annotations
on the fields and putting them on the getters or setters instead

@Id
private long _id;

public getId()...
public setId()...

in this example hibernate will see annotation on the field
and see it as _id

if you change the code to

private long _id;

@Id
public getId()...
public setId()...

in this example hibernate will see annotation on the getter
and see it as id when get is stripped

!Beware. if you put annotations both on fields and getters
hibernate will loose some of them


I'll find some time and fix the code to adopt one convention

Davor Hrg






On 10/13/07, Angelo Chen [EMAIL PROTECTED] wrote:



Hi Olivier,

In that tutorial the only place with underscore is _session, the
entities
for hibernate do not have underscore, I prefer this way, it looks
normal
when u do some sql/hql queries, but for Tapestry variables ,seems
to me, a
unspoken rule here is to prefix underscore.

A.C.


Olivier-36 wrote:



Hi,


I followed the small tutorial on using hibernate with T5 here
http://wiki.apache.org/tapestry/Tapestry5HowToUseTapestryHibernate
and

it

worked like a charm. Thank you to whoever wrote this!

The example uses underscores for some private fields and sometimes
not.
Now
I want to use this in my entities but then Hibernate generates
incorrect
column names. Isn't there a way for tuning this in the  
configuration

file

or something? If someone has that info, please share it with me!


Thank you in advance,
Olivier



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





--
View this message in context:


http://www.nabble.com/T5%3A-Tapestry%2C-Hibernate-and-Underscores.-tf4614534.html#a13188869

Sent from the Tapestry - User mailing list archive at Nabble.com.


-
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: Does tapestry need an IntegerPropertySelectionModel ?

2007-10-15 Thread Ken nashua

I am re-testing this...

Best regards
Ken in nashua

 From: [EMAIL PROTECTED]
 To: users@tapestry.apache.org
 Subject: RE: Does tapestry need an IntegerPropertySelectionModel ?
 Date: Mon, 15 Oct 2007 12:09:28 -0400
 
 
 Just some feedback...Nothing works with latest OGNL build.Best regardsKen in 
 nashuan exception has occurred.
 
 
 You may continue by restarting the session.
 
 
 
 
   [ +/- ] Exception:
 Unable to update OGNL expression 'parsed OGNL expression' of
 [EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
 (StaticBinding[2]) may not be updated. 
   
   org.apache.tapestry.BindingException
   
   
   
   Unable
 to update OGNL expression 'parsed OGNL expression' of
 [EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
 (StaticBinding[2]) may not be updated.
   
   
   
   binding:
   ExpressionBinding[Home/galleryWidget tableSize]
 
   
   location:
   classpath:/org/trails/demo/components/Gallery.jwc, line 
 12, column 467
 8 !-- property name=tableSize persist=session/ --
 9 !-- property name=pagingSpan persist=session/ --
 10
 11component id=tableSizeSelect type=PropertySelection 
 inherit-informal-parameters=true
 12binding name=value value=tableSize/
 13binding name=model value=tableSizeModel/
 14/component
 15
 16component id=pagingSpanSelect type=PropertySelection
 17binding name=value value=pagingSpan/
 
   
 

 
  
   
   
 
   [ +/- ] Exception:
 Unable to update OGNL expression 'parsed OGNL expression' of
 [EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
 (StaticBinding[2]) may not be updated. 
   
   org.apache.hivemind.ApplicationRuntimeException
   
   
   
   Unable
 to update OGNL expression 'parsed OGNL expression' of
 [EMAIL PROTECTED]/galleryWidget] to 3: Binding with value 2
 (StaticBinding[2]) may not be updated.
   
   
   
   component:
   [EMAIL PROTECTED]/galleryWidget]
 
   
   location:
   context:/WEB-INF/Home.html, line 94 div 
 id=page.title
 5 span jwcid=@Insert value=Listings/
 6 /div
 7 /h1
 8
 9 div jwcid=[EMAIL PROTECTED]:Gallery
 10collectionType=ognl:@[EMAIL PROTECTED]
 11component=galleryWidget
 12collectionContentParm=collectionContent
 13autoPagingContentParm=autoPagingContent
 14tableSize=2
 
   
 

 
  
   
   
 
   [ +/- ] Exception:
  Binding with value 2 (StaticBinding[2]) may not be updated.
   
   
   
   org.apache.tapestry.BindingException
   
   
   
   Binding with value 2 (StaticBinding[2]) may not be 
 updated.
   
   
   
   binding:
   StaticBinding[2]
 
   
   location:
   context:/WEB-INF/Home.html, line 94 div 
 id=page.title
 5 span jwcid=@Insert value=Listings/
 6 /div
 7 /h1
 8
 9 div jwcid=[EMAIL PROTECTED]:Gallery
 10collectionType=ognl:@[EMAIL PROTECTED]
 11component=galleryWidget
 12collectionContentParm=collectionContent
 13autoPagingContentParm=autoPagingContent
 14tableSize=2
 
   
 
   
 
 
   
   Stack Trace:
   
 
   
   
   
   
 org.apache.tapestry.binding.AbstractBinding.createReadOnlyBindingException(AbstractBinding.java:115)
   
 org.apache.tapestry.binding.AbstractBinding.setObject(AbstractBinding.java:66)
   
 $Gallery_17.setTableSize($Gallery_17.java)
   
 $ASTProperty_115a46b08c2.set($ASTProperty_115a46b08c2.java)
   
 org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.write(ExpressionEvaluatorImpl.java:175)
   
 $ExpressionEvaluator_115a46b0873.write($ExpressionEvaluator_115a46b0873.java)
   
 org.apache.tapestry.binding.ExpressionBinding.setObject(ExpressionBinding.java:223)
 

Re: T5: refreshing page when there is an error

2007-10-15 Thread Howard Lewis Ship
Form has a clearErrors() method.

On 10/15/07, Angelo Chen [EMAIL PROTECTED] wrote:


 Hi,

 I notice that when an error is recorded thru recordError, refreshing the
 form will not erase the error messages unlike when form was rejected by
 validator where pressing refresh in the browser can errase the errors and
 go
 back to the initial form screen, here is the code
 public void onValidate() throws EncoderException {
 _form.recordError(test error);
 }

 if this error is shown in the form, it will be there forever even you
 restart the browser, any hint?
 A.C.
 --
 View this message in context:
 http://www.nabble.com/T5%3A-refreshing-page-when-there-is-an-error-tf4627982.html#a13214217
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
Howard M. Lewis Ship
Partner and Senior Architect at Feature50

Creator Apache Tapestry and Apache HiveMind


Re: T5: refreshing page when there is an error

2007-10-15 Thread Thiago H de Paula Figueiredo
On Mon, 15 Oct 2007 15:36:26 -0300, Howard Lewis Ship [EMAIL PROTECTED]  
wrote:



Form has a clearErrors() method.


This raises again the question on which is the best persistence strategy  
for the ValidationTracker of Form: session or flash. I prefer flash, as it  
makes more sense to me. On the other hand, I think Howard disagrees. :)


--
Thiago H. de Paula Figueiredo
Desenvolvedor, Instrutor e Consultor de Tecnologia
Eteg Tecnologia da Informação Ltda.
http://www.eteg.com.br

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



Re: Validate regexp error

2007-10-15 Thread mogulwraith

Tapestry 5
To restate, Im trying to do something similar to the documentation listed
near the end of this page

http://tapestry.apache.org/tapestry5/tutorial1/forms.html

for your convenience the sample code is as follows:

@Validate(required,regexp=\\d{5}(-\\d{4})?)
  public String getZip()
  {
return _zip;
  }   

But Im getting the error: Failure reading parameter validate of component
core/PropertyEditBlocks:textfield: Unknown validator type 'regexp'.
Configured validators are max, maxlength, min, minlength, required.

Do I have to manually create the UI element for the beaneditform as you have
listed or is there something I have to do to get the Validate annotation to
work for regular expressions?


Josh Canfield-2 wrote:
 
 Can you provide us some code and error message?
 
 It should look something like this...
 
 input t:id=runningTime t:type=textfield t:size=6 t:value=
 video.runningTime t:validate=required,regexp=\d+:\d{2} type=text /
 
 Josh
 
 On 10/12/07, mogulwraith [EMAIL PROTECTED] wrote:


 The documentation shows a validation of a zip code but an Unknown
 Validator
 error is produced.
 What do I need to do differently than what is written in the
 documentation?
 --
 View this message in context:
 http://www.nabble.com/Validate-regexp-error-tf4616208.html#a13183605
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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


 
 
 -- 
 --
 TheDailyTube.com. Sign up and get the best new videos on the internet
 delivered fresh to your inbox.
 
 

-- 
View this message in context: 
http://www.nabble.com/Validate-regexp-error-tf4616208.html#a13219821
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: T5 Order in which modules load

2007-10-15 Thread Martin Reurings
Hmm, actually the order of resolving all such configurations is the part 
where I'm having problems. You see, this piece of code:

   public void contributePageRenderInitializer(
   final OrderedConfigurationPageRenderCommand configuration,
   final ThreadLocale threadLocale,
   final SymbolSource symbolSource,
   final AssetSource assetSource) {

   //Displacing the default Validation-decorator with our own clean 
interpretation.

   configuration.add(TempTapestryToolsValidationDelegate,
 new CustomValidationDecoratorCommand());
  
   }


When it's running in my webapps' AppModule will override T5's default, 
in doing so it gets rid of the error-icons and does a few things that I 
find really usefull.
When that piece of code runs in my pluggable module (for lack of better 
wording) it seems to run that piece of code before Tapestrys' equivalent 
and T5s' default will override my custom code.
I just have a clue if I can override that, or where I would even start 
to look :)


Thanx for the tips though, at least I don't appear to be going crazy ;)

Martin

Nick Westgate wrote:

Doesn't an ordered configuration help you there?
http://tapestry.apache.org/tapestry5/tapestry-ioc/configuration.html#Ordered%20List 



The order of module processing shouldn't be important since the final
ordering is imposed by resolving all such configurations after loading.

(Sorry, I haven't explored this area much.)

Cheers,
Nick.


Martin Reurings wrote:

Hey Guys,

I've quite happily been working on creating my own module to enhance 
Tapestry5. This module is a generic patch so that I can more rapidly 
create new WebApps based on T5. I've added some components and a 
service and all seemed to be working quite well. Now I've run into a 
problem though.
In a recent project we had created our own ValidationDecorator and 
pushed it into the environment, thus overriding T5's default 
validator. Now that I've been creating my own plugable module I've 
been trying to move this solution in there, but it seems that my 
plugable module runs before T5 adds it's Services. As a result, the 
T5 default is now overruling my own ValidationDecorator :(


Anybody here have a clue how I can change the order in which 
AppModules load?!?


Regards,

Martin

-
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: Validate regexp error

2007-10-15 Thread Josh Canfield
What build of Tapestry are you using? While I've never used @Validate before
I believe it should work the same.

Have you created a form field to see if it's specific to the annotation?

Josh

On 10/15/07, mogulwraith [EMAIL PROTECTED] wrote:


 Tapestry 5
 To restate, Im trying to do something similar to the documentation listed
 near the end of this page

 http://tapestry.apache.org/tapestry5/tutorial1/forms.html

 for your convenience the sample code is as follows:

 @Validate(required,regexp=\\d{5}(-\\d{4})?)
 public String getZip()
 {
return _zip;
 }

 But Im getting the error: Failure reading parameter validate of component
 core/PropertyEditBlocks:textfield: Unknown validator type 'regexp'.
 Configured validators are max, maxlength, min, minlength, required.

 Do I have to manually create the UI element for the beaneditform as you
 have
 listed or is there something I have to do to get the Validate annotation
 to
 work for regular expressions?


 Josh Canfield-2 wrote:
 
  Can you provide us some code and error message?
 
  It should look something like this...
 
  input t:id=runningTime t:type=textfield t:size=6 t:value=
  video.runningTime t:validate=required,regexp=\d+:\d{2} type=text /
 
  Josh
 
  On 10/12/07, mogulwraith [EMAIL PROTECTED] wrote:
 
 
  The documentation shows a validation of a zip code but an Unknown
  Validator
  error is produced.
  What do I need to do differently than what is written in the
  documentation?
  --
  View this message in context:
  http://www.nabble.com/Validate-regexp-error-tf4616208.html#a13183605
  Sent from the Tapestry - User mailing list archive at Nabble.com.
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
  --
  --
  TheDailyTube.com. Sign up and get the best new videos on the internet
  delivered fresh to your inbox.
 
 

 --
 View this message in context:
 http://www.nabble.com/Validate-regexp-error-tf4616208.html#a13219821
 Sent from the Tapestry - User mailing list archive at Nabble.com.


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




-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.


Re: T5: refreshing page when there is an error

2007-10-15 Thread Nick Westgate

I agree it should be Flash. I copied Form and changed it to that.
It should be possible for a user to configure this.

Cheers,
Nick.


Thiago H de Paula Figueiredo wrote:
On Mon, 15 Oct 2007 15:36:26 -0300, Howard Lewis Ship [EMAIL PROTECTED] 
wrote:



Form has a clearErrors() method.


This raises again the question on which is the best persistence strategy 
for the ValidationTracker of Form: session or flash. I prefer flash, as 
it makes more sense to me. On the other hand, I think Howard disagrees. :)




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



Re: T5 Order in which modules load

2007-10-15 Thread Nick Westgate

Sorry, order in the message title diverted my attention.
You want to override DefaultValidationDelegateCommand using Alias:
http://tapestry.apache.org/tapestry5/tapestry-core/guide/alias.html

That documentation is a bit thin, but if you can search the list for more.

HLS:
You supply a new implementation with a new id, and contribute to the Alias
service configuration.  This will allow injections based on type to prefer
your implementation over the built-in one.

Cheers,
Nick.


Martin Reurings wrote:
Hmm, actually the order of resolving all such configurations is the part 
where I'm having problems. You see, this piece of code:

   public void contributePageRenderInitializer(
   final OrderedConfigurationPageRenderCommand configuration,
   final ThreadLocale threadLocale,
   final SymbolSource symbolSource,
   final AssetSource assetSource) {

   //Displacing the default Validation-decorator with our own clean 
interpretation.

   configuration.add(TempTapestryToolsValidationDelegate,
 new CustomValidationDecoratorCommand());
 }

When it's running in my webapps' AppModule will override T5's default, 
in doing so it gets rid of the error-icons and does a few things that I 
find really usefull.
When that piece of code runs in my pluggable module (for lack of better 
wording) it seems to run that piece of code before Tapestrys' equivalent 
and T5s' default will override my custom code.
I just have a clue if I can override that, or where I would even start 
to look :)


Thanx for the tips though, at least I don't appear to be going crazy ;)

Martin

Nick Westgate wrote:

Doesn't an ordered configuration help you there?
http://tapestry.apache.org/tapestry5/tapestry-ioc/configuration.html#Ordered%20List 



The order of module processing shouldn't be important since the final
ordering is imposed by resolving all such configurations after loading.

(Sorry, I haven't explored this area much.)

Cheers,
Nick.


Martin Reurings wrote:

Hey Guys,

I've quite happily been working on creating my own module to enhance 
Tapestry5. This module is a generic patch so that I can more rapidly 
create new WebApps based on T5. I've added some components and a 
service and all seemed to be working quite well. Now I've run into a 
problem though.
In a recent project we had created our own ValidationDecorator and 
pushed it into the environment, thus overriding T5's default 
validator. Now that I've been creating my own plugable module I've 
been trying to move this solution in there, but it seems that my 
plugable module runs before T5 adds it's Services. As a result, the 
T5 default is now overruling my own ValidationDecorator :(


Anybody here have a clue how I can change the order in which 
AppModules load?!?


Regards,

Martin

-
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]




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



Re: can i change locale manually or not ???

2007-10-15 Thread Nick Westgate

The docs are out of date, hence the wiki.

Don't effect is not specific enough. Give us the info to help you.
What are you trying do? What are the names of your localized files?
How is this event being invoked from your .tml file?

Cheers,
Nick.


Mohammad Shamsi wrote:

i was read in tapestry localization guide that : Tapestry does not yet
support changing the locale, but that will be available shortly.

but in wiki T5 Howto, i read a guide to changing locale  in tapestry, look
at code :

@Inject
private PersistentLocale persistentLocale;

public void onActionFromChangeLocale(String language)
{
persistentLocale.set(new Locale(language));
}


but change locale here, don't effect on my pages :( , any idea ?



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