Hi Ken,

On Tue, May 21, 2013 at 7:25 AM, Ken in Nashua <kcola...@live.com> wrote:

> tHANKS gEOFF...
>
> bUT it tell sme I have a serious problem onmy hands
>
> the output is not matching the input
>
> I dont know what to do
>
>
Just make the output match the input:

Here's your output:

 @OnEvent(EventConstants.PASSIVATE)
    Object[] passivate() {
        return new Object[] { team, team.getId(), this };
    }

and your input should be:

void onActivate(Object team, Long teamId, Object someInstance)
{
 ...
}

But, you don't need all this, because you don't understand something...

I have seen this months ago tryign to create CRUD pages.
>
> Maybe it has to do with the routing features of tynamo? I dont know...
>
> Here is the routing feature
>
> @At("/{2}/{0}/{1}")
> public class RosterQuery implements ExceptionReporter {
>
> the annotation allows me to specify which array subscript (depending on
> how many you are employing in onPassivate.. if it is an array) gets
> positioned on the URL from between transmission onPassivate and onActivate.
>
>

You don't need it, just don't use @At here.

Use tapestry defaults (at least just for now until you get all your
application working and you will want to make your urls prettier with @At).



> kool tool... but I think i uncovered a bug in it.
>

The above routing scheme gets me what I want...
>
>     @OnEvent(EventConstants.PASSIVATE)
>     Object[] passivate() {
>         return new Object[] { team, team.getId(), this };
>     }
>
>
> http://localhost:8080/org.tynamo.examples.pphl.pages.RosterQuery$00401b6140d/2/2
>
>
Most of this URL is useless.

Look at this:

org.tynamo.examples.pphl.pages.RosterQuery$00401b6140d

this is a encoding result of calling this.toString() -- which as decoded
becomes:

org.tynamo.examples.pphl.pages.RosterQuery@1b6140d

Why do you need this in URL? You can't use this anyhow in java anyway.

What do you think tapestry should do with this?

The other two parameters are 2 and 2. Not sure how you get 2 from
the "team" instance, I believe this is the work of encoders.
And you will always have these two numbers the same here.
Why don't you just remove one from activation context?

So what we have at the end is:

 @OnEvent(EventConstants.PASSIVATE)
    Long passivate() {
        return team.getId();
    }

and your input should be:

void onActivate(Long teamId)
{
    this.team = findTeamById(teamId);
    // you're already in context of "this" instance, so you don't need to
pass "this" in onPassivate.
}

and that url gets me to stay on the same RosterQuery page that I intended
> to stay on after table gets rendered.
>
> Not sure what to make of the garble
>
> But I dont like the idea that everytime onActivate gets triggered... its
> formal parameter is NULL
>
>
Again, what do you expect if you don't play the rules?

You can declare your onActivate like this:

void onActivate(EventContext context)
{
    // and context will never be null in this case -- why didn't you use
this?
}



>
> ░░░░░░░░░░░░░░░░░▒█████████▓░░░░░░░░░░░░░░░░░
> ░░░░░░░░░░░░░░░▓██████████████▒░░░░░░░░░░░░░░
> ░░░░░░░░░░░░░▒████▓▒░░░░░░▒▓████▒░░░░░░░░░░░░
> ░░░░░░░░░░░░████▒░░░░░░░░░░░░▒████░░░░░░░░░░░
> ░░░░░░░░░░░███▒░░░░░░░░░░░░░░░░▒███░░░░░░░░░░
> ░░░░░░░░░░███░░░░░░░░░░░░░░░░░░░░███░░░░░░░░░
> ░░░░░░░░░██▓░░░░░░░░░░░░░░░░░░░░░░███░░░░░░░░
> ░░░░░░░░██▓░░░░░░░░░░░░░░░░░░░░░░░░▓██░░░░░░░
> ░░░░░░░██▓░░░░░░░░░░░░░░░░░░░░░░░░░░███░░░░░░
> ░░░░░░███░░░░░▒░▒░▒░░░░░░░▒░▒░▒░▒░░░░██▓░░░░░
> ░░░░░▒██░▒░▒▒▒▒▒░▒░▒░▒░▒░▒░▒░▒▒▒▒▒░░░░██░░░░░
> ░░░░░██░░░▒▒▒▒▒▒▒▒▒░▒░▒░▒░▒░▒▒▒▒▒▒▒▒▒░▒██░░░░
> ░░░░██▓░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░██▒░░░
> ░░░░██░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░██░░░
> ░░░██▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░▓█▓░░
> ░░░██░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░▒███░░██░░
> ░░▓█▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▒██████▓░▓█▒░
> ░░██░▒▒░░░▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░▓█████████▓░██░
> ░░██░░▒▓▒▒░░░░░░░▒▒▒▒▒▒▒░░░░███████████▓▒░██░
> ░▓█▒░░████████▓▒░░░░░░▒░░░████████▓██▒░░▒░▓█░
> ░██░░█████████████▓▒░░░░████████░░░░█▓▒▒▒▒▒█▓
> ░██░▓████████████████▓▒█████████▒░░░█▓▒▒▒▒░██
> ▒█▓░▒▓▓██░░▒██████████▒█████████▒░░░█▓▒▒▒▒░██
> ▓█▒░▒░▒██░░░███████▓█▓░█▒▓█░▓███▒░░░█▓▒▒▒▒▒▓█
> ██▒▒▒▒▒██░░░██░████░▓▓░▓▓░█████▓░░░▒█▒▒▒▒▒▒▒█
> ██░▒▒▒▒██░░░▓█████▓░█▒░▓█░▒███▓░░░░▓█▒▒▒▒▒▒▒█
> ██░▒▒▒░██░░░░▓███▓░░█▒▒▒█▒░░░░░░░░▒█▓▒▒▒▒▒▒▒█
> ██░▒▒▒▒▓█▒░░░░▒▒▒░░▓█░▒▒▓█▒░░░░░░░██░▒▒▒▒▒▒▒█
> ██░▒▒▒▒▒██░░░░░░░░▒█▒▒▒▒░▓█▓░░░░▒██▒▒▒▒▒▒▒▒▒█
> ██▒▒▒▒▒░▒██░░░░░░▒█▓▒▒▒▒▒░▒██▓▓██▓░▒▒▒▒▒▒▒▒▒█
> ██▒▒▒▒▒▒░▓██▒▒▒▒▓█▓░▒▒▒▒▒▒░▒▒▓▓▒░░▒▒▒▒▒▒▒▒▒▓█
> ▓█▓▒▒▒▒▒▒░▒▓████▓▒░▒▒▒▒▒▒▒▒▒▒░░░▒▒▒▒▒▒▒▒▒▒▒██
> ░██▒▒▒▒▒▒▒░░▒▒▒▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░██
> ░██░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒█▓
> ░▓█▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓█░
> ░░██▒▒▒▒▒▒▒▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██░

░░██▒▒▒▒▒▒▒▒▒▒██░▒▒▒▒▒▒▒▒▒▒▒▒▒░▓▓▒▒▒▒▒▒▒▒▒██░

░░▒██▒▒▒▒▒▒▒▒▒▒██▓░░▒▒▒▒▒▒▒▒▒▒██▒▒▒▒▒▒▒▒▒▒██░

░░░██▒▒▒▒▒▒▒▒▒▒▒███▒░░░░░▒▒▒▓███▒▒▒▒▒▒▒▒▒▓██░

░░░░██▒▒▒▒▒▒▒▒▒▒▒▒███████████▒▒▒▒▒▒▒▒▒▒▒██░░░

░░░░▓██▒▒▒▒▒▒▒▒▒▒▒░▒▓█████▓▒░▒▒▒▒▒▒▒▒▒▒██▒░░░
> ░░░░░███▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▒▒▒▒▒▒▒██▓░░░░

░░░░░░███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███░░░░░
> ░░░░░░░███▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓███░░░░░░
> ░░░░░░░░████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓███▓░░░░░░░
> ░░░░░░░░░▒████▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓████░░░░░░░░░
> ░░░░░░░░░░░▓█████▓▒▒▒▒▒▒▒▒▒▒▓█████▓░░░░░░░░░░
> ░░░░░░░░░░░░░▓██████████████████▒░░░░░░░░░░░░
> ░░░░░░░░░░░░░░░░▒███████████▓▒░░░░░░░░░░░░░░░
>



-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Reply via email to