Re: tapestry-acegi

2007-05-03 Thread William Keller

I forgot to mention that you will need to map your User and GrantedAuthority
as per usual on Acegi. The stuff I gave you doesn't go in depth on setting
up your models (your User needs to implement UserDetails). Once you set up
yoru GrantedAuthority for your users your tapestry pages can now use the
annotations like mine: @Secured(value = { "ROLE_AGENT", "ROLE_ADMIN" })

Hope it works!


Re: tapestry-acegi

2007-05-03 Thread William Keller

I've got this working. Code supplied. Please customise for your purpose :)

hivemodule.xml


   
   
   
 
   
   

   
   
   
   
   

   
   
   

   
   
   
   
   
   
   
   
   

   
   
   
   
   
   
   
   

   
 
   
 
   


AuthoriserServiceImpl code:

import org.acegisecurity.userdetails.UserDetails;
import org.acegisecurity.userdetails.UsernameNotFoundException;
import org.springframework.dao.DataAccessException;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.ews.domain.core.User;
import com.ews.domain.core.UserService;

/**
* Implementation of the authoriser service
*
* @author williamk
*
*/
public class AuthoriserServiceImpl implements AuthoriserService
{

   /**
* Injected user service
*/
   private UserService userService;

   /**
* Constructor
*
* @param userService
*/
   public AuthoriserServiceImpl(UserService userService)
   {
   this.userService = userService;
   }

   /**
* [EMAIL PROTECTED]
*/
   @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
   public UserDetails loadUserByUsername(String arg0)
   throws UsernameNotFoundException, DataAccessException
   {
   User user = userService.fetchByUsername(arg0);
   if (user == null)
   {
   throw new UsernameNotFoundException("Authentication failed");
   }
   return user;
   }

}


Hopefully that will get you started!

On 5/4/07, Asim Khaja <[EMAIL PROTECTED]> wrote:


Is there a good tutorial on using the tapestry-acegi (
http://www.carmanconsulting.com/tapestry-acegi/) library?

Thanks,
Asim



tapestry-acegi

2007-05-03 Thread Asim Khaja

Is there a good tutorial on using the tapestry-acegi (
http://www.carmanconsulting.com/tapestry-acegi/) library?

Thanks,
Asim


Re: [T4] Component initialization and PageBeginRender

2007-05-03 Thread Jesse Kuhnert

I think that wiki page is out of date. MindBridge went in and made the
ordering deterministic a fairly long time ago.

On 5/3/07, Jorge Montero <[EMAIL PROTECTED]> wrote:


I'm trying toconvert part of a tapestry page into a component for reuse.
The part of the page I want to reuse renders two PropertySelectors with
different data depending of the value of a property, and updates another
property by processing the original property and the current values on
the PropertySelectors. When this is part of the page, the filtering and
creation of the models is done during pageBeginRender, and everything
works fine.

My original plan was to just move the code over to the component's
pageBeginRender(). The problem is that, as it is mentioned here (
http://wiki.apache.org/tapestry/Gotchas ), the component is not
guaranteed to have received its parameters in pageBeginRender(), so the
component might fail to initialize properly.

Is there any other way to initialize my component after the parameters
have been populated?
Is there any other scheme that could make such a component work?

Jorge

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Some Basic Form Handling

2007-05-03 Thread William Keller

From my understanding, T5 is much different in that there is an '@OnEvent'

annotation

e.g.

class Page
{

  @Component
  private Form form;

  @InjectPage
  NextPage nextPage;

  @OnEvent(value="submit")
  public Object submit()
  {
  return nextPage;
  }
}

and on your corresponding page:







Hope that helps somewhat


On 5/3/07, Paul Stanton < [EMAIL PROTECTED]> wrote:


http://tapestry.apache.org/tapestry4.1/components/form/form.html

in html:


in java:
public IPage doSubmit()
{}

Don Heninger wrote:
> I am a noob when it comes to tapestry but I am looking for some basic
> instruction on Form handling (not the BeanEditForm) in Tapestry 5.
>
> Can anyone point me in the right direction?
>
> Thanks,
> Don
>

--
Paul Stanton
Gunn Software
PH: (02) 9918 3666 (ext 503)




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




[T4] Component initialization and PageBeginRender

2007-05-03 Thread Jorge Montero
I'm trying toconvert part of a tapestry page into a component for reuse. 
The part of the page I want to reuse renders two PropertySelectors with 
different data depending of the value of a property, and updates another 
property by processing the original property and the current values on 
the PropertySelectors. When this is part of the page, the filtering and 
creation of the models is done during pageBeginRender, and everything 
works fine.


My original plan was to just move the code over to the component's 
pageBeginRender(). The problem is that, as it is mentioned here ( 
http://wiki.apache.org/tapestry/Gotchas ), the component is not 
guaranteed to have received its parameters in pageBeginRender(), so the 
component might fail to initialize properly.


Is there any other way to initialize my component after the parameters 
have been populated?

Is there any other scheme that could make such a component work?

Jorge

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



RE: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Ben Dotte
I think its finally working!

Thanks!!

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 3:18 PM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

OkIt's deploying now.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> 
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Jesse Kuhnert

OkIt's deploying now.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:








--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


RE: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Ben Dotte
Ok, I hate to bring this up yet again but things still aren't working
the way they need to. Tapestry used to search the context for the
templates first, then it searched the classpath. Now it searches the
classpath first. Our templates technically get output to both places,
but the ones we need Tapestry to use are in WEB-INF/app. So I changed
our build process to no longer output templates to the classpath so it
would be forced to go to the context. Now pages render just fine from
the context but we get a huge pile of stack traces to the console as
documented on this case:

http://issues.apache.org/jira/browse/TAPESTRY-1437

If Tapestry just looked at the context first like it used to, everything
would work fine for us. Alternately, these stack traces really need to
be suppressed. I am talking 15,000 lines of stack traces just to get to
our home page. Ouch.

Thanks,
Ben

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 1:37 PM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

ShewwFinally :)

Yeah I don't think the classpath search is going to be the most typical
type
either so it doesn't make sense to take the perf hit on resolving them
for
that. I'm not nearly done with these changes though ..Need to
re-factor
things so that only one service/object has knowledge of all the various
places to search / how / etc..

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> Cool, it seems to be finding the component templates again like it
used
> to. The only difference is it used to search on the context first,
then
> the classpath.. but I'm not going to split hairs, works plenty good
for
> me.
>
> Thanks Jesse!
>
> -Original Message-
> From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 12:23 PM
> To: Tapestry users
> Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
>
> Ok that's making more sense now.  I've made some changes and can no
> longer
> find any combination that breaks it. What a pita .It should now
find
> them in
>
> -) classpath relative to component class
> -) relative to context root
> -) relative to context + WEB-INF root
> -) relative to context + WEB-INF + app name root
>
> Jar should be deployed by the time you read this email.
>
> On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> >
> > Yes, so an example would be WEB-INF/app/About.html. I'm a little
fuzzy
> > on the historical reason for this but it has certainly been a valid
> > choice since Tapestry 3 at least. I noticed
> > AbstractSpecificationResolver.java has two different methods,
> > getWebInfLocation() and getWebInfAppLocation(), the latter of which
is
> > documented with "Returns the location of the application-specific
> > subdirectory, under /WEB-INF/, in the servlet context."
> >
> > So presumably for us that application-specific subdirectory is app.
> > Perhaps that is because the  is defined as "app" for
us
> in
> > web.xml but I'm not 100% sure where that is coming from.
> >
> > Yes, our .application file is also in that directory.
> >
> > -Original Message-
> > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 03, 2007 11:41 AM
> > To: Tapestry users
> > Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
> >
> > Where/how does the "app" part come in? Is there literally a
directory
> > called
> > "app" where you have stuff, and if so is your .application file
there
> as
> > well?
> >
> > On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> > >
> > > The issue where component templates cannot be found in WEB-INF/app
> for
> > > specless apps. Yes, Marcus mentioned the same problem on
> TAPESTRY-1396
> > > yesterday. And yes, it is still a problem with the snapshot that
> just
> > > went out (tapestry-framework-4.1.2-20070503.160951-67.jar).
> > >
> > > To recreate, just put a component template with no spec under
> > > WEB-INF/app and Tapestry will be unable to find it on any of the
> > > post-4-30 snapshots.
> > >
> > > -Original Message-
> > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, May 03, 2007 11:13 AM
> > > To: Tapestry users
> > > Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
> > >
> > > Which issue is still a problem? Is it anything discussed in
> > > https://issues.apache.org/jira/browse/TAPESTRY-1396 ?
> > >
> > > Perhaps your failure is slightly different ? I may need more
> specific
> > > information (to re-create) . ...Either way an update just went out
a
> > few
> > > seconds ago. Maybe that fixed it.
> > >
> > > On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> > > >
> > > > It appears this is still a problem, even with the newest
snapshot
> > > > (tapestry-framework-4.1.2-20070503.050340-66.jar)
> > > > 
> > > >
> > >
> > >
> > >
> > > --
> > > Jesse Kuhnert
> > > Tapestry/Dojo team member/developer
> > >
> > > Open source based consulting work centered around
> > > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> > >
> > 

Re: @Delegator is not showing validation errors

2007-05-03 Thread Ulrich Stärk

Thanks for your help Jesse,

I know now why you should always obey to these: http://www.debuggingrules.com/debuggingrules.jpg - 
especially rule #3 :)
I specified the ValidationDelegate in the Form component using a 'delegator' attribute where it 
should read 'delegate'. 2 characters, big impact.


Sorry for the inconvenience.

Uli

Ulrich Stärk schrieb:
According to the API doc ValidationDelegate.getFirstError() does exactly 
that - returning an IRender instance used to render the first error - 
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/valid/ValidationDelegate.html#getFirstError() 

I think the problem lies somewhere else namely that the 
ValidationDelegate doesn't record the error if you leave the TextField 
empty. Any idea why this could be?


Cheers

Uli

Jesse Kuhnert schrieb:

This is a lazy answer, but I don't think the default ValidationDelegate
provided by tapestry actually renders the error message - it just marks
things as being in error. (perhaps the default should be the other way
around ? )

You can see an example of how to extend the validationdelegate to do what
you want at the bottom of this page:

http://tapestry.apache.org/tapestry4.1/usersguide/validation.html

Something along the lines of your @Delegate component (which I'm 
assuming is

supposed to print out all the error messages? ) is also found here:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.java?view=markup 



Note that this particular example only prints out the first error, not 
all

of them.

On 5/3/07, Ulrich Stärk <[EMAIL PROTECTED]> wrote:


Hi list,

I've constructed a small test case using Tapestry 4.1.1. I'm trying to
validate a text input field
using the 'required' validator. The FieldLabel for this TextField is
indicating an error, but the
Delegator doesn't display it.

This is my template:



   Test 
   displayName="Test"

validators="validators:required" />
   
   


The page-specification for this page contains nothing except for the
corresponding class reference.
The page class looks like this:

public abstract class Test extends BasePage {
 @Override public String getClientId() { return null; }
 @Override public void setClientId(String arg0) { }

 @Bean public abstract ValidationDelegate getDelegate();
 @InjectPage("Home") public abstract IPage getHomePage();
 public abstract String getTest();

 public IPage doTest() {
 if(getDelegate().getHasErrors())
 return null;
 System.out.println(getTest());
 return getHomePage();
 }
}

After fighting with this for 4 hours I've got the strong feeling that 
I'm

missing something here. So
all you experts out there please help me :)

Cheers

Uli

-
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] How to call Asserts in component template

2007-05-03 Thread Robert Zeigler

Make link an "any" component.  Then change href to be:
href="prop:cssFile"

Tapestry will "do the right thing" for you.
Or, more completely:


Robert


On May 3, 2007, at 5/32:03 PM , Fidel Chavarria wrote:



I want to use the asset component instead of  

what i should do?

My component class **
package net.caimito.savila.tapestry.components;

import org.apache.tapestry.Asset;
import org.apache.tapestry.annotations.Inject;

/**
 * @author  mailto:[EMAIL PROTECTED] Fidel Chavarria
 *
 */
public class ActionLayout {

@Inject("context:css/screen.css")
private Asset cssFile;

public Asset getCssFile() {
return cssFile;
}
}


** component Template **

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



--  
View this message in context: http://www.nabble.com/-T5--How-to- 
call--Asserts-in-component-template-tf3688366.html#a10311227

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


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



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



Re: @Delegator is not showing validation errors

2007-05-03 Thread Ulrich Stärk
According to the API doc ValidationDelegate.getFirstError() does exactly that - returning an IRender 
instance used to render the first error - 
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/valid/ValidationDelegate.html#getFirstError()
I think the problem lies somewhere else namely that the ValidationDelegate doesn't record the error 
if you leave the TextField empty. Any idea why this could be?


Cheers

Uli

Jesse Kuhnert schrieb:

This is a lazy answer, but I don't think the default ValidationDelegate
provided by tapestry actually renders the error message - it just marks
things as being in error. (perhaps the default should be the other way
around ? )

You can see an example of how to extend the validationdelegate to do what
you want at the bottom of this page:

http://tapestry.apache.org/tapestry4.1/usersguide/validation.html

Something along the lines of your @Delegate component (which I'm 
assuming is

supposed to print out all the error messages? ) is also found here:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.java?view=markup 



Note that this particular example only prints out the first error, not all
of them.

On 5/3/07, Ulrich Stärk <[EMAIL PROTECTED]> wrote:


Hi list,

I've constructed a small test case using Tapestry 4.1.1. I'm trying to
validate a text input field
using the 'required' validator. The FieldLabel for this TextField is
indicating an error, but the
Delegator doesn't display it.

This is my template:



   Test 
   displayName="Test"

validators="validators:required" />
   
   


The page-specification for this page contains nothing except for the
corresponding class reference.
The page class looks like this:

public abstract class Test extends BasePage {
 @Override public String getClientId() { return null; }
 @Override public void setClientId(String arg0) { }

 @Bean public abstract ValidationDelegate getDelegate();
 @InjectPage("Home") public abstract IPage getHomePage();
 public abstract String getTest();

 public IPage doTest() {
 if(getDelegate().getHasErrors())
 return null;
 System.out.println(getTest());
 return getHomePage();
 }
}

After fighting with this for 4 hours I've got the strong feeling that I'm
missing something here. So
all you experts out there please help me :)

Cheers

Uli

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








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



[T5] How to call Asserts in component template

2007-05-03 Thread Fidel Chavarria

I want to use the asset component instead of  

what i should do?

My component class **
package net.caimito.savila.tapestry.components;

import org.apache.tapestry.Asset;
import org.apache.tapestry.annotations.Inject;

/**
 * @author  mailto:[EMAIL PROTECTED] Fidel Chavarria 
 *
 */
public class ActionLayout {

@Inject("context:css/screen.css")
private Asset cssFile;

public Asset getCssFile() {
return cssFile;
}
}


** component Template **

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



-- 
View this message in context: 
http://www.nabble.com/-T5--How-to-call--Asserts-in-component-template-tf3688366.html#a10311227
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



Re: [T5] Tree component and recursive component ?

2007-05-03 Thread Howard Lewis Ship

I was just thinking about some of this on the way in.


If you @Inject the ServiceResources into your Tree component, you can ask it
to generate action links for you.  Handy!

On 5/3/07, Francois Armand <[EMAIL PROTECTED]> wrote:


Le jeudi 03 mai 2007 à 10:27 +0200, Francois Armand a écrit :
> Hello everybody,

> So, my question is : is there a way of implementing recursive
> component ? If not, is there an existing component implementing a
> non-recursive tree walk ? And if not, have you some advices about doing
> such a component in T5 (say I know an algorithm for non-recursive tree
> walk, what are the best practice in T5 ?)
>

Ok, I found that :
http://tapestry.apache.org/tapestry5/tapestry-core/guide/dom.html and I
can render my tree with ul/li tags thanks to MarkupWriter.

But now, I want to add "actionlink" around each node content (the string
enclosed by  tags). How can I do that ? I think I can copy the code
from ActionLink, but perhaps there is a better method (well... Now that
I begin to play with MarkupWriter, I certainly have to use it for
everything...).

Any advice would be appreciated :)

Francois


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





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

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


Re: Tap 4.1.2 EventListener

2007-05-03 Thread Jesse Kuhnert

You should expect it to behave exactly the same way as it would if you had
just submitted the form normally without any ajax stuff.

In your case you are probably looking for the value to be in a temporary
property you use when iterating over your values in a For loop - when really
the value will have already been updated inside of whatever your original
"source" parameter was to the For. (assuming it's able to figure out which
one it was in case you haven't used a converter / something else )

On 5/3/07, Tony Nelson <[EMAIL PROTECTED]> wrote:


I grabbed the latest snapshot and now the callback is getting called for
all of my inputs.  Thank you very much.

I still get NULL as the value, but I think that's my fault.  I'm going
to have to do some serious thinking about how this page works.

For my understanding, when the "onchange" event fires, what data should
I expect to be posted back to the server?  The entire form?  Or just the
changed field?  Reading all the logging that I have in my page, it
appears as though the entire page is being reconstructed (like a
rewind?) on the back end.  Is that normal?  Should I expect that?

I'm going to have to add even more logging, but should I expect
pageBeginRender() to be called?  I would expect not.. but I might be
wrong.

I can see that Tapestry is definitely evaluating the entire template
because of all the logging I get just updating one field in the browser,
and I guess that might be necessary, I just need to figure out what the
consequences of that will be on my code.

Thanks for all your help
Tony

Jesse Kuhnert wrote:
> Yes the feeling was correct. The snapshot version should be fixed and
> deployed already.
>
> Sorry for the inconvenience,  you caught me in the middle of some larger
> changes and I guess this use case was a victim.
>
> On 5/3/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
>>
>> Hmm...I have a bad feeling this is my fault - obviously it should work
>> fine as-is. I'll take a look...
>>
>> On 5/3/07, Tony Nelson < [EMAIL PROTECTED]> wrote:
>> >
>> > A little additional info.. when I change the value on any of the
>> inputs
>> > beyond the first one, it is causing the form to be submitted, it just
>> > doesn't call my EventListener method.  Also, I am using the latest
>> > (today's) Tapestry build.
>> >
>> > Thanks again
>> > Tony
>> >
>> > Tony Nelson wrote:
>> > > Is it possible to use an EventListener in a component that is
>> > > displayed multiple times on a page?
>> > >
>> > > Specifically, I would like a component that has 2 inputs, and
>> when the
>> > > 1st one is updated an onchange event causes the 2nd component to
>> > > update it's value.  From my testing, it appears that only the first
>> > > component responds to a change event (meaning causes my java
>> method to
>> > > be called), and when it's called, I don't seem to have access to
the
>> > > updated values.
>> > >
>> > > My component in progress looks like:
>> > >
>> > > 
>> > > > > > value="ognl:jobExportValues.externalJobBoard" />
>> > > > size="5"
>> > />
>> > >
>> > > And I register the EventListener in the component as follows:
>> > >
>> > >@EventListener(events={"onchange"}, targets="jobIdField")
>> > >public void testEvent()
>> > >{
>> > >logger.debug("LOOKHERE... " +
>> getJobExportValues().getJobId() +
>> >
>> > > " " + getJobExportValues().getId());
>> > >}
>> > >
>> > >
>> > > When the listener is actually called, I always get NULL for both
>> > > values.  And again, the listener only fires for the first
>> component on
>> >
>> > > the page.
>> > >
>> > > Looking at the page source, it appears that dojo code for all of my
>> > > inputs is being generated which I won't include here due to it's
>> > length.
>> > >
>> > > Any help would be greatly appreciated.  Am I just missing the whole
>> > > concept on the new dojo stuff?
>> > >
>> > > Tony
>> > >
>> > >
>> >
>>

>> > >
>> > >
>> -
>> > > 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]
>> >
>>
>>
>>
>> --
>> Jesse Kuhnert
>> Tapestry/Dojo team member/developer
>>
>> Open source based consulting work centered around
>> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
>
>
>



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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Tap 4.1.2 EventListener

2007-05-03 Thread Tony Nelson
I grabbed the latest snapshot and now the callback is getting called for 
all of my inputs.  Thank you very much. 

I still get NULL as the value, but I think that's my fault.  I'm going 
to have to do some serious thinking about how this page works.


For my understanding, when the "onchange" event fires, what data should 
I expect to be posted back to the server?  The entire form?  Or just the 
changed field?  Reading all the logging that I have in my page, it 
appears as though the entire page is being reconstructed (like a 
rewind?) on the back end.  Is that normal?  Should I expect that?


I'm going to have to add even more logging, but should I expect 
pageBeginRender() to be called?  I would expect not.. but I might be wrong.


I can see that Tapestry is definitely evaluating the entire template 
because of all the logging I get just updating one field in the browser, 
and I guess that might be necessary, I just need to figure out what the 
consequences of that will be on my code.


Thanks for all your help
Tony

Jesse Kuhnert wrote:

Yes the feeling was correct. The snapshot version should be fixed and
deployed already.

Sorry for the inconvenience,  you caught me in the middle of some larger
changes and I guess this use case was a victim.

On 5/3/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:


Hmm...I have a bad feeling this is my fault - obviously it should work
fine as-is. I'll take a look...

On 5/3/07, Tony Nelson < [EMAIL PROTECTED]> wrote:
>
> A little additional info.. when I change the value on any of the 
inputs

> beyond the first one, it is causing the form to be submitted, it just
> doesn't call my EventListener method.  Also, I am using the latest
> (today's) Tapestry build.
>
> Thanks again
> Tony
>
> Tony Nelson wrote:
> > Is it possible to use an EventListener in a component that is
> > displayed multiple times on a page?
> >
> > Specifically, I would like a component that has 2 inputs, and 
when the

> > 1st one is updated an onchange event causes the 2nd component to
> > update it's value.  From my testing, it appears that only the first
> > component responds to a change event (meaning causes my java 
method to

> > be called), and when it's called, I don't seem to have access to the
> > updated values.
> >
> > My component in progress looks like:
> >
> > 
> >  > value="ognl:jobExportValues.externalJobBoard" />
> > size="5"

> />
> >
> > And I register the EventListener in the component as follows:
> >
> >@EventListener(events={"onchange"}, targets="jobIdField")
> >public void testEvent()
> >{
> >logger.debug("LOOKHERE... " + 
getJobExportValues().getJobId() +

>
> > " " + getJobExportValues().getId());
> >}
> >
> >
> > When the listener is actually called, I always get NULL for both
> > values.  And again, the listener only fires for the first 
component on

>
> > the page.
> >
> > Looking at the page source, it appears that dojo code for all of my
> > inputs is being generated which I won't include here due to it's
> length.
> >
> > Any help would be greatly appreciated.  Am I just missing the whole
> > concept on the new dojo stuff?
> >
> > Tony
> >
> >
> 


> >
> > 
-

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



--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com








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

Re: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Jesse Kuhnert

ShewwFinally :)

Yeah I don't think the classpath search is going to be the most typical type
either so it doesn't make sense to take the perf hit on resolving them for
that. I'm not nearly done with these changes though ..Need to re-factor
things so that only one service/object has knowledge of all the various
places to search / how / etc..

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:


Cool, it seems to be finding the component templates again like it used
to. The only difference is it used to search on the context first, then
the classpath.. but I'm not going to split hairs, works plenty good for
me.

Thanks Jesse!

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 03, 2007 12:23 PM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Ok that's making more sense now.  I've made some changes and can no
longer
find any combination that breaks it. What a pita .It should now find
them in

-) classpath relative to component class
-) relative to context root
-) relative to context + WEB-INF root
-) relative to context + WEB-INF + app name root

Jar should be deployed by the time you read this email.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> Yes, so an example would be WEB-INF/app/About.html. I'm a little fuzzy
> on the historical reason for this but it has certainly been a valid
> choice since Tapestry 3 at least. I noticed
> AbstractSpecificationResolver.java has two different methods,
> getWebInfLocation() and getWebInfAppLocation(), the latter of which is
> documented with "Returns the location of the application-specific
> subdirectory, under /WEB-INF/, in the servlet context."
>
> So presumably for us that application-specific subdirectory is app.
> Perhaps that is because the  is defined as "app" for us
in
> web.xml but I'm not 100% sure where that is coming from.
>
> Yes, our .application file is also in that directory.
>
> -Original Message-
> From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 11:41 AM
> To: Tapestry users
> Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
>
> Where/how does the "app" part come in? Is there literally a directory
> called
> "app" where you have stuff, and if so is your .application file there
as
> well?
>
> On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> >
> > The issue where component templates cannot be found in WEB-INF/app
for
> > specless apps. Yes, Marcus mentioned the same problem on
TAPESTRY-1396
> > yesterday. And yes, it is still a problem with the snapshot that
just
> > went out (tapestry-framework-4.1.2-20070503.160951-67.jar).
> >
> > To recreate, just put a component template with no spec under
> > WEB-INF/app and Tapestry will be unable to find it on any of the
> > post-4-30 snapshots.
> >
> > -Original Message-
> > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 03, 2007 11:13 AM
> > To: Tapestry users
> > Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
> >
> > Which issue is still a problem? Is it anything discussed in
> > https://issues.apache.org/jira/browse/TAPESTRY-1396 ?
> >
> > Perhaps your failure is slightly different ? I may need more
specific
> > information (to re-create) . ...Either way an update just went out a
> few
> > seconds ago. Maybe that fixed it.
> >
> > On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> > >
> > > It appears this is still a problem, even with the newest snapshot
> > > (tapestry-framework-4.1.2-20070503.050340-66.jar)
> > > 
> > >
> >
> >
> >
> > --
> > Jesse Kuhnert
> > Tapestry/Dojo team member/developer
> >
> > Open source based consulting work centered around
> > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> >
> >
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


RE: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Ben Dotte
Cool, it seems to be finding the component templates again like it used
to. The only difference is it used to search on the context first, then
the classpath.. but I'm not going to split hairs, works plenty good for
me.

Thanks Jesse!

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 12:23 PM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Ok that's making more sense now.  I've made some changes and can no
longer
find any combination that breaks it. What a pita .It should now find
them in

-) classpath relative to component class
-) relative to context root
-) relative to context + WEB-INF root
-) relative to context + WEB-INF + app name root

Jar should be deployed by the time you read this email.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> Yes, so an example would be WEB-INF/app/About.html. I'm a little fuzzy
> on the historical reason for this but it has certainly been a valid
> choice since Tapestry 3 at least. I noticed
> AbstractSpecificationResolver.java has two different methods,
> getWebInfLocation() and getWebInfAppLocation(), the latter of which is
> documented with "Returns the location of the application-specific
> subdirectory, under /WEB-INF/, in the servlet context."
>
> So presumably for us that application-specific subdirectory is app.
> Perhaps that is because the  is defined as "app" for us
in
> web.xml but I'm not 100% sure where that is coming from.
>
> Yes, our .application file is also in that directory.
>
> -Original Message-
> From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 11:41 AM
> To: Tapestry users
> Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
>
> Where/how does the "app" part come in? Is there literally a directory
> called
> "app" where you have stuff, and if so is your .application file there
as
> well?
>
> On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> >
> > The issue where component templates cannot be found in WEB-INF/app
for
> > specless apps. Yes, Marcus mentioned the same problem on
TAPESTRY-1396
> > yesterday. And yes, it is still a problem with the snapshot that
just
> > went out (tapestry-framework-4.1.2-20070503.160951-67.jar).
> >
> > To recreate, just put a component template with no spec under
> > WEB-INF/app and Tapestry will be unable to find it on any of the
> > post-4-30 snapshots.
> >
> > -Original Message-
> > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, May 03, 2007 11:13 AM
> > To: Tapestry users
> > Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
> >
> > Which issue is still a problem? Is it anything discussed in
> > https://issues.apache.org/jira/browse/TAPESTRY-1396 ?
> >
> > Perhaps your failure is slightly different ? I may need more
specific
> > information (to re-create) . ...Either way an update just went out a
> few
> > seconds ago. Maybe that fixed it.
> >
> > On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> > >
> > > It appears this is still a problem, even with the newest snapshot
> > > (tapestry-framework-4.1.2-20070503.050340-66.jar)
> > > 
> > >
> >
> >
> >
> > --
> > Jesse Kuhnert
> > Tapestry/Dojo team member/developer
> >
> > Open source based consulting work centered around
> > dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
> >
> >
-
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: @Delegator is not showing validation errors

2007-05-03 Thread Jesse Kuhnert

This is a lazy answer, but I don't think the default ValidationDelegate
provided by tapestry actually renders the error message - it just marks
things as being in error. (perhaps the default should be the other way
around ? )

You can see an example of how to extend the validationdelegate to do what
you want at the bottom of this page:

http://tapestry.apache.org/tapestry4.1/usersguide/validation.html

Something along the lines of your @Delegate component (which I'm assuming is
supposed to print out all the error messages? ) is also found here:
http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.java?view=markup

Note that this particular example only prints out the first error, not all
of them.

On 5/3/07, Ulrich Stärk <[EMAIL PROTECTED]> wrote:


Hi list,

I've constructed a small test case using Tapestry 4.1.1. I'm trying to
validate a text input field
using the 'required' validator. The FieldLabel for this TextField is
indicating an error, but the
Delegator doesn't display it.

This is my template:



   Test 
   
   
   


The page-specification for this page contains nothing except for the
corresponding class reference.
The page class looks like this:

public abstract class Test extends BasePage {
 @Override public String getClientId() { return null; }
 @Override public void setClientId(String arg0) { }

 @Bean public abstract ValidationDelegate getDelegate();
 @InjectPage("Home") public abstract IPage getHomePage();
 public abstract String getTest();

 public IPage doTest() {
 if(getDelegate().getHasErrors())
 return null;
 System.out.println(getTest());
 return getHomePage();
 }
}

After fighting with this for 4 hours I've got the strong feeling that I'm
missing something here. So
all you experts out there please help me :)

Cheers

Uli

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Tap 4.1.2 EventListener

2007-05-03 Thread Jesse Kuhnert

Yes the feeling was correct. The snapshot version should be fixed and
deployed already.

Sorry for the inconvenience,  you caught me in the middle of some larger
changes and I guess this use case was a victim.

On 5/3/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:


Hmm...I have a bad feeling this is my fault - obviously it should work
fine as-is. I'll take a look...

On 5/3/07, Tony Nelson < [EMAIL PROTECTED]> wrote:
>
> A little additional info.. when I change the value on any of the inputs
> beyond the first one, it is causing the form to be submitted, it just
> doesn't call my EventListener method.  Also, I am using the latest
> (today's) Tapestry build.
>
> Thanks again
> Tony
>
> Tony Nelson wrote:
> > Is it possible to use an EventListener in a component that is
> > displayed multiple times on a page?
> >
> > Specifically, I would like a component that has 2 inputs, and when the
> > 1st one is updated an onchange event causes the 2nd component to
> > update it's value.  From my testing, it appears that only the first
> > component responds to a change event (meaning causes my java method to
> > be called), and when it's called, I don't seem to have access to the
> > updated values.
> >
> > My component in progress looks like:
> >
> > 
> >  > value="ognl:jobExportValues.externalJobBoard" />
> >  />
> >
> > And I register the EventListener in the component as follows:
> >
> >@EventListener(events={"onchange"}, targets="jobIdField")
> >public void testEvent()
> >{
> >logger.debug("LOOKHERE... " + getJobExportValues().getJobId() +
>
> > " " + getJobExportValues().getId());
> >}
> >
> >
> > When the listener is actually called, I always get NULL for both
> > values.  And again, the listener only fires for the first component on
>
> > the page.
> >
> > Looking at the page source, it appears that dojo code for all of my
> > inputs is being generated which I won't include here due to it's
> length.
> >
> > Any help would be greatly appreciated.  Am I just missing the whole
> > concept on the new dojo stuff?
> >
> > Tony
> >
> >
> 
> >
> > -
> > 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]
>



--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Tap 4.1.2 EventListener

2007-05-03 Thread Jesse Kuhnert

Hmm...I have a bad feeling this is my fault - obviously it should work fine
as-is. I'll take a look...

On 5/3/07, Tony Nelson <[EMAIL PROTECTED]> wrote:


A little additional info.. when I change the value on any of the inputs
beyond the first one, it is causing the form to be submitted, it just
doesn't call my EventListener method.  Also, I am using the latest
(today's) Tapestry build.

Thanks again
Tony

Tony Nelson wrote:
> Is it possible to use an EventListener in a component that is
> displayed multiple times on a page?
>
> Specifically, I would like a component that has 2 inputs, and when the
> 1st one is updated an onchange event causes the 2nd component to
> update it's value.  From my testing, it appears that only the first
> component responds to a change event (meaning causes my java method to
> be called), and when it's called, I don't seem to have access to the
> updated values.
>
> My component in progress looks like:
>
> 
>  value="ognl:jobExportValues.externalJobBoard" />
> 
>
> And I register the EventListener in the component as follows:
>
>@EventListener(events={"onchange"}, targets="jobIdField")
>public void testEvent()
>{
>logger.debug("LOOKHERE... " + getJobExportValues().getJobId() +
> " " + getJobExportValues().getId());
>}
>
>
> When the listener is actually called, I always get NULL for both
> values.  And again, the listener only fires for the first component on
> the page.
>
> Looking at the page source, it appears that dojo code for all of my
> inputs is being generated which I won't include here due to it's length.
>
> Any help would be greatly appreciated.  Am I just missing the whole
> concept on the new dojo stuff?
>
> Tony
>
> 
>
> -
> 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]





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: [T5] Tree component and recursive component ?

2007-05-03 Thread Francois Armand
Le jeudi 03 mai 2007 à 10:27 +0200, Francois Armand a écrit :
> Hello everybody,

> So, my question is : is there a way of implementing recursive
> component ? If not, is there an existing component implementing a
> non-recursive tree walk ? And if not, have you some advices about doing
> such a component in T5 (say I know an algorithm for non-recursive tree
> walk, what are the best practice in T5 ?)
> 

Ok, I found that :
http://tapestry.apache.org/tapestry5/tapestry-core/guide/dom.html and I
can render my tree with ul/li tags thanks to MarkupWriter.

But now, I want to add "actionlink" around each node content (the string
enclosed by  tags). How can I do that ? I think I can copy the code
from ActionLink, but perhaps there is a better method (well... Now that
I begin to play with MarkupWriter, I certainly have to use it for
everything...).

Any advice would be appreciated :)

Francois


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



Re: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Jesse Kuhnert

Ok that's making more sense now.  I've made some changes and can no longer
find any combination that breaks it. What a pita .It should now find
them in

-) classpath relative to component class
-) relative to context root
-) relative to context + WEB-INF root
-) relative to context + WEB-INF + app name root

Jar should be deployed by the time you read this email.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:


Yes, so an example would be WEB-INF/app/About.html. I'm a little fuzzy
on the historical reason for this but it has certainly been a valid
choice since Tapestry 3 at least. I noticed
AbstractSpecificationResolver.java has two different methods,
getWebInfLocation() and getWebInfAppLocation(), the latter of which is
documented with "Returns the location of the application-specific
subdirectory, under /WEB-INF/, in the servlet context."

So presumably for us that application-specific subdirectory is app.
Perhaps that is because the  is defined as "app" for us in
web.xml but I'm not 100% sure where that is coming from.

Yes, our .application file is also in that directory.

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 03, 2007 11:41 AM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Where/how does the "app" part come in? Is there literally a directory
called
"app" where you have stuff, and if so is your .application file there as
well?

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> The issue where component templates cannot be found in WEB-INF/app for
> specless apps. Yes, Marcus mentioned the same problem on TAPESTRY-1396
> yesterday. And yes, it is still a problem with the snapshot that just
> went out (tapestry-framework-4.1.2-20070503.160951-67.jar).
>
> To recreate, just put a component template with no spec under
> WEB-INF/app and Tapestry will be unable to find it on any of the
> post-4-30 snapshots.
>
> -Original Message-
> From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 11:13 AM
> To: Tapestry users
> Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
>
> Which issue is still a problem? Is it anything discussed in
> https://issues.apache.org/jira/browse/TAPESTRY-1396 ?
>
> Perhaps your failure is slightly different ? I may need more specific
> information (to re-create) . ...Either way an update just went out a
few
> seconds ago. Maybe that fixed it.
>
> On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> >
> > It appears this is still a problem, even with the newest snapshot
> > (tapestry-framework-4.1.2-20070503.050340-66.jar)
> > 
> >
>
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


Re: Tapestry 3 DirectLink and stateful (Thanks a lot!)

2007-05-03 Thread Mike Davis
Hi,

Thanks for that - it solved my problem neatly ...

I'd also like to say thanks to the list - great to see a big community
that helps out so quickly and politely!

Thnks
Mike

On Thu, 03 May 2007 15:46:18 +0100
Richard Kirby <[EMAIL PROTECTED]> wrote:

> Hi Mike,
> 
> I think you will find that the cookie used for session tracking is 
> actually generated by the servlet engine 
> (Tomcat/Jetty/Weblogic/whatever) and nothing to do with Tapestry.
> 
> However, since cookies are nothing but HTTP header lines, you could 
> always use a Filter to hack the cookie header line. Alternatively, if 
> you are using mod_proxy to hook your apache to your servlet engine,
> look into using ProxyPassReverseCookiePath and
> ProxyPassReverseCookieDomain.
> 
> Cheers
> 
> Richard
> 
> Mike Davis wrote:
> > Hi,
> >
> > As it turns out, the problem is actually that I've used Apache's
> > mod_rewrite to transparently eliminate the context part of the path
> > ('/xyz/app.htm' => '/app.htm') and obviously Tapestry uses the
> > context as part of the cookie's path ... 
> >
> > Is there a way to setup Tapestry so that it will set up the cookie
> > path without the context (or with an alternate path)? I have other
> > applications on the same app server, so I still need to keep the
> > apps in seperate contexts.
> >
> > I have taken a look in the code and I suppose I could simply hack it
> > until it works, but obviously I'm hoping that it's possible just
> > using a config file.
> >
> > Thanks
> > Mike Davis
> >
> >
> > On Thu, 3 May 2007 08:47:10 +0200
> > Mike Davis <[EMAIL PROTECTED]> wrote:
> >
> >   
> >> Hi,
> >>
> >> The problem is that I have a page that I'd like users to be able to
> >> access with or without a session. This works fine, but calling
> >> getVisit() on that page returns null whether or not the user
> >> previously had an accessible visit object. Once a user has been to
> >> that page, calls to getVisit() from *any other page* also return
> >> null, again regardless of whether a visit object was previously
> >> accessible.
> >>
> >> Thanks
> >> Mike Davis
> >>
> >>
> >>
> >> On Thu, 3 May 2007 04:50:29 +0300
> >> "Andreas Andreou" <[EMAIL PROTECTED]> wrote:
> >>
> >> 
> >>> not, that's not correct... session is not invalidated when
> >>> clicking on a DirectLink having the stateful flag set to false
> >>>
> >>> What exactly is the problem you're facing?
> >>>
> >>> On 5/3/07, Mike Davis <[EMAIL PROTECTED]> wrote:
> >>>   
>  Hi all,
> 
>  I've been asked to do some work on a Tapestry 3 application
>  (unfortunately I can't upgrade it!) and I'm struggling with a
>  DirectLink/session issue. I would like to allow our users to
>  access certain pages without session, yet still be able to return
>  to pages that require a session, without losing any stored state.
> 
>  Is it possible to create a Tapestry app that allows a user to do
>  the following?
>  - open a page that creates and uses a visit object
>  - click a DirectLink with the stateful flag set to false
>  - go back to the first page and use the original visit object
>  again
> 
>  Is it correct to say that once a DirectLink is clicked with the
>  stateful flag set to false, any session data associated with that
>  user's session is invalidated?
> 
>  Thanks
>  Mike Davis
> 
>  -
>  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: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Ben Dotte
Yes, so an example would be WEB-INF/app/About.html. I'm a little fuzzy
on the historical reason for this but it has certainly been a valid
choice since Tapestry 3 at least. I noticed
AbstractSpecificationResolver.java has two different methods,
getWebInfLocation() and getWebInfAppLocation(), the latter of which is
documented with "Returns the location of the application-specific
subdirectory, under /WEB-INF/, in the servlet context."

So presumably for us that application-specific subdirectory is app.
Perhaps that is because the  is defined as "app" for us in
web.xml but I'm not 100% sure where that is coming from.

Yes, our .application file is also in that directory.

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 11:41 AM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Where/how does the "app" part come in? Is there literally a directory
called
"app" where you have stuff, and if so is your .application file there as
well?

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> The issue where component templates cannot be found in WEB-INF/app for
> specless apps. Yes, Marcus mentioned the same problem on TAPESTRY-1396
> yesterday. And yes, it is still a problem with the snapshot that just
> went out (tapestry-framework-4.1.2-20070503.160951-67.jar).
>
> To recreate, just put a component template with no spec under
> WEB-INF/app and Tapestry will be unable to find it on any of the
> post-4-30 snapshots.
>
> -Original Message-
> From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 11:13 AM
> To: Tapestry users
> Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
>
> Which issue is still a problem? Is it anything discussed in
> https://issues.apache.org/jira/browse/TAPESTRY-1396 ?
>
> Perhaps your failure is slightly different ? I may need more specific
> information (to re-create) . ...Either way an update just went out a
few
> seconds ago. Maybe that fixed it.
>
> On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> >
> > It appears this is still a problem, even with the newest snapshot
> > (tapestry-framework-4.1.2-20070503.050340-66.jar)
> > 
> >
>
>
>
> --
> Jesse Kuhnert
> Tapestry/Dojo team member/developer
>
> Open source based consulting work centered around
> dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Tap 4.1.2 EventListener

2007-05-03 Thread Tony Nelson
A little additional info.. when I change the value on any of the inputs 
beyond the first one, it is causing the form to be submitted, it just 
doesn't call my EventListener method.  Also, I am using the latest 
(today's) Tapestry build.


Thanks again
Tony

Tony Nelson wrote:
Is it possible to use an EventListener in a component that is 
displayed multiple times on a page?


Specifically, I would like a component that has 2 inputs, and when the 
1st one is updated an onchange event causes the 2nd component to 
update it's value.  From my testing, it appears that only the first 
component responds to a change event (meaning causes my java method to 
be called), and when it's called, I don't seem to have access to the 
updated values.


My component in progress looks like:


value="ognl:jobExportValues.externalJobBoard" />



And I register the EventListener in the component as follows:

   @EventListener(events={"onchange"}, targets="jobIdField")
   public void testEvent()
   {
   logger.debug("LOOKHERE... " + getJobExportValues().getJobId() + 
" " + getJobExportValues().getId());

   }


When the listener is actually called, I always get NULL for both 
values.  And again, the listener only fires for the first component on 
the page.


Looking at the page source, it appears that dojo code for all of my 
inputs is being generated which I won't include here due to it's length.


Any help would be greatly appreciated.  Am I just missing the whole 
concept on the new dojo stuff?


Tony



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

Tap 4.1.2 EventListener

2007-05-03 Thread Tony Nelson
Is it possible to use an EventListener in a component that is displayed 
multiple times on a page?


Specifically, I would like a component that has 2 inputs, and when the 
1st one is updated an onchange event causes the 2nd component to update 
it's value.  From my testing, it appears that only the first component 
responds to a change event (meaning causes my java method to be called), 
and when it's called, I don't seem to have access to the updated values.


My component in progress looks like:


value="ognl:jobExportValues.externalJobBoard" />



And I register the EventListener in the component as follows:

   @EventListener(events={"onchange"}, targets="jobIdField")
   public void testEvent()
   {
   logger.debug("LOOKHERE... " + getJobExportValues().getJobId() + 
" " + getJobExportValues().getId());

   }


When the listener is actually called, I always get NULL for both 
values.  And again, the listener only fires for the first component on 
the page.


Looking at the page source, it appears that dojo code for all of my 
inputs is being generated which I won't include here due to it's length.


Any help would be greatly appreciated.  Am I just missing the whole 
concept on the new dojo stuff?


Tony

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

@Delegator is not showing validation errors

2007-05-03 Thread Ulrich Stärk

Hi list,

I've constructed a small test case using Tapestry 4.1.1. I'm trying to validate a text input field 
using the 'required' validator. The FieldLabel for this TextField is indicating an error, but the 
Delegator doesn't display it.


This is my template:

delegate="ognl:beans.delegate.firstError">


  Test 
  validators="validators:required" />

  
  


The page-specification for this page contains nothing except for the 
corresponding class reference.
The page class looks like this:

public abstract class Test extends BasePage {
@Override public String getClientId() { return null; }
@Override public void setClientId(String arg0) { }

@Bean public abstract ValidationDelegate getDelegate();
@InjectPage("Home") public abstract IPage getHomePage();
public abstract String getTest();

public IPage doTest() {
if(getDelegate().getHasErrors())
return null;
System.out.println(getTest());
return getHomePage();
}
}

After fighting with this for 4 hours I've got the strong feeling that I'm missing something here. So 
all you experts out there please help me :)


Cheers

Uli

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



Re: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Jesse Kuhnert

Where/how does the "app" part come in? Is there literally a directory called
"app" where you have stuff, and if so is your .application file there as
well?

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:


The issue where component templates cannot be found in WEB-INF/app for
specless apps. Yes, Marcus mentioned the same problem on TAPESTRY-1396
yesterday. And yes, it is still a problem with the snapshot that just
went out (tapestry-framework-4.1.2-20070503.160951-67.jar).

To recreate, just put a component template with no spec under
WEB-INF/app and Tapestry will be unable to find it on any of the
post-4-30 snapshots.

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 03, 2007 11:13 AM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Which issue is still a problem? Is it anything discussed in
https://issues.apache.org/jira/browse/TAPESTRY-1396 ?

Perhaps your failure is slightly different ? I may need more specific
information (to re-create) . ...Either way an update just went out a few
seconds ago. Maybe that fixed it.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> It appears this is still a problem, even with the newest snapshot
> (tapestry-framework-4.1.2-20070503.050340-66.jar)
> 
>



--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


RE: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Ben Dotte
The issue where component templates cannot be found in WEB-INF/app for
specless apps. Yes, Marcus mentioned the same problem on TAPESTRY-1396
yesterday. And yes, it is still a problem with the snapshot that just
went out (tapestry-framework-4.1.2-20070503.160951-67.jar).

To recreate, just put a component template with no spec under
WEB-INF/app and Tapestry will be unable to find it on any of the
post-4-30 snapshots.

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 11:13 AM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Which issue is still a problem? Is it anything discussed in
https://issues.apache.org/jira/browse/TAPESTRY-1396 ?

Perhaps your failure is slightly different ? I may need more specific
information (to re-create) . ...Either way an update just went out a few
seconds ago. Maybe that fixed it.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> It appears this is still a problem, even with the newest snapshot
> (tapestry-framework-4.1.2-20070503.050340-66.jar)
> 
>



-- 
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

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



Re: Tapestry 3 DirectLink and stateful

2007-05-03 Thread Robert Zeigler

On May 2, 2007, at 5/24:45 PM , Mike Davis wrote:


Hi all,

I've been asked to do some work on a Tapestry 3 application
(unfortunately I can't upgrade it!) and I'm struggling with a
DirectLink/session issue. I would like to allow our users to
access certain pages without session, yet still be able to return to
pages that require a session, without losing any stored state.



Yes, this is possible.


Is it possible to create a Tapestry app that allows a user to do the
following?
- open a page that creates and uses a visit object
- click a DirectLink with the stateful flag set to false
- go back to the first page and use the original visit object again



Yup, fine.


Is it correct to say that once a DirectLink is clicked with the
stateful flag set to false, any session data associated with that
user's session is invalidated?




No, that's not the case.  If the stateful flag is true, and your user  
doesn't have a session, or the session was newly created, tapestry  
will complain.  But if you have a session already and you click on a  
direct link with stateful=false, tapestry will keep on chugging  
merrily along.


That said, if your page is really supposed to be accessible  
"stateless", you might consider implementing IExternalPage and using  
an external link, instead; then you avoid having to worry about  
statefulness altogether.


Robert


Thanks
Mike Davis

-
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: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Jesse Kuhnert

Which issue is still a problem? Is it anything discussed in
https://issues.apache.org/jira/browse/TAPESTRY-1396 ?

Perhaps your failure is slightly different ? I may need more specific
information (to re-create) . ...Either way an update just went out a few
seconds ago. Maybe that fixed it.

On 5/3/07, Ben Dotte <[EMAIL PROTECTED]> wrote:


It appears this is still a problem, even with the newest snapshot
(tapestry-framework-4.1.2-20070503.050340-66.jar)






--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


RE: 4.1.2 snapshot changes 4-20 to 4-30

2007-05-03 Thread Ben Dotte
It appears this is still a problem, even with the newest snapshot
(tapestry-framework-4.1.2-20070503.050340-66.jar)

-Original Message-
From: Ben Dotte [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 02, 2007 2:50 PM
To: Tapestry users
Subject: RE: 4.1.2 snapshot changes 4-20 to 4-30

Ok, looks like Marcus ran into the same problem:

https://issues.apache.org/jira/browse/TAPESTRY-1396

On a separate note I see OGNL Jira is sending out e-mails now.. awesome.

-Original Message-
From: Ben Dotte [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 02, 2007 1:55 PM
To: Tapestry users
Subject: RE: 4.1.2 snapshot changes 4-20 to 4-30

Thanks. A good example that replicates our setup would be to have a
component (not page) template with no spec directly under WEB-INF/app.
It would probably also work to just put it directly into WEB-INF.

-Original Message-
From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 02, 2007 1:46 PM
To: Tapestry users
Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30

Yes I think my intention/want now is to have everything "just work"
whether
you stick things in context or classpath (if possible, some things
aren't
because of restricted filesystem access ).

I'll look in to this later today, but to be sure I'm not
mis-interpreting
A good example would be having a page with no spec + the html
template
just being under the web-inf folder right ?

On 5/2/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
>
> It looks like the newest snapshot does fix my EventListener and Script
> problems. However now I am seeing the problem Andreas mentioned, where
a
> component isn't being found where it used to get found.
>
> We are specless and our page/component templates are stored in
> WEB-INF/app. There was a change made to
> ComponentSpecificationResolverImpl.java between the current snapshot
and
> the one from 4-20 that seems to have caused this problem (in
> searchForComponentClass() line 252):
>
> Resource componentResource =
namespaceResource.getRelativeResource(type
> + ".jwc");
>
> // try classpath relative if namespace relative doesn't resolve
>
> if (componentResource.getResourceURL() == null) {
>
> Resource classResource = new ClasspathResource(_classResolver,
> componentClass.getName().replace('.', '/'));
> componentResource = classResource.getRelativeResource(type +
> ".jwc");
> }
>
> Since we don't have any .jwc files, componentResource.getResourceURL()
> always returns null and it then searches on the classpath instead. I
> tried putting the templates on the classpath and it finds them there,
> but that isn't how our build system is setup to work right now. If I
> comment out that if statement everything works fine again and the
> templates on WEB-INF/app are found.
>
> So, is this an intentional change, or should it be able to find
> templates in WEB-INF/app for specless apps?
>
> Thanks,
> Ben
>
> -Original Message-
> From: Ben Dotte [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 01, 2007 2:54 PM
> To: Tapestry users
> Subject: RE: 4.1.2 snapshot changes 4-20 to 4-30
>
> Thanks for looking into it so quickly.. I will try out the new
snapshot
> tomorrow.
>
> -Original Message-
> From: Jesse Kuhnert [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, May 01, 2007 2:49 PM
> To: Tapestry users
> Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
>
> A fix is deploying now for the @EventListener related issue. (though
I'm
> unsure if it fixes it for Ben but we'll see)
>
> The script thing will have to happen later tonight.
>
> On 5/1/07, Jesse Kuhnert <[EMAIL PROTECTED]> wrote:
> >
> > Yeah I'm aware of the issue, think it's fixed locally but am still
> testing
> > the changes.
> >
> > On 5/1/07, Andreas Andreou < [EMAIL PROTECTED]> wrote:
> > >
> > > I think i've seen some similar issues in the latest snapshots...
> > >
> > > They indeed seem to be related to how components/pages are found,
> i'll
> > > try
> > > to have
> > > a clean example demonstrating this and register a JIRA.
> > >
> > > For now, try using:
> > >
> > > 
> > > org.apache.tapestry
> > > tapestry-framework
> > > 4.1.2-20070424.205219-56
> > > 
> > >
> > >
> > >
> > > On 5/1/07, Ben Dotte <[EMAIL PROTECTED]> wrote:
> > > >
> > > > I tried the snapshots from this morning but unfortunately I
still
> get
> > > > the same EventListener error. For the script error I tried
adding
> > > > context: to the path like this:
> > > >
> > > >  script="context:/scripts/categoryHelper.script"
> > > />
> > > >
> > > > But now the error I get for that is:
> > > >
> > > > Unable to parse script
> > > >
> > >
>
classpath:collective/ui/components/context:/scripts/categoryHelper.scrip
> > > > t.
> > > >
> > > > -Original Message-
> > > > From: Jesse Kuhnert [mailto:[EMAIL PROTECTED] ]
> > > > Sent: Tuesday, May 01, 2007 9:33 AM
> > > > To: Tapestry users
> > > > Subject: Re: 4.1.2 snapshot changes 4-20 to 4-30
> > > >
> > > > There we

Re: T5: injecting service into page

2007-05-03 Thread Howard Lewis Ship

The module must be test.services.AppModule.  You have it as test.AppModule,
and Tapestry simply doesn't see it there.  Because of these, no service
binding, and therefore, no service to inject.

On 5/3/07, Peter V <[EMAIL PROTECTED]> wrote:



--- Peter V <[EMAIL PROTECTED]> wrote:

> I have serious problems with simple service
> injection
> into page.
>
> ...

Test page class is in test.pages.Test of course, not
in test.Test.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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





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

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


Re: [T5]: rendering component with nested component with @Component annotation

2007-05-03 Thread Howard Lewis Ship

Sub-components have no meaning unless there's a template.  It is the
elements in the template that drive the creation of sub-components. This
should be more explicit in the documentation, and perhaps there should be a
check for components in classes without a template.

On 5/3/07, Kristian Marinkovic <[EMAIL PROTECTED]> wrote:


hi,

does anyone know how to render a Tapestry 5 component that itself
contains a component with the @Component annotation?

What i did so far is to define a template for the first component that
contains the second component as a embedded component (code below).

I'm trying to write a Stylesheet component that depends on a
RelationshipLink (... actually the  tag :)) (please comment
on whether you consider this component to be useful/reasonable
or not).

anyway, is this the right approach for writing (nested) components?
should i use component inheritance instead? then i do not need the
template.

g,
kris

example code:

public class Stylesheet {
@Parameter(required=true) private Asset href;
@Parameter  private String media;
@Parameter  private String rel;
@Parameter(value="text/css",defaultPrefix="literal") private String
type;



@Component(id="relationshipLink",parameters={"href=href","media=media","rel=rel","type=type"})
private RelationshipLink relationshipLink;

public RelationshipLink getRelationshipLink() {
return relationshipLink;
}

Stylesheet.html
http://tapestry.."; />

//see http://www.w3.org/TR/html4/struct/links.html for more details on
link
public class RelationshipLink {
/*
 * As the only valid location for  is within 
it will
 * not check the location
 */
  ...
void beginRender(MarkupWriter writer) {
writer.element("link",
"href",href, "charSet",charSet, "hrefLang",
hrefLang,"media",media,"rel",rel,"rev",rev,
"target",target,"type",type);
writer.end();
}





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

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


Re: simple ajax text update help please

2007-05-03 Thread Jesse Kuhnert

I probably need to add a ResponseBuilder.insertComponents() call pretty
soon, but the basic reason why it's not updating is because the "counter"
and "B" elements probably don't exist on your rendered page already. For it
to update them it needs an element that it can find with something simple
like this javascript:

document.getElementById("counter")

This is usually solved by doing something like:


 


You also shouldn't need to specify which form to submit (in 4.1.2 at least).


On 5/3/07, Paul Stanton <[EMAIL PROTECTED]> wrote:


Hi All,

I'm trying to do something very basic with ajax. I simply want a value
to increment when an onchange event is triggered for another component.
The listener is being called via ajax etc. but I cannot get my component
to update. I understand I'm missing the logic which identifies and
updates the component, but have no idea where I need to do it, or what I
need to do.

I have my counter component 'AjaxCount' and my page 'AjaxDemo'.
Hopefully the code explains what I'm trying to do:

The error I'm getting:
"No node could be found to update content in with id counter"

AjaxCount.html:

Update Count
5

AjaxCount.java:

@ComponentClass(allowInformalParameters = false)
public abstract class AjaxCount extends ApplicationComponent
{
private int count;

public int getCount()
{
return count;
}

public void setCount(int count)
{
this.count = count;
}

public void increment()
{
setCount(getCount() + 1);
}
}

AjaxDemo.java:

public abstract class AjaxDemo extends ApplicationPage implements
PageBeginRenderListener
{
@InjectComponent("counter")
public abstract AjaxCount getCounter();

@EventListener(targets = "A", events = "onchange", submitForm =
"form")
public void changeA(IRequestCycle cycle)
{
System.out.println("changeA()");
modelB = this.getModelB();
AjaxCount counter = getCounter();
counter.increment();
cycle.getResponseBuilder().updateComponent("B");
cycle.getResponseBuilder().updateComponent("counter");
}
...
}

AjaxDemo.html:

...

...


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





--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com


simple ajax text update help please

2007-05-03 Thread Paul Stanton

Hi All,

I'm trying to do something very basic with ajax. I simply want a value 
to increment when an onchange event is triggered for another component. 
The listener is being called via ajax etc. but I cannot get my component 
to update. I understand I'm missing the logic which identifies and 
updates the component, but have no idea where I need to do it, or what I 
need to do.


I have my counter component 'AjaxCount' and my page 'AjaxDemo'. 
Hopefully the code explains what I'm trying to do:


The error I'm getting:
"No node could be found to update content in with id counter"

AjaxCount.html:

Update Count
5

AjaxCount.java:

@ComponentClass(allowInformalParameters = false)
public abstract class AjaxCount extends ApplicationComponent
{
   private int count;

   public int getCount()
   {
   return count;
   }

   public void setCount(int count)
   {
   this.count = count;
   }

   public void increment()
   {
   setCount(getCount() + 1);
   }
}

AjaxDemo.java:

public abstract class AjaxDemo extends ApplicationPage implements 
PageBeginRenderListener

{
   @InjectComponent("counter")
   public abstract AjaxCount getCounter();

   @EventListener(targets = "A", events = "onchange", submitForm = "form")
   public void changeA(IRequestCycle cycle)
   {
   System.out.println("changeA()");
   modelB = this.getModelB();
   AjaxCount counter = getCounter();
   counter.increment();
   cycle.getResponseBuilder().updateComponent("B");
   cycle.getResponseBuilder().updateComponent("counter");
   }
...
}

AjaxDemo.html:

...

...


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



Re: Tapestry 3 DirectLink and stateful

2007-05-03 Thread Richard Kirby

Hi Mike,

I think you will find that the cookie used for session tracking is 
actually generated by the servlet engine 
(Tomcat/Jetty/Weblogic/whatever) and nothing to do with Tapestry.


However, since cookies are nothing but HTTP header lines, you could 
always use a Filter to hack the cookie header line. Alternatively, if 
you are using mod_proxy to hook your apache to your servlet engine, look 
into using ProxyPassReverseCookiePath and ProxyPassReverseCookieDomain.


Cheers

Richard

Mike Davis wrote:

Hi,

As it turns out, the problem is actually that I've used Apache's
mod_rewrite to transparently eliminate the context part of the path
('/xyz/app.htm' => '/app.htm') and obviously Tapestry uses the context
as part of the cookie's path ... 


Is there a way to setup Tapestry so that it will set up the cookie path
without the context (or with an alternate path)? I have other
applications on the same app server, so I still need to keep the apps
in seperate contexts.

I have taken a look in the code and I suppose I could simply hack it
until it works, but obviously I'm hoping that it's possible just using
a config file.

Thanks
Mike Davis


On Thu, 3 May 2007 08:47:10 +0200
Mike Davis <[EMAIL PROTECTED]> wrote:

  

Hi,

The problem is that I have a page that I'd like users to be able to
access with or without a session. This works fine, but calling
getVisit() on that page returns null whether or not the user
previously had an accessible visit object. Once a user has been to
that page, calls to getVisit() from *any other page* also return null,
again regardless of whether a visit object was previously accessible.

Thanks
Mike Davis



On Thu, 3 May 2007 04:50:29 +0300
"Andreas Andreou" <[EMAIL PROTECTED]> wrote:



not, that's not correct... session is not invalidated when clicking
on a DirectLink having the stateful flag set to false

What exactly is the problem you're facing?

On 5/3/07, Mike Davis <[EMAIL PROTECTED]> wrote:
  

Hi all,

I've been asked to do some work on a Tapestry 3 application
(unfortunately I can't upgrade it!) and I'm struggling with a
DirectLink/session issue. I would like to allow our users to
access certain pages without session, yet still be able to return
to pages that require a session, without losing any stored state.

Is it possible to create a Tapestry app that allows a user to do
the following?
- open a page that creates and uses a visit object
- click a DirectLink with the stateful flag set to false
- go back to the first page and use the original visit object
again

Is it correct to say that once a DirectLink is clicked with the
stateful flag set to false, any session data associated with that
user's session is invalidated?

Thanks
Mike Davis

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



  

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




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



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



[T5]: rendering component with nested component with @Component annotation

2007-05-03 Thread Kristian Marinkovic
hi,

does anyone know how to render a Tapestry 5 component that itself 
contains a component with the @Component annotation? 

What i did so far is to define a template for the first component that 
contains the second component as a embedded component (code below).

I'm trying to write a Stylesheet component that depends on a 
RelationshipLink (... actually the  tag :)) (please comment 
on whether you consider this component to be useful/reasonable
or not).

anyway, is this the right approach for writing (nested) components?
should i use component inheritance instead? then i do not need the 
template.

g,
kris

example code:

public class Stylesheet {
@Parameter(required=true) private Asset href;
@Parameter  private String media;
@Parameter  private String rel;
@Parameter(value="text/css",defaultPrefix="literal") private String 
type;
 
 
@Component(id="relationshipLink",parameters={"href=href","media=media","rel=rel","type=type"})
private RelationshipLink relationshipLink;
 
public RelationshipLink getRelationshipLink() {
return relationshipLink;
}

Stylesheet.html
http://tapestry.."; />

//see http://www.w3.org/TR/html4/struct/links.html for more details on 
link
public class RelationshipLink {
/*
 * As the only valid location for  is within  
it will
 * not check the location
 */
  ...
void beginRender(MarkupWriter writer) {
writer.element("link", 
"href",href, "charSet",charSet, "hrefLang",
hrefLang,"media",media,"rel",rel,"rev",rev,
"target",target,"type",type);
writer.end();
}

Re: Tapestry 3 DirectLink and stateful

2007-05-03 Thread Mike Davis
Hi,

As it turns out, the problem is actually that I've used Apache's
mod_rewrite to transparently eliminate the context part of the path
('/xyz/app.htm' => '/app.htm') and obviously Tapestry uses the context
as part of the cookie's path ... 

Is there a way to setup Tapestry so that it will set up the cookie path
without the context (or with an alternate path)? I have other
applications on the same app server, so I still need to keep the apps
in seperate contexts.

I have taken a look in the code and I suppose I could simply hack it
until it works, but obviously I'm hoping that it's possible just using
a config file.

Thanks
Mike Davis


On Thu, 3 May 2007 08:47:10 +0200
Mike Davis <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> The problem is that I have a page that I'd like users to be able to
> access with or without a session. This works fine, but calling
> getVisit() on that page returns null whether or not the user
> previously had an accessible visit object. Once a user has been to
> that page, calls to getVisit() from *any other page* also return null,
> again regardless of whether a visit object was previously accessible.
> 
> Thanks
> Mike Davis
> 
> 
> 
> On Thu, 3 May 2007 04:50:29 +0300
> "Andreas Andreou" <[EMAIL PROTECTED]> wrote:
> 
> > not, that's not correct... session is not invalidated when clicking
> > on a DirectLink having the stateful flag set to false
> > 
> > What exactly is the problem you're facing?
> > 
> > On 5/3/07, Mike Davis <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi all,
> > >
> > > I've been asked to do some work on a Tapestry 3 application
> > > (unfortunately I can't upgrade it!) and I'm struggling with a
> > > DirectLink/session issue. I would like to allow our users to
> > > access certain pages without session, yet still be able to return
> > > to pages that require a session, without losing any stored state.
> > >
> > > Is it possible to create a Tapestry app that allows a user to do
> > > the following?
> > > - open a page that creates and uses a visit object
> > > - click a DirectLink with the stateful flag set to false
> > > - go back to the first page and use the original visit object
> > > again
> > >
> > > Is it correct to say that once a DirectLink is clicked with the
> > > stateful flag set to false, any session data associated with that
> > > user's session is invalidated?
> > >
> > > Thanks
> > > Mike Davis
> > >
> > > -
> > > 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: injecting service into page

2007-05-03 Thread Peter V

--- Peter V <[EMAIL PROTECTED]> wrote:

> I have serious problems with simple service
> injection
> into page.
> 
> ...

Test page class is in test.pages.Test of course, not
in test.Test.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



T5: injecting service into page

2007-05-03 Thread Peter V
I have serious problems with simple service injection
into page.

I have one service interface (test.FooManager) and one
service implementation (test.DefaultFooManager).


Module (test.AppModule):

public class AppModule
{
public static void bind(ServiceBinder binder)
{
binder.bind(FooManager.class,
DefaultFooManager.class);
}
}


web.xml


App


tapestry.app-package
test



app

org.apache.tapestry.TapestryFilter



app
/*




Test page class (test.Test):

public class Test
{
@Inject
private FooManager fooManager;
}


While trying to display page exception is raised:

java.lang.RuntimeException
No service implements the interface test.FooManager.


I've run a little debug session and I discover, that
in ModuleImpl#findServiceIdsForInterface(Class
serviceInterface) check if passed parameter is
assignable from interface class defined in module
definition always gives false for my service (it looks
like they both were loaded by different classloaders).

Injecting service in pages should be straightforward,
so... what do I miss?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: [vote] remove renderTags default of true for @If/@Else? (tapestry 4.1.2 )

2007-05-03 Thread Andrea Chiumenti

ooops, the solution by Tony is what I meant!

On 5/2/07, Joe Chen <[EMAIL PROTECTED]> wrote:


+1 both false.

Upgrading from 4.0.x to 4.1.2 with the current default of true means that
I
have to reverse all the page logic in order for my pages to work as they
did
in 4.0.x.  This is just a bad decision for people looking to upgrade.  If
the default is false, then at least pages render as they did in 4.0.x, and
you can still output deprecation warnings for use of "element=".


On 5/2/07, Robert J. Walker <[EMAIL PROTECTED]> wrote:
>
> +1 default both to false, and to make changing the default apply at the
> app or library level rather than globally as indicated in the JIRA
issue.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: HttpSession And Hivemodule state-object

2007-05-03 Thread Hugo Palma

The difference is the amount of coding that you have to do.
If you don't use ASOs you'll have to implement the code that puts your
object in session, the string constant that has the name of the session
attribute, in every page/component that you want to access the value you'll
have access the session again. Also, if you declare the state object in
hivemind you get all the goodies like dependency injection, etc...

Hope this helped,

Hugo

On 5/3/07, Yohan Yudanara <[EMAIL PROTECTED]> wrote:


What is the difference between accessing HttpSession directly using this
injection:


and using hivemodule.xml state-object like this:






Is there any advantages and disadvantages?
Which one is recommended?

Thanks..









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




[T5] Tree component and recursive component ?

2007-05-03 Thread Francois Armand
Hello everybody,

I'm a beginner with Tapestry (and T5), and test it as a possible
framework for a futur application. 

I have tested T5 for 3 days and for now, I'm really impressed by it. But
I came to my first real problem (all others are related with the lack of
documentation, which is quite normal for an alpha release).

My application deals with LDAP directories, so I need to managed tree
structures all the time. But I saw that recursive component are not
allowed in T5, I think it is due to the "Principal 1 -- Static
Structure" of T5.

So, my question is : is there a way of implementing recursive
component ? If not, is there an existing component implementing a
non-recursive tree walk ? And if not, have you some advices about doing
such a component in T5 (say I know an algorithm for non-recursive tree
walk, what are the best practice in T5 ?)

Thanks you for your work, it's already quite impressive, and I hope it
will continue in this path. 

A last remark from a new tapestry(ies ?) user : it's a bit disturbing to
have 3 or 4 version of tapestry cohabiting, compatible or perhaps
not... 
It's a pain to find valid information, or just to find where to look.
Ok, Tapestry already has a (great) history, but T5 is something really
new, different and exiting. I think it would be great that T5 will be
clearly presented as that, with its own user list, community, wiki, etc,
and not as just a new version of an old framework (even if this old
framework was a breakthrough one, because t5 is a new breakthrough,
isn't it ?) 
But well, it's just my user point of view ;)

Francois


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



Tacos 4.1.0-SNAPSHOT, maven, eclipse

2007-05-03 Thread Borut Bolčina

I guess it is Maven related, but checking out

svn checkout https://svn.sourceforge.net/svnroot/tacos/tacos-4.1/trunk/
tacos-project

and running

mvn eclipse:eclipse

doesn't generate a valid eclipse project (project files are
generated). I can't import it as an existing eclipse project. Can
anyone try this?

I want to have a look at tree component. Any suggestions on how to
create a tree like this
http://www.flickr.com/photos/[EMAIL PROTECTED]/414492659/

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