AW: Cross Validation in dynamic Forms

2010-02-16 Thread Dominik Gätjens
Hey, this doesn't work i only get the last textfield. But i guess you are mean 
@InjectComponent instead of @Inject?

My code looks like:








@InjectComponent
private TextField tippHeim;
@InjectComponent
private TextField tippGast;
@Persist
private Map tfMap;
void onAfterSubmit(){
for(Tipp t:tipps){
if(tipp.equals(t)){
tfMap.put(tipp, new 
TextField[]{tippGast,tippHeim});
}
}
}

I checked the onAfterSubmit() with my debugger and find always the two same 
TextField Objects.


Dominik


-Ursprüngliche Nachricht-
Von: Ulrich Stärk [mailto:u...@spielviel.de] 
Gesendet: Dienstag, 16. Februar 2010 15:38
An: Tapestry users
Betreff: Re: Cross Validation in dynamic Forms

Depends on how you are doing the "dynamic" part. If you are looping over your 
textfields, then 
injecting them into the page class should work, e.g.  and "@Inject private TextField foo" should give you the field of 
the current iteration.

Uli

On 16.02.2010 14:34 schrieb Dominik Gätjens:
> Hello List,
>
>
>
> I'm building a dynamic form with textfields on the fly and need to do some 
> cross validation. This all works pretty and i find two fields that are 
> invalid together.
>
> But how can I report this error AND mark both fields as invalid? I don't have 
> a component to call  Form.recordError(field, errorMessage)
>
>
>
> Thanks
>
>
>
> Dominik
>
>
>
>
>
>
>
>

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


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



Re: What websites are using Tapestry 5?

2010-02-16 Thread martijn.list

Michael Martineau wrote:
I'm trying to find a list of websites that use Tapestry 5.  I would like 
to take a look at them and see what sort of things they are able to do 
using Tapestry.  If any of you have a public website that is built on 
Tapestry 5, please send me a link.  


I known Lithium uses T5 for their forum software

http://www.lithium.com/

Lithium is used by large companies like:

RIM: http://supportforums.blackberry.com/t5/Java-Development/bd-p/java_dev)

Lenovo: http://forums.lenovo.com/t5/

HP: http://h30434.www3.hp.com/t5/Welcome-to-the-Forum/ct-p/about


Martijn


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



Re: What websites are using Tapestry 5?

2010-02-16 Thread Robin Komiwes
Hi!

There is Wooki, an open source collaborative book authoring tool.
You can see the demo @wookicentral.com and checkout the source code @
github.com/robink/wooki


Regards,

Robin K.

On Wed, Feb 17, 2010 at 8:24 AM, Michael Martineau
wrote:

> Hi,
>
> I'm trying to find a list of websites that use Tapestry 5.  I would like to
> take a look at them and see what sort of things they are able to do using
> Tapestry.  If any of you have a public website that is built on Tapestry 5,
> please send me a link.  Also, I'm interested to know if you built the
> website using mostly standard "out of the box" components, or did it require
> you to create a lot of custom components?  Did you use the packaged
> prototype/scriptaculous javascript library, or did you use some other
> library?  If you did, was it difficult to connect in?  Did you use hibernate
> or did you use some other ORM?  If you did, was it difficult to connect in?
>
> I'm new to Tapestry and am evaluating whether I want to use it for my next
> project(s).  The component based architecture is very intriguing to me.
>  I've gone through the excellent tutorial which is what grabbed my attention
> the most and got me excited about using Tapestry.  However, for a Tapestry
> beginner, there is a rather large jump from the level the tutorial stops at
> and where the rest of the documentation ends up, with little in between.
>  While Tapestry at face value seems to make things really easy, I also get
> the feeling that it locks a developer into specific technologies unless
> he/she can spend an enormous amount of time really understanding how things
> work in order to customize it to work the way they want.  I know the
> documentation says I can customize things, but how is not very clear.
>
> So before I get too deep, I would like to know if Tapestry 5 CAN be
> customized to do the sorts of things I want to do.  And, I want to know if
> it is EASY to customize.  Thus, reviewing other websites using Tapestry 5
> (with additional feedback requested above) would be a great help.
>
> Thanks,
> Michael Martineau
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


What websites are using Tapestry 5?

2010-02-16 Thread Michael Martineau

Hi,

I'm trying to find a list of websites that use Tapestry 5.  I would like 
to take a look at them and see what sort of things they are able to do 
using Tapestry.  If any of you have a public website that is built on 
Tapestry 5, please send me a link.  Also, I'm interested to know if you 
built the website using mostly standard "out of the box" components, or 
did it require you to create a lot of custom components?  Did you use 
the packaged prototype/scriptaculous javascript library, or did you use 
some other library?  If you did, was it difficult to connect in?  Did 
you use hibernate or did you use some other ORM?  If you did, was it 
difficult to connect in?


I'm new to Tapestry and am evaluating whether I want to use it for my 
next project(s).  The component based architecture is very intriguing to 
me.  I've gone through the excellent tutorial which is what grabbed my 
attention the most and got me excited about using Tapestry.  However, 
for a Tapestry beginner, there is a rather large jump from the level the 
tutorial stops at and where the rest of the documentation ends up, with 
little in between.  While Tapestry at face value seems to make things 
really easy, I also get the feeling that it locks a developer into 
specific technologies unless he/she can spend an enormous amount of time 
really understanding how things work in order to customize it to work 
the way they want.  I know the documentation says I can customize 
things, but how is not very clear.


So before I get too deep, I would like to know if Tapestry 5 CAN be 
customized to do the sorts of things I want to do.  And, I want to know 
if it is EASY to customize.  Thus, reviewing other websites using 
Tapestry 5 (with additional feedback requested above) would be a great help.


Thanks,
Michael Martineau

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



Re: [T5.1] Remembering Search Parameter during Changing Page in Grid

2010-02-16 Thread Yohan Yudanara
Thanks a lot for the solution...
It works..

On Wed, Feb 17, 2010 at 2:10 AM, Thiago H. de Paula Figueiredo
 wrote:
> On Tue, 16 Feb 2010 03:42:30 -0200, Yohan Yudanara
>  wrote:
>
>> Hi..
>
> Hi!
>
>> My question is:
>> can I execute above scenario without persisting searchParam in Session ?
>
> Use the search text as the page activation context. Something like:
>
> public void onActivate(String search) {
>        searchParam = search;
> }
>
> public String onPassivate() {
>        return searchParam;
> }
>
> This way, it's like you're persisting the search param in the URL.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and
> instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

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



Re: Activation context for a component?

2010-02-16 Thread Nathan Kopp
Probably the tip I needed was this:

"When using an EventLink inside a loop, be sure that your event handling
method does not refer to any loop variable either directly or indirectly.
 Especially be cautions of referring to parameters that may have been bound
to any loop variable or a field of a loop variable.  If you avoid referring
to such parameters in the eventlink's event handler (and pass the
information to that method using the context instead), Tapestry will not
attempt to process the parameter binding, and therefore no problem will be
caused by the null loop variable."

I would have found this most easily if it were located in the primary
documentation for either EventLink or Loop in the component reference.

Tapestry's stack trace actually did a good job highlighting the offending
line of code, once I figured out what was happening.

Personally, I think it would be great if there would be a way for the Loop
component to automatically encode loop state into something like the page
activation context and then automatically restore that point-in-time state
when processing the eventlink request.  It would work like a blend of the
page activation context and the formState functionality already in the Loop
component.  However, this feature isn't really necessary as long as
developers use the action context and avoid the "gotcha" that I ran into.

-Nathan



On Tue, Feb 16, 2010 at 10:45 PM, Kalle Korhonen  wrote:

> Nathan, since you invested considerable amount of time debugging a
> case that seems to be just a standard event bubbling behavior, do you
> think that there is anything you'd think the framework or somebody
> could do to make the logical error in your code more visible? I know
> Tapestry documentation has often been blamed and while "everything is
> there", it's scattered - if you knew what you are looking for, you'd
> find it. But on the other side, I don't know how to make it better and
> I'm sure you can see now why the old-timers annoyingly enough just
> kept repeating the same message. So, is this just a case of having to
> learn the tricks of the trade or is there something we could
> collectively do to improve things?
>
> Kalle
>
>
> On Tue, Feb 16, 2010 at 7:18 PM, Nathan Kopp 
> wrote:
> > For future reference... this in fact turned out to be a bug in my code.
> >  Under normal circumstances Tapestry will NOT attempt to perform
> parameter
> > bindings when processing the EventLink.  However, I accidentally left a
> line
> > of code in my event handling method which referenced one of the
> parameters
> > which was bound to the loop variable.  The line of code was purely
> > unnecessary, but it is what caused Tapestry to process the bindings, and
> > thus trigger a null pointer exception.  Once I removed that line of code,
> > Tapestry was able to execute my method without any exceptions.  Many
> thanks
> > to those who offered the recommendations that eventually led me to locate
> my
> > bug and resolve the problem.
> >
> > -Nathan
> >
> >
> >
> > On Tue, Feb 16, 2010 at 9:32 AM, Nathan Kopp  >wrote:
> >
> >>
> >>
> >> On Mon, Feb 15, 2010 at 3:21 PM, Thiago H. de Paula Figueiredo <
> >> thiag...@gmail.com> wrote:
> >>
> >>> On Mon, 15 Feb 2010 03:51:08 -0200, Nathan Kopp <
> >>> nathan0...@nathankopp.com> wrote:
> >>>
> >>>  This looks like a bug in your code, most probably by working in a
> T4-ish
> > way in T5.
> >
> 
>  Well, it's certainly a "bug" in that I'm trying to do something that
> T5
>  doesn't seem to handle out-of-the-box.
> 
> >>>
> >>> I disagree. A bug is something that doesn't work like it should. In
> this
> >>> case, it could be the lack of a feature, not a bug. Or just lack of T5
> >>> experience. :)
> >>
> >>
> >> I have to laugh at the miscommunication happening here.  Otherwise I'd
> get
> >> frustrated.  I was not trying to say it was a bug in Tapestry.  It's a
> "bug
> >> in my code" in the fact that I'm trying to use a nonexistent feature.
>  And
> >> I'm NOT suggesting that T5 should replay loops like T4.  Tapestry has
> moved
> >> beyond that and I have too.  I am fully aware that Tapestry has
> introduced a
> >> number of other features (page activation context, action context, and
> >> formState) to take the place of replaying loops.  I just haven't found
> the
> >> "thing" that handles this particular use case.  It actually might be
> there
> >> but I just don't know.  I do have a lack of T5 experience, as you point
> out.
> >>  So I am asking to see if anyone on this forum can help me to discover
> what
> >> I'm missing.
> >>
> >>
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Re: Activation context for a component?

2010-02-16 Thread Kalle Korhonen
Nathan, since you invested considerable amount of time debugging a
case that seems to be just a standard event bubbling behavior, do you
think that there is anything you'd think the framework or somebody
could do to make the logical error in your code more visible? I know
Tapestry documentation has often been blamed and while "everything is
there", it's scattered - if you knew what you are looking for, you'd
find it. But on the other side, I don't know how to make it better and
I'm sure you can see now why the old-timers annoyingly enough just
kept repeating the same message. So, is this just a case of having to
learn the tricks of the trade or is there something we could
collectively do to improve things?

Kalle


On Tue, Feb 16, 2010 at 7:18 PM, Nathan Kopp  wrote:
> For future reference... this in fact turned out to be a bug in my code.
>  Under normal circumstances Tapestry will NOT attempt to perform parameter
> bindings when processing the EventLink.  However, I accidentally left a line
> of code in my event handling method which referenced one of the parameters
> which was bound to the loop variable.  The line of code was purely
> unnecessary, but it is what caused Tapestry to process the bindings, and
> thus trigger a null pointer exception.  Once I removed that line of code,
> Tapestry was able to execute my method without any exceptions.  Many thanks
> to those who offered the recommendations that eventually led me to locate my
> bug and resolve the problem.
>
> -Nathan
>
>
>
> On Tue, Feb 16, 2010 at 9:32 AM, Nathan Kopp wrote:
>
>>
>>
>> On Mon, Feb 15, 2010 at 3:21 PM, Thiago H. de Paula Figueiredo <
>> thiag...@gmail.com> wrote:
>>
>>> On Mon, 15 Feb 2010 03:51:08 -0200, Nathan Kopp <
>>> nathan0...@nathankopp.com> wrote:
>>>
>>>  This looks like a bug in your code, most probably by working in a T4-ish
> way in T5.
>

 Well, it's certainly a "bug" in that I'm trying to do something that T5
 doesn't seem to handle out-of-the-box.

>>>
>>> I disagree. A bug is something that doesn't work like it should. In this
>>> case, it could be the lack of a feature, not a bug. Or just lack of T5
>>> experience. :)
>>
>>
>> I have to laugh at the miscommunication happening here.  Otherwise I'd get
>> frustrated.  I was not trying to say it was a bug in Tapestry.  It's a "bug
>> in my code" in the fact that I'm trying to use a nonexistent feature.  And
>> I'm NOT suggesting that T5 should replay loops like T4.  Tapestry has moved
>> beyond that and I have too.  I am fully aware that Tapestry has introduced a
>> number of other features (page activation context, action context, and
>> formState) to take the place of replaying loops.  I just haven't found the
>> "thing" that handles this particular use case.  It actually might be there
>> but I just don't know.  I do have a lack of T5 experience, as you point out.
>>  So I am asking to see if anyone on this forum can help me to discover what
>> I'm missing.
>>
>>
>

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



Re: Activation context for a component?

2010-02-16 Thread Nathan Kopp
For future reference... this in fact turned out to be a bug in my code.
 Under normal circumstances Tapestry will NOT attempt to perform parameter
bindings when processing the EventLink.  However, I accidentally left a line
of code in my event handling method which referenced one of the parameters
which was bound to the loop variable.  The line of code was purely
unnecessary, but it is what caused Tapestry to process the bindings, and
thus trigger a null pointer exception.  Once I removed that line of code,
Tapestry was able to execute my method without any exceptions.  Many thanks
to those who offered the recommendations that eventually led me to locate my
bug and resolve the problem.

-Nathan



On Tue, Feb 16, 2010 at 9:32 AM, Nathan Kopp wrote:

>
>
> On Mon, Feb 15, 2010 at 3:21 PM, Thiago H. de Paula Figueiredo <
> thiag...@gmail.com> wrote:
>
>> On Mon, 15 Feb 2010 03:51:08 -0200, Nathan Kopp <
>> nathan0...@nathankopp.com> wrote:
>>
>>  This looks like a bug in your code, most probably by working in a T4-ish
 way in T5.

>>>
>>> Well, it's certainly a "bug" in that I'm trying to do something that T5
>>> doesn't seem to handle out-of-the-box.
>>>
>>
>> I disagree. A bug is something that doesn't work like it should. In this
>> case, it could be the lack of a feature, not a bug. Or just lack of T5
>> experience. :)
>
>
> I have to laugh at the miscommunication happening here.  Otherwise I'd get
> frustrated.  I was not trying to say it was a bug in Tapestry.  It's a "bug
> in my code" in the fact that I'm trying to use a nonexistent feature.  And
> I'm NOT suggesting that T5 should replay loops like T4.  Tapestry has moved
> beyond that and I have too.  I am fully aware that Tapestry has introduced a
> number of other features (page activation context, action context, and
> formState) to take the place of replaying loops.  I just haven't found the
> "thing" that handles this particular use case.  It actually might be there
> but I just don't know.  I do have a lack of T5 experience, as you point out.
>  So I am asking to see if anyone on this forum can help me to discover what
> I'm missing.
>
>


Re: ActivationContext for a component

2010-02-16 Thread Nathan Kopp
Wow... You were absolutely correct that I was making this more complicated
than it needed to be.  It turns out that when I tested the version with the
eventlink context, I accidentally left a line of code in the event method
that caused Tapestry to do a parameter binding to the loop variable.  It
turns out that Tapestry is actually smart enough to not attempt the
parameter unless it is requested... which means that it stopped generating
the exception when I removed the offending line of code.  Doh!  I wish I
would have seen that a few days ago!

With that line of code removed, your suggested solution works perfectly, as
expected... without the need for the code I wrote below.

Thanks much for your help and patience!!!

-Nathan


On Tue, Feb 16, 2010 at 10:01 AM, Nathan Kopp wrote:

> Thanks for the suggestion.  This looks like a great idea, but it didn't
> work for me exactly as-is.  I still get an NPE when Tapestry is trying to
> bind component parameters in the level just above ViewDonkeyInlineEdit.
>
> The point of code with the problem is where I'm passing
>
> in Test.tml.  When Tapestry tries to process this parameter binding when
> attempting to fire my startEditDonkey event, it sees that fooLoopVar is
> null, so I get the NPE.  I need to get fooLoopVar to be NOT NULL when T5 is
> processing the parameter binding.
>
> This did get me to think of another possible solution, though.  I could use
> your suggestion of a context parameter, but also make a change to Test.java:
>   
> becomes
>   
>
> Then add this to Test.java:
>   public getFooLoopVarDotDonkey() { if(fooLoopVar!=null) return
> fooLoopVar.getDonkey() else return null; }
>
> This will allow Tapestry to process the parameter binding without hitting a
> null pointer exception and thus allow it to actually trigger my event code
> so that I can actually retrieve the donkey using the ID passed in the
> EventLink's action context.
>
> I'll test this out and let you know how it works.
>
> -Nathan
>
>
> On Mon, Feb 15, 2010 at 3:32 PM, Thiago H. de Paula Figueiredo <
> thi...@arsmachina.com.br> wrote:
>
>> Try this:
>>
>> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd";
>> xmlns:p="tapestry:parameter">
>>Donkey's name: ${donkey.name}
>>
>>
>>
>>Description: 
>> > event="cancelEditDonkey">Cancel
>>
>>
>>Description: ${donkey.descr} > event="startEditDonkey" context="donkey.id">Edit
>>
>>
>> 
>>
>> The only differences here are the use of the context parameter to Form and
>> EventLink. You can replace id by any field or info that is unique for all
>> donkeys.
>>
>> public class ViewDonkeyInlineEdit
>> {
>>@Property @Parameter private Donkey donkey;
>>@Persist @Property private Donkey editDonkey;
>>public boolean isEditing() {
>>return (editDonkey!=null &&
>> editDonkey.getName().equals(donkey.getName()));
>>}
>>public void onStartEditDonkey(Integer id) {
>>// get donkey by id and do any processing needed.
>>}
>>public void onSaveEditDonkey(Integer id) {
>>// get donkey by id
>>donkey.setDescr(editDonkey.getDescr());
>>editDonkey = null;
>>}
>>public void onCancelEditDonkey()  {
>>editDonkey = null;
>>}
>> }
>>
>> By the way, I guess you don't need to @Persist the editDonkey field.
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
>> and instructor
>> Owner, software architect and developer, Ars Machina Tecnologia da
>> Informação Ltda.
>> http://www.arsmachina.com.br
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>


Re: integrating a web services stack

2010-02-16 Thread Piero Sartini
> That would be for RESTful web services only. Did you ever have to expose a
> service via SOAP?

You are right, this is useful for RESTful services only. Never had to
expose a SOAP service within a pure tapestry application, but a few
where I am doing this from an EJB backend. But that's overkill if you
don't have it in place already.

 Piero

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



Re: integrating a web services stack

2010-02-16 Thread Ulrich Stärk

That would be for RESTful web services only. Did you ever have to expose a 
service via SOAP?

Uli

On 16.02.2010 20:40 schrieb Piero Sartini:

Which solution are you using and why? Are there others I haven't thought of?


I am using tapestry-resteasy if I need to make a service available.

  Piero

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



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



Re: integrating a web services stack

2010-02-16 Thread Piero Sartini
> Which solution are you using and why? Are there others I haven't thought of?

I am using tapestry-resteasy if I need to make a service available.

 Piero

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



integrating a web services stack

2010-02-16 Thread Ulrich Stärk

Hi folks,

I'd like to know how you are integrating a web services stack to expose services used by your pages 
as a web service. For me there are several options:


1. Most stacks come with a servlet that handles requests to the web services. One could write a 
wrapper around that servlet and contribute that to one of Tapestrys handler pipelines to handle 
requests to web service URLs.


2. Let the servlet run "as is" inside the web container and get the service implementations from the 
registry that is stored in the ServletContext.


3. Integrate the web service stack with Spring and expose Tapestry services as 
Spring beans.

Which solution are you using and why? Are there others I haven't thought of?

Cheers,

Uli

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



Re: [T5.1] Remembering Search Parameter during Changing Page in Grid

2010-02-16 Thread Thiago H. de Paula Figueiredo
On Tue, 16 Feb 2010 03:42:30 -0200, Yohan Yudanara  
 wrote:



Hi..


Hi!


My question is:
can I execute above scenario without persisting searchParam in Session ?


Use the search text as the page activation context. Something like:

public void onActivate(String search) {
searchParam = search;
}

public String onPassivate() {
return searchParam;
}

This way, it's like you're persisting the search param in the URL.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.

http://www.arsmachina.com.br

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



Re: Page render & event URLs with large optional context parameter

2010-02-16 Thread Kalle Korhonen
If you have a limited number of pagelinks referring to the same page,
maybe you could just contruct them by hand and just return null in
onPassivate. I.e. store the initial context to @Property
initialContext and then render the page links with  - would that work?

Kalle


On Tue, Feb 16, 2010 at 9:54 AM, Blower, Andy
 wrote:
> I may have enquired about this a while back, but I put it on the back burner 
> and am only just returning to it now.
>
> Basically I have a page with an activation context which is not bookmarkable 
> (relies on session info) without an extra parameter in the activation context 
> which contains all the info that allows the page to be regenerated without 
> the original session. This works fine, but the issue is that the string is 
> very long and it gets added to every event link on the page even though it's 
> completely useless except once the session has the info in it - if the 
> session times out and then one of the event links is clicked there's a 
> dispatcher to detect & redirect to a session ended page with a login page 
> following. So, it's only really useful in page render URL's that appear in 
> the browser location box and can be bookmarked.
>
> Why worry about it, well, it increases the page size by 15-20%. That's a lot 
> and I want to come up with a way of only having this context param in page 
> render URL's. The page's activation handles it being present or not 
> perfectly, I'm just not sure how to make the context that passivate returns 
> conditional on the type of link being generated. My only idea so far is to 
> use call stack introspection to see where the method was called from, but I'd 
> rather not - seems quite horrible.
>
> Anyone have any (more elegant and Tapestry-ish) ideas?
>
> Thanks,
>
> Andy Blower.
>

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



Page render & event URLs with large optional context parameter

2010-02-16 Thread Blower, Andy
I may have enquired about this a while back, but I put it on the back burner 
and am only just returning to it now.

Basically I have a page with an activation context which is not bookmarkable 
(relies on session info) without an extra parameter in the activation context 
which contains all the info that allows the page to be regenerated without the 
original session. This works fine, but the issue is that the string is very 
long and it gets added to every event link on the page even though it's 
completely useless except once the session has the info in it - if the session 
times out and then one of the event links is clicked there's a dispatcher to 
detect & redirect to a session ended page with a login page following. So, it's 
only really useful in page render URL's that appear in the browser location box 
and can be bookmarked.

Why worry about it, well, it increases the page size by 15-20%. That's a lot 
and I want to come up with a way of only having this context param in page 
render URL's. The page's activation handles it being present or not perfectly, 
I'm just not sure how to make the context that passivate returns conditional on 
the type of link being generated. My only idea so far is to use call stack 
introspection to see where the method was called from, but I'd rather not - 
seems quite horrible.

Anyone have any (more elegant and Tapestry-ish) ideas?

Thanks,

Andy Blower.


[T5.1] Request to Application Root path ignores t5 filters

2010-02-16 Thread Everton Agner
Hi,

I've noticed a weird behavior in two different T5.1 applications.

I've made a ComponentRequestFilter to handle Locale issues... And if I request 
[ /t5app/Start ]  page, my Filter code is executed. But, if I request the 
Application Root path [ /t5app or /t5app/ ] it ignores the Filter and avoids it.

Is that normal?

One more thing... Tapestry automatically knows if there is a Start page or a 
Index page? Or only the Start page (so I should change the @Symbol value 
related to it)?

Thanks!

Everton



  

Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: ActivationContext for a component

2010-02-16 Thread Nathan Kopp
Thanks for the suggestion.  This looks like a great idea, but it didn't work
for me exactly as-is.  I still get an NPE when Tapestry is trying to bind
component parameters in the level just above ViewDonkeyInlineEdit.

The point of code with the problem is where I'm passing
   
in Test.tml.  When Tapestry tries to process this parameter binding when
attempting to fire my startEditDonkey event, it sees that fooLoopVar is
null, so I get the NPE.  I need to get fooLoopVar to be NOT NULL when T5 is
processing the parameter binding.

This did get me to think of another possible solution, though.  I could use
your suggestion of a context parameter, but also make a change to Test.java:
  
becomes
  

Then add this to Test.java:
  public getFooLoopVarDotDonkey() { if(fooLoopVar!=null) return
fooLoopVar.getDonkey() else return null; }

This will allow Tapestry to process the parameter binding without hitting a
null pointer exception and thus allow it to actually trigger my event code
so that I can actually retrieve the donkey using the ID passed in the
EventLink's action context.

I'll test this out and let you know how it works.

-Nathan


On Mon, Feb 15, 2010 at 3:32 PM, Thiago H. de Paula Figueiredo <
thi...@arsmachina.com.br> wrote:

> Try this:
>
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
> "
> xmlns:p="tapestry:parameter">
>Donkey's name: ${donkey.name}
>
>
>
>Description: 
>  event="cancelEditDonkey">Cancel
>
>
>Description: ${donkey.descr}  event="startEditDonkey" context="donkey.id">Edit
>
>
> 
>
> The only differences here are the use of the context parameter to Form and
> EventLink. You can replace id by any field or info that is unique for all
> donkeys.
>
> public class ViewDonkeyInlineEdit
> {
>@Property @Parameter private Donkey donkey;
>@Persist @Property private Donkey editDonkey;
>public boolean isEditing() {
>return (editDonkey!=null &&
> editDonkey.getName().equals(donkey.getName()));
>}
>public void onStartEditDonkey(Integer id) {
>// get donkey by id and do any processing needed.
>}
>public void onSaveEditDonkey(Integer id) {
>// get donkey by id
>donkey.setDescr(editDonkey.getDescr());
>editDonkey = null;
>}
>public void onCancelEditDonkey()  {
>editDonkey = null;
>}
> }
>
> By the way, I guess you don't need to @Persist the editDonkey field.
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, software architect and developer, Ars Machina Tecnologia da
> Informação Ltda.
> http://www.arsmachina.com.br
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


Res: Grid get objects from current page

2010-02-16 Thread Everton Agner
I had to do this and I tried to get the objects from the model using the 
getAvailableRows() and getRow() method... but it turned out that the model 
refers to all of them... So, it freaked out with Indexes.

My GridDataSource implementation had a List result object that refers 
to the objects loaded on the "prepare" method. So, I've just made a getter for 
it and it worked. :)

But, I don't really know if this turn out to be a workaround or not.




De: blueboy6 
Para: users@tapestry.apache.org
Enviadas: Segunda-feira, 15 de Fevereiro de 2010 20:26:19
Assunto: Grid get objects from current page


Hi guys,

I have one problem and I'm not sure how to solve it, so here it goes.


I have large set of objects(markers) and I'm using grid to show them on the
page. I want to display that data in Map that is on same page, but only data
of objects that I can see in that moment in grid. 

So elementary I want to get objects or their ID's from grid from that page
that is currently active...(page 3 that is active in pager)


Any ideas, and any help is appreciated

Tnx
Bojan Cincur
-- 
View this message in context: 
http://old.nabble.com/Grid-get-objects-from-current-page-tp27601046p27601046.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


  

Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com

Re: Cross Validation in dynamic Forms

2010-02-16 Thread Ulrich Stärk
Depends on how you are doing the "dynamic" part. If you are looping over your textfields, then 
injecting them into the page class should work, e.g. /> and "@Inject private TextField foo" should give you the field of the current iteration.


Uli

On 16.02.2010 14:34 schrieb Dominik Gätjens:

Hello List,



I'm building a dynamic form with textfields on the fly and need to do some 
cross validation. This all works pretty and i find two fields that are invalid 
together.

But how can I report this error AND mark both fields as invalid? I don't have a 
component to call  Form.recordError(field, errorMessage)



Thanks



Dominik










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



Re: Activation context for a component?

2010-02-16 Thread Nathan Kopp
On Mon, Feb 15, 2010 at 3:21 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Mon, 15 Feb 2010 03:51:08 -0200, Nathan Kopp 
> wrote:
>
>  This looks like a bug in your code, most probably by working in a T4-ish
>>> way in T5.
>>>
>>
>> Well, it's certainly a "bug" in that I'm trying to do something that T5
>> doesn't seem to handle out-of-the-box.
>>
>
> I disagree. A bug is something that doesn't work like it should. In this
> case, it could be the lack of a feature, not a bug. Or just lack of T5
> experience. :)


I have to laugh at the miscommunication happening here.  Otherwise I'd get
frustrated.  I was not trying to say it was a bug in Tapestry.  It's a "bug
in my code" in the fact that I'm trying to use a nonexistent feature.  And
I'm NOT suggesting that T5 should replay loops like T4.  Tapestry has moved
beyond that and I have too.  I am fully aware that Tapestry has introduced a
number of other features (page activation context, action context, and
formState) to take the place of replaying loops.  I just haven't found the
"thing" that handles this particular use case.  It actually might be there
but I just don't know.  I do have a lack of T5 experience, as you point out.
 So I am asking to see if anyone on this forum can help me to discover what
I'm missing.

Please don't get defensive and think that I'm blaming T5.  I really like T5.
 But I need to get my code to work.


>
>  First, I need to rely on a loop variable.  Period.  The component exists
>> in the context of one iteration of the loop.  Without the loop variable, the
>> component wouldn't need to exist.
>>
>
> I didn't meant to remove the loop variable, just not using it when handling
> events.


And how do you propose I do that?  I'm NOT using the loop variable for
handling events in my Java code.  The NPE is happening not in my code but
rather in the middle of T5's processing of the component tree and handling
parameter bindings in preparation for triggering the event from th
eventlink.  I'm using the loop variable inside the TML file as part of
passing a parameter to a component.  There's no way around that, as far as I
can see, though I am open to suggestions.


>
>  I'll rephrase my problem like this: "I
>> need to rely on the loop variable, but it is null when tapestry processes
>> the click from the eventlink, so I need to find a way to make it not null
>> while tapestry processes that eventlink click... and specifically make it
>> equal the a value for a specific iteration through the loop... the
>> iteration that was occurring at the time the eventlink was being rendered."
>>
>
> You'll won't have a nice solution for that because, in an event request,
> the loop is not rerendered, so the loop variable is not set. That's how T5
> works. You need to find the solution in another way, most probably using the
> context of an EventLink.
>

As stated before, the context for the eventlink doesn't seem to solve the
problem.  I already tried.  My event method isn't even being reached,
because the NPE happens in the middle of Tapestry's code (parameter binding)
before Tapestry can get a chance to fire my event.  I need to find a way to
make the variable NOT NULL so that Tapestry is able to process all of the
necessary parameter bindings so that it can fire my event... only then can I
start thinking about the action context for the eventlink.


>
>  3) context for eventlink, actionlink, and form;
>> #3 wont' work because my loop is not happening at the evenlink level, but
>> rather at an intermediate level
>>
>
> There's no such thing as an EventLink level. Events bubble from inside to
> outside. Just pass all the needed info in the context. Inside your
> component, create an event handler method for the event.
>

Understood.  That's what I meant to say... "the level of the component into
which the EventLink is placed"... but that was really long so I wrote
"eventlink level" instead.  I already tried this suggestion and it didn't
work.  Trust me, please.  I really did try all of these things with real
code before saying that they didn't work.  I'm not just assuming that they
won't work... I actually really did try them all.  :-)


> And don't forget that the EventLink context is independent from the page
> activation context. ComponentEventRequestParameters has two contexts: the
> page one (getPageActivationContext) and the event one ().


Understood.  That's why I mentioned both (#2 and #3) separately.  I'm well
aware that they are separate.

Please don't misunderstand the tone here... I am extremely grateful for the
desire to help me find a solution.  I love the fact that Tapestry has a
great community of users who are willing to give time to help.  But I do
know at least a bit of what I'm talking about.  I'm not looking for an RTFM
answer.  I've already read the manuals.  I've read some of the JavaDocs.
 I've read tutorials.  I've even looked at Tapestry's internal source code.
 I understand the concepts of T5 and how

Launched Yardsellr with T5.1

2010-02-16 Thread Daniel Leffel
We wanted to share with the mail list that we've launched Yardsellr using
T5.1 (also using Spring/Hibernate).

http://yardsellr.com

Also, we're interested in hiring one or two engineers who know how to make
rocking tapestry apps. Full-time or on contract would be considered- contact
j...@yellowdogmedia.com.


-- 
YellowDog Media
yardsellr.com | yellowdogmedia.com


Cross Validation in dynamic Forms

2010-02-16 Thread Dominik Gätjens
Hello List,

 

I'm building a dynamic form with textfields on the fly and need to do some 
cross validation. This all works pretty and i find two fields that are invalid 
together. 

But how can I report this error AND mark both fields as invalid? I don't have a 
component to call  Form.recordError(field, errorMessage)

 

Thanks

 

Dominik

 

 

 



Re: [T5.1] Remembering Search Parameter during Changing Page in Grid

2010-02-16 Thread Joost Schouten (ml)
Use the code below. It will not use a session and encode the value in 
your urls.


Cheers,
Joost

private String searchTerm;

@OnEvent(value = EventConstants.ACTIVATE)
private void activate(String searchTerm) {
   this.searchTerm = searchTerm;
}

@OnEvent(value = EventConstants.PASSIVATE)
private Object passivate() {
   return this.searchTerm;
}



Muhammad Mohsen wrote:

I'm no expert in tapestry and I'm not sure if I got your question right, but
either ways I'll try to help.

1.try using use "@Persist" without specifying that it's a session scoped
persistence. (assuming you are using tapestry 5)
2.refer to the "hilo" tutorial here on
tapestry.
See it through till the end, I'm sure you'll find what you're looking for
god willing.

On Tue, Feb 16, 2010 at 7:42 AM, Yohan Yudanara wrote:

  

Hi..

I'd like to ask a question which seems to be basic question, but I
can't find it on this mailing list archives and wiki.

I have a page with textfield, "search" button, and grid to display
search result:
  

Let's say the search returned 60 rows, and the grid display the first 25
rows.
If I click link to second page to display next 25 rows, the search
result is displayed correctly if I was using session (not FLASH) to
save searchParam, like this:
@Persist(PersistenceConstants.SESSION)
private String searchParam;

My page class executing search query to return GridDataSource object
on setupRender() method.

My question is:
can I execute above scenario without persisting searchParam in Session ?

Thanks in advance.

Regards,
Yohan Yudanara

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






  



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



Re: [T5.1] Remembering Search Parameter during Changing Page in Grid

2010-02-16 Thread Muhammad Mohsen
I'm no expert in tapestry and I'm not sure if I got your question right, but
either ways I'll try to help.

1.try using use "@Persist" without specifying that it's a session scoped
persistence. (assuming you are using tapestry 5)
2.refer to the "hilo" tutorial here on
tapestry.
See it through till the end, I'm sure you'll find what you're looking for
god willing.

On Tue, Feb 16, 2010 at 7:42 AM, Yohan Yudanara wrote:

> Hi..
>
> I'd like to ask a question which seems to be basic question, but I
> can't find it on this mailing list archives and wiki.
>
> I have a page with textfield, "search" button, and grid to display
> search result:
>t:id="search" value="Search" />
>
> Let's say the search returned 60 rows, and the grid display the first 25
> rows.
> If I click link to second page to display next 25 rows, the search
> result is displayed correctly if I was using session (not FLASH) to
> save searchParam, like this:
> @Persist(PersistenceConstants.SESSION)
> private String searchParam;
>
> My page class executing search query to return GridDataSource object
> on setupRender() method.
>
> My question is:
> can I execute above scenario without persisting searchParam in Session ?
>
> Thanks in advance.
>
> Regards,
> Yohan Yudanara
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Muhammad Mohsen Hussien
Jr. Java Software Engineer
HP Enterprise Services