[
https://issues.apache.org/jira/browse/CLK-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12693557#action_12693557
]
Bob Schellink commented on CLK-508:
-----------------------------------
Agreed we have to be careful on this one.
However just to highlight where I think this change would be useful:
1) Its more predictable. For example if you add the ActionLink to the Form the
link will be rendered but its listener won't fire, but if you add the link to
the Page and use Velocity template layout to render the link inside the Form,
the link listener is fired. What I mean here is that we cannot stop a user from
rendering the link inside the Form, just make it more difficult.
2) AutoCompleteTextField highlights the problem very well. To make it work we
need to add the Field to the Page so it can be processed on Ajax requests.
Further if a AutoCompleteTextField, say "postCode", is added to two different
forms on the same page, the Page will throw an exception when the second
"postCode" field is added to the page.
3) A complex component such as CheckboxTree becomes awkward to use because it
combines GET/POST behavior in the same control. To make things work a custom
Form must be created which overrides the Form#onProcess behavior. See
CheckboxTreeForm here [1] for the workaround.
[1]:
http://www.avoka.com/click-examples/source-viewer.htm?filename=WEB-INF/classes/org/apache/click/examples/page/tree/CheckboxTreePage.java
> Move isFormSubmission check to Field
> ------------------------------------
>
> Key: CLK-508
> URL: https://issues.apache.org/jira/browse/CLK-508
> Project: Click
> Issue Type: Improvement
> Components: core, extras
> Reporter: Bob Schellink
> Assignee: Bob Schellink
> Fix For: 2.1.0
>
>
> Currently Form determines whether its child controls should be processed
> based on whether Form was submitted or not. This restriction works well for
> Fields, however problems arise when adding components such as ActionLink,
> Tables and Trees which need to be processed even when Form is not submitted.
> Ajax based Fields also has this problem and often need to be added to the
> Page in order to be processed.
> This issue will try and address the problem by introducing a new Field method
> called "canProcess". This method will return true if the Form is submitted or
> if its a Ajax request.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.