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
    • Fix Version/s: 6.9.0, 7.0.0
    • 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

        Sven Meier made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 6.9.0 [ 12324357 ]
        Fix Version/s 7.0.0 [ 12322958 ]
        Resolution Fixed [ 1 ]
        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.
        Sven Meier made changes -
        Affects Version/s 7.0.0 [ 12322958 ]
        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.
        Sven Meier made changes -
        Assignee Sven Meier [ svenmeier ]
        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 -

        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?
        Betlista made changes -
        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

        {{code}}<!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>{{code}}

        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...
        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...
        Hide
        Betlista added a comment -

        reerted previous code try

        Show
        Betlista added a comment - reerted previous code try
        Betlista made changes -
        Field Original Value New Value
        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...
        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

        {{code}}<!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>{{code}}

        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...
        Betlista created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development