Hi Thiago!

Well, I have different entry points to show a different amount of the same type of data. Either I can enter the page
1) using a PK (which results in a list of child entities) or
2) a combination of two PKs (a direct parent / child relation) or
3) an intervall (which directly results in child entities for the intervall having multiple roots) or
4) a search string
5) a.s.o.

This is all reflected in readable URLs.
The data and all componts used on my page are (more or less) the same regardless of the entry path. But to show some details I always use a combination of PKs which I do not have in my activation context for method 1, 3, 4, 5, but I know it from the hibernate objects anyway.

So consider I have a loop to build up my JSON Objects including an eventlink: I have to reset my page state prior eventlink creation which on the other hand destroys my initial onActivate context. So a workaround is something like this:

    push activation context
        reset context in loop and create eventlinks
    pop activation context

or simply a method which allows me to create the eventlink bypassing onPassivate and accepting a "new context object array". I know that this might introduce a different class of errors because the logic of link creation is now spread across different places, but I believe its still easier to deal with compared to modifying a "complex" page state in a loop.

The other way round: I can create PageLinks with arbitrary page activation context objects, why not EventLinks?


Jens

Sorry, I am a non native english speaker as you may have recognized already, hopefully you understand what I mean.


Am 21.08.18 um 23:56 schrieb Thiago H. de Paula Figueiredo:
Hello!

Why do you want to have EventLinks with an activation context different
from the current one? This doesn't look good at first look, to be honest.

On Thu, Aug 16, 2018 at 10:35 AM Jens Breitenstein <mailingl...@j-b-s.de>
wrote:

Hi all!

I use ComponentResources to create my EventLinks. As the page context
(in this example "id") is added to the link onPassivate gets called.
This results in a link like

      /mypage:mycomponent?t:ac=id

Each component context "cc1", "cc2" passed to the createEventLink method
results in a link like

/mypage:mycomponent/cc1/cc2?t:ac=id

My goal is to replace the exisiting ac, means the activation context of
the page which is used in onPassivate to create "arbitrary" eventlinks
like this

/webui/mypage:mycomponent?t:ac=ec1/ec2

without accessing the page members prior link creation. Of course it's
possible to convert the Link to URI / String and perform some string
manipulations, but I wonder if there is a "real Tapestry" solution?


Thanks in advance

Jens





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

Reply via email to