[ 
https://issues.apache.org/jira/browse/TAPESTRY-1457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507740
 ] 

Howard M. Lewis Ship commented on TAPESTRY-1457:
------------------------------------------------

For PageLink, if you bind the context (to null) then the page link will be 
created with an empty context.  

That is, the override method parameter is set to true if the context component 
parameter is bound (even if bound to null). A null value is converted to an 
empty array.  With override set to true, the target page will not be consulted 
(via the passivate event) for the context, the provided, empty context will be 
used.

This is slightly different from the initial description.  Of course, you can 
bypass PageLink and generate the Link in code if this isn't precisely what you 
want.



> No way for PageLink to distinguish between an explicitly empty page activate 
> context and normal delegation to the target page's passivate event
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1457
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1457
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Core Components
>    Affects Versions: 5.0.3
>            Reporter: Peter
>            Assignee: Howard M. Lewis Ship
>             Fix For: 5.0.5
>
>
> It isn't possible to set an empty context using 'contex' parameter of 
> PageLink. It always treats null and zero length array/list in the same way - 
> asks the page about its activation context via onPassivate. I think that only 
> null should trigger onPassivate.
> Example
> <a t:type="PageLink" page="test" context="context">page link</a>
> public Object[] getContext()
> {
>       if (test == 0)
>               return new Object[] {"1", "2"}; // context will be ../test/1/2
>       else
>               if (test == 1)
>                       return new Object[0];   // onPassivate will be asked 
> but context should be empty IMO
>               else
>                       return null;    // onPassivate will be asked, ok
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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

Reply via email to