Re: DateTimeField enhancement
I am attempting to upload a patch. Should an issue be opened as well? MartinM wrote: Patch would be nice.. ** Martin 2009/12/17 Steve Lowery slow...@gatessolutions.com: I'd like to use the DateTimeField component, but there is no API that I can see to override what DatePicker gets added to the component. I'd like to subclass the DatePicker and customize the icon, positioning, etc. I can do this if just dealing with the DateTextField, where I add the DatePicker behavior myself, but I can't do it when using the DateTimeField. Is there a way to do this? If not, could it be enhanced so we can do this? A simple protected newDatePicker() method on DateTimeField would accomplish this. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org http://old.nabble.com/file/p26835477/DateTimeField.java.patch DateTimeField.java.patch -- View this message in context: http://old.nabble.com/DateTimeField-enhancement-tp26835114p26835477.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: override isEnabledInHierarchy?
Actually, that's what I initially tried, but it didn't work. If you use the simple example below, you'll see that. None of the components with isEnabled() overridden to return true are enabled. I am using wicket 1.4-rc4. In looking at the source code, it looks like if I were able to override isEnabledInHierarchy to return true it would work. Java code: package test.web.page; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.markup.html.link.Link; import org.apache.wicket.model.CompoundPropertyModel; @SuppressWarnings( { unused, serial }) public class DemoPage extends WebPage { private String firstName = Steve; private String lastName = Lowery; public DemoPage(PageParameters parameters) { super(parameters); FormDemoPage form = new FormDemoPage(form, new CompoundPropertyModelDemoPage(this)); add(form.setEnabled(false)); form.add(new TextFieldString(firstName)); form.add(new TextFieldString(lastName) { @Override public boolean isEnabled() { return true; } }); form.add(new Link(regular) { @Override public void onClick() { System.out.println(do something); } }); form.add(new Link(enabled) { @Override public void onClick() { System.out.println(i want this link always enabled, regardless of what its hierarch looks like); } @Override public boolean isEnabled() { return true; } }); } } Html: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html xmlns:wicket=http://wicket.apache.org/; head titleDemo/title /head body form wicket:id=form table tbody tr td[first name]/td tdinput type=text wicket:id=firstName//td /tr tr td[last name]/td tdinput type=text wicket:id=lastName//td /tr tr tdnbsp;/td td [reg link] /td /tr tr tdnbsp;/td td [enabled link] /td /tr /tbody /table /form /body /html MartinM wrote: Yes, you could do it another way. Make each component that you want to enable/disable like this: form.add(new xxxFormComponent(id) { @Override isEnabled() { return your logic here; } }); 2009/7/17 Steve Lowery slow...@gatessolutions.com: I would like to build a simple form whose markup looks like the following: wicket:panel form wicket:id=form table thead tr th[Label]/th th wicket:id=editLink[edit] /th /tr /thead tbody tr td[attr1]/td tdinput type=text wicket:id=attr1//td /tr tr td[attr2]/td tdinput type=text wicket:id=longitude//td /tr /tbody tfoot tr td colspan=2 button wicket:id=submit[submit]/button button wicket:id=cancel[cancel]/button /td /tr /tfoot /table /form /wicket:panel I call setEnabled(false) on the Form when it is constructed which makes its FormComponents disabled making a read only version of the form. I'd then like the editLink.onClick() to enable the form, which will enable it's components. However, since
Re: override isEnabledInHierarchy?
That certainly will work. But if I have a form and I want to disable all of the elements in the form except for the Edit Form link, it is, IMO, much simpler to disable the form and override the one link so it is enabled, rather than disabling many form components. We have one use case where we probably have 80 form components on the page (not great web design, i know, but that's what the users wanted). The onClick() method of the Edit Form link would be 80 lines long enabling the components instead of 1 to enable the form. MartinM wrote: Don't disable the form. Disable only the components you want to disable. ** Martin 2009/7/19 slowery23 slow...@gatessolutions.com: Actually, that's what I initially tried, but it didn't work. If you use the simple example below, you'll see that. None of the components with isEnabled() overridden to return true are enabled. I am using wicket 1.4-rc4. In looking at the source code, it looks like if I were able to override isEnabledInHierarchy to return true it would work. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/override-isEnabledInHierarchy--tp24535687p24558342.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: override isEnabledInHierarchy?
can u give an code example of what your centrallyenableddisabledcomponent looks like? MartinM wrote: That certainly will work. But if I have a form and I want to disable all of the elements in the form except for the Edit Form link, it is, IMO, much simpler to disable the form and override the one link so it is enabled, rather than disabling many form components. You can just make your own centrallyenableddisabledcomponent. That's what we did and works great. ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/override-isEnabledInHierarchy--tp24535687p24559838.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AutoCompletetextField misbehavior in IE
Did you have to do anything else to get this to work? I am having the same issue in both 1.4rc1 and 1.4rc2. cbchhaya wrote: Never mind, I was doing something daft but have now correctly replaced with the Mar 10 snapshot for 1.3.5 and the thing works fine. Thanks everyone for your help! -- View this message in context: http://www.nabble.com/AutoCompletetextField-misbehavior-in-IE-tp22459455p23750605.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org