wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Eugelink <t...@tbee.org>
Subject focus locked in place
Date Fri, 13 Apr 2012 09:58:23 GMT

I'm slowly getting some ground under my Wicket feet, but now I have a strange problem. I've
got a form with two TextFields and a RefreshingView inside a MarkupContainer, building rows
containing a DropDownChoice, TextField and a AjaxSubmitLink. The stripped version of the Java
code looks like this:

             final Form<MasterLicenseModel> lForm = new Form<MasterLicenseModel>("form",
new CompoundPropertyModel(masterLicenseModel)) ;
             add(lForm);

             DatePicker<Date> lValidFromDateTextField = new DatePicker<Date>(LicenseModel.VALIDFROM_PROPERTY)
             lForm.add(lValidFromDateTextField);

             DatePicker lValidUntilDateTextField = new DatePicker(LicenseModel.VALIDUNTIL_PROPERTY);
             lForm.add(lValidUntilDateTextField);

             final MarkupContainer lRuntimesPanel = new WebMarkupContainer("runtimesPanel");
             lRuntimesPanel.setOutputMarkupId(true);
             lForm.add(lRuntimesPanel);

             final RefreshingView<License.Runtime> lRuntimeListView = new RefreshingView<License.Runtime>(LicenseModel.RUNTIMES_PROPERTY)
             {
                 @Override
                 protected void populateItem(final Item<Runtime> item)
                 {
                     item.add( new DropDownChoice<String>("runtimeType", new PropertyModel<String>(item.getDefaultModel(),
"type"), License.RUNTIME_TYPES));
                     item.add( new TextField<String>("runtimeOs", new PropertyModel<String>(item.getDefaultModel(),
"os")));

                       AjaxSubmitLink lRemoveRuntime = new AjaxSubmitLink("removeRuntime",
lForm)
                       lRemoveRuntime.setDefaultFormProcessing(false);
                       item.add(lRemoveRuntime);
                 }
             };
             lRuntimesPanel.add(lRuntimeListView);

             AjaxSubmitLink lAddRuntime = new AjaxSubmitLink("addRuntime", lForm)
             {
             };
             lAddRuntime.setDefaultFormProcessing(false);
             lRuntimesPanel.add(lAddRuntime);

The cursor can be placed in the date fields, but not in any of the textfield in the listview.
Focus then immediately jumps to the DropDownChoice in the first row. I've tried removing the
MarkupContainer & Ajax part, reverting back to a regular ListView. In the HTML I use a
table for the listview, but a bunch of divs instead do not make a difference.

I also see no events on the HTML text element in the listview either.

<input type="text" wicket:id="runtimeOs" style="width:100px;" value="ios" name="runtimesPanel:runtimes:19:runtimeOs">

Any ideas why the focus jumps?

Tom


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message