| <!DOCTYPE html> |
| <html> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <title>Wicket 1.4.10 released | Apache Wicket</title> |
| <meta charset="utf8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| |
| <link rel="shortcut icon" href="/favicon.ico" type="image/vnd.microsoft.icon" /> |
| <link rel="stylesheet" href="/css/style.css" type="text/css" media="screen" /> |
| <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" /> |
| |
| <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> |
| |
| </head> |
| |
| <body class=""> |
| <div class="header default"> |
| <div class="l-container"> |
| <nav class="mainmenu"> |
| <ul> |
| <!-- /start/quickstart.html || /news/2010/08/11/wicket-1.4.10-released.html --> |
| <li class=""><a href="/start/quickstart.html">Quick Start</a></li> |
| <!-- /start/download.html || /news/2010/08/11/wicket-1.4.10-released.html --> |
| <li class=""><a href="/start/download.html">Download</a></li> |
| <!-- /learn || /news/2010/08/11/wicket-1.4.10-released.html --> |
| <li class=""><a href="/learn">Documentation</a></li> |
| <!-- /help || /news/2010/08/11/wicket-1.4.10-released.html --> |
| <li class=""><a href="/help">Support</a></li> |
| <!-- /contribute || /news/2010/08/11/wicket-1.4.10-released.html --> |
| <li class=""><a href="/contribute">Contribute</a></li> |
| <!-- /apache || /news/2010/08/11/wicket-1.4.10-released.html --> |
| <li class=""><a href="/apache">Apache</a></li> |
| </ul> |
| </nav> |
| <div class="logo"> |
| <a href="/"><img src="/img/logo-apachewicket-white.svg" alt="Apache Wicket"></a> |
| </div> |
| </div> |
| </div> |
| <main> |
| <div class="l-container"> |
| <header class="l-full preamble"> |
| <h1>Wicket 1.4.10 released</h1> |
| </header> |
| <section class="l-one-third right"> |
| </section> |
| <section class="l-two-third left"> |
| <div class="l-full"> |
| <p class="meta">11 Aug 2010</p> |
| <p>This is the tenth maintenance release of the 1.4.x series and brings over |
| thirty bug fixes and improvements.</p> |
| <p>As well as bringing bug fixes and small improvements, 1.4.10 brings two major new features: |
| * Delayed component initialization |
| * Component configuration </p> |
| <p>Delayed component initialization allows developers to initialize their components outside of a constructor, when more environment is available to the component instance. From the javadoc:</p> |
| <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Component</span> <span class="o">{</span> |
| <span class="cm">/**</span> |
| <span class="cm"> * This method is meant to be used as an alternative to initialize components. Usually the</span> |
| <span class="cm"> * component's constructor is used for this task, but sometimes a component cannot be</span> |
| <span class="cm"> * initialized in isolation, it may need to access its parent component or its markup in order</span> |
| <span class="cm"> * to fully initialize. This method is invoked once per component's lifecycle when a path exists</span> |
| <span class="cm"> * from this component to the {@link Page} thus providing the component with an atomic callback</span> |
| <span class="cm"> * when the component's environment is built out.</span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * Overrides must call super#{@link #onInitialize()}. Usually this should be the first thing an</span> |
| <span class="cm"> * override does, much like a constructor.</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * Parent containers are guaranteed to be initialized before their children</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * It is safe to use {@link #getPage()} in this method</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * </span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * NOTE:The timing of this call is not precise, the contract is that it is called sometime</span> |
| <span class="cm"> * before {@link Component#onBeforeRender()}.</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * </span> |
| <span class="cm"> */</span> |
| <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">onInitialize</span><span class="o">()</span> <span class="o">{}</span> |
| <span class="o">}</span></code></pre></div> |
| <p>Component configuration allows developers to easier configure component states such as visibility, enabled, etc. From the javadoc:</p> |
| <div class="highlight"><pre><code class="language-java" data-lang="java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">Component</span> <span class="o">{</span> |
| <span class="cm">/**</span> |
| <span class="cm"> * Called once per request on components before they are about to be rendered. This method</span> |
| <span class="cm"> * should be used to configure such things as visibility and enabled flags.</span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * Overrides must call {@code super.onConfigure()}, usually before any other code</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * NOTE: Component hierarchy should not be modified inside this method, instead it should be</span> |
| <span class="cm"> * done in {@link #onBeforeRender()}</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * NOTE: Why this method is preferrable to directly overriding {@link #isVisible()} and</span> |
| <span class="cm"> * {@link #isEnabled()}? Because those methods are called multiple times even for processing of</span> |
| <span class="cm"> * a single request. If they contain expensive logic they can slow down the response time of the</span> |
| <span class="cm"> * entire page. Further, overriding those methods directly on form components may lead to</span> |
| <span class="cm"> * inconsistent or unexpected state depending on when those methods are called in the form</span> |
| <span class="cm"> * processing workflow. It is a better practice to push changes to state rather than pull.</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * NOTE: If component's visibility or another property depends on another component you may call</span> |
| <span class="cm"> * {@code other.configure()} followed by {@code other.isVisible()} as mentioned in</span> |
| <span class="cm"> * {@link #configure()} javadoc.</span> |
| <span class="cm"> * </p></span> |
| <span class="cm"> * <p></span> |
| <span class="cm"> * NOTE: Why should {@link #onBeforeRender()} not be used for this? Because if visibility of a</span> |
| <span class="cm"> * component is toggled inside {@link #onBeforeRender()} another method needs to be overridden</span> |
| <span class="cm"> * to make sure {@link #onBeforeRender()} will be invoked on ivisible components:</span> |
| <span class="cm"> * </span> |
| <span class="cm"> * <pre></span> |
| <span class="cm"> * class MyComponent extends WebComponent</span> |
| <span class="cm"> * {</span> |
| <span class="cm"> * protected void onBeforeRender()</span> |
| <span class="cm"> * {</span> |
| <span class="cm"> * setVisible(Math.rand() &gt; 0.5f);</span> |
| <span class="cm"> * super.onBeforeRender();</span> |
| <span class="cm"> * }</span> |
| <span class="cm"> * </span> |
| <span class="cm"> * // if this override is forgotten, once invisible component will never become visible</span> |
| <span class="cm"> * protected boolean callOnBeforeRenderIfNotVisible()</span> |
| <span class="cm"> * {</span> |
| <span class="cm"> * return true;</span> |
| <span class="cm"> * }</span> |
| <span class="cm"> * }</span> |
| <span class="cm"> * </pre></span> |
| <span class="cm"> * </span> |
| <span class="cm"> * VS</span> |
| <span class="cm"> * </span> |
| <span class="cm"> * <pre></span> |
| <span class="cm"> * class MyComponent extends WebComponent</span> |
| <span class="cm"> * {</span> |
| <span class="cm"> * protected void onConfigure()</span> |
| <span class="cm"> * {</span> |
| <span class="cm"> * setVisible(Math.rand() &gt; 0.5f);</span> |
| <span class="cm"> * super.onConfigure();</span> |
| <span class="cm"> * }</span> |
| <span class="cm"> * }</span> |
| <span class="cm"> * </pre></span> |
| <span class="cm"> */</span> |
| <span class="kd">protected</span> <span class="kt">void</span> <span class="nf">onConfigure</span><span class="o">()</span> <span class="o">{}</span> |
| <span class="o">}</span></code></pre></div> |
| <ul> |
| <li><a href="http://svn.apache.org/repos/asf/wicket/releases/wicket-1.4.10/">Subversion tag</a> </li> |
| <li><a href="https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&mode=hide&sorter/order=DESC&sorter/field=priority&pid=12310561&fixfor=12315070">Changelog</a></li> |
| <li>To use in Maven: </li> |
| </ul> |
| <div class="highlight"><pre><code class="language-xml" data-lang="xml"><span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.apache.wicket<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>wicket<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.4.10<span class="nt"></version></span> |
| <span class="nt"></dependency></span></code></pre></div> |
| <ul> |
| <li>Download the <a href="http://www.apache.org/dyn/closer.cgi/wicket/1.4.10">full |
| distribution</a> (including |
| source)</li> |
| </ul> |
| </div> |
| </section> |
| </div> |
| </main> |
| <footer class="l-container"> |
| <div class="l-full"> |
| <img height="60px" src="/img/asf_logo.gif" style="float:left"> |
| Copyright © 2014 — The Apache Software Foundation. Apache Wicket, |
| Wicket, Apache, the Apache feather logo, and the Apache Wicket |
| project logo are trademarks of The Apache Software Foundation. All |
| other marks mentioned may be trademarks or registered trademarks of |
| their respective owners. |
| </div> |
| </footer> |
| </body> |
| |
| </html> |