[jira] Updated: (WICKET-1736) Allow Access to AutoCompleteTextField AutoCompleteBehavior
[ https://issues.apache.org/jira/browse/WICKET-1736?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Will Hoover updated WICKET-1736: Description: Currently there is no easy way to access the AutoCompleteBehavior of the AutoCompleteTextField. This is useful when dynamically enabling/disabling the behavior (among other reasons). The current code is: {code} public AutoCompleteTextField(String id, IModel model, Class type, IAutoCompleteRenderer renderer, AutoCompleteSettings settings) { super(id, model, type); // this disables Firefox autocomplete add(new SimpleAttributeModifier(autocomplete, off)); add(new AutoCompleteBehavior(renderer, settings) { private static final long serialVersionUID = 1L; protected Iterator getChoices(String input) { return AutoCompleteTextField.this.getChoices(input); } }); } {code} One solution to this is to extract the creation of the AutoCompleteBehavior to a method: {code} public AutoCompleteTextField(final String id, final IModel model, final Class? type, final IAutoCompleteRenderer renderer, final AutoCompleteSettings settings) { super(id, model, type); // this disables Firefox autocomplete add(new SimpleAttributeModifier(autocomplete, off)); final AutoCompleteBehavior autoCompleteBehavior = createAutoCompleteBehavior(renderer, settings); if (autoCompleteBehavior == null) { throw new NullPointerException(Auto complete behavior cannot be null); } add(autoCompleteBehavior); } protected AutoCompleteChoiceBehavior createAutoCompleteBehavior(final IAutoCompleteRenderer renderer, final AutoCompleteSettings settings) { return new AutoCompleteChoiceBehavior(renderer, settings); } public class AutoCompleteChoiceBehavior extends AutoCompleteBehavior { public AutoCompleteChoiceBehavior(final IAutoCompleteRenderer renderer, final AutoCompleteSettings settings) { super(renderer, settings); } protected final Iterator? getChoices(final String input) { return AbstractAutoCompleteTextField.this.getChoices(input); } } {code} Also, when the auto-complete behavior is disabled [overriding the isEnable(component)] it currently does not clear the client events from the text field. A work around for this is to clear it out onCompoentTag (not the best option, but it works): {code} protected void onComponentTag(final ComponentTag tag) { if (!getAutoCompleteBehavior().isEnabled(this)) { // FIXME : Need to clear the events when the auto-complete behavior is disabled tag.put(onfocus, this.onblur=null;this.onchange=null;this.onkeydown=null;this.onkeypress=null;this.onkeyup=null;); } super.onComponentTag(tag); } {code} was: Currently there is no easy way to access the AutoCompleteBehavior of the AutoCompleteTextField. This is useful when dynamically enabling/disabling the behavior (among other reasons). The current code is: {code} public AutoCompleteTextField(String id, IModel model, Class type, IAutoCompleteRenderer renderer, AutoCompleteSettings settings) { super(id, model, type); // this disables Firefox autocomplete add(new SimpleAttributeModifier(autocomplete, off)); add(new AutoCompleteBehavior(renderer, settings) { private static final long serialVersionUID = 1L; protected Iterator getChoices(String input) { return AutoCompleteTextField.this.getChoices(input); } }); } {code} One solution to this is to extract the creation of the AutoCompleteBehavior to a method: {code} public AutoCompleteTextField(final String id, final IModel model, final Class? type, final IAutoCompleteRenderer renderer, final AutoCompleteSettings settings) { super(id, model, type); // this disables Firefox autocomplete add(new SimpleAttributeModifier(autocomplete, off)); final AutoCompleteBehavior autoCompleteBehavior = getAutoCompleteBehavior(renderer, settings); if (autoCompleteBehavior == null) { throw new NullPointerException(Auto complete behavior cannot be null);
[jira] Created: (WICKET-1737) wicketTester does not find HTML mark-up if custom location is used.
wicketTester does not find HTML mark-up if custom location is used. --- Key: WICKET-1737 URL: https://issues.apache.org/jira/browse/WICKET-1737 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.4 Reporter: Karsten Efker Priority: Minor If a custom HTML mark-up location is used as described in the ApacheWicket Wiki the wicketTester does not find mark-up to render pages. refer to: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html#ControlwhereHTMLfilesareloadedfrom-InWicket1.3 Nevertheless running the application with ApacheTomcat 6.0.16 everything renders fine. Remark: wicketTester has been instanciated using custom test application extended from the application used, overriding newSession for different purpose. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (WICKET-1738) New page map suitable for use in terracotta
New page map suitable for use in terracotta --- Key: WICKET-1738 URL: https://issues.apache.org/jira/browse/WICKET-1738 Project: Wicket Issue Type: New Feature Components: wicket Environment: Java 5+ required Reporter: Richard Wilkinson Priority: Minor Following on from discussion in this thread: http://www.nabble.com/Terracotta-integration-td18168616.html A new implementation of PageStore has been created which stores the page map in the users http session so that it is easy for terracotta to distribute the page map. Pages are serialized stored as byte arrays. Also required is updating of the wicket terracotta integration module. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-1738) New page map suitable for use in terracotta
[ https://issues.apache.org/jira/browse/WICKET-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12611568#action_12611568 ] Richard Wilkinson commented on WICKET-1738: --- Forgot to mention, also requires that org.apache.wicket.protocol.http.pagestore.AbstractPageStore$SerializedPage implements IClusterable rather than Serializable New page map suitable for use in terracotta --- Key: WICKET-1738 URL: https://issues.apache.org/jira/browse/WICKET-1738 Project: Wicket Issue Type: New Feature Components: wicket Environment: Java 5+ required Reporter: Richard Wilkinson Priority: Minor Attachments: TerracottaPageStore.java Following on from discussion in this thread: http://www.nabble.com/Terracotta-integration-td18168616.html A new implementation of PageStore has been created which stores the page map in the users http session so that it is easy for terracotta to distribute the page map. Pages are serialized stored as byte arrays. Also required is updating of the wicket terracotta integration module. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-1738) New page map suitable for use in terracotta
[ https://issues.apache.org/jira/browse/WICKET-1738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12611794#action_12611794 ] Richard Wilkinson commented on WICKET-1738: --- It could probably be added as part of the terracotta module, but there isn't any terracotta specific stuff in it. Its only an implementation of IPageStore which uses the HttpSession to keep pages. It could have other uses apart from terracotta and does work without terracotta. The main reason I thought it would be best in the wicket source is that then it is more likely to be kept in sync with any future changes to how the PageStore is used. New page map suitable for use in terracotta --- Key: WICKET-1738 URL: https://issues.apache.org/jira/browse/WICKET-1738 Project: Wicket Issue Type: New Feature Components: wicket Environment: Java 5+ required Reporter: Richard Wilkinson Priority: Minor Attachments: TerracottaPageStore.java Following on from discussion in this thread: http://www.nabble.com/Terracotta-integration-td18168616.html A new implementation of PageStore has been created which stores the page map in the users http session so that it is easy for terracotta to distribute the page map. Pages are serialized stored as byte arrays. Also required is updating of the wicket terracotta integration module. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (WICKET-1737) wicketTester does not find HTML mark-up if custom location is used.
[ https://issues.apache.org/jira/browse/WICKET-1737?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12611892#action_12611892 ] Timo Rantalaiho commented on WICKET-1737: - Thanks for reporting, this sounds like a problem that impedes your unit testing a lot when using a custom markup location. Would it be possible for you to provide a quickstart with a WicketTester test failing because of this? Or better yet a patch against Wicket code that provides a failing unit test. Meanwhile, in jdave-wicket there is an example of starting components with markup provided in a String http://svn.laughingpanda.org/svn/jdave/trunk/jdave-wicket/src/java/jdave/wicket/ComponentSpecification.java You might be able to do something similar to work around this issue, although it might involve too much code. wicketTester does not find HTML mark-up if custom location is used. --- Key: WICKET-1737 URL: https://issues.apache.org/jira/browse/WICKET-1737 Project: Wicket Issue Type: Bug Components: wicket Affects Versions: 1.3.4 Reporter: Karsten Efker Priority: Minor If a custom HTML mark-up location is used as described in the ApacheWicket Wiki the wicketTester does not find mark-up to render pages. refer to: http://cwiki.apache.org/WICKET/control-where-html-files-are-loaded-from.html#ControlwhereHTMLfilesareloadedfrom-InWicket1.3 Nevertheless running the application with ApacheTomcat 6.0.16 everything renders fine. Remark: wicketTester has been instanciated using custom test application extended from the application used, overriding newSession for different purpose. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.