Uploaded image for project: 'Click'
  1. Click
  2. CLK-737

Form.replace throws an exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Invalid
    • None
    • None
    • core
    • None

    Description

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            leszekp Leszek Piotrowicz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: