You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Leszek Piotrowicz (JIRA)" <ji...@apache.org> on 2010/12/10 12:34:03 UTC
[jira] Created: (CLK-737) Form.replace throws an exception
Form.replace throws an exception
--------------------------------
Key: CLK-737
URL: https://issues.apache.org/jira/browse/CLK-737
Project: Click
Issue Type: Bug
Components: core
Reporter: Leszek Piotrowicz
Priority: Minor
the code below:
Form form = new Form();
Submit submit = new Submit("ok", "ok"); // field of type button
Label label = new Label("lab", "lab"); // field of type other than button
form.add(submit);
form.replace(submit, label);
throws an exception: index out of bounds
the reason is that Form.replace assumes that control is always replaced by control, button by another button etc... which is not always the case
In the above example the function tries to replace submit by label in field list but submit is in button list
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (CLK-737) Form.replace throws an exception
Posted by "Bob Schellink (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-737?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bob Schellink resolved CLK-737.
-------------------------------
Resolution: Invalid
Hi Leszek,
This isn't really the way replace is used. #replace was introduced in 2.2.0 in an attempt to streamline stateful pages where subsequent requests would add the same control into the container. In Click 2.3.0 Stateful pages have been deprecated and as consequence the #replace method as well.
Kind regards
Bob
> Form.replace throws an exception
> --------------------------------
>
> Key: CLK-737
> URL: https://issues.apache.org/jira/browse/CLK-737
> Project: Click
> Issue Type: Bug
> Components: core
> Reporter: Leszek Piotrowicz
> Priority: Minor
>
> the code below:
> Form form = new Form();
> Submit submit = new Submit("ok", "ok"); // field of type button
> Label label = new Label("lab", "lab"); // field of type other than button
> form.add(submit);
> form.replace(submit, label);
> throws an exception: index out of bounds
> the reason is that Form.replace assumes that control is always replaced by control, button by another button etc... which is not always the case
> In the above example the function tries to replace submit by label in field list but submit is in button list
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.