Wicket
  1. Wicket
  2. WICKET-5220

AjaxEditableLabel not working well in form

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.8.0, 7.0.0-M1
    • Fix Version/s: 6.9.0, 7.0.0-M1
    • Component/s: None
    • Environment:
      Win8, MS10, Chrome 27.0.1453.94 m

      Description

      Using quickstart I created new maven project (using 6.8.0 wicket + extensions).

      Code of my page is

      package net.betlista;

      import org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel;
      import org.apache.wicket.markup.html.WebPage;
      import org.apache.wicket.markup.html.form.Form;
      import org.apache.wicket.model.CompoundPropertyModel;

      public class AjaxEditableLabelInFormTestPage extends WebPage {

      Form<AjaxEditableLabelInFormTestPageModel> form = new Form("form");

      AjaxEditableLabel<String> text = new AjaxEditableLabel<String>("text");

      public AjaxEditableLabelInFormTestPage()

      { form.setModel(new CompoundPropertyModel<AjaxEditableLabelInFormTestPage.AjaxEditableLabelInFormTestPageModel>(new AjaxEditableLabelInFormTestPageModel())); form.add(text); add(form); }

      class AjaxEditableLabelInFormTestPageModel

      { String text; }

      }

      code for markup HTML is

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
      <title>Insert title here</title>
      </head>
      <body>

      <form wicket:id="form">
      <span wicket:id="text">text</span>
      </form>

      </body>
      </html>

      and when I edit the label and press tab, it changed to regular page text (span), but when I press enter (while editing) the component is still input instead of span and the content is not submitted also. It's not possible to change the component to span again...

        Activity

        Hide
        Betlista added a comment -

        reerted previous code try

        Show
        Betlista added a comment - reerted previous code try
        Hide
        Sven Meier added a comment -

        EditableLabelPage in wicket-examples works just fine. Could you please attach your quickstart?

        Show
        Sven Meier added a comment - EditableLabelPage in wicket-examples works just fine. Could you please attach your quickstart?
        Hide
        Betlista added a comment -

        But in in EditableLabelPage it is not in form if we are talking about the same page - http://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-label

        Show
        Betlista added a comment - But in in EditableLabelPage it is not in form if we are talking about the same page - http://www.wicket-library.com/wicket-examples-6.0.x/ajax/editable-label
        Hide
        Sven Meier added a comment -

        Indeed, I should have read your description more carefully.

        Show
        Sven Meier added a comment - Indeed, I should have read your description more carefully.
        Hide
        Sven Meier added a comment -

        Enter key has to be prevented onkeypress.

        Show
        Sven Meier added a comment - Enter key has to be prevented onkeypress.

          People

          • Assignee:
            Sven Meier
            Reporter:
            Betlista
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development