Re: i18n in javascript

2008-02-12 Thread Michael Courcy

Do you use onclick on a component or on a simple html element ?

learner a écrit :

onclick="javascript:return confirm('${message:key_in_my_property_file}');"

i try to use key in javascript like above but failed. 
how to use key in javascript?



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


  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: JumpStart 3.2 - for Tapestry 5.0.9

2008-02-05 Thread Michael Courcy

It's running !

Thanks a lot Geoff I always learn a lot from your Jumpstart


Geoff Callender a écrit :

Hi all,

JumpStart 3.2 is now available for Tapestry 5.0.9.  New features since 
3.0 include:


* Basic Ajax example
* Joda Time example
* Custom exception page example
* Examples and discussion of render requests vs action requests
* Best practice use of "persisting through the redirection"
* Flatter structure, especially webapp (which is now more like 
T5's maven archetype)

* More complete build files
* Ant target to create a fresh project
* Fixed some Firefox and IE7 formatting issues.

You'll find it in the usual place:

http://files.doublenegative.com.au/jumpstart

Comments and suggestions are always welcome.  Be brutal or helpful - I 
don't care which, because it all helps to make this stuff more useful.


Cheers,

Geoff Callender



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: JumpStart 3.2 - for Tapestry 5.0.9

2008-02-05 Thread Michael Courcy
Yes it's a change from the previous release do we have to put the 
project in a directory of JBoss ?


Massimo Lusetti a écrit :

On Feb 5, 2008 2:54 PM, Geoff Callender
<[EMAIL PROTECTED]> wrote:

  

Comments and suggestions are always welcome.  Be brutal or helpful - I
don't care which, because it all helps to make this stuff more useful.



Very very nice.
There's a problem with absolute path for jboss.dir properties, you
should use directly ${jboss.dir} under you build.xml and not prefix
that with ${project.dir}.

Regards

  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com



Re: T5: Custom components are not statefull

2008-02-04 Thread Michael Courcy

Sorry I meant AbstractField

Michael Courcy a écrit :


Does your enrollmentbenchmarkchart compenent extends AbstractTextField ?

Alexander Lamb a écrit :

Hello list,

It looks like custom components are not statefull.

Indeed, I have a loop which contains a graph I generate and a 
TextField (for testing purposes), and the generated code looks like 
this:


src="./statistics.dashboardview.enrollmentbenchmarkchart.monthserieslinechart:chart/460/280">id="textfield_8" name="textfield_8" type="text" value="ITALY">alt="[Error]" class="t-error-icon t-invisible" id="textfield_8:icon" 
src="assets/tapestry/field-error-marker.gif"> IT src="./statistics.dashboardview.enrollmentbenchmarkchart.monthserieslinechart:chart/460/280">id="textfield_9" name="textfield_9" type="text" 
value="NETHERLANDS">src="assets/tapestry/field-error-marker.gif"> NL src="./statistics.dashboardview.enrollmentbenchmarkchart.monthserieslinechart:chart/460/280">id="textfield_10" name="textfield_10" type="text" value="NORWAY">alt="[Error]" class="t-error-icon t-invisible" id="textfield_10:icon" 
src="assets/tapestry/field-error-marker.gif"> NO
As you can see, my TextField gets incremented but not my 
enrollmentbenchmarkchart !

Should I file a bug for this?
P.S. I tried to generate the ids but it didn't work.
Thanks,

Alex

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








--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: T5: Custom components are not statefull

2008-02-04 Thread Michael Courcy


Does your enrollmentbenchmarkchart compenent extends AbstractTextField ?

Alexander Lamb a écrit :

Hello list,

It looks like custom components are not statefull.

Indeed, I have a loop which contains a graph I generate and a 
TextField (for testing purposes), and the generated code looks like this:


src="./statistics.dashboardview.enrollmentbenchmarkchart.monthserieslinechart:chart/460/280">id="textfield_8" name="textfield_8" type="text" value="ITALY">alt="[Error]" class="t-error-icon t-invisible" id="textfield_8:icon" 
src="assets/tapestry/field-error-marker.gif"> IT src="./statistics.dashboardview.enrollmentbenchmarkchart.monthserieslinechart:chart/460/280">id="textfield_9" name="textfield_9" type="text" 
value="NETHERLANDS">src="assets/tapestry/field-error-marker.gif"> NL src="./statistics.dashboardview.enrollmentbenchmarkchart.monthserieslinechart:chart/460/280">id="textfield_10" name="textfield_10" type="text" value="NORWAY">alt="[Error]" class="t-error-icon t-invisible" id="textfield_10:icon" 
src="assets/tapestry/field-error-marker.gif"> NO
As you can see, my TextField gets incremented but not my 
enrollmentbenchmarkchart !

Should I file a bug for this?
P.S. I tried to generate the ids but it didn't work.
Thanks,

Alex

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





--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: T5 image component

2008-02-01 Thread Michael Courcy

Ok
Thus I wait a bit for listening that such library doens't exist and then 
we start the job

Chris Lewis a écrit :
I don't, but I'd gladly contribute code/ideas as I've done some image 
work and will also probably need such a lib.


chris

Michael Courcy wrote:

Hi list,

Do you know if there's a good image component library for reducing, 
rotating or writing on image with a little cache management  ?


I'm not against the idea of doing it (on the contrary) I just want to 
make sure it has not been done yet.


Cheers




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





--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



T5 image component

2008-02-01 Thread Michael Courcy

Hi list,

Do you know if there's a good image component library for reducing, 
rotating or writing on image with a little cache management  ?


I'm not against the idea of doing it (on the contrary) I just want to 
make sure it has not been done yet.


Cheers

--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com



Re: Tapestry 5 - Custom Component Validation

2008-01-31 Thread Michael Courcy

I'm really not sure that I grasp your need but

given that you declare the component in the template

@Component(id="myAttLabel")
private AttLabel myAttLabel;

public void  onValidate(){
 if(...whatever that could be an error...){
myAttLabel.setErrorFlag(true);
 }
}

should do the job

But I think the answer of Josh Canfield is better
http://www.nabble.com/Tapestry-5---Custom-Component-Validation-tt15186101.html#a15186101
Because you can track the error within the component


Xinhua a écrit :

This is what I am trying to do. But I could not pass the error flag from page
to component(AttLabel). I do not want to use @Persist to do this, but like
to add it to something like request object. So what annotation can I use? 
Can you show me the way (some codes) to do this? 


Xinhua


Michael Courcy wrote:
  
I you have control on the validation why not putting a flag in your 
component when a validation error happen.


Your render process would depend of this flag.

does it help ?

Xinhua a écrit :


I create a custom component (AttrLable) which extends AbstractField. In
the
BeginRender(MarkupWriter writer), I will need to override the label tag
based on whether there is an error in the input field which is associated
to
this label. 


On the form submission, I will do the form validation and if errors are
found, I will highlight the label and input field in the form page. But
the
problem is how I can pass the error flag to the component class
(Attrlabel)
which will rend the component.

Thanks in advance!


Xinhua 
  
      

--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



    


  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com



Re: Improved Tapestry Component Reference

2008-01-31 Thread Michael Courcy
The explaination you give on the loop within a form and the use of 
encoder are really helpful


I was looking for that for a while.

I understand now that when the submit is processed

1) The Loop Component update the model thanks to the encoder
2) Then the textfield update the model



Howard Lewis Ship a écrit :

I've been very busy this week improving the Tapestry Component Reference.

The Component Reference is now generated as multiple pages: an master
index, and one page per component (or mixin, page, base class) that is
documented.

Documentation partly comes from the JavaDoc for the component, and
partly from an extra hand-tooled documentation file.  The hand-tooled
documentation gives extra examples and notes.

You can view the current documentation set here:

http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/index.html

Feedback is most welcome!

  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: Improved Tapestry Component Reference

2008-01-31 Thread Michael Courcy
Don't know if it helps, but I propose a small tutorial for a more 
sophisticated layout


http://courcy-en.blogspot.com/2008/01/tapestry-5-create-layout-component.html

You have something a bit in the spirit of tiles but much simpler, it's a 
really easy and short read.


Franz Amador a écrit :

Is there a doc on Layout?  It looks like a component, but since it isn't in the 
component catalog, apparently it's built into tapestry.  I've found only 
bare-bones tutorial-style mention of layouts here and there, but no 
comprehensive reference.  For example, can I have multiple layouts, and if so, 
how?

- Original Message 
From: Howard Lewis Ship <[EMAIL PROTECTED]>
To: Tapestry users 
Sent: Thursday, January 31, 2008 10:58:50 AM
Subject: Improved Tapestry Component Reference


I've 
been 
very 
busy 
this 
week 
improving 
the 
Tapestry 
Component 
Reference.


The 
Component 
Reference 
is 
now 
generated 
as 
multiple 
pages: 
an 
master
index, 
and 
one 
page 
per 
component 
(or 
mixin, 
page, 
base 
class) 
that 
is

documented.

Documentation 
partly 
comes 
from 
the 
JavaDoc 
for 
the 
component, 
and
partly 
from 
an 
extra 
hand-tooled 
documentation 
file.  
The 
hand-tooled
documentation 
gives 
extra 
examples 
and 
notes.


You 
can 
view 
the 
current 
documentation 
set 
here:


http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/index.html

Feedback 
is 
most 
welcome!


  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: Improved Tapestry Component Reference

2008-01-31 Thread Michael Courcy

The examples is a real plus.


Howard Lewis Ship a écrit :

I've been very busy this week improving the Tapestry Component Reference.

The Component Reference is now generated as multiple pages: an master
index, and one page per component (or mixin, page, base class) that is
documented.

Documentation partly comes from the JavaDoc for the component, and
partly from an extra hand-tooled documentation file.  The hand-tooled
documentation gives extra examples and notes.

You can view the current documentation set here:

http://tapestry.formos.com/nightly/tapestry5/tapestry-core/ref/index.html

Feedback is most welcome!

  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: T5: checkbox questions

2008-01-31 Thread Michael Courcy


  
   


a dummy text that would 
be replaced by the actual value of the label attribute of the checkbox  

  




Angelo Chen a écrit :

Hi,

Got two questions about my checkbox in a form, template at end of this
email:

1. Why the 'check here to approve' was not shown in the example below? even
I remove the ?
   I'd like to display that text after the check box.

2. How to implement this: I will enable submit button if the checkbox is
checked?

Thanks.

A.C.


& nbsp;
Check
here to approve

 



  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: Tapestry 5 - Custom Component Validation

2008-01-31 Thread Michael Courcy
I you have control on the validation why not putting a flag in your 
component when a validation error happen.


Your render process would depend of this flag.

does it help ?

Xinhua a écrit :

I create a custom component (AttrLable) which extends AbstractField. In the
BeginRender(MarkupWriter writer), I will need to override the label tag
based on whether there is an error in the input field which is associated to
this label. 


On the form submission, I will do the form validation and if errors are
found, I will highlight the label and input field in the form page. But the
problem is how I can pass the error flag to the component class (Attrlabel)
which will rend the component.

Thanks in advance!


Xinhua 
  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: Editing a collection

2008-01-29 Thread Michael Courcy

Hi François

Thanks a lot, but actually my goal was more on understanding the loop 
inside the form and how the model is updated in such situation.


I keep your link though, I'll have a look on it.


Michael.

Francois Armand a écrit :

Michael Courcy wrote:
You mean that using value="user.loginUser" tapestry alway update the 
same thing.

Thus if I change the method

User {
void setLoginUser(String loginUser){
  this.loginUser = loginUser;
  System.out.println(loginUser);
}

It should at least output the value I input in my textField ...
And that's right, it actually what's going on the input are correctly 
output


But When I outout the user itself in the page

public void setUser(User user) {
   this.user = user;
   System.out.println(user);
   }

the old value is kept

actually setUser is call before setLoginUser ...

Ok thanks I've to work on that.


If you want, I built a "ListEditor" to handle this kind of things. 
It's part of my project, http://interldap.org
What you may looking for is here : 
http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/java/org/interldap/wui/t5lib/components/ListEditor.java?view=markup&rev=672 


And here there is an example of use case (it really lacks a lot of doc) :
http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/interldap/interldap-wui-common/trunk/src/main/resources/org/interldap/wui/t5lib/components/eschema/EditAttribute.tml?view=markup&rev=568 



That build a list of input fields, with a [delete] button next to 
them, and [add new value] button at the end of the list.
Each button emits an events so that enclosing component can add or 
delete matching value from list.
When you click on a button, updated values are set in the list at the 
right place.


It may be use to construct simpler list editor.

Hope it may help !




--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: Editing a collection

2008-01-29 Thread Michael Courcy
You mean that using value="user.loginUser" tapestry alway update the 
same thing.

Thus if I change the method

User {
void setLoginUser(String loginUser){
  this.loginUser = loginUser;
  System.out.println(loginUser);
}

It should at least output the value I input in my textField ...
And that's right, it actually what's going on the input are correctly 
output


But When I outout the user itself in the page

public void setUser(User user) {
   this.user = user;
   System.out.println(user);
   }

the old value is kept

actually setUser is call before setLoginUser ...

Ok thanks I've to work on that.


Szemere Szemere a écrit :

I'm going through something similar right now. Looking at the docs:

http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentstextfield

it seems that your:

value="user.loginUser"

determines the field that gets updated when the form is submitted. So as
you've got 6x fields that point to the same field in your form, that's what
gets updated (take a peek at 'user' to confirm this).

I think you need to override the 'value' setting to point to your different
objects.

  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Editing a collection

2008-01-28 Thread Michael Courcy

Hi,

I make some nice night experience about editing a list in a form.

Here is my  template
===
 
   
   
   
   
 

and here is my page
===
public class ListBean {
  
   private List users = new ArrayList(0);

   private User user;
  
   @PageLoaded

   public void initUsers(){
   users.add(new User("mic1","pass1"));
   users.add(new User("mic2","pass2"));
   users.add(new User("mic3","pass3"));
   users.add(new User("mic4","pass4"));
   users.add(new User("mic5","pass5"));
   users.add(new User("mic6","pass6"));
   }
  
   public void onValidate(){

   System.out.println(users);
   }

   public List getUsers() {
   return users;
   }

   public void setUsers(List users) {
   this.users = users;
   }

   public User getUser() {
   return user;
   }

   public void setUser(User user) {
   this.user = user;
   }

}

I bump into really strange things ...

1) onValidate is called six time !! Probably as much as users.size() I 
guess, is that expected ?


2) Debugging and logging show me that the list of users is never updated 
whatever the input in the textfields


Is all that normal or did I miss a key concept


--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: Is there an example using ajax with tapestry to refresh a table?

2008-01-28 Thread Michael Courcy

http://213.160.23.119:8080/t5components/

James Lin a écrit :

Hi:
   I want to see a very simple example show how to update a table using ajax.
   But I could not find one in the tapestry source.
   Do anyone have a sample for this?

thanks in advance!

James

_
Climb to the top of the charts! Play the word scramble challenge with star 
power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
  



--
Michael Courcy
http://courcy.blogspot.com
http://courcy-en.blogspot.com


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



Re: [T5] Spring and T5

2008-01-24 Thread Michael Courcy

Just work perfect, and Honestly installing spring was a matter of 3 minutes.

Have a look there
http://wiki.apache.org/tapestry/Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate

If you're still metting problem I can send you a mavenized project with 
even dbunit integrated.


Emmanuel Sowah a écrit :

Hi,

I read some time back that unlike T4, T5 would treat Spring as a first
citizen.
However, I've been struggling in making T5 work smoothly with Spring. Anyone
out there has had luck with this?
I'm now fed up and this is for me a wake up call to go look at some of the
other
ambitious and innovative web framework out there. Wicket probably?

Regards,

Emmanuel

  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: Writing a XML editor component (Tree view) in tapestry 5

2008-01-23 Thread Michael Courcy

This example could meet your need
http://wiki.apache.org/tapestry/Tapestry5TreeComponent



Mahen Perera a écrit :

Hi all,

 

I know this is going to be a tough one. But I think I need it. 


Basically, I need  a XML editor component, ,, the component should be
able to show a tree view of an XML document, and the user should be able
to add/edit/delete nodes (i.e XML elements), values etc. For example,
when you right click a node, you should be able to get these options. 


I am thinking of writing this component using tapestry 5,, and need a
jump start to writing components,, or else a pointer to some work
already done along these lines. 

 


Thanks in advance for any help..

 


The information contained in this email is strictly confidential and for the 
use of the addressee only, unless otherwise indicated. If you are not the 
intended recipient, please do not read, copy, use or disclose to others this 
message or any attachment. Please also notify the sender by replying to this 
email or by telephone (+44 (0)20 7896 0011) and then delete the email and any 
copies of it. Opinions, conclusions (etc.) that do not relate to the official 
business of this company shall be understood as neither given nor endorsed by 
it. IG Index plc is a company registered in England and Wales under number 
01190902. VAT registration number 761 2978 07. Registered Office: Friars House, 
157-168 Blackfriars Road, London SE1 8EZ. Authorised and regulated by the 
Financial Services Authority. FSA Register number 114059.

  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: Antwort: Layout component

2008-01-22 Thread Michael Courcy

Kristian,

I didn't know that, I'll try it.

Thanks.

Kristian Marinkovic a écrit :

hi michael,

great tutorial... had to figure out this myself :)

you can simplify the getLeftContent() method 
if you use the value attribute of the Parameter 
annotation:


@Parameter(value="block:left")
private Object left;

Object getLeftContent() {
   return left;
}

if no left parameter is passed to the layout
component it will use the default block.

g,
kris




Michael Courcy <[EMAIL PROTECTED]> 
22.01.2008 00:12

Bitte antworten an
"Tapestry users" 


An
Tapestry users 
Kopie

Thema
Layout component






Hi,

I propose a small tutorial to build a Layout component.
http://courcy-en.blogspot.com/2008/01/tapestry-5-create-layout-component.html


This one is a bit more sophisticated than the exemple given in the 
documentation, because you are able to override static content on case 
by case.



Your feedback are welcome and wanted.

  



--
Michael Courcy
http://courcy.blogspot.com


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



Layout component

2008-01-21 Thread Michael Courcy

Hi,

I propose a small tutorial to build a Layout component.
http://courcy-en.blogspot.com/2008/01/tapestry-5-create-layout-component.html

This one is a bit more sophisticated than the exemple given in the 
documentation, because you are able to override static content on case 
by case.



Your feedback are welcome and wanted.

--
Michael Courcy

http://courcy-en.blogspot.com
http://courcy.blogspot.com



Re: [ANN]: Seam for T5

2008-01-21 Thread Michael Courcy
What would be extremly cool is having the famous seam book example 
working with T5.


http://seam.demo.jboss.com/home.seam

Because the more interesting features of seam are in there (convesation, 
security  )


But I know that's probably a lot of work ...

Angelo Chen a écrit :

Hi,

Good news, a few questions:

1) Any tutorials on using Seam with T5?  I tried Seam, up to the point of
booking example, stop when i know I have to learn something about JSF. A
'hello world' tutorial with T5 will be helpful.

2) if an app uses Seam, do we still need Tapestry-hibernate?

Thanks,

A.C.



Igor Drobiazko wrote:
  

Hi all,

Seam integration with Tapestry 5 is available in Tacos 5.

http://tacos.sourceforge.net/tacos5/tacos-seam/index.html

--
Best regards,

Igor Drobiazko


    


  



--
Michael Courcy
http://courcy.blogspot.com



Re: [ANN] t5components - release 0.5.3

2008-01-19 Thread Michael Courcy

Really impressing

Go on !!


Sven Homburg a écrit :

Hi there,

the t5components release 0.5.3 is out now.

project page with demo  click here http://213.160.23.119:8080/t5components/ 



-
best regards
Sven
  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: [T5] Choosing components at runtime

2008-01-19 Thread Michael Courcy

John Owen Atala a écrit :

Thanks, that should be usefull, but doesn't help on the issue that to get an
instance of a component it must be injected somewhere, and that somewhere's
template must have every component that eventually you will use (because I
can't inject a component in a class whose template doesn't have it), so it
will always load every posible component...

And this is one main problem: i wanna use an injected component that it's
not on any template on a explicit way. Is there any way to get an instance
of a component that is not present on any template?

By the way, there says:
"The component may have been injected via the Component annotation, or may
have been passed to the as a parameter".
I don't know how to pass a Component as a parameter in a phase render
method, I tried:

Object beginRender(MyComponent myComponent) { ... }
  
I don't unsderstand the sentence this way, I woud think something like 
that :




well, I may be completly wrong ... I'm gonna try it and comeback to you 
to see if I find something interesting.

but myComponent variable is always null there...

What do you think?

Regards, 


John


Michael Courcy wrote:
  

Taken from
http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html


Rendering Components

Instead of returning true or false, a render phase method may return a 
component. The component may have been injected via the Component 
<http://tapestry.apache.org/tapestry5/tapestry-core/guide/.../apidocs/org/apache/tapestry/annotations/Component.html> 
annotation, or may have been passed to the as a parameter.


In any case, returning a component will queue that component to be 
rendered *before* the active component continues rendering.


The component to render may even be from a completely different page of 
the application.


Recursive rendering of components is not allowed.

This technique allows the rendering of Tapestry pages to be /highly/ 
dynamic.


Returning a component instance does *not* short circuit method 
invocation, the way returning a boolean would. It is possible that 
multiple methods may return components (this is not advised -- insanity 
may ensue).




johnowenatala a écrit :


Hi, i have a place in a page where i wanna put a component, but which
component is desided in runtime (can be from configuration or from
request
parameters).
I tried to do this by putting a delegate component, but i couldn't inject
in
runtime an unknowed component in compilation time.
What do you think i can do? Is this possible?
  
  

--
Michael Courcy
http://courcy.blogspot.com


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






  



--
Michael Courcy
http://courcy.blogspot.com



Re: T5: Encoder and Loop

2008-01-19 Thread Michael Courcy

Howard Lewis Ship a écrit :

That's the intent of the PrimaryKeyEncoder: to provide client/server
synchronization so that TextFields inside Loops inside a Form can
connect, when the client-side form is submitted, to equivalent
server-side objects.
  

ok

The TextField components (and other form control element components)
understand how to operate inside a loop correctly.  On each pass
through the loop, they render again, with a unique @name and @id
attribute.

There are some examples for this inside the Tapestry integration
suite.  I'm afraid real documentation isn't ready yet.
  

ok, but now  the intent is confirmed and I can do my search on my own.

when I'll better understand it, I'll make a wiki page with an example.

Thanks for your answer.


On Jan 16, 2008 1:29 PM, Michael Courcy <[EMAIL PROTECTED]> wrote:
  

Hi,

Reading the doc on the loop component
http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentsloop

I can see that one of the parameter is encoder (PrymaryKeyEncoder) and
this one should be used for a loop inside a form.

I don't really grasp it, but does it mean that with an encoder it's
possible to generate loop of textFields with validation for instance, or
make me able to edit a whole collection inside a form ?

If yes, someone could point examples or give hints ?

Thanks a lot.

--
Michael Courcy
http://courcy.blogspot.com







  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: [T5] Choosing components at runtime

2008-01-17 Thread Michael Courcy

Taken from
http://tapestry.apache.org/tapestry5/tapestry-core/guide/rendering.html


   Rendering Components

Instead of returning true or false, a render phase method may return a 
component. The component may have been injected via the Component 
<http://tapestry.apache.org/tapestry5/tapestry-core/guide/.../apidocs/org/apache/tapestry/annotations/Component.html> 
annotation, or may have been passed to the as a parameter.


In any case, returning a component will queue that component to be 
rendered *before* the active component continues rendering.


The component to render may even be from a completely different page of 
the application.


Recursive rendering of components is not allowed.

This technique allows the rendering of Tapestry pages to be /highly/ 
dynamic.


Returning a component instance does *not* short circuit method 
invocation, the way returning a boolean would. It is possible that 
multiple methods may return components (this is not advised -- insanity 
may ensue).




johnowenatala a écrit :

Hi, i have a place in a page where i wanna put a component, but which
component is desided in runtime (can be from configuration or from request
parameters).
I tried to do this by putting a delegate component, but i couldn't inject in
runtime an unknowed component in compilation time.
What do you think i can do? Is this possible?
  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: Using a component in a subpackage

2008-01-17 Thread Michael Courcy

I found the answer myself it's explain here

http://lombok.demon.co.uk/tapestry5Demo/test/components/colorpickerdemosource

sorry

Michael Courcy a écrit :

Hi

I made a component call Personne in ${tapetry-root-package}/components 
package and it works fine


But I'd like to move my component in a subpackage of the components 
package say personne but I don't see how to call it now in my pages


 lead to this error
Unable to resolve component type 'personne/Personne' to a component 
class name


and
 ead to this error
Unable to resolve component type 'Personne'

That's maybe not possible ?
--
Michael Courcy
http://courcy.blogspot.com



--
Michael Courcy
http://courcy.blogspot.com



T5: Encoder and Loop

2008-01-16 Thread Michael Courcy

Hi,

Reading the doc on the loop component
http://tapestry.apache.org/tapestry5/tapestry-core/component-parameters.html#orgapachetapestrycorelibcomponentsloop

I can see that one of the parameter is encoder (PrymaryKeyEncoder) and 
this one should be used for a loop inside a form.


I don't really grasp it, but does it mean that with an encoder it's 
possible to generate loop of textFields with validation for instance, or 
make me able to edit a whole collection inside a form ?


If yes, someone could point examples or give hints ?

Thanks a lot.

--
Michael Courcy
http://courcy.blogspot.com



Re: [ANN] Tapestry/Seam integration

2008-01-15 Thread Michael Courcy

Maybe a stupid question, but does your work support also seam page flow ?

That should not be easy, this part is tightly integrated with JSF.

Thanks for your work.

Igor Drobiazko a écrit :

Hi all,

Seam integration for Tapestry 4 is now available as Tacos subproject:
http://tacos.sourceforge.net/tacos4.1/tacos-seam/index.html

Read how get the latest snapshots here:
http://tacos.sourceforge.net/tacos4.1/tacos-seam/download.html

The demo sources can be found here:
http://tacos.svn.sourceforge.net/viewvc/tacos/tacos-4.1/trunk/tacos-seam/demo/

Integration with Tapestry 5 is started as well. This will be the first
module for Tacos 5.
Unfortunately I can't upload the snapshots yet because some work is still
needed.
But you can expect the snapshots in the next days.

  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5: regexp for commas

2008-01-15 Thread Michael Courcy

Thomas Zenglein a écrit :

Hello,

thanks evrybody for attempting to help me with that problem. I tried every suggest you gave, with no positve result. Now I think this is a Tapetry internal problem. 
Any idea for an alternative solution method?

Meanwhile I have to be happy without the regexp check.
  

Well you could do that inside the onValidate method of your form ...
No ?


THX

Thomas


  
Michael Courcy <[EMAIL PROTECTED]> schrieb am Mo, Jan 14, 2008 um  4:18 


in Nachricht <[EMAIL PROTECTED]>:
  
well I wonder if the comma is not playing a role in the interpretation 
of the annotation ?


did you try to replace the comma by its unicode value :  \u002C


Thomas Zenglein a écrit :


Hello Michael,

I've just tried following lines.

public class Test {
   public static void main(String[] args) {
String foo = ",";
if (foo.matches("[<>a-zA-Z,öäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")){
System.out.println(":)");
} else {
System.out.println(":(");
}
  }
}

With the aim to decide weather String foo contains a ',' ( or  another 
  
blabla that I allow) or not. Fortunately that works fine :). Now I want the 
same functionality in T5.


Thomas

  
  
Michael Courcy <[EMAIL PROTECTED]> schrieb am Mo, Jan 14, 2008 um  1:33 




in Nachricht <[EMAIL PROTECTED]>:
  
  

Did you try this regexp with in a regular java program ?

Thomas Zenglein a écrit :



Hello everybody,

I want my textfield to allow a couple of signs.  For that I have the 
  
  

following code.



@Validate("required,regexp=[<>a-zA-ZöäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")
public void setName(String name) {
 this.name = name;
}

Comma signs should also be allowed here. So I want to extend the regexp to 
  
  

handle that case.



@Validate("required,regexp=[<>a-zA-Z,öäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")
leads to 
Coercion of [<>a-zA-Z to type java.util.regex.Pattern (via String --> 
  
  
java.util.regex.Pattern) failed: Unclosed character class near index 8 
[<>a-zA-Z ^


@Validate("required,regexp=[<>a-z\\,A-ZöäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+") 
  
  

leads to following error:


Coercion of [<>a-z\ to type java.util.regex.Pattern (via String --> 
  
  
java.util.regex.Pattern) failed: Unclosed character class near index 7 [<>a-z\ 

^



Has anybody an idea for the correct code??? I use tapestry 5.0.6.

THX 


Thomas

-
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: Antw: Re: T5: regexp for commas

2008-01-14 Thread Michael Courcy
well I wonder if the comma is not playing a role in the interpretation 
of the annotation ?


did you try to replace the comma by its unicode value :  \u002C


Thomas Zenglein a écrit :

Hello Michael,

I've just tried following lines.

public class Test {
   public static void main(String[] args) {
String foo = ",";
if (foo.matches("[<>a-zA-Z,öäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")){
System.out.println(":)");
} else {
System.out.println(":(");
}
  }
}

With the aim to decide weather String foo contains a ',' ( or  another blabla 
that I allow) or not. Fortunately that works fine :). Now I want the same 
functionality in T5.

Thomas

  
Michael Courcy <[EMAIL PROTECTED]> schrieb am Mo, Jan 14, 2008 um  1:33 


in Nachricht <[EMAIL PROTECTED]>:
  

Did you try this regexp with in a regular java program ?

Thomas Zenglein a écrit :


Hello everybody,

I want my textfield to allow a couple of signs.  For that I have the 
  

following code.


@Validate("required,regexp=[<>a-zA-ZöäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")
public void setName(String name) {
 this.name = name;
}

Comma signs should also be allowed here. So I want to extend the regexp to 
  

handle that case.


@Validate("required,regexp=[<>a-zA-Z,öäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")
leads to 
Coercion of [<>a-zA-Z to type java.util.regex.Pattern (via String --> 
  
java.util.regex.Pattern) failed: Unclosed character class near index 8 
[<>a-zA-Z ^

@Validate("required,regexp=[<>a-z\\,A-ZöäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+") 
  

leads to following error:

Coercion of [<>a-z\ to type java.util.regex.Pattern (via String --> 
  
java.util.regex.Pattern) failed: Unclosed character class near index 7 [<>a-z\ 
^


Has anybody an idea for the correct code??? I use tapestry 5.0.6.

THX 


Thomas

-
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: regexp for commas

2008-01-14 Thread Michael Courcy

Did you try this regexp with in a regular java program ?

Thomas Zenglein a écrit :

Hello everybody,

I want my textfield to allow a couple of signs.  For that I have the following 
code.

@Validate("required,regexp=[<>a-zA-ZöäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")
public void setName(String name) {
 this.name = name;
}

Comma signs should also be allowed here. So I want to extend the regexp to 
handle that case.

@Validate("required,regexp=[<>a-zA-Z,öäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+")
leads to 
Coercion of [<>a-zA-Z to type java.util.regex.Pattern (via String --> java.util.regex.Pattern) failed: Unclosed character class near index 8 [<>a-zA-Z ^


@Validate("required,regexp=[<>a-z\\,A-ZöäüÖÄÜß0-9\\.\"\'?!§$%&\\-+*:/ ]+") 
leads to following error:
Coercion of [<>a-z\ to type java.util.regex.Pattern (via String --> 
java.util.regex.Pattern) failed: Unclosed character class near index 7 [<>a-z\ ^

Has anybody an idea for the correct code??? I use tapestry 5.0.6.

THX 


Thomas

-
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: What's heartbeat ?

2008-01-07 Thread Michael Courcy

Hi Chris,

Chris Lewis a écrit :
I'm not an expert on this, but I can offer you a real need for 
defer(). Suppose you have a mixin that attaches some trivial piece of 
JavaScript to components that use it;  for example, a key logger. As 
far as the JS, what you need to do is register a few DOM event 
handlers on an element - probably onkeypress or onkeyup, etc. Let's 
suppose you wrote a class that creates such objects, and all you need 
to instantiate them is the DOM id of the element.


In a simple case all you'd need to do is have your mixin include the 
javascript and provide a line (like support.addScript()) to 
instantiate the object in JS code - providing the component id, which 
I think you can get through something like ComponentResources. Now, if 
in your template code you have one component for which you explicitly 
provide the DOM id, then your mixin will end up with this id. However 
there are situations where you simply can't know the id before hand, 
and in such cases you must rely on Tapestry to provide it.


A classic example is looping. If you have a loop that for some reason 
creates a variable number of components, to which you'd like to attach 
instances of your JS key logger, then you need to get the ids (created 
on the fly) from Tapestry. What's more, you can't assk a component for 
its id until it has already been assigned one, and the only way to be 
sure that your code executes after the assignment happen is to use 
Heartbeat#defer.


Now as far as when a heartbeat is created, and when/who must call 
start() and end(), I'm not entirely sure. I think that a component 
whose behavior interacts with/depends on that of other 
components/mixins must use heartbeats to coordinate.
I understand this concept my question is how can they cooperate, It 
would be really nice to have a live example involving the use of 
heartbeat to get Ids of "only known at runtime component".


The only example I could find about heartbeat is to defer the firing of 
an event :

Taken from http://wiki.apache.org/tapestry/Tapestry5SubmitContextComponent

Runnable sendNotification = new Runnable()
{
public void run()
{
_resources.triggerEvent(SELECTED_EVENT, new Object[] {context}, 
null);
}
};

// When not deferred, don't wait, fire the event now (actually, at the 
end of the current
// heartbeat). This is most likely because the Submit is inside a Loop 
and some contextual
// information will change if we defer. Another option might be to wait 
until the next
// heartbeak?

if (_defer)
_formSupport.defer(sendNotification);
else
_heartbeat.defer(sendNotification);


But If you read the rest of this exemple, _heartbeat.begin, 
_heartbeat.end are never called ... Who call them ? What means calling 
them ?


I hope this helps. I'd suggest looking into the source for heartbeat's 
implementation as well as what really happens inside form support's 
defer method. You're not alone in your questions and expanded docs on 
this would be helpful.
You're right I think a little dive in the source code would be 
refreshing :-)


sincerely,
chris

PS - irc.freenode.net #tapestry

Michael Courcy wrote:

Gabriel Landais a écrit :

Michael Courcy a écrit :

If you look at this exemple :  TreeGridComponent
http://tapestry5-treegrid.googlecode.com/svn/trunk/tapestry5-treegrid/src/main/java/org/codelutin/tapestry/components/TreeGrid.java 

a hearbeat.begin is called in beginRender and heartbeat.end is 
called in afterRender but you can never read a call to defer, so 
can you explain why the author of this component call begin and end 
? I really can't explain myself.
I've based my component on 
<http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents> 
and <http://wiki.apache.org/tapestry/Tapestry5TreeComponent> without 
really understanding how it heartbeat works... As I don't use defer, 
I don't even know if it is useful...

Gabriel

But do you see a different hehaviour if you remove this two lines ?


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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: What's heartbeat ?

2008-01-07 Thread Michael Courcy

Gabriel Landais a écrit :

Michael Courcy a écrit :

If you look at this exemple :  TreeGridComponent
http://tapestry5-treegrid.googlecode.com/svn/trunk/tapestry5-treegrid/src/main/java/org/codelutin/tapestry/components/TreeGrid.java 

a hearbeat.begin is called in beginRender and heartbeat.end is called 
in afterRender but you can never read a call to defer, so can you 
explain why the author of this component call begin and end ? I 
really can't explain myself.
I've based my component on 
<http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents> 
and <http://wiki.apache.org/tapestry/Tapestry5TreeComponent> without 
really understanding how it heartbeat works... As I don't use defer, I 
don't even know if it is useful...

Gabriel

But do you see a different hehaviour if you remove this two lines ?


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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: What's heartbeat ?

2008-01-07 Thread Michael Courcy

Gabriel Landais a écrit :

Michael Courcy a écrit :

If you look at this exemple :  TreeGridComponent
http://tapestry5-treegrid.googlecode.com/svn/trunk/tapestry5-treegrid/src/main/java/org/codelutin/tapestry/components/TreeGrid.java 

a hearbeat.begin is called in beginRender and heartbeat.end is called 
in afterRender but you can never read a call to defer, so can you 
explain why the author of this component call begin and end ? I 
really can't explain myself.
I've based my component on 
<http://wiki.apache.org/tapestry/Tapestry5HowToCreateYourOwnComponents> 
and <http://wiki.apache.org/tapestry/Tapestry5TreeComponent> without 
really understanding how it heartbeat works... As I don't use defer, I 
don't even know if it is useful...

Gabriel

One point for your honesty.

Thanks.


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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: What's heartbeat ?

2008-01-07 Thread Michael Courcy

Yes thanks,

I've done this first of course.

It's a start but it does not bring so much light in my point of view.

For instance :

it does not say what's the difference between calling formSupport.defer 
or heartbeat.defer, do you see the difference and the conscequences on 
request treatment or event treatment ?


If you look at this exemple :  TreeGridComponent
http://tapestry5-treegrid.googlecode.com/svn/trunk/tapestry5-treegrid/src/main/java/org/codelutin/tapestry/components/TreeGrid.java
a hearbeat.begin is called in beginRender and heartbeat.end is called in 
afterRender but you can never read a call to defer, so can you explain 
why the author of this component call begin and end ? I really can't 
explain myself.


What's going on if many components on a page use heartbeat, each 
component have its own heartbeat system, or is there a general heartbeat 
rythm, and each component register to it through the call to begin, end 
and defer ? Can two different heartbeat join and in which circumstances? 
Especially if a componnent contains another component ?


Mybe heartbeat is something very simple and the word "heartbeat" make me 
think it's bigger but I don't find that so clear when I start to read it 
in real components.


Michael




Kalle Korhonen a écrit :

First result with a google search "tapestry 5 heartbeat":
http://tapestry.formos.com/nightly/tapestry5/apidocs/org/apache/tapestry/services/Heartbeat.html

Kalle

On 1/6/08, Michael Courcy <[EMAIL PROTECTED]> wrote:
  

Hi list,

As I start to read the code on components I often see heartbeat

@Environmental
private Heartbeat heartbeat;

with heartbeat.begin and heartbeat.end

Can someone explain the role of this object and its methods invocations
(begin and end) beacause it's not really clear in my mind.

Thanks a lot.

--
Michael Courcy
http://courcy.blogspot.com


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





  



--
Michael Courcy
http://courcy.blogspot.com


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



What's heartbeat ?

2008-01-06 Thread Michael Courcy

Hi list,

As I start to read the code on components I often see heartbeat

@Environmental
private Heartbeat heartbeat;

with heartbeat.begin and heartbeat.end

Can someone explain the role of this object and its methods invocations 
(begin and end) beacause it's not really clear in my mind.


Thanks a lot.

--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5: JumpStart 3.0.0 Preview ready for comments

2007-12-18 Thread Michael Courcy

Thanks a lot, I 'll try it.

Francois Armand a écrit :

Michael Courcy wrote:

Hi

I was really interested on how we could handle the edition of an 
entire list in a single page with T5.


Let's say a  List in a situation where we want the user to be 
able to edit the name and surname of all in a single request.


What could be the more elegant solution ?

I have a listEditor that build a list of property editor with the 
possibility to add/remove/update properties.
I built it to handle simple properties (String, Enum, date...), but it 
seems to work as long as you have an editor associated with the 
property type : I use it to handle a list of criterion, which are a 
complex object (well, complex...). In your case, you would have to 
define a personEditor (surely just a beanEditor).


It should (at least :) need a lot more of polish, but it work rather 
nicely.


For example, if you want to edit a list of string, say "bleue", "red" 
and that the editor for String is "text", the rendered template is :


[blue] 
[red]  


The "[]" are text input fields, "<>" are buttons.

The component generate event on button selection so that the parent 
element can handle matching action (add or remove element, with 
perhaps other business logic).


The project is open source, but the browse SVN is still broken (OW2 
plateform... no comment).

Thought,  you can checkout the source at this address :
--
svn://svn.forge.objectweb.org/svnroot/interldap/interldap-wui-common/trunk 


--
The component is in 
src/main/java/org.interldap.wui.t5lib.components/ListEditor.java.
Example of use are available in 
src/main/java/org/interldap/wui/t5lib/components/eschema/EditClass and 
EditAttribute.


If the god of spare time is with me, I will try to contribute to some 
component repository or another the code in January, cleaner and 
documented.





--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5: JumpStart 3.0.0 Preview ready for comments

2007-12-18 Thread Michael Courcy

Hi

I was really interested on how we could handle the edition of an entire 
list in a single page with T5.


Let's say a  List in a situation where we want the user to be 
able to edit the name and surname of all in a single request.


What could be the more elegant solution ?

Michael.


Geoff Callender a écrit :

Hi all,

I've reworked JumpStart to address Tapestry 5, and I need feedback on 
how to make it as good as it can be...


If you don't know JumpStart, its purpose is to get newcomers 
up-to-speed with Tapestry as fast as possible.  It's aim is to dispel 
the myth of Tapestry's steep learning curve by helping people get 
productive quickly.  The better that JumpStart is, the better I hope 
it will be for all the Tapestry community.


So, I'm looking for heaps of feedback on its strengths, weaknesses, 
choice of examples, quality of code, correctness, etc., anything that 
will make it more helpful to more people!


To get it, go to http://files.doublenegative.com.au/jumpstart/ , click 
on Downloads, and look for jumpstart-min-3.0.0.preview.1.zip.


Cheers,

Geoff Callender
http://files.doublenegative.com.au/jumpstart/

You can mail me directly or reply to this thread.  Either is fine.

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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5: JumpStart 3.0.0 Preview ready for comments

2007-12-16 Thread Michael Courcy

Hi Geoff

I've successfully installed the jumpstart-min on windows XP with JBOSS 
4.2.2GA


I start  digging now.

Thanks a lot.
Michael


Geoff Callender a écrit :

Hi all,

I've reworked JumpStart to address Tapestry 5, and I need feedback on 
how to make it as good as it can be...


If you don't know JumpStart, its purpose is to get newcomers 
up-to-speed with Tapestry as fast as possible.  It's aim is to dispel 
the myth of Tapestry's steep learning curve by helping people get 
productive quickly.  The better that JumpStart is, the better I hope 
it will be for all the Tapestry community.


So, I'm looking for heaps of feedback on its strengths, weaknesses, 
choice of examples, quality of code, correctness, etc., anything that 
will make it more helpful to more people!


To get it, go to http://files.doublenegative.com.au/jumpstart/ , click 
on Downloads, and look for jumpstart-min-3.0.0.preview.1.zip.


Cheers,

Geoff Callender
http://files.doublenegative.com.au/jumpstart/

You can mail me directly or reply to this thread.  Either is fine.

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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: Can't get component inside a component

2007-12-09 Thread Michael Courcy

Hi Kristian

Thanks for your hints.

I just wanted to have control over my component and they appeared to be 
null in my debugger at any stages of the rendering process.


My fault was to not declare them private. Since I declared them private 
the problem was fixed.


Michael.

Kristian Marinkovic a écrit :

Hi Michael,

Thiago is right, first make the fields private... you should have
some warnings in your console tough.

then you have to decide how you want to add components:

you can add components to a page by declaring them
in the template like you did (then you dont need to declare
them in your page/component class):



or by using invisible instrumentation by adding an t:id attribute 
to one of your HTML elements that matches

a field in the page class/componen class with a @Component
annotation with the same name of with a id parameter:

...

// id matches field name
@Component
private PageLink page

// id in template does not match field name
@Component(id="page")
private PageLink pageToEdit



g,
kris



"Thiago HP" <[EMAIL PROTECTED]> 
06.12.2007 12:31

Bitte antworten an
"Tapestry users" 


An
"Tapestry users" 
Kopie

Thema
Re: Can't get component inside a component







Try replacing
@Component(id="couleur1")
Couleur couleur1;

by

@Component(id="couleur1")
private Couleur couleur1;

AFAIK, @Component and @Inject only works in private fields.
Thiago

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



  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5 How to write a layout component ?

2007-12-08 Thread Michael Courcy

I had a similar problem

I just add a

beforeRender(MarkupWriter writer){
 return true;
}

method that just return true and it solves the problem.

Dapeng a écrit :

Hi

First time try T5

i followed the link
http://tapestry.apache.org/tapestry5/tapestry-core/guide/templates.html





http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
   
   My Tapestry Application
   
   
   
   





copy the codes into respective

src/java/com/my/components/Layout.tml
src/java/com/my/components/Layout.java (empty class)


and have my start page as the guide stated

http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

 My Page Specific Content




then run,

getting into




An unexpected application exception has occurred.
java.lang.IllegalStateException
This markup writer does not have a current element. The current element
is established with the first call to element() and is maintained across
subsequent calls.







my environment:

   1. netbeans 6
   2. maven plugin for nb 6
   3. t5 5.0.6
   4. tomcat 6



here is my pom


http://maven.apache.org/POM/4.0.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>
4.0.0
com.my
test2
war
1.0-SNAPSHOT
test2 Maven Webapp
http://maven.apache.org

   
   junit
   junit
   3.8.1
   test
   
   
   org.apache.tapestry
   tapestry-core
   5.0.6
   compile
   


   test2
   
   
   maven-compiler-plugin
   RELEASE
   
   1.6
   1.6
   
   



   


   Tomcat60





















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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: Can't get component inside a component

2007-12-06 Thread Michael Courcy

Thanks a lot.

Thiago HP a écrit :

Try replacing
@Component(id="couleur1")
Couleur couleur1;

by

@Component(id="couleur1")
private Couleur couleur1;

AFAIK, @Component and @Inject only works in private fields.
Thiago

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


  



--
Michael Courcy
http://courcy.blogspot.com


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



Can't get component inside a component

2007-12-06 Thread Michael Courcy

Hi, I'm a newbie in tapestry

I have a component Drapeau that embed 3 others components of type Couleur

all the Couleur components in any phase of the Drapeau render process 
appear to be null in my debugger.


Drapeau.html
==
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
This is a flag
 Couleur 1 
 Couleur 2 
 Couleur 3 



Drapeau.java
==
public class Drapeau {
  
   @Component(id="couleur1")

   Couleur couleur1;
  
   @Component(id="couleur2")

   Couleur couleur2;
  
   @Component(id="couleur3")

   Couleur couleur3;

   @BeforeRender
   public boolean beforeRender(MarkupWriter writer){   
   return true;

   }
... other phases ...  
  
}


And in my page Root.html
 bla 

The Drapeau is rendered fine (I mean with the three Couleurs) in the 
browser but I really don't see how the Drapeau Component can collaborate 
with the Couleur components.


Thanks.


--
Michael Courcy
http://courcy.blogspot.com



Re: T5: Grid queries partial data

2007-12-03 Thread Michael Courcy

Very interesting thank you
Sven Homburg a écrit :

have a look for a simple hibernated grid datasource

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

best regards

S.Homburg




ronaldlee schrieb:

Hi,

Does anyone know how to implement a Grid data source, or thru other 
ways,
such that it will only query partial data from the database, 
depending on
the page link user click on the Grid, and the "rowsPerPage" value set 
for

the Grid? I just don't want to retrieve the whole list if I only need to
display part of it.

thx!
Ronald
  


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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: [T5] 5.0.7 ajax update

2007-11-26 Thread Michael Courcy

Hi
i used this example for tapestry 5.0.6 to update some components: 

Where did you read this example ? On the wiki ?

Thanks.


Alexander Turtsevich a écrit :

hi,

i used this example for tapestry 5.0.6 to update some components:

   public Object onMyAction()
   {
   MarkupWriter markupWriter = 
_markupWriterFactory.newMarkupWriter();

   markupWriter.element("component");
   _pageRenderInitializer.setup(markupWriter);
   Page page = 
_requestPageCache.get(_componentResources.getPageName());
   ComponentPageElement element = 
page.getRootElement().getEmbeddedElement("componentId");

   RenderQueueImpl queue = new RenderQueueImpl(page.getLogger());
   queue.push(element);queue.run(markupWriter);
   markupWriter.end();
   _pageRenderInitializer.cleanup(markupWriter);
   return new TextStreamResponse("text/html", 
markupWriter.toString());

   }

but for 5.0.7 this code doesnt work.

How partial page rendering should be done using 5.0.7??

thanks for any help

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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: Get application context from within a BasePage subclass

2007-11-20 Thread Michael Courcy

If you are working on Tapestry 5 you can read  this wiki  :
http://wiki.apache.org/tapestry/Tapstry5First_project_with_Tapestry5,_Spring_and_Hibernate

Kaspar Fischer a écrit :

Hi,

The Tapestry reference,

  
http://static.springframework.org/spring/docs/2.0.x/reference/webintegration.html#webintegration-common 



says that "[...] one can use the following code snippet to get access
to this 'business context' ApplicationContext created by the
ContextLoaderListener":

  WebApplicationContext ctx = 
WebApplicationContextUtils.getWebApplicationContext(servletContext);


How would I do this from within a page (i.e., a subclass of BasePage)?

IIUC, a page need not have an associated servletContext. So what sort
of indirection would I use?

I am trying to get the Spring WebApplicationContext service that
(apparently) the tapestry-spring.jar,

  http://tapestry.apache.org/tapestry5/tapestry-spring/

adds. My finally goal is to load a Spring bean from a page to do
some processing.

Many thanks and sorry for the simple question (I am a Tapestry newbie!),
Kaspar

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





--
Michael Courcy
http://courcy.blogspot.com


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



Re: How to initialize a session variable in a page render request?

2007-11-20 Thread Michael Courcy
I may be wrong as I'm a tapestry newbie, but pageAttached is something 
related to the compilation and pooling of the page template. Thus it 
should not deal with session buisness.


jeffrey ai a écrit :

Hi Folks,

I am looking for the best way to initialize a session variable(@Persist) in
a page render request once, so I could access it in the next action request.

I tried to put the logic into "pageAttached" method like below:

@Persist
private xxx myVar;

@SuppressWarnings(value = "unused")
private void pageAttached()
{
if (myVar == null) initializeVar();
}


It doesn't work as I expected. myVar is always null in "pageAttached"
method. It seems the "pageAttached" method is not supposed to mutate a
persistent variable.

However, if I put this logic into some other place  like below, it works
fine.

@Persist
private xxx myVar;

public String getSomeOtherVar()
{
if (myVar == null) initializeVar();
return someOtherVar;
}


Although it works, apparently, this is not a good place.
Is there a better place to do session variable initialization?
I believe it should not be put into constructor too because it will be
viewable to other sessions.

Thanks,
Jeffrey Ai
  



--
Michael Courcy
http://courcy.blogspot.com


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



How to make a basic crud; feedback wanted

2007-11-18 Thread Michael Courcy

Hi,

This is the second edition of  "how to make a basic crud with tapestry5" ;-)

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

I did it because as a newbie I really needed one.

If you think there could be much better way to do it, or tapestry is not 
used as it should be, please let me know.


--
Michael Courcy
http://courcy.blogspot.com



Re: How to make a basic crud : Feedback wanted

2007-11-17 Thread Michael Courcy

Vjeran Marcinko a écrit :

Hi.

Although your example is very simple in code as such, it suffers from 
some drawbacks, mainly because you don't have activation context for 
Save page.


1. Your create and edit actions on Start page use ActionLinks which 
make 2 HTTP requests (action + render Save page), whereas PageLinks 
with "myBeanId" context value would execute just one HTTP request 
which will just render Save page, and that is all you actually need
Did  you mean that instead of 




You'd rather see 

 




2. Its always good practice to pass only necessary activation context 
values (in this case myBeanId), and let page itself be responsible to 
reconstructing all that is necessary, meaning, it is not good to 
instantiate new MyBean or fetch it from database outside of Save page 
as in your case, but to do it inside it, in onPrepare event method. 
This way if you have some additions to save page which maybe lead to 
another page and get back to it, all you need to do when getting back 
to Save page is to make certain this entity ID is present there, and 
page will know how to reconstruct itself.

You are right


3. If you keep only "myBeanId" inside Save as Session persistent 
value, your Session has much less overhead in cluster recplication 
then when holding whole instances. Though I guess this is just small 
gain, often dismissable.

ok


Of course, all the written above depends on situation and your needs.

Regards,
Vjeran

Thanks a lot, I going to rework this.


- Original Message - From: "Michael Courcy" 
<[EMAIL PROTECTED]>

To: "Tapestry users" 
Sent: Saturday, November 17, 2007 12:16 AM
Subject: How to make a basic crud : Feedback wanted



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

--
Michael Courcy
http://courcy.blogspot.com



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





--
Michael Courcy
http://courcy.blogspot.com


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



How to make a basic crud : Feedback wanted

2007-11-16 Thread Michael Courcy

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

--
Michael Courcy
http://courcy.blogspot.com



Re: T5 Newbie : populate the value of a form in a bean

2007-11-16 Thread Michael Courcy
In my case I think I was running in confusion, the MyObject was already 
initialized from a previous page and injected in the page that hold the 
form.
Thus initialising it from onPrepareFromForm or setupRender is useless in 
this particular case.
Things are working fine now, I really don't see what was wrong before as 
I can't see what's better now ...

Newbie bad time. Josh send me good vibes ;-)

I'm going to produce a little wiki tutorial on Basic Crud this weekend 
because that really miss me.


Thanks for your help and your explainations.


Howard Lewis Ship a écrit :

Generally, what you want to do is replace setupRender() with
onPrepareFromForm().

void onPrepareFromForm()
{
  if (_myObject == null) _myObject = new MyObject();
}

"Prepare" means the prepare event, fired from your Form component.
Prepare event is triggered when the form starts to render AND when it
starts to process a submission.  Instantiating and object is exactly
what prepare is intended for.

Tapestry will supply an id of "form" for the  component. If
you have multiple forms, they may end up being "form", "form_0",
"form_1".  I tend to give an explicit id.

You test page is a little different, in that it displays the contents
of the myObject property as well, so your setupRender() should do the
job (because the _myObject field is persistent).

On Nov 15, 2007 11:39 AM, Josh Canfield <[EMAIL PROTECTED]> wrote:
  

Hey Michael,

I didn't get to it last night, but here you go, a very simple example:

** Start.tml 
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
  
Form Test
  
  
MyObject:
Name: ${myObject.name}
Number: ${myObject.number}

  
   
   
  

  


 Start.java 
*package* joshcan.test.myapp.pages;
**
*import* joshcan.test.myapp.model.TestObject;
*import* org.apache.tapestry.annotations.Persist;

/**
 * Start page of application myapp.
 */
*public* *class* Start
{
  @Persist // Store this object in the session...
*  private* TestObject _myObject;
*  *
*  public* *void* setupRender() {
*if* ( _myObject == *null* ) { // make sure we have an object to work
on.
  _myObject = *new* TestObject();
}
  }

*  public* TestObject getMyObject() {
*return* _myObject;
  }

*  public* *void* setMyObject(TestObject myObject) {
_myObject = myObject;
  }
}
 TestObject.java 
*

package* joshcan.test.myapp.model;

*public* *class* TestObject {

*  private* String name;
*  private* Long number;

*  public* String getName() {
*return* name;
  }

*  public* *void* setName(String name) {
*this*.name = name;
  }

*  public* Long getNumber() {
*return* number;
  }

*  public* *void* setNumber(Long number) {
*this*.number = number;
  }

}
Josh



On Nov 15, 2007 1:35 AM, Michael Courcy <[EMAIL PROTECTED]> wrote:



The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh


Josh It would be really really nice  !!!
If you do so I would make it a small wiki tutorial


Josh Canfield a écrit :
 > Hi Michael,
  




Thanks Josh, but do you have also a title property with getter and
setter in your page class ?


  

No, I only have the video getter/setter





And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?

  

The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh

On Nov 14, 2007 11:01 AM, Michael Courcy <[EMAIL PROTECTED]>


wrote:
  


Thanks Josh, but do you have also a title property with getter and
setter in your page class ?

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?

Josh Canfield a écrit :
 >> I want to populate from the form directly to the bean. But this
require

  

to use either the beanEditForm or a custom component.



  

You can get this to work. I use the textfield component for editing my



bean

  

objects. This is from a working emplate:


My page class has a getVideo method which returns an object that has a
getTitle method.

Good luck,
Josh

On Nov 14, 2007 9:05 AM, Michael Courcy <[EMAIL PROTECTED]>



wrote:

  

You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tap

Re: [T5] Simple question about select and enum

2007-11-15 Thread Michael Courcy

Do you have error messages ?

TNO a écrit :

Hi,

I want to create a very simple select list from an enum.



But in a select component, the model (org.apache.tapestry.SelectModel)
is required, I try to use EnumSelectModel but it did not work...
I can't have my enum list...

please help, thanks

Tom



---
Antivirus avast! : message Sortant sain.
Base de donnees virale (VPS) : 071114-0, 14/11/2007
Analyse le : 15/11/2007 16:50:02
avast! - copyright (c) 1988-2007 ALWIL Software.
http://www.avast.com




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


  



--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5 Newbie : populate the value of a form in a bean

2007-11-15 Thread Michael Courcy

I've tried it
It works, got to understand my errors now.
Thanks a lot.

Josh Canfield a écrit :

Hey Michael,

I didn't get to it last night, but here you go, a very simple example:

** Start.tml 
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
  
Form Test
  
  
MyObject:
Name: ${myObject.name}
Number: ${myObject.number}

  
   
   
  

  


 Start.java 
*package* joshcan.test.myapp.pages;
**
*import* joshcan.test.myapp.model.TestObject;
*import* org.apache.tapestry.annotations.Persist;

/**
 * Start page of application myapp.
 */
*public* *class* Start
{
  @Persist // Store this object in the session...
*  private* TestObject _myObject;
*  *
*  public* *void* setupRender() {
*if* ( _myObject == *null* ) { // make sure we have an object to work
on.
  _myObject = *new* TestObject();
}
  }

*  public* TestObject getMyObject() {
*return* _myObject;
  }

*  public* *void* setMyObject(TestObject myObject) {
_myObject = myObject;
  }
}
 TestObject.java 
*

package* joshcan.test.myapp.model;

*public* *class* TestObject {

*  private* String name;
*  private* Long number;

*  public* String getName() {
*return* name;
  }

*  public* *void* setName(String name) {
*this*.name = name;
  }

*  public* Long getNumber() {
*return* number;
  }

*  public* *void* setNumber(Long number) {
*this*.number = number;
  }

}
Josh


On Nov 15, 2007 1:35 AM, Michael Courcy <[EMAIL PROTECTED]> wrote:

  

The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh
  

Josh It would be really really nice  !!!
If you do so I would make it a small wiki tutorial


Josh Canfield a écrit :
 > Hi Michael,



  

Thanks Josh, but do you have also a title property with getter and
setter in your page class ?




No, I only have the video getter/setter



  

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?



The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh

On Nov 14, 2007 11:01 AM, Michael Courcy <[EMAIL PROTECTED]>
  

wrote:

  

Thanks Josh, but do you have also a title property with getter and
setter in your page class ?

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?

Josh Canfield a écrit :
 >> I want to populate from the form directly to the bean. But this
require



to use either the beanEditForm or a custom component.





You can get this to work. I use the textfield component for editing my

  

bean



objects. This is from a working emplate:


My page class has a getVideo method which returns an object that has a
getTitle method.

Good luck,
Josh

On Nov 14, 2007 9:05 AM, Michael Courcy <[EMAIL PROTECTED]>

  

wrote:



You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tapestry but from me.
I want to populate from the form directly to the bean. But this


require


to use either the beanEditForm or a custom component.

I 'm just influenced by other framework like struts2 for instance :

If you have something like that in your form



When the form is submitted struts2 tries to find if the controller
features a user property, and then if user features a name property
If the answer is yes to both it calls controller.getUser



().setName("bla");




Ezra Epstein a écrit :
 > I always pause when hearing "100% sure."  An easy check/test is to
remove the offending  and stick in a simple ${user} and see if



indeed



you get the toString() value for your user object.




Michael Courcy <[EMAIL PROTECTED]> wrote: I'm 100% sure, user

  

is



not null




I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a écrit :



  

On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy
 wrote:






 [input]

I have to provide the setter and the getter for name and I still
  

get


an error when I submit.



  

What error? Make sure your user field is not null when the form is
submited. Also make sure you have public getters and setters

Re: T5 Newbie : populate the value of a form in a bean

2007-11-15 Thread Michael Courcy

Thanks a lot Josh
I'm going to try it now

Josh Canfield a écrit :

Hey Michael,

I didn't get to it last night, but here you go, a very simple example:

** Start.tml 
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
  
Form Test
  
  
MyObject:
Name: ${myObject.name}
Number: ${myObject.number}

  
   
   
  

  


 Start.java 
*package* joshcan.test.myapp.pages;
**
*import* joshcan.test.myapp.model.TestObject;
*import* org.apache.tapestry.annotations.Persist;

/**
 * Start page of application myapp.
 */
*public* *class* Start
{
  @Persist // Store this object in the session...
*  private* TestObject _myObject;
*  *
*  public* *void* setupRender() {
*if* ( _myObject == *null* ) { // make sure we have an object to work
on.
  _myObject = *new* TestObject();
}
  }

*  public* TestObject getMyObject() {
*return* _myObject;
  }

*  public* *void* setMyObject(TestObject myObject) {
_myObject = myObject;
  }
}
 TestObject.java 
*

package* joshcan.test.myapp.model;

*public* *class* TestObject {

*  private* String name;
*  private* Long number;

*  public* String getName() {
*return* name;
  }

*  public* *void* setName(String name) {
*this*.name = name;
  }

*  public* Long getNumber() {
*return* number;
  }

*  public* *void* setNumber(Long number) {
*this*.number = number;
  }

}
Josh


On Nov 15, 2007 1:35 AM, Michael Courcy <[EMAIL PROTECTED]> wrote:

  

The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh
  

Josh It would be really really nice  !!!
If you do so I would make it a small wiki tutorial


Josh Canfield a écrit :
 > Hi Michael,



  

Thanks Josh, but do you have also a title property with getter and
setter in your page class ?




No, I only have the video getter/setter



  

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?



The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh

On Nov 14, 2007 11:01 AM, Michael Courcy <[EMAIL PROTECTED]>
  

wrote:

  

Thanks Josh, but do you have also a title property with getter and
setter in your page class ?

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?

Josh Canfield a écrit :
 >> I want to populate from the form directly to the bean. But this
require



to use either the beanEditForm or a custom component.





You can get this to work. I use the textfield component for editing my

  

bean



objects. This is from a working emplate:


My page class has a getVideo method which returns an object that has a
getTitle method.

Good luck,
Josh

On Nov 14, 2007 9:05 AM, Michael Courcy <[EMAIL PROTECTED]>

  

wrote:



You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tapestry but from me.
I want to populate from the form directly to the bean. But this


require


to use either the beanEditForm or a custom component.

I 'm just influenced by other framework like struts2 for instance :

If you have something like that in your form



When the form is submitted struts2 tries to find if the controller
features a user property, and then if user features a name property
If the answer is yes to both it calls controller.getUser



().setName("bla");




Ezra Epstein a écrit :
 > I always pause when hearing "100% sure."  An easy check/test is to
remove the offending  and stick in a simple ${user} and see if



indeed



you get the toString() value for your user object.




Michael Courcy <[EMAIL PROTECTED]> wrote: I'm 100% sure, user

  

is



not null




I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a écrit :



  

On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy
 wrote:






 [input]

I have to provide the setter and the getter for name and I still
  

get


an error when I submit.



  

What error? Make sure your user field is not null when the form is
submited. Also make sure you have public getters and setters

Re: T5 Newbie : populate the value of a form in a bean

2007-11-15 Thread Michael Courcy

Ok thanks.
I need to work on this component anyway. But things are not totally 
clear in my mind of the state of @Persist objects during the phase 
request. I 'm going to work on this as well.


Ezra Epstein a écrit :

Is it that the user object is null on page load?

If so, see the BeanEditForm's implementation of void onPrepareFromForm()


Michael Courcy <[EMAIL PROTECTED]> wrote: You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tapestry but from me.
I want to populate from the form directly to the bean. But this require 
to use either the beanEditForm or a custom component.


I 'm just influenced by other framework like struts2 for instance :

If you have something like that in your form

 [input] 

When the form is submitted struts2 tries to find if the controller 
features a user property, and then if user features a name property

If the answer is yes to both it calls controller.getUser().setName("bla");





Ezra Epstein a �crit :
  

I always pause when hearing "100% sure."  An easy check/test is to remove the 
offending  [input]  and stick in a simple ${user} and see if indeed you get the 
toString() value for your user object.

Michael Courcy  wrote: I'm 100% sure, user is not null

I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a �crit :
  

On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy 
 wrote:



  
 [input] 

I have to provide the setter and the getter for name and I still get 
an error when I submit.
  

What error? Make sure your user field is not null when the form is 
submited. Also make sure you have public getters and setters, because 
otherwise Tapestry cannot access them.



  
  




  



--
Michael Courcy
http://courcy.blogspot.com



Re: T5 Newbie : populate the value of a form in a bean

2007-11-15 Thread Michael Courcy


The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh

Josh It would be really really nice  !!!
If you do so I would make it a small wiki tutorial


Josh Canfield a écrit :

Hi Michael,


  

Thanks Josh, but do you have also a title property with getter and
setter in your page class ?




No, I only have the video getter/setter


  

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?




The title property of the video object is updated, I don't have a title
property on my page class.

I can't compile anything right now, but I'll try to put together a small
example tonight, if someone else hasn't posted something by then.

Josh

On Nov 14, 2007 11:01 AM, Michael Courcy <[EMAIL PROTECTED]> wrote:

  

Thanks Josh, but do you have also a title property with getter and
setter in your page class ?

And if yes (as I guess) whish value is updated when you submit the form
: MyPage.title or MyPage.video.title  ?

Josh Canfield a écrit :
 >> I want to populate from the form directly to the bean. But this
require


to use either the beanEditForm or a custom component.




You can get this to work. I use the textfield component for editing my
  

bean


objects. This is from a working emplate:


My page class has a getVideo method which returns an object that has a
getTitle method.

Good luck,
Josh

On Nov 14, 2007 9:05 AM, Michael Courcy <[EMAIL PROTECTED]>
  

wrote:

  

You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tapestry but from me.
I want to populate from the form directly to the bean. But this require
to use either the beanEditForm or a custom component.

I 'm just influenced by other framework like struts2 for instance :

If you have something like that in your form



When the form is submitted struts2 tries to find if the controller
features a user property, and then if user features a name property
If the answer is yes to both it calls controller.getUser


().setName("bla");





Ezra Epstein a écrit :
 > I always pause when hearing "100% sure."  An easy check/test is to
remove the offending  and stick in a simple ${user} and see if


indeed


you get the toString() value for your user object.



Michael Courcy <[EMAIL PROTECTED]> wrote: I'm 100% sure, user
  

is


not null



I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a écrit :


  

On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy
 wrote:





 [input]

I have to provide the setter and the getter for name and I still get
an error when I submit.


  

What error? Make sure your user field is not null when the form is
submited. Also make sure you have public getters and setters, because
otherwise Tapestry cannot access them.




  

--
Michael Courcy
http://courcy.blogspot.com






  

--
Michael Courcy
http://courcy.blogspot.com






  



--
Michael Courcy
http://courcy.blogspot.com



Re: T5 Newbie : populate the value of a form in a bean

2007-11-14 Thread Michael Courcy


Thanks Josh, but do you have also a title property with getter and 
setter in your page class ?


And if yes (as I guess) whish value is updated when you submit the form 
: MyPage.title or MyPage.video.title  ?


Josh Canfield a écrit :

I want to populate from the form directly to the bean. But this require
to use either the beanEditForm or a custom component.





You can get this to work. I use the textfield component for editing my bean
objects. This is from a working emplate:


My page class has a getVideo method which returns an object that has a
getTitle method.

Good luck,
Josh

On Nov 14, 2007 9:05 AM, Michael Courcy <[EMAIL PROTECTED]> wrote:

  

You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tapestry but from me.
I want to populate from the form directly to the bean. But this require
to use either the beanEditForm or a custom component.

I 'm just influenced by other framework like struts2 for instance :

If you have something like that in your form



When the form is submitted struts2 tries to find if the controller
features a user property, and then if user features a name property
If the answer is yes to both it calls controller.getUser().setName("bla");





Ezra Epstein a écrit :
 > I always pause when hearing "100% sure."  An easy check/test is to
remove the offending  and stick in a simple ${user} and see if indeed
you get the toString() value for your user object.


Michael Courcy <[EMAIL PROTECTED]> wrote: I'm 100% sure, user is
  

not null


I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a écrit :

  

On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy
 wrote:




 [input]

I have to provide the setter and the getter for name and I still get
an error when I submit.

  

What error? Make sure your user field is not null when the form is
submited. Also make sure you have public getters and setters, because
otherwise Tapestry cannot access them.





  

--
Michael Courcy
http://courcy.blogspot.com






  



--
Michael Courcy
http://courcy.blogspot.com



Re: T5 Newbie : populate the value of a form in a bean

2007-11-14 Thread Michael Courcy

You're right

here it is,  I remove the "offending input"

and use this instead

${user}-- ${user.name}

And I get

[EMAIL PROTECTED] -- A name

Obviously user is not null.

I think the problem does not come from tapestry but from me.
I want to populate from the form directly to the bean. But this require 
to use either the beanEditForm or a custom component.


I 'm just influenced by other framework like struts2 for instance :

If you have something like that in your form



When the form is submitted struts2 tries to find if the controller 
features a user property, and then if user features a name property

If the answer is yes to both it calls controller.getUser().setName("bla");





Ezra Epstein a écrit :

I always pause when hearing "100% sure."  An easy check/test is to remove the 
offending  and stick in a simple ${user} and see if indeed you get the toString() 
value for your user object.

Michael Courcy <[EMAIL PROTECTED]> wrote: I'm 100% sure, user is not null

I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a écrit :
  
On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy 
 wrote:



 [input] 

I have to provide the setter and the getter for name and I still get 
an error when I submit.
  
What error? Make sure your user field is not null when the form is 
submited. Also make sure you have public getters and setters, because 
otherwise Tapestry cannot access them.






  



--
Michael Courcy
http://courcy.blogspot.com



Re: T5 Newbie : populate the value of a form in a bean

2007-11-14 Thread Michael Courcy

I'm 100% sure, user is not null

I have a getter and a setter for both : name and user

Thanks
Thiago H de Paula Figueiredo a écrit :
On Wed, 14 Nov 2007 12:47:06 -0200, Michael Courcy 
<[EMAIL PROTECTED]> wrote:





I have to provide the setter and the getter for name and I still get 
an error when I submit.


What error? Make sure your user field is not null when the form is 
submited. Also make sure you have public getters and setters, because 
otherwise Tapestry cannot access them.





--
Michael Courcy
http://courcy.blogspot.com


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



Re: T5 Newbie : populate the value of a form in a bean

2007-11-14 Thread Michael Courcy

Yes and I still get the message user is not an Embedded Component

CarstenM a écrit :

Hi,

have you tried it with

@ApplicationState
private User user;

in your page class ?


Michael Courcy wrote:
  

Hi

In my Page  I have a property User, and I want to directly populate the 
value of the form to the bean User


User.java
class User{
  private String name;
  private String surName;
   getters ans setters .
}

Start.java
class Start{
   private User user;
    getters and setters 
}


Start.html :

<||input|| ||t||:||type||=||"||TextField||"|| 
||t||:||id||=||"||user.name||"|| ||t||:||value||=||"||user.name||"/>
<||input|| ||t||:||type||=||"||TextField||"|| 
||t||:||id||=||"||user.surName||"|| 
||t||:||value||=||"||user.surName||"/>
<||input|| ||t||:||id||=||"||submitform||"|| 
||t||:||type||=||"||Submit||"|| ||t||:||value||=||"||submit||" />



But It seems that it does not work this way and I get an error message : 
User is not an embedded component...


Do you think I'll have to build my own component :



Or is there another way to do this without using the beanEditForm ?
||

--
Michael Courcy
http://courcy.blogspot.com






  



--
Michael Courcy
http://courcy.blogspot.com



Re: T5 Newbie : populate the value of a form in a bean

2007-11-14 Thread Michael Courcy


The t:id attribute is not meant as a way to tell Tapestry what are you 
editing: it's just an id that you can use to refer to it in another 
component (Label, for example) or in your page class.


Ok you're right but if I try this



I get a failure because tapestry expect an id

Then  if  I do this



I have to provide the setter and the getter for name and I still get an 
error when I submit.


The only thing that work properly is this



But I comeback to my initial question :  I just can't populate the value 
to the bean directly from the form


The best thing I can do is this

public String getName(){
return user.getName();
}

public void setName(String name){
user.setName(name);
}


--
Michael Courcy
http://courcy.blogspot.com


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



T5 Newbie : populate the value of a form in a bean

2007-11-14 Thread Michael Courcy

Hi

In my Page  I have a property User, and I want to directly populate the 
value of the form to the bean User


User.java
class User{
 private String name;
 private String surName;
  getters ans setters .
}

Start.java
class Start{
  private User user;
   getters and setters 
}


Start.html :

<||input|| ||t||:||type||=||"||TextField||"|| 
||t||:||id||=||"||user.name||"|| ||t||:||value||=||"||user.name||"/>
<||input|| ||t||:||type||=||"||TextField||"|| 
||t||:||id||=||"||user.surName||"|| 
||t||:||value||=||"||user.surName||"/>
<||input|| ||t||:||id||=||"||submitform||"|| 
||t||:||type||=||"||Submit||"|| ||t||:||value||=||"||submit||" />



But It seems that it does not work this way and I get an error message : 
User is not an embedded component...


Do you think I'll have to build my own component :



Or is there another way to do this without using the beanEditForm ?
||

--
Michael Courcy
http://courcy.blogspot.com



Re: T5.06 Project tree

2007-11-14 Thread Michael Courcy

Well it's a matter of convention

When maven build the project, things are in the place they have to be.

Michael Bernagou a écrit :

No I didn't because I don't understand why the webroot should be in the src
directory.

About that :
MyProject/src/papo/pages/
MyProject/src/papo/services/

It is what I have but I wrote in my message
MyProject/src/papo.pages/
MyProject/src/papo.services/
instead, just to show it is packages in the point of view of eclipse and
java.

The debug mode show me the Start.java is normally compiled and Tapestry
describe what it did with at runtime :
replacing method, etc...

2007/11/14, Joachim Van der Auwera <[EMAIL PROTECTED]>:
  

Have you started using the project archetype? This is the easiest way to
have a correct directory srtucture.

Anyway, I think the paths should be

MyProject/src/papo/pages/
MyProject/src/papo/services/

Kind regards,
Joachim

Michael Bernagou wrote:


I have something strange and it made me asking this question :

What are the mandatory project tree elements? (sorry for my english I
  

don't


now how to write it differently).

So, my project is :

MyProject/src/papo.pages/[all pages such as Start.java and
  

Start.properties]


MyProject/src/papo.services/[ioc stuff]
MyProject/webroot/[all template such as Start.tml and Start_fr.tml]

But I have this error :

java.lang.RuntimeException Page Start did not generate any markup when
rendered. This could be because its template file could not be located,
  

or


because a render phase method in the page prevented rendering.


Start.tml:
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>

Paper and Pen Online



  


  

Si vous n'avez pas encore de compte,   

page="Register">crees-en


un!!
${message}


***
Start.java:
package papo.pages;

import org.apache.tapestry.annotations.ApplicationState;
import org.apache.tapestry.annotations.InjectPage;
import org.apache.tapestry.annotations.Persist;
import org.apache.tapestry.ioc.annotations.Inject;
import papo.data.Login;
import papo.data.UserLite;
import papo.exception.PapoException;
import papo.model.User;
import papo.services.ApplicationService;
import papo.services.UserService;


/**
 * Start page of application papo.
 */
public class Start {
  private static final String SUCCESS = "Home";
  private static final String FAILURE = "Start";

  @Persist
  private Login login;
  public Login getLogin() { return login; }
  public void setLogin(Login login) { this.login = login; }

  private String message;
  public String getMessage() { return message; }
  public void setMessage(String message) { this.message = message; }

  @ApplicationState
  private User user;

  @InjectPage
  private Home home;

  @Inject
  private UserService userService;

  @Inject
  private ApplicationService applicationService;

  String onSuccess() {
try {
  user = userService.getAuthenticatedUser(login.getLogin(),
login.getPassword());
  if (user != null) {
home.setUser(user);
UserLite userLite = new UserLite(user.getLogin());
applicationService.makeOnline(userLite);
home.setUsers(applicationService.getUserList().getUserList());
  }
  else {
message = "Login ou Password inconnue. L'identification a
  

échoué.";


return FAILURE;
  }
}
catch (PapoException pe) {
  message = "La procedure d'identification a rencontré un probleme
  

!!";


  return null;
}
return SUCCESS;
  }
}

It didn't enter in Start.java (I put a debug point) because it was not
  

able


to "compile" or "find" the Start.tml. Usually, when it found a
  

compilation


problem, the error message explicitely explain where is the line in the
template, but in my case, I have only a stack trace.

When I see the Snapshot for the typicall project, there is something
  

else as


Project tree, and I don't want to follow the architecture. Having the
webroot folder in the src/main and the java in the src/main/java is not
logic for me.
A web application is not defined like that usually, why to change the
  

way?


But this is another subject...



  

--
Joachim Van der Auwera
PROGS bvba, progs.be, blog.progs.be


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






  




Re: Feedback wanted on IoC documentation

2007-11-10 Thread Michael Courcy
Ok I think I have understood your explainations (actually I'm not pretty 
sure)


The component is totally managed by tapestry and by injecting services 
through @Inject annotation you get more control on its fields.


While in the other hand you encourage proper storage of service by 
making injection only available through constructor.


Well, honestly I don't have enough experiences to assess that, it's 
doing the job properly anyway, I was a bit curious that's all.


I agree on the fact that making those two ways dependencies injection 
available in both context won't bring that much compare to the 
expectation of the community : Ajax  and the next tutorial on form ;-).


Thanks for your answer.

Michael


Howard Lewis Ship a écrit :

Services are loaded by the normal class loader without any special
trickery.  We create classes (proxies and such), but don't modify
existing classes for Tapestry IoC.  This is necessary to ensure that
services code inter-operates properly with all kinds of third party,
legacy and other code that is far, far beyond the scope of Tapestry
IoC.

To encourage service implementations to properly store service
depenencies as final instance variables, such dependencies are passed
only into the constructor.

So for services, injection is assumed, for the constructor parameters
(as if an @Inject annotation was present).

Now for components, it's a different story.  The component classes are
very specific to Tapestry, not intended for reuse elsewhere, and are
modified at runtime to work properly and efficiently within the
constraints of Tapestry's multi-threaded runtime environment.

Tapestry components are quite a bit different from service, in terms
of lifecycle, and in terms of the what can be injected (all sorts of
resources besides services) and in the fact that they quite often have
considerable (if largely temporary)
internal state, while services most often have no internal state at all.

Constructor injection is insufficient for components, because Tapestry
needs to really know about the individual fields.  For example, if
you:

@Inject
private MyService _service;

... and then in some code:

void onActionFromNotAGoodIdea()
{
  _service = new MyOtherImpl();
}

You'll actually get a runtime error explaining that the field is read only.

So field injection is both necessary and requires far less typing ...
you don't have to write a constructor and assigning all the fields
from it. On the other hand, the fields aren't final (though they often
act final).

The real downside is that you have a similar concept, injection, with
two very different expressions.

It would be interesting if Tapestry IoC could support injection on
fields, and "backtrack" from the field to the constructor parameter.
It might also be interesting if components could define a constructor
and Tapestry could work forwards from the parameter annotations
forwards to the fields.  I think both approaches would require a large
amount of effort and may not actually add any value.

Certainly in the short term, people would be much happier if we got
the Ajax support going.

Of course, I'm writing this on my PC while I get Leopard installed
onto my Mac (my main development machine).

On Nov 10, 2007 12:43 PM, Michael Courcy <[EMAIL PROTECTED]> wrote:
  

Hi

Thanks again for this effort of documentation.

I have a question about dependency injection between services.

We can inject a service thanks to the @Inject annotation in a page
component.
I find this feature pretty handy.

But (correct me if I'm wrong but I think I'm not because I test it) we
can't @Inject a service in a sercice.
Instead we must provide the service to the other service through its
constructor.

Why did you make this choice ?

I would find useful as well to inject a service in a service with the
same annotation ?

Michael


Howard Lewis Ship a écrit :


I've been working on new documentation about Tapestry IoC (similar
stuff will be coming for Tapestry core):

Overview:

http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/overview.html

Cookbook:

http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/cookbook/index.html

Feedback is encouraged!


  


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







  




Re: Feedback wanted on IoC documentation

2007-11-10 Thread Michael Courcy

Hi

Thanks again for this effort of documentation.

I have a question about dependency injection between services.

We can inject a service thanks to the @Inject annotation in a page 
component.

I find this feature pretty handy.

But (correct me if I'm wrong but I think I'm not because I test it) we 
can't @Inject a service in a sercice.
Instead we must provide the service to the other service through its 
constructor.


Why did you make this choice ?

I would find useful as well to inject a service in a service with the 
same annotation ?


Michael


Howard Lewis Ship a écrit :

I've been working on new documentation about Tapestry IoC (similar
stuff will be coming for Tapestry core):

Overview:

http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/overview.html

Cookbook:

http://tapestry.formos.com/nightly/tapestry5/tapestry-ioc/cookbook/index.html

Feedback is encouraged!

  



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



Re: 3 new French Tapestry5 tutorials

2007-11-06 Thread Michael Courcy

ok alors je vais m'y mettre
Ok let's do it

Merci / Thanks
#Cyrille37# a écrit :

Baptiste Meurant a écrit :
j'autorise la traduction bien sur et je suis disposé à faire une 
relecture

des tutoriels une fois traduits.
Merci.

I allow you translating my tutorials. I can read them once translated 
if you

need.
Thanks.
  

Hello
I think it's a very good thing. When your tutorials will be in 
english, Tapestry's Guru will be able to make comments, precisions and 
corrections.


Cheers
cyrille.



Michael Courcy wrote:
 
Si vous m'y autorisez je peux faire la traduction en anglais et la 
poster sur le wiki, comme je découvre Tapestry 5 mais que je connais 
Spring et hibernate (ainsi que wtp) ça ne devrait pas poser de souci.


If you allow me I would translate it and post  on the wiki. As I 'm 
a newbie in tapestry 5 but already used to Spring and hibernate it 
should not be a problem.


Michael.

#Cyrille37# a écrit :
   

Howard Lewis Ship a écrit :
 

Thanks, looks like a great effort.  Sorry I've been so swamped about
getting your translations on the main web site.
  

Thanks Howard :

Here is translation, done with my poor english :

[fr] Premier projet avec Tapestry5, Spring et Hibernate :
[en] First project with Tapestry5, Spring and Hibernate :
http://baptiste-meurant.developpez.com/tutoriaux/tapestry5-spring-hibernate/ 



[fr] Intégration simple et élégante d'AJAX avec DWR:
[en] A nice integration of Ajax with DWR into Tapestry5 :
http://baptiste-meurant.developpez.com/tutoriaux/dwr-tapestry5-spring-hibernate/ 



[fr] Sécurisation d'une application Web avec Acegi Security:
[en] Securising a web application with ACEGI
http://baptiste-meurant.developpez.com/tutoriaux/acegi-dwr-tapestry5-spring-hibernate/ 



All of those 3 tutorials have Tapestry5 as Front view

 

On Nov 5, 2007 3:48 AM, #Cyrille37# <[EMAIL PROTECTED]> wrote:
 
   

Hello, Bonjour,

There are 3 new tutorials for Tapestry5 in French.
Il y a 3 nouveaux tutoriels en français pour Tapestry5.

Thanks to Baptiste Meurant !
Merci à Baptiste Meurant !

Premier projet avec Tapestry5, Spring et Hibernate :
http://baptiste-meurant.developpez.com/tutoriaux/tapestry5-spring-hibernate/ 



Intégration simple et élégante d'AJAX avec DWR:
http://baptiste-meurant.developpez.com/tutoriaux/dwr-tapestry5-spring-hibernate/ 



Sécurisation d'une application Web avec Acegi Security:
http://baptiste-meurant.developpez.com/tutoriaux/acegi-dwr-tapestry5-spring-hibernate/ 



I've added them on 
http://wiki.apache.org/tapestry/TapestryTutorials but
it should be nice to add them to 
http://tapestry.apache.org/articles.html


Bye, Salut
Cyrille.

  




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





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



Re: 3 new French Tapestry5 tutorials

2007-11-05 Thread Michael Courcy
Si vous m'y autorisez je peux faire la traduction en anglais et la 
poster sur le wiki, comme je découvre Tapestry 5 mais que je connais 
Spring et hibernate (ainsi que wtp) ça ne devrait pas poser de souci.


If you allow me I would translate it and post  on the wiki. As I 'm a 
newbie in tapestry 5 but already used to Spring and hibernate it should 
not be a problem.


Michael.

#Cyrille37# a écrit :

Howard Lewis Ship a écrit :

Thanks, looks like a great effort.  Sorry I've been so swamped about
getting your translations on the main web site.
  

Thanks Howard :

Here is translation, done with my poor english :

[fr] Premier projet avec Tapestry5, Spring et Hibernate :
[en] First project with Tapestry5, Spring and Hibernate :
http://baptiste-meurant.developpez.com/tutoriaux/tapestry5-spring-hibernate/ 



[fr] Intégration simple et élégante d'AJAX avec DWR:
[en] A nice integration of Ajax with DWR into Tapestry5 :
http://baptiste-meurant.developpez.com/tutoriaux/dwr-tapestry5-spring-hibernate/ 



[fr] Sécurisation d'une application Web avec Acegi Security:
[en] Securising a web application with ACEGI
http://baptiste-meurant.developpez.com/tutoriaux/acegi-dwr-tapestry5-spring-hibernate/ 



All of those 3 tutorials have Tapestry5 as Front view


On Nov 5, 2007 3:48 AM, #Cyrille37# <[EMAIL PROTECTED]> wrote:
 

Hello, Bonjour,

There are 3 new tutorials for Tapestry5 in French.
Il y a 3 nouveaux tutoriels en français pour Tapestry5.

Thanks to Baptiste Meurant !
Merci à Baptiste Meurant !

Premier projet avec Tapestry5, Spring et Hibernate :
http://baptiste-meurant.developpez.com/tutoriaux/tapestry5-spring-hibernate/ 



Intégration simple et élégante d'AJAX avec DWR:
http://baptiste-meurant.developpez.com/tutoriaux/dwr-tapestry5-spring-hibernate/ 



Sécurisation d'une application Web avec Acegi Security:
http://baptiste-meurant.developpez.com/tutoriaux/acegi-dwr-tapestry5-spring-hibernate/ 



I've added them on http://wiki.apache.org/tapestry/TapestryTutorials 
but
it should be nice to add them to 
http://tapestry.apache.org/articles.html


Bye, Salut
Cyrille.






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





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



Re: 3 new French Tapestry5 tutorials

2007-11-05 Thread Michael Courcy

Bravo et merci.

#Cyrille37# a écrit :

Hello, Bonjour,

There are 3 new tutorials for Tapestry5 in French.
Il y a 3 nouveaux tutoriels en français pour Tapestry5.

Thanks to Baptiste Meurant !
Merci à Baptiste Meurant !

Premier projet avec Tapestry5, Spring et Hibernate :
http://baptiste-meurant.developpez.com/tutoriaux/tapestry5-spring-hibernate/ 



Intégration simple et élégante d'AJAX avec DWR:
http://baptiste-meurant.developpez.com/tutoriaux/dwr-tapestry5-spring-hibernate/ 



Sécurisation d'une application Web avec Acegi Security:
http://baptiste-meurant.developpez.com/tutoriaux/acegi-dwr-tapestry5-spring-hibernate/ 



I've added them on http://wiki.apache.org/tapestry/TapestryTutorials 
but it should be nice to add them to 
http://tapestry.apache.org/articles.html


Bye, Salut
Cyrille.




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





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



How to contribute a new Request Handler

2007-11-04 Thread Michael Courcy

Hi

I'm  really new to tapestry, and I was trying to contribute a new 
request Handler


So I follow the documentation and the example provided by the archetype

first I provide a builder for my RequestHandlerService :

public RequestFilter buildMichaelFilter(final Logger log){
   return new RequestFilter(){

   public boolean service(Request request, Response response, 
RequestHandler requestHandler) throws IOException {

   try{
   log.info("Mic before");
   return requestHandler.service(request, response);
   }finally{
   log.info("Mic after");
   }
   }
  
   };

   }


And then I contribute it :

public void contributeRequestHandler(OrderedConfiguration 
configuration,   
   @InjectService("MichaelFilter")

   RequestFilter michaelFilter,
   @InjectService("TimingFilter")
   RequestFilter timingFilter
   )
   {
   // Each contribution to an ordered configuration has a name, 
When necessary, you may
   // set constraints to precisely control the invocation order of 
the contributed filter
   // within the pipeline.   
  
   configuration.add("Michael", michaelFilter);

   configuration.add("Timing", timingFilter);
  
   }


And nothing is logged from the michaelFilter ... while the timingFilter 
keep on working like before.


I probably misunderstood something.

Any idea ?


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



Re: T5: Property binding

2007-11-04 Thread Michael Courcy

did you try ${list.size()} ?

Christoph Jaeger a écrit :

Hi,

Tapestry seems to only accept properties with getXxx() and setXxx()
accessor methods, or isXxx() for boolean values. This is ok when using
your own bean classes, but I just tried to output the number of entries
in a java.util.List using

${list.size}

in my .tml file (with a "public List getList()" method in the
corresponding java class), and I get an exception page with the
following error message:

Class java.util.List does not contain a property named 'size' (within
property expression 'list.size'). Available properties: empty.

This is because java.util.List does not provide a getSize() method, only
a size() method.

Is it a design decision to only go for getXxx() accessor methods, or
would you think about trying xxx() if getXxx() can not be found?

Christoph

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



typo in the documentation

2007-11-04 Thread Michael Courcy

Hi

I think there's a small typo in the documentation in

http://tapestry.apache.org/tapestry5/tapestry-ioc/service.html

In the section : Injecting dependencies

==

For example, let's say the Indexer needs a JobScheduler to control when 
it executes, and a FileSystem to access files and store indexes.


 public static Indexer build(JobScheduler scheduler, FileSystem fileSystem)
 {
   IndexerImpl indexer = new IndexerImpl(fileSystem);
 
   scheduler.scheduleDailyJob(indexer);
 
   return indexer;

 }

Here we've annotated the parameters of the service builder method to 
identify what service to inject for that parameter.



But there's no anotation at all so I think the author meant

==

For example, let's say the Indexer needs a JobScheduler to control when 
it executes, and a FileSystem to access files and store indexes.


 public static Indexer build(@InjectService JobScheduler scheduler, 
@InjectService FileSystem fileSystem)
 {
   IndexerImpl indexer = new IndexerImpl(fileSystem);
 
   scheduler.scheduleDailyJob(indexer);
 
   return indexer;

 }

Here we've annotated the parameters of the service builder method to 
identify what service to inject for that parameter.



Michael.


/ /




Typo in the documentation

2007-11-03 Thread Michael Courcy

Hi

I'm new to tapestry so I'm not sure that's the right place to speak 
about that but there's a small typo in the documentation :


http://tapestry.apache.org/tapestry5/tapestry-core/guide/parameters.html

In the usage of the count component :

 Ho! 

Where actually it should be 


 Ho! 

Michael.



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