You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Markus Jung (JIRA)" <ji...@apache.org> on 2011/07/27 23:27:09 UTC

[jira] [Updated] (TAP5-1592) Refactor AjaxFormLoop, RemoveRowLink and AddRowLink to make mixin useful for these components

     [ https://issues.apache.org/jira/browse/TAP5-1592?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Markus Jung updated TAP5-1592:
------------------------------

    Summary: Refactor AjaxFormLoop, RemoveRowLink and AddRowLink to make mixin useful for these components  (was: Provide public getter for the map of initilizer calls of the JavaScriptSupportImpl class)

Since it is not a good approach to expose the initializer call map by a getter I want to explain the background a little bit more. My problem is that I want to use my CSRF protection mixin for the AjaxFormLoop component, especially for the RemoveRowLink component. 

Problem 1 - RemoveRowLink component does not render itself:

The problem with the current design is, that the AjaxFormLoop provides the AjaxFormLoopContext to the RemoveRowLink component. Currently the context contains the logic to create the javascript event link AND it does also the rendering. So basically the rendering of the RemoveRowLink component does not happen in that component and all information used for the render process is stored in the AjaxFormLoop and the AjaxFormLoopContext. I propose to refactor the design and to provide all information required to render the javascript event link in the AjaxFormLoopContext. In this way everything needed to render javascript event links is available in the RemoveRowLink component. By using AOP this information can later be reused, e.g. for mixins. 

Problem 2 - JavaScriptSupport does not allow update of any JSON objects

In my mixin I would like to update rendered javascript event links. I propose an update method that allows doing that for a certain functionName. I have implemented a method that takes a Comparator<JSONObject> object to identify the JSONObject that should be replaced.

I attach a new patch, that demonstrates a possible solution.

  

> Refactor AjaxFormLoop, RemoveRowLink and AddRowLink to make mixin useful for these components
> ---------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1592
>                 URL: https://issues.apache.org/jira/browse/TAP5-1592
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.3
>            Reporter: Markus Jung
>            Priority: Trivial
>              Labels: javascript
>         Attachments: jssupport.diff
>
>
> The AjaxFormLoop component stores the links in the intitializer call map. In order to modify them in a mixin in the afterRender phase, a public getter for the JavaScriptSupport interface and the JavaScriptSupportImpl class is required.
> I need this feature for the cross-site request forgery protection, where I use a mixin to add a token to the rendered event links.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira