[CONF] Apache Wicket How to switch to SSL mode

2013-01-15 Thread confluence







How to switch to SSL mode
Page edited by Jeremy Levy


 Changes (1)
 




...
Referencing the example above, override thenbsp;getDesiredSchemeFornbsp;method.  
setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()){ nbsp; nbsp; @Override nbsp; nbsp; protected Scheme getDesiredSchemeFor(Class pageClass) { nbsp; nbsp; nbsp; nbsp; if (getConfigurationType()==RuntimeConfigurationType.DEVELOPMENT) { nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; logger.debug(in development mode, returning HTTP); nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; return Scheme.HTTP; nbsp; nbsp; nbsp; nbsp; } else { nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; logger.debug(not in development mode, letting the mapper decide); nbsp; nbsp; nbsp; nbsp; nbsp; nbsp; return super.getDesiredSchemeFor(pageClass); nbsp; nbsp; nbsp; nbsp; } nbsp; nbsp; } }); 
{code}setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()){   @Override 
...


Full Content

Wicket 6.x, usingHttpsMapper

Inside of the Application.init() method add the following, note: it is extemtely important that when setting the rootRequestMapper it is done AFTER you have added any bookmarkable links otherwise they will not be switched over to Secure mode.

setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));

As with previous versions of Wicket, now all you need to do is include the @RequiresHttps attribute on your Pages or Components.
Using other methods to determine if Https should be use:

Referencing the example above, override thegetDesiredSchemeFormethod.


setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()){
  @Override
  protected Scheme getDesiredSchemeFor(Class pageClass) {
 if (getConfigurationType()==RuntimeConfigurationType.DEVELOPMENT) {
 log.debug("Dev mode, always use HTTP");
 return Scheme.HTTP;
  } else {
 log.debug("not in development mode, letting the mapper decide, or roll you own solution");
 return super.getDesiredSchemeFor(pageClass);
  }
   }
});
As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details

Using HttpsRequestCycleProcessor (after 1.4--rc3)

By replacing the default WebRequestCycleProcessor with the HttpsRequestCycleProcessor, you are able to specify secure pages using the @RequireHttps annotation on your pages. If you wanted a little more control... lets say for development you did not want your annotated pages to use https, you could bypass the Switch Protocol code like this.


@Override
protected IRequestCycleProcessor newRequestCycleProcessor()
{
HttpsConfig config = new HttpsConfig(80,443);
return new HttpsRequestCycleProcessor(config)
{

@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
	return target;
}
else
{
return super.checkSecureIncoming(target);
}
}

@Override
protected IRequestTarget checkSecureOutgoing(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
return target;
}
else
{
return super.checkSecureOutgoing(target);
}
}

};
}



For The Entire Application

web.xml

web-app ...
   security-constraint
  user-data-constraint
 transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint
   /security-constraint
/web-app


Quote from web-app_2_3.dtd:
The transport-guarantee element specifies that the communication
between client and server should be NONE, INTEGRAL, or
CONFIDENTIAL. NONE means that the application does not require any
transport guarantees. A value of INTEGRAL means that the application
requires that the data sent between the client and server be sent in
such a way that it can't be changed in transit. CONFIDENTIAL means
that the application requires that the data be transmitted in a
fashion that prevents other entities from observing the contents of
the transmission. In most cases, the presence of the INTEGRAL or
CONFIDENTIAL flag will indicate that the use of SSL is required.

For Particular Pages
An explanation of how to transparently switch from http to https.
Table of contents


Change Render Strategy
Create RequiredSSL Annotation
Create New Response Strategy
Annotate Your Pages
Edit:
Edit (Wicket 1.3.x):
Edit (Wicket 1.3.x) alternative:




[CONF] Apache Wicket How to switch to SSL mode

2013-01-15 Thread confluence







How to switch to SSL mode
Page edited by Jeremy Levy


 Changes (1)
 




...
});{code}  
--- 
 
{note} As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details 
...


Full Content

Wicket 6.x, usingHttpsMapper

Inside of the Application.init() method add the following, note: it is extemtely important that when setting the rootRequestMapper it is done AFTER you have added any bookmarkable links otherwise they will not be switched over to Secure mode.

setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));

As with previous versions of Wicket, now all you need to do is include the @RequiresHttps attribute on your Pages or Components.


Using other methods to determine if Https should be use:

Referencing the example above, override thegetDesiredSchemeFormethod.


setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()){
  @Override
  protected Scheme getDesiredSchemeFor(Class pageClass) {
 if (getConfigurationType()==RuntimeConfigurationType.DEVELOPMENT) {
 log.debug("Dev mode, always use HTTP");
 return Scheme.HTTP;
  } else {
 log.debug("not in development mode, letting the mapper decide, or roll you own solution");
 return super.getDesiredSchemeFor(pageClass);
  }
   }
});




As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details

Using HttpsRequestCycleProcessor (after 1.4--rc3)

By replacing the default WebRequestCycleProcessor with the HttpsRequestCycleProcessor, you are able to specify secure pages using the @RequireHttps annotation on your pages. If you wanted a little more control... lets say for development you did not want your annotated pages to use https, you could bypass the Switch Protocol code like this.


@Override
protected IRequestCycleProcessor newRequestCycleProcessor()
{
HttpsConfig config = new HttpsConfig(80,443);
return new HttpsRequestCycleProcessor(config)
{

@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
	return target;
}
else
{
return super.checkSecureIncoming(target);
}
}

@Override
protected IRequestTarget checkSecureOutgoing(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
return target;
}
else
{
return super.checkSecureOutgoing(target);
}
}

};
}



For The Entire Application

web.xml

web-app ...
   security-constraint
  user-data-constraint
 transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint
   /security-constraint
/web-app


Quote from web-app_2_3.dtd:
The transport-guarantee element specifies that the communication
between client and server should be NONE, INTEGRAL, or
CONFIDENTIAL. NONE means that the application does not require any
transport guarantees. A value of INTEGRAL means that the application
requires that the data sent between the client and server be sent in
such a way that it can't be changed in transit. CONFIDENTIAL means
that the application requires that the data be transmitted in a
fashion that prevents other entities from observing the contents of
the transmission. In most cases, the presence of the INTEGRAL or
CONFIDENTIAL flag will indicate that the use of SSL is required.

For Particular Pages
An explanation of how to transparently switch from http to https.
Table of contents


Change Render Strategy
Create RequiredSSL Annotation
Create New Response Strategy
Annotate Your Pages
Edit:
Edit (Wicket 1.3.x):
Edit (Wicket 1.3.x) alternative:



Change Render Strategy

Change the rendering strategy in your application.


getRequestCycleSettings().setRenderStrategy(Settings.ONE_PASS_RENDER);


I could not get this to work with the other strategies because you cannot send more than one redirect in the same request.  You lose some features like avoiding double submit, but you can avoid that with some _javascript_.  You gain some performance because the rendering is also done in the same request.

Create RequiredSSL Annotation

Create an annotation.


@Retention(RetentionPolicy.RUNTIME)
@Inherited //For a "BasePage" strategy
 public @interface RequiredSSL { }



[CONF] Apache Wicket How to switch to SSL mode

2013-01-15 Thread confluence







How to switch to SSL mode
Page edited by Jeremy Levy


 Changes (6)
 




h2. Wicket 6.x, usingnbsp;HttpsMapper  
Inside of the Application.init() method add the following.  {note} 
Inside of the Application.init() method add the following, note: it It is extemtely important that when setting the rootRequestMapper it is done AFTER you have added any bookmarkable links otherwise they will not be switched over to Secure mode.{note} 
{code}setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));{code} 
 {code}  mountPage(/somepage, MyPage.class);  // notice that in most cases this should be done as the // last mounting-related operation because it replaces the root mapper setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig())); {code}  
As with previous versions of Wicket, now all you need to do is include the @RequiresHttps attribute on your Pages or Components.  
...
---  
{note} As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details {note} 
  h2. Using HttpsRequestCycleProcessor (after 1.4--rc3)  
By replacing the default WebRequestCycleProcessor with the HttpsRequestCycleProcessor, you are able to specify secure pages using the @RequireHttps annotation on your pages. If you wanted a little more control... lets say for development you did not want your annotated pages to use https, you could bypass the Switch Protocol code like this. As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details 
{code} @Override 
...


Full Content

Wicket 6.x, usingHttpsMapper

Inside of the Application.init() method add the following.

It is extemtely important that when setting the rootRequestMapper it is done AFTER you have added any bookmarkable links otherwise they will not be switched over to Secure mode.




mountPage("/somepage", MyPage.class);

// notice that in most cases this should be done as the
// last mounting-related operation because it replaces the root mapper
setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));



As with previous versions of Wicket, now all you need to do is include the @RequiresHttps attribute on your Pages or Components.


Using other methods to determine if Https should be use:

Referencing the example above, override thegetDesiredSchemeFormethod.


setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()){
  @Override
  protected Scheme getDesiredSchemeFor(Class pageClass) {
 if (getConfigurationType()==RuntimeConfigurationType.DEVELOPMENT) {
 log.debug("Dev mode, always use HTTP");
 return Scheme.HTTP;
  } else {
 log.debug("not in development mode, letting the mapper decide, or roll you own solution");
 return super.getDesiredSchemeFor(pageClass);
  }
   }
});






Using HttpsRequestCycleProcessor (after 1.4--rc3)

By replacing the default WebRequestCycleProcessor with the HttpsRequestCycleProcessor, you are able to specify secure pages using the @RequireHttps annotation on your pages. If you wanted a little more control... lets say for development you did not want your annotated pages to use https, you could bypass the Switch Protocol code like this. As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details


@Override
protected IRequestCycleProcessor newRequestCycleProcessor()
{
HttpsConfig config = new HttpsConfig(80,443);
return new HttpsRequestCycleProcessor(config)
{

@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
	return target;
}
else
{
return super.checkSecureIncoming(target);
}
}

@Override
protected IRequestTarget checkSecureOutgoing(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
return target;
}
else
{
return super.checkSecureOutgoing(target);
}
}

};
}



For The Entire Application

web.xml

web-app ...
   security-constraint
  user-data-constraint
 

[CONF] Apache Wicket Page Storage

2013-01-21 Thread confluence







Page Storage
Page edited by Sven Meier


 Changes (1)
 




...
 When a SerializedPage has to be stored DefaultPageStore stores it in a application scoped cache (\{sessionId, pageId\} \- SerializedPage) and additionally 
gives it to the underlying IDataStore (#storeData(sessionId, pageId, data). The application scoped cache is used as second level cache. Getting a page from it is slower than the http session based cache in StorePageManager PageStoreManager because the page has to be deserialized, but is faster than the underlying IDataStore which stores the page bytes in some persistent store. 
 The size of the application scoped cache is configurable via org.apache.wicket.settings.IStoreSettings.setInmemoryCacheSize(int). 
...


Full Content

Wicket 1.5 - Page storage



Introduction
Involved classes

IPageProvider
IPageSource
IPageFactory
IPageManager
IPageStore
IDataStore

Additional information

AsynchronousDataStore
DebugDiskDataStore
HttpSessionDataStore
PageExpiredException



Introduction

This page describes the internals of Wicket page storages in version 1.5.

Involved classes

picture here

IPageProvider

org.apache.wicket.request.handler.IPageProvider's task is to return a page instance by page id or page class.
Default implementation provided by Wicket is org.apache.wicket.request.handler.PageProvider, which delegates page creation and retrieval to a IPageSource.

IPageSource

Default implementation of org.apache.wicket.request.mapper.IPageSource is org.apache.wicket.DefaultMapperContext.
When page class is provided then DefaultMapperContext delegates to IPageFactory. When page id is provided it will delegate to IPageManager to find the page.

IPageFactory

org.apache.wicket.IPageFactory creates pages.

IPageManager

org.apache.wicket.page.IPageManager's task is to manage which pages have been used in a request and store their last state in the backing stores, namely IPageStore.
The default implementation org.apache.wicket.page.PageStoreManager collects all stateful pages which have been used in the request cycle (more than one page can be used in a single request if for example setResponsePage() or RestartResponseException is used).
At the end of the request all collected page instances are being stored in the first level cache - http session. They are stored in http session attribute named "wicket:persistentPageManagerDataAPPLICATION_NAME" and passed to the underlying IPageStore.
When the next http request comes IPageProvider will ask for page with specific id and PageStoreManager will look first in the http session and if no match is found then it will delegate to the IPageStore. At the end of the second request the http session based cache is being overwritten completely with the newly used page instances.

To setup another IPageManager implementation use org.apache.wicket.Application.setPageManagerProvider(IPageManagerProvider).
The custom IPageManager implementation may or may not use IPageStore/IDataStore.

IPageStore

org.apache.wicket.pageStore.IPageStore's role is to mediate the storing and loading of pages done by the underlying IDataStore.
The default implementation org.apache.wicket.pageStore.DefaultPageStore pre-processes the pages before passing them to IDataStore#storeData(String, int, byte[]) and to post-processes them after IDataStore#getData(String, int). The processing consists of transforming the page instance to org.apache.wicket.pageStore.DefaultPageStore.SerializedPage. This is a struct of:
{
sessionId: String,
pageId   : int,
data : byte[]
}
i.e. this is the serialized page instance (data) plus additional information needed to be able to easily find it later (sessionId, pageId).

When a SerializedPage has to be stored DefaultPageStore stores it in a application scoped cache ({sessionId, pageId}  SerializedPage) and additionally
gives it to the underlying IDataStore (#storeData(sessionId, pageId, data). The application scoped cache is used as second level cache. Getting a page from it is slower than the http session based cache in PageStoreManager because the page has to be deserialized, but is faster than the underlying IDataStore which stores the page bytes in some persistent store.

The size of the application scoped cache is configurable via org.apache.wicket.settings.IStoreSettings.setInmemoryCacheSize(int).

IDataStore

org.apache.wicket.pageStore.IDataStore is used to persist Wicket pages (as bytes) to a persistent store like e.g. files or databases.
The default implementation is org.apache.wicket.pageStore.DiskDataStore which as its name says stores the pages in files.
The location of the folder where the files are stored is configurable via 

[CONF] Apache Wicket Adding Javascript or CSS using a Resource

2013-01-21 Thread confluence







Adding _javascript_ or CSS using a Resource
Page edited by Adam A. Koch


Comment:
added 1.4 example


 Changes (1)
 




...
{code}  
Or   {code} public class MyPage extends WebPage { ...  @Override public void renderHead(HtmlHeaderContainer container) { container.getHeaderResponse().renderOnLoadJavascript(alert(test)); super.renderHead(container); } } {code}  
h1. Wicket 1.5 In Wicket *1.5*, [CompressedResourceReference has been removed|WICKET:Migration to Wicket 1.5]! 
...


Full Content

Wicket 1.3 and earlier
To add _javascript_ or CSS to your pages and have them compressed during the "deployment" cycle automatically by Wicket, start with the _javascript_ or CSS file somewhere in our package hierarchy that we can reference in our Page.  For simplicity, we can copy it right next to the HTML file like so:



MyPage.java
MyPage.html
MyPage.js
MyPage.css



Then in our Page, we need to reference these items based on the path of our Java file, like so:



private static final CompressedResourceReference MYPAGE_JS = new CompressedResourceReference(MyPage.class, "MyPage.js");

private static final CompressedResourceReference MYPAGE_CSS = new CompressedResourceReference(MyPage.class, "MyPage.css");



This code gives us a ResourceReference that we can add to our page, most use cases to the HTML head element block.  To do that in your page:



add(HeaderContributor.forJavaScript( MYPAGE_JS ));

add(HeaderContributor.forCss( MYPAGE_CSS ));



Wicket 1.4
In Wicket 1.4 HeaderContributor.forJavaScript() and HeaderContributor.forCss() are deprecated, so use the code below:


add(_javascript_PackageResource.getHeaderContribution(MYPAGE_JS));

add(CSSPackageResource.getHeaderContribution(MYPAGE_CSS));



Or 



public class MyPage extends WebPage {
...

@Override
public void renderHead(HtmlHeaderContainer container) {
container.getHeaderResponse().renderOnLoadJavascript("alert('test')");
super.renderHead(container);
}
}



Wicket 1.5
In Wicket 1.5, CompressedResourceReference has been removed!

Also, the getHeaderContribution functionality has been removed.  Instead, your component (Page, Panel, etc.) needs to override renderHead(IHeaderResponse):


  @Override
  public void renderHead(IHeaderResponse response) {
response.renderJavaScriptReference("urlHere");
  }



Wicket 6.x
renderJavaScriptReference seems to be gone.


...
private static final _javascript_ResourceReference MYPAGE_JS = new _javascript_ResourceReference(MyPage.class, "MyPage.js");
...
@Override
public void renderHead(IHeaderResponse response) {
  response.render(_javascript_ReferenceHeaderItem.forReference(MYPAGE_JS));
}
...





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Adding Javascript or CSS using a Resource

2013-01-21 Thread confluence







Adding _javascript_ or CSS using a Resource
Page edited by Adam A. Koch


Comment:
added 1.4 example


 Changes (2)
 




...
{code}  
Or  {code} public class MyPage extends WebPage { ...   @Override   public void renderHead(HtmlHeaderContainer container) { super.renderHead(container); container.getHeaderResponse().renderJavascriptReference(new _javascript_ResourceReference(MyPage.class, script.js));   } ... {code}  
Also see the example for Wicket 1.5.   
...
Also, the {{getHeaderContribution}} functionality has been removed.  Instead, your component (Page, Panel, etc.) needs to override renderHead(IHeaderResponse): {code} 
public class MyPage extends WebPage implements IHeaderContributor { ... 
  @Override   public void renderHead(IHeaderResponse response) { 
...


Full Content

Wicket 1.3 and earlier
To add _javascript_ or CSS to your pages and have them compressed during the "deployment" cycle automatically by Wicket, start with the _javascript_ or CSS file somewhere in our package hierarchy that we can reference in our Page.  For simplicity, we can copy it right next to the HTML file like so:



MyPage.java
MyPage.html
MyPage.js
MyPage.css



Then in our Page, we need to reference these items based on the path of our Java file, like so:



private static final CompressedResourceReference MYPAGE_JS = new CompressedResourceReference(MyPage.class, "MyPage.js");

private static final CompressedResourceReference MYPAGE_CSS = new CompressedResourceReference(MyPage.class, "MyPage.css");



This code gives us a ResourceReference that we can add to our page, most use cases to the HTML head element block.  To do that in your page:



add(HeaderContributor.forJavaScript( MYPAGE_JS ));

add(HeaderContributor.forCss( MYPAGE_CSS ));



Wicket 1.4
In Wicket 1.4 HeaderContributor.forJavaScript() and HeaderContributor.forCss() are deprecated, so use the code below:


add(_javascript_PackageResource.getHeaderContribution(MYPAGE_JS));

add(CSSPackageResource.getHeaderContribution(MYPAGE_CSS));



Or



public class MyPage extends WebPage {
...
  @Override
  public void renderHead(HtmlHeaderContainer container) {
super.renderHead(container);
container.getHeaderResponse().renderJavascriptReference(new _javascript_ResourceReference(MyPage.class, "script.js"));
  }
...



Also see the example for Wicket 1.5. 

Wicket 1.5
In Wicket 1.5, CompressedResourceReference has been removed!

Also, the getHeaderContribution functionality has been removed.  Instead, your component (Page, Panel, etc.) needs to override renderHead(IHeaderResponse):


public class MyPage extends WebPage implements IHeaderContributor {
...
  @Override
  public void renderHead(IHeaderResponse response) {
response.renderJavaScriptReference("urlHere");
  }



Wicket 6.x
renderJavaScriptReference seems to be gone.


...
private static final _javascript_ResourceReference MYPAGE_JS = new _javascript_ResourceReference(MyPage.class, "MyPage.js");
...
@Override
public void renderHead(IHeaderResponse response) {
  response.render(_javascript_ReferenceHeaderItem.forReference(MYPAGE_JS));
}
...





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Index

2013-01-22 Thread confluence







Index
Page edited by Ondrej Zizka


 Changes (1)
 




...
h3. Application server * [Setup Tomcat] - servlet engine / application server 
* [JBoss AS 7 Wicket Quickstart|http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/wicket-war/] * [Red Hat OpenShift + Wicket - HOWTO|https://community.jboss.org/wiki/JBossAS7WicketJPAInOpenShiftFreeJavaEEHosting] Free hosting for Wicket applications on JBoss AS 7  
 h3. Portal server 
...


Full Content

Bookmarkable URL
Linking to the wikiTo help with the server loading, please only link to pages under the http://cwiki.apache.org/WICKET/ static root.

This wiki is dedicated to documenting the Wicket Java application framework. Wicket takes simplicity, separation of concerns and ease of development to a whole new level. The wiki is currently open to new users and contributors; see the contribution page for more information. To download Wicket, please visit the Wicket site.
Table of contents


About Wicket

What is Wicket?

Introduction to Java web applications

Why Wicket

Framework Comparisons

Who is using Wicket
Where to (get) help

IRC
Community initiatives
Communities on social networking sites
Contribute to Wicket
Commercial Services

What's next

Wish List for Next Version
Migrations

More about Wicket...

Videos, Talks, Screencasts
Wicket Press  User Stories
Companies Hiring Wicket Developers
External Links


Using Wicket

Development Environment

Java
Build tools
IDE
Application server
Portal server
Database

Development

Framework Documentation
GUI-Components and Widgets

Output

Wicket Component Packaging
Portlet Development
Development Aids

Testing




About Wicket

What is Wicket?

Wicket is one of the most recent in a long line of Java web development frameworks and stands on the shoulders of many that have come before it. Wicket is a component-based framework, which puts it in stark contrast to some of the earlier solutions to the sometimes monotonous task of web programming. Like other frameworks, Wicket builds on top of Sun's servlet API; however, unlike frameworks like Struts or Spring MVC, the developer using Wicket is mostly removed from the request/response nature that is inherent with the web and Servlets. Instead of building controllers that must service many users and threads simultaneously, taking in requests, returning responses, and never storing any state, the Wicket developer thinks in terms of stateful components. Instead of creating a controller or action class, he or she creates a page, places components on it, and defines how each component reacts to user input.

This may all sound familiar to those with desktop GUI experience; Microsoft's Visual Studio line, Sun's Swing API, and Borland's Delphi are all popular desktop GUI development tools that use component models. Using components allows the developer to spend less time on the visual tier of his or her app and more time implementing the core functionality. Even more important is how extensible this makes component-based GUIs. Adding additional functionality is simply a matter of adding one more component, which can act independently or in cooperation with other components in the view. These advantages have not been lost on web developers. In fact, many web framework projects have attempted to leverage the productivity and scalability of desktop applications. Apache Jakarta's Tapestry and Microsoft's own ASP.NET as well as Sun's Java Server Faces specification all present solutions to component-based development over the web and bring new ideas to the table. All of these technologies separate the page layout into a template file. JSF uses Sun's JSPs, ASP.NET uses ASP, and Tapestry use's it's own templating system based on standard HTML markup. These pages are rendered on each request, and as they are rendering, they make calls into a backing class to support dynamic content. As much as the word "template" would seem to suggest otherwise, this makes the page template king. Backing classes tends to be a series of listener methods, at the total mercy of the page template that is supposed to be merely defining the placement of components.

This works fine, and it is definitely a step up from a model 2 controller singleton class. Instead of a giant if block, we have well defined methods. Instead of being stateless, we can have instance variables. But now our Java code is a second-class citizen, existing merely to provide the page with the information it needs while it renders itself. Also, this backing class is always aware of the request-response cycle. It knows that getMember() is 

[CONF] Apache Wicket Calling Wicket from Javascript

2013-01-25 Thread confluence







Calling Wicket from _javascript_
Page edited by Nick Pratt


 Changes (3)
 




...
h3. Calling your Java Wicket component from _javascript_ If you add any class that extends AbstractDefaultAjaxBehavior to your page, wicket-ajax.js will be added to the header ofyour web page. wicket-ajax.js provides you with two basic methods to call your component: 
 h4. Wicket 6.0+ Wicket.Ajax.get( ) and Wicket.Ajax.post( )  h4. Older Versions  
function wicketAjaxGet(url, successHandler, failureHandler, precondition, channel)  and 
...
{note}   
Here is an example: 
h4. Example - Wicket 6.0+  This snippet is taken from a piece of code that makes use of PackageTextTemplate, which is added in the renderHead( component, response ) of AbstractDefaultAjaxBehavior {code:java|title=Java} 		String componentMarkupId = component.getMarkupId(); 		String callbackUrl = getCallbackUrl().toString();  		MapString, Object map = new HashMap(); 		map.put( callbackUrl, callbackUrl ); 		map.put( args, Your Arguments Here ); 		map.put( componentMarkupId, componentMarkupId );  		PackageTextTemplate ptt = new PackageTextTemplate( clazz, resources/main.js ); 		OnDomReadyHeaderItem _onDomReadyHeaderItem_ = OnDomReadyHeaderItem.forScript( ptt.asString( map ) ); {code} {code:_javascript_|title=_javascript_ - Fragment of resources/main.js} var wcall = Wicket.Ajax.get({ u: ${callbackUrl} + ${args} }); {code}   h4. Example - Older Versions 
{code:_javascript_|title=_javascript_} function callWicket() { 
...


Full Content

This mini tutorial shows you how to call Wicket from _javascript_. It is based on an e-mail from Michael Sparer.

Setting up the Wicket response to the _javascript_ call

Add the AbstractDefaultAjaxBehavior to the component you'd like to call from _javascript_. You then have to override the respond method of AbstractDefaultAjaxBehavior to perform your actions and to append your changes to the response

For example in your panel:


final AbstractDefaultAjaxBehavior behave = new AbstractDefaultAjaxBehavior() {
protected void respond(final AjaxRequestTarget target) {
target.add(new Label("foo", "Yeah I was just called from _javascript_!"));
}
};
add(behave);



Invoking _javascript_ from your Java Wicket component

Any component can add _javascript_ to the page header by implementing IHeaderContributor, that's where the
response-object gets passed.
TODO: add an example of Java code.

Alternatively, you can add a Wicket label containing _javascript_ to your page:
HTML

script type="text/_javascript_" wicket:id="myScript"/* script will be rendered here *//script



Java

Label myScript = new Label("myScript", "callWicket();");
myScript.setEscapeModelStrings(false); // do not HTML escape _javascript_ code
add(myScript);



Calling your Java Wicket component from _javascript_
If you add any class that extends AbstractDefaultAjaxBehavior to your page, wicket-ajax.js will be added to the header ofyour web page. wicket-ajax.js provides you with two basic methods to call your component:

Wicket 6.0+
Wicket.Ajax.get( )
and
Wicket.Ajax.post( )

Older Versions

function wicketAjaxGet(url, successHandler, failureHandler, precondition, channel) 
and
function wicketAjaxPost(url, body, successHandler, failureHandler, precondition, channel)

Don't POST without POST contentNote that some web servers gulp on HTTP POST requests with no POST content (in other words: "wicketAjaxPost($URL);" is evil).
This is due to some browsers (Firefox, ...) not sending the mandatory header "content-length" when the POST body is empty.
Jetty is generous in this case, while Tomcat might respond with an HTTP 411 error code.
So if you have to use HTTP POST requests, then make sure that at least a dummy _javascript_ object is added as POST data. 

Example - Wicket 6.0+

This snippet is taken from a piece of code that makes use of PackageTextTemplate, which is added in the renderHead( component, response ) of AbstractDefaultAjaxBehavior
Java

		String componentMarkupId = component.getMarkupId();
		String callbackUrl = getCallbackUrl().toString();

		MapString, Object map = new HashMap();
		map.put( "callbackUrl", callbackUrl );
		map.put( "args", "Your Arguments Here" );
		map.put( "componentMarkupId", componentMarkupId );

		PackageTextTemplate ptt = new PackageTextTemplate( clazz, "resources/main.js" );
		OnDomReadyHeaderItem _onDomReadyHeaderItem_ = OnDomReadyHeaderItem.forScript( ptt.asString( map ) );


_javascript_ - Fragment of resources/main.js

var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '${args}' });

 

Example - Older Versions
_javascript_

function callWicket() {
   var wcall = wicketAjaxGet('$url$' + '$args$', function() { 

[CONF] Apache Wicket Calling Wicket from Javascript

2013-01-25 Thread confluence







Calling Wicket from _javascript_
Page edited by Emond Papegaaij


 Changes (2)
 




...
 h4. Wicket 6.0+ 
Wicket.Ajax.get( ) and Wicket.Ajax.post( ) 
 
You use Wicket.Ajax.get( ) and Wicket.Ajax.post( ) in _javascript_ to do an Ajax call to Wicket manually. In Wicket 6, AbstractDefaultAjaxBehavior also has a convenience method to generate a _javascript_ function that performs the call: getCallbackFunction(...). This method can also generate functions that pass parameters from _javascript_ to Wicket.  
h4. Older Versions  
...


Full Content

This mini tutorial shows you how to call Wicket from _javascript_. It is based on an e-mail from Michael Sparer.

Setting up the Wicket response to the _javascript_ call

Add the AbstractDefaultAjaxBehavior to the component you'd like to call from _javascript_. You then have to override the respond method of AbstractDefaultAjaxBehavior to perform your actions and to append your changes to the response

For example in your panel:


final AbstractDefaultAjaxBehavior behave = new AbstractDefaultAjaxBehavior() {
protected void respond(final AjaxRequestTarget target) {
target.add(new Label("foo", "Yeah I was just called from _javascript_!"));
}
};
add(behave);



Invoking _javascript_ from your Java Wicket component

Any component can add _javascript_ to the page header by implementing IHeaderContributor, that's where the
response-object gets passed.
TODO: add an example of Java code.

Alternatively, you can add a Wicket label containing _javascript_ to your page:
HTML

script type="text/_javascript_" wicket:id="myScript"/* script will be rendered here *//script



Java

Label myScript = new Label("myScript", "callWicket();");
myScript.setEscapeModelStrings(false); // do not HTML escape _javascript_ code
add(myScript);



Calling your Java Wicket component from _javascript_
If you add any class that extends AbstractDefaultAjaxBehavior to your page, wicket-ajax.js will be added to the header ofyour web page. wicket-ajax.js provides you with two basic methods to call your component:

Wicket 6.0+

You use Wicket.Ajax.get( ) and Wicket.Ajax.post( ) in _javascript_ to do an Ajax call to Wicket manually. In Wicket 6, AbstractDefaultAjaxBehavior also has a convenience method to generate a _javascript_ function that performs the call: getCallbackFunction(...). This method can also generate functions that pass parameters from _javascript_ to Wicket.

Older Versions

function wicketAjaxGet(url, successHandler, failureHandler, precondition, channel) 
and
function wicketAjaxPost(url, body, successHandler, failureHandler, precondition, channel)

Don't POST without POST contentNote that some web servers gulp on HTTP POST requests with no POST content (in other words: "wicketAjaxPost($URL);" is evil).
This is due to some browsers (Firefox, ...) not sending the mandatory header "content-length" when the POST body is empty.
Jetty is generous in this case, while Tomcat might respond with an HTTP 411 error code.
So if you have to use HTTP POST requests, then make sure that at least a dummy _javascript_ object is added as POST data. 

Example - Wicket 6.0+

This snippet is taken from a piece of code that makes use of PackageTextTemplate, which is added in the renderHead( component, response ) of AbstractDefaultAjaxBehavior
Java

		String componentMarkupId = component.getMarkupId();
		String callbackUrl = getCallbackUrl().toString();

		MapString, Object map = new HashMap();
		map.put( "callbackUrl", callbackUrl );
		map.put( "args", "Your Arguments Here" );
		map.put( "componentMarkupId", componentMarkupId );

		PackageTextTemplate ptt = new PackageTextTemplate( clazz, "resources/main.js" );
		OnDomReadyHeaderItem _onDomReadyHeaderItem_ = OnDomReadyHeaderItem.forScript( ptt.asString( map ) );


_javascript_ - Fragment of resources/main.js

var wcall = Wicket.Ajax.get({ u: '${callbackUrl}' + '${args}' });

 

Example - Older Versions
_javascript_

function callWicket() {
   var wcall = wicketAjaxGet('$url$' + '$args$', function() { }, function() { });
}

 

'$url$' is obtained from the method behave.getCallbackUrl(). If you paste the String returned from that method into your browser, you'll invoke the respond method, the same applies for the _javascript_ method.

You can optionally add arguments by appending these to the URL string. They take the form foo=bar.

Obtaining the GET/POST arguments on the server side

Ok, this is actually quite ugly, but you get the optional arguments in the response method like this:
Java

IRequestParameters params = RequestCycle.get().getRequest().getRequestParameters();


Or to retrieve a single parameter by its key:
Java

String paramFoo = 

[CONF] Apache Wicket More on models

2013-01-29 Thread confluence







More on models
Page edited by Kai Broszat


 Changes (2)
 




...
will convert the contents of the text field to and from an Integer value.  
{warning:title=BoundCompoundPropertyModel has been removed in Wicket 6!}  
In the event that you need more flexibility or property expressions power in your compound models, you can use the {{BoundCompoundPropertyModel}}.  This class provides three methods you can call on the containers model object to bind a given child Component to a specific property _expression_ and/or type conversion: {code} 
...
{code} The {{Form}} is constructed without a model.  We then create the Forms model as a {{BoundCompoundPropertyModel}}, set it as the Forms model and finally use it to bind the {{RequiredTextField}} to the desired property _expression_. 
{warning} 
 h4. String Resource Models 
...


Full Content

More on models

Let us take a closer look at models.

The HelloWorld example program demonstrates the simplest model type in Wicket:


public class HelloWorld extends WicketExamplePage
{
  public HelloWorld()
  {
add(new Label("message", "Hello World!"));
  }
}


The first parameter to the Label component added in the constructor is the Wicket id, which associates the Label with a tag in the HelloWorld.html markup file:


html
head
	titleWicket Examples - helloworld/title
	link rel="stylesheet" type="text/css" href="" class="code-quote">"style.css"/
/head
body
	span wicket:id="mainNavigation"main nav will be here/span
	span wicket:id="message"Message goes here/span
/body
/html


The second parameter to Label is the model for the Label, which provides content which replaces any text inside the span tag that the Label is attached to.  The model being passed to the Label constructor above is apparently a String.  But if we look inside the Label constructor, we see that this constructor is merely there for convenience - it wraps its String argument in a Model object like this:


public Label(final String id, String label)
{
  this(id, new Model(label));
}


If we look up the inheritance hierarchy for Label, we see that Label extends WebComponent, which in turn extends Component. Each of these superclasses has only two constructors. One Component constructor takes a String id:


public Component(final String id)
{
  setId(id);
}


And the other takes a String id and an IModel:


public Component(final String id, final IModel model)
{
  setId(id);
  setModel(model);
}


IModel is the interface that must be implemented by all Wicket model objects.  It looks like this:


public interface IModel extends IDetachable
{
  public Object getObject();
  public void setObject(Object object);
}


And the base interface IDetachable looks like this:


public interface IDetachable extends Serializable
{
  public void detach();
}


These details are not especially interesting to a beginning model user, so we will come back to this later.  What we need to know right now is that Model is an IModel and therefore it can be passed to the Component(String, IModel) constructor we saw a moment ago.

If we take a peek inside Model, we'll see that the Model object is simply a wrapper that holds a Serializable object:


private Serializable object;


Model's object value is Serializable in order to support deployment of web applications in clustered environments.  Note also that since IModel extends IDetachable, which extends Serializable, all IModel wrapper classes are themselves Serializable.  So all Wicket models are therefore serializable, which means that they can be replicated between servers in a cluster.  Don't worry if you don't fully understand this.  We will talk more about clustering later.

Working with POJOs

While using a String like we did in the above example ('Hello World') is convenient, you will usually want to work with domain objects directly. To illustrate how Wicket supports working with domain object, we use the following Plain Old Java Object (POJO) for our examples:


import java.util.Date;

public class Person
{
  private String name;
  private Date birthday;

  public Person()
  {
  }
  public String getName()
  {
return name;
  }
  public void setName(String name)
  {
this.name = name;
  }
  public Date getBirthday()
  {
return birthday;
  }
  public void setBirthday(Date birthday)
  {
this.birthday = birthday;
  }
}



Static models

Like we have seen above, the simplest way of providing e.g. a Label a model, is just to provide a string, and let the Label implicitly construct one for you.


add(new Label("name", person.getName()));


We can create the model explicitly like:


Model model = new Model(person.getName());
add(new Label("name", 

[CONF] Apache Wicket Wicket's XHTML tags

2013-01-30 Thread confluence







Wickets XHTML tags
Page edited by Ondrej Zizka


 Changes (2)
 




...
 h3. Element wicket:enclosure 
*wicket:enclosure* \- (since 1.3) This tag is useful for filtering markup that surrounds a component but has its visibility dependent on the visibility of that component. Lets take a simple example of where you want to show a table row, but only if a Label is visible. 
*wicket:enclosure* \- (since 1.3) Useful for markup whose visibility depends on visibility of surrounded component. Lets take a simple example where you want to show a table row, but only if a Label is visible.  
{code:xml} trtd class=labelPhone:/tdtdspan wicket:id=phonephone number/span/td/tr 
...
{code:xml} table 
 span wicket:id=repeater
  trtd.../td/tr
  trtd.../td/tr
 /span 
/table {code} 
...
{code:xml} table 
 wicket:container wicket:id=repeater
  trtd.../td/tr
  trtd.../td/tr
 /wicket:container
/table 
{code} The above is valid markup because wicket namespaced tags are allowed anywhere. 
...


Full Content



Using Wicket Tags
Wicket Attributes

Attribute wicket:id
Attribute wicket:message
Attribute wicket:enclosure
Attribute wicket:for
Attribute wicket:unknown
Attribute wicket:scope

Wicket Tags

Element wicket:link
Element wicket:panel
Element wicket:fragment
Elements wicket:border and wicket:body
Element wicket:extend
Element wicket:child
Element wicket:message
Element wicket:remove
Element wicket:head
Element wicket:enclosure
Element wicket:container



The HTML documents that Wicket uses as templates can contain several special attributes and tags

Using Wicket Tags

To make most HTML editors not complain about using wicket tags and attributes, you need to declare the namespace. You can use any value for the namespace 'xmlns:wicket' but this value should be mapped in your HTML editor to one of the following definitions:


Wicket 1.5+ (XML Schema): http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob_plain;f=wicket-core/src/main/resources/META-INF/wicket-1.5.xsd;hb=master
Wicket 1.4 (DTD): http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd
Wicket 1.3 (DTD): http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd
Wicket 1.2 and earlier: http://wicket.sourceforge.net/



Note that some HTML editors (e.g. IntelliJ IDEA's) can't handle the redirect (302) when fetching the schema. Start URL with https as workaround.

For example the first lines of a markup file could be:


?xml version="1.0" encoding="UTF-8"?
html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" xml:lang="da" lang="da"



or


!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
html xmlns="http://www.w3.org/1999/xhtml"  
  xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.3-strict.dtd"  
  xml:lang="en"  
  lang="en" 



or


!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
html xmlns="http://www.w3.org/1999/xhtml"  
  xmlns:wicket="http://my.site.org" 



In the latter demo we use custom value for 'wicket' namespace. To make it working you need to provide a mapping in your HTML editor that will map from 'http://my.site.org' to any of the available XML Schema or DTDs above.
For example in Intellij IDEA you can do that with: File - Settings - Schemas and DTDs - External Schemas and DTDs - add new entry with URI 'http://my.site.org' and Location one of the above.

This will setup the "wicket" namespace for Wicket tags. You can change the namespace used, for example xmlns:wcn="DTD here" will change it to "wcn" for this markup file only. Without any xmlns declaration the default is "wicket". Just using xmlns:wicket and xmlns:wcn on their own will work as well, as long as you don't have any additional namespace declarations.
What you can not do (but is possible with XHTML) is change the namespace within the very same markup file per tag. Wicket does allow it only with the html tag.

If your IDE needs a DTD, for Wicket 1.3 and later the namespace is also the URL where the DTD can be retrieved.

Wicket Attributes

Attribute wicket:id

wicket:id="ID_HERE"  Used on any element to which you want to add a component.


span wicket:id="hellotext"Hello/span



The value of the attribute is duplicated in the java code:


add(new Label("hellotext", "Hello World"));



Attribute wicket:message
wicket:message="attribute:resource_identifier"  Used on any tag 

[CONF] Apache Wicket Wicket Products

2013-02-01 Thread confluence







Wicket Products
Page edited by Ondrej Zizka


 Changes (1)
 




...
* [Small Improvements|http://www.small-improvements.com] Wicket and GAE based system to power your employee performance reviews and 360 degree feedback. * [syntevo.com|http://www.syntevo.com] SVN client: SmartSVN, CVS client: SmartCVS 
* [tally-ho|https://tally-ho.dev.java.net/] Forum/Community software powering [morons.org|http://morons.org] 
* [Vocus student information system|http://www.vocuslis.nl/] Topicus created a web based student administration system for highschools. The application is not publicly available. * [Voyager - GIS Data Discovery|http://voyagergis.com/] Search engine for your geographic data. 
...


Full Content

(sorted alphabetically by product name)


	amiando amiando is Europe’s leading tool for online registration and ticketing build on wicket
	Artifactory Artifactory is a maven2 proxy based on Wicket
	Brix CMS Wicket and JCR based CMS Framework. Allows developers to build dynamic CMS-based web sites using Wicket Components.
	Burgerweeshuis An open source CMS for pop venues, currently only dutch
	CentralWire An open source centralized management console for tripwire, using Wicket, Spring, Hibernate/JPA.
	Devproof DevProof is a portal framework that comes with modules like blogging, bookmarks, downloads, articles and more.
	eHour eHour is an open source timesheet management app
	Elephas Elephas is an open-source blogging system.
	Finan Finan is a financial analysis tool and now features a web based solution for their win32 deplhi client application built using Wicket
	GaeWicketBlog GaeWicketBlog is a simple open source blog/issue tracker running on Google App Engine. Lightweight and easy to deploy.
	hackystat-ui-wicket Wicket-based interface to Hackystat
	Hippo CMS 7 An open source and enterprise-ready CMS based on Wicket, Jackrabbit and Lucene.
	Irrigator A simple web interface for controlling water taps in an irrigation system
	JTrac JTrac is an open source and highly customizable issue-tracking web-application written in Java.
	mediacockpit  A Digital Asset Management (DAM) platform written in Java with Apache Wicket.
	Profile2  A Web2-styled Wicket-based Profile tool for Sakai.
	QuickBuild A continuous integration and release management tool based on Wicket, Guice, and Hibernate.
	Servoy A RAD environment which uses Wicket for web interface generation
	Small Improvements Wicket and GAE based system to power your employee performance reviews and 360 degree feedback.
	syntevo.com SVN client: SmartSVN, CVS client: SmartCVS
	Vocus student information system Topicus created a web based student administration system for highschools. The application is not publicly available.
	Voyager - GIS Data Discovery Search engine for your geographic data.
	WebiCal A Web application to view and edit multiple iCalendars
	Xaloon Components, integrated wicket based web portal/application solution
	OpenMQSeriesOpenMQSeries is a JAVA software which allows the management of MQseries Messages. it offers to the user the possibility of displaying, manipulating and managing messages in a WebSphere MQ Queue.





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Wicket Products

2013-02-01 Thread confluence







Wicket Products
Page edited by Ondrej Zizka


 Changes (6)
 




...
* [amiando|http://www.amiando.com] amiando is Europe’s leading tool for online registration and ticketing build on wicket * [Artifactory|http://www.jfrog.org/sites/artifactory/1.2/] Artifactory is a maven2 proxy based on Wicket 
* [Brix CMS|http://brix-cms.googlecode.com/] CMS|https://github.com/brix-cms/brix-cms#readme] Wicket and JCR based CMS Framework. Allows developers to build dynamic CMS-based web sites using Wicket Components. 
* [Burgerweeshuis|http://burgerweeshuis.sf.net] An open source CMS for pop venues, currently only dutch 
* [CentralWire|http://http://centralwire.sourceforge.net] An open source centralized management console for tripwire, using Wicket, Spring, Hibernate/JPA. 
* [Devproof|http://www.devproof.org] DevProof is a portal framework that comes with modules like blogging, bookmarks, downloads, articles and more. * [eHour|http://www.ehour.nl/] eHour is an open source timesheet management app 
...
* [GaeWicketBlog|http://gaewicketblog.appspot.com] GaeWicketBlog is a simple open source blog/issue tracker running on Google App Engine. Lightweight and easy to deploy. * [hackystat-ui-wicket|http://code.google.com/p/hackystat-ui-wicket/] Wicket-based interface to Hackystat 
* [Hippo CMS 7|http://www.onehippo.org/cms7/] An open source and enterprise-ready CMS based on Wicket, Jackrabbit and Lucene. 
* [Irrigator|http://code.google.com/p/irrigator/] A simple web interface for controlling water taps in an irrigation system * [JTrac|http://jtrac.info/] JTrac is an open source and highly customizable issue-tracking web-application written in Java. 
...
* [Small Improvements|http://www.small-improvements.com] Wicket and GAE based system to power your employee performance reviews and 360 degree feedback. * [syntevo.com|http://www.syntevo.com] SVN client: SmartSVN, CVS client: SmartCVS 
* [Vocus student information system|http://www.vocuslis.nl/] Topicus created a web based student administration system for highschools. The application is not publicly available. 
* [Voyager - GIS Data Discovery|http://voyagergis.com/] Search engine for your geographic data. 
* [WebiCal|http://www.webical.org] A Web application to view and edit multiple iCalendars 
* [Xaloon|http://xaloon.org] Components, integrated wicket based web portal/application solution 
* [OpenMQSeries|http://sourceforge.net/projects/openmqseries/]OpenMQSeries is a JAVA software which allows the management of MQseries Messages. it offers to the user the possibility of displaying, manipulating and managing messages in a WebSphere MQ Queue. 


Full Content

(sorted alphabetically by product name)


	amiando amiando is Europe’s leading tool for online registration and ticketing build on wicket
	Artifactory Artifactory is a maven2 proxy based on Wicket
	Brix CMS Wicket and JCR based CMS Framework. Allows developers to build dynamic CMS-based web sites using Wicket Components.
	Burgerweeshuis An open source CMS for pop venues, currently only dutch
	CentralWire An open source centralized management console for tripwire, using Wicket, Spring, Hibernate/JPA.
	Devproof DevProof is a portal framework that comes with modules like blogging, bookmarks, downloads, articles and more.
	eHour eHour is an open source timesheet management app
	Elephas Elephas is an open-source blogging system.
	Finan Finan is a financial analysis tool and now features a web based solution for their win32 deplhi client application built using Wicket
	GaeWicketBlog GaeWicketBlog is a simple open source blog/issue tracker running on Google App Engine. Lightweight and easy to deploy.
	hackystat-ui-wicket Wicket-based interface to Hackystat
	Hippo CMS 7 An open source and enterprise-ready CMS based on Wicket, Jackrabbit and Lucene.
	Irrigator A simple web interface for controlling water taps in an irrigation system
	JTrac JTrac is an open source and highly customizable issue-tracking web-application written in Java.
	mediacockpit  A Digital Asset Management (DAM) platform written in Java with Apache Wicket.
	Profile2  A Web2-styled Wicket-based Profile tool for Sakai.
	QuickBuild A continuous integration and release management tool based on Wicket, Guice, and Hibernate.
	Servoy A RAD environment which uses Wicket for web interface generation
	Small Improvements Wicket and GAE based system to power your employee performance reviews and 360 degree feedback.
	syntevo.com SVN client: SmartSVN, CVS client: SmartCVS
	Voyager - GIS Data Discovery Search engine for your geographic data.
	Xaloon Components, integrated wicket 

[CONF] Apache Wicket How to switch to SSL mode

2013-02-11 Thread confluence







How to switch to SSL mode
Page edited by Chris Merrill


Comment:
correct reference to @RequireHttps (was: @RequiresHttps)


 Changes (1)
 




...
{code}  
As with previous versions of Wicket, now all you need to do is include the @RequiresHttps attribute on your Pages or Components. 
  
...


Full Content

Wicket 6.x, usingHttpsMapper

Inside of the Application.init() method add the following.

It is extemtely important that when setting the rootRequestMapper it is done AFTER you have added any bookmarkable links otherwise they will not be switched over to Secure mode.




mountPage("/somepage", MyPage.class);

// notice that in most cases this should be done as the
// last mounting-related operation because it replaces the root mapper
setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()));



As with previous versions of Wicket, now all you need to do is include the @RequireHttps attribute on your Pages or Components.


Using other methods to determine if Https should be use:

Referencing the example above, override thegetDesiredSchemeFormethod.


setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new HttpsConfig()){
  @Override
  protected Scheme getDesiredSchemeFor(Class pageClass) {
 if (getConfigurationType()==RuntimeConfigurationType.DEVELOPMENT) {
 log.debug("Dev mode, always use HTTP");
 return Scheme.HTTP;
  } else {
 log.debug("not in development mode, letting the mapper decide, or roll you own solution");
 return super.getDesiredSchemeFor(pageClass);
  }
   }
});






Using HttpsRequestCycleProcessor (after 1.4--rc3)

By replacing the default WebRequestCycleProcessor with the HttpsRequestCycleProcessor, you are able to specify secure pages using the @RequireHttps annotation on your pages. If you wanted a little more control... lets say for development you did not want your annotated pages to use https, you could bypass the Switch Protocol code like this. As of 1.4-rc3 Wicket provides built in support for http/https switching via org.apache.wicket.protocol.https.HttpsRequestCycleProcessor. Please see the javadoc of this class for details


@Override
protected IRequestCycleProcessor newRequestCycleProcessor()
{
HttpsConfig config = new HttpsConfig(80,443);
return new HttpsRequestCycleProcessor(config)
{

@Override
protected IRequestTarget checkSecureIncoming(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
	return target;
}
else
{
return super.checkSecureIncoming(target);
}
}

@Override
protected IRequestTarget checkSecureOutgoing(IRequestTarget target)
{
if (getConfigurationType().equals(Application.DEVELOPMENT))
{
return target;
}
else
{
return super.checkSecureOutgoing(target);
}
}

};
}



For The Entire Application

web.xml

web-app ...
   security-constraint
  user-data-constraint
 transport-guaranteeCONFIDENTIAL/transport-guarantee
  /user-data-constraint
   /security-constraint
/web-app


Quote from web-app_2_3.dtd:
The transport-guarantee element specifies that the communication
between client and server should be NONE, INTEGRAL, or
CONFIDENTIAL. NONE means that the application does not require any
transport guarantees. A value of INTEGRAL means that the application
requires that the data sent between the client and server be sent in
such a way that it can't be changed in transit. CONFIDENTIAL means
that the application requires that the data be transmitted in a
fashion that prevents other entities from observing the contents of
the transmission. In most cases, the presence of the INTEGRAL or
CONFIDENTIAL flag will indicate that the use of SSL is required.

For Particular Pages
An explanation of how to transparently switch from http to https.
Table of contents


Change Render Strategy
Create RequiredSSL Annotation
Create New Response Strategy
Annotate Your Pages
Edit:
Edit (Wicket 1.3.x):
Edit (Wicket 1.3.x) alternative:



Change Render Strategy

Change the rendering strategy in your application.


getRequestCycleSettings().setRenderStrategy(Settings.ONE_PASS_RENDER);


I could not get this to work with the other strategies because you cannot send more than one redirect in the same request.  You lose some features like avoiding double submit, but you can avoid that with some _javascript_.  You gain some performance because the rendering is also done in the 

[CONF] Apache Wicket Spring

2013-02-21 Thread confluence







Spring
Page edited by Gerry King


Comment:
replaced 'accessor' (which is incorrect) with 'setter' in WARNING. Small but not minor change


 Changes (1)
 




...
h3.  Annotation-based Approach {warning} 
Please note that you cannot use *constructor argument* based injection with Wicket, only accessor-based setter-based injection! 
{warning} Its possible to have your annotated dependencies automatically injected on construction. For this you have to install a SpringComponentInjector in your application. 
...


Full Content

Bookmarkable link

Table of contents


The Issues

Wicket is an unmanaged framework
Wicket components and models are often serialized

Solutions

Application Object Approach
Proxy-based Approach
Annotation-based Approach
Unit Testing the Proxy Approach

Unit Testing Proxy Approach with Custom Session


Beyond Spring
Using @SpringBean beyond Wicket
Getting wicket-spring with Maven 2




	Wicket-spring project is in the subversion alongside wicket.
	Please read on for some Maven tips.
	Also look at wicket-examples org.apache.wicket.spring packages for examples.
	Some knowledge of spring is required.
	In wicket the Page class is a subclass of Component, so from here on the word component can represent either a component or a page.



The Issues
Most problems with injecting dependencies from an IOC container come from the following

	wicket is an unmanaged framework
	wicket components and models are often serialized



Wicket is an unmanaged framework
Wicket does not manage the lifecycle of its components. This means that a page or a component can be created anywhere in the code by simply using the new operator. This makes it difficult to inject dependencies because it is difficult to intercept the creation of the component. A possible solution can be to use a singleton factory to create the components and subsequently inject them with dependencies. However, this approach is not very flexible because it is often more convenient to have specific constructors in components rather than the default empty constructor. ie 


class EditUserPage extends WebPage {
public EditUserPage(long userId) {...}
}
...
setResponsePage(new EditUserPage(userId));


is far more convenient than


class EditUserPage extends WebPage {
public EditUserPage() {...}
void setUserId(long userId) {...}
}
...
PageFactory factory=getPageFactory();
EditUserPage page=(EditUserPage)factory.createPage(EditUserPage.class);
page.setUserId(userId);
setResponsePage(page);



Wicket components and models are often serialized
Wicket keeps its tree of components in the session. In a clustered environment, session data needs to be replicated across the cluster. This is done by serializing objects in a cluster-node's session and deserializing them on another cluster-node's session. This presents a problem for dependency injection because it is not desirable to serialize the dependency. Dependencies often have references  to other dependencies in the container, and so if one is serialized it will probably serialize a few others and can possibly cascade to serializing the entire container. To say the least, this is undesirable. Even if the cascading is not a problem and the dependency is serialized, when it deserializes it will no longer be part of the conainer - it will be a stand alone clone. This is also undesirable.

Solutions

Application Object Approach
Wicket applications have a global application object which is a subclass of Application. This global application object is only created once per application and is never serialized (since it contains no user-specific data and thus remains the same across all nodes in the cluster). These qualities make it a good candidate to act as a service locator for the rest of the application. Wicket allows you to provide a custom factory for creating this object, the wicket-contrib-spring project provides such a factory (SpringWebApplicationFactory) that, instead of creating an instance, pulls it out of the spring application context. Wicket keeps the instance of the application object in a threadlocal variable and provides various helper methods in components to get to it, so it is easy to retrieve dependencies in wicket components.

Example:

web.xml:


...
servlet
servlet-namewicket/servlet-name
servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class
init-param
param-nameapplicationFactoryClassName/param-name
param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value
/init-param
init-param
param-nameapplicationBean/param-name
param-valuewicketApplication/param-value
  

[CONF] Apache Wicket Generic Busy Indicator (for both Ajax and non-Ajax submits)

2013-03-05 Thread confluence







Generic Busy Indicator (for both Ajax and non-Ajax submits)
Page edited by Marcus Bosten


Comment:
added some code for usage along with wicket 6


 Changes (2)
 




...
{code} This code has been tested on both IE and Firefox (06/2008). 
h3. with Wicket 6 one can use the following code 
 
{code} script type=text/_javascript_  window._onload_ = setupFunc;   function setupFunc() {document.getElementsByTagName(body)[0]._onclick_ = clickFunc;hideBusysign();Wicket.Event.subscribe(/ajax/call/beforeSend, function( attributes, jqXHR, settings ) { 	   showBusysign() 	});Wicket.Event.subscribe(/ajax/call/complete, function( attributes, jqXHR, textStatus) { 	   hideBusysign() 	});  }   function hideBusysign() {document.getElementById(ajaxveil).style.display =none;  }   function showBusysign() {document.getElementById(ajaxveil).style.display =inline;  }   function clickFunc(eventData) {var clickedElement = (window.event) ? event.srcElement : eventData.target;if ((clickedElement.tagName.toUpperCase() == BUTTON || clickedElement.tagName.toUpperCase() == A || clickedElement.parentNode.tagName.toUpperCase() == A  || (clickedElement.tagName.toUpperCase() == INPUT  (clickedElement.type.toUpperCase() == BUTTON || clickedElement.type.toUpperCase() == SUBMIT)))clickedElement.parentNode.id.toUpperCase() != NOBUSY ) {  showBusysign();}  } /script /head body   div id=ajaxveilh1nbsp;nbsp; ... nbsp;nbsp;/h1 /div {code}  
h3. Special circumstances  
...


Full Content

Generic Busy Indicator (for both Ajax and non-Ajax submits)

The idea of a generic busy indicator is to show a busy sign whenever the browser is processing remote requests. Ofcourse this feature comes built in with every browser, but users get confused whether the site is really loading something or if the site has just stalled - if nothing appears on the site itself. This often results in the users clicking the request buttons several times, which just adds into the possible overload of the network and the servers. User anxiety can be significantly reduced showing a busy signal to the user (think, e.g., gmail busy indicator).

The following script is a working example that will set a busy indicator visible whenever a link or button is pressed on the web page. It simply detects the user click and analyzes the reason to decide whether to show the busy indicator. Whenever a new page is loaded, the busy sign is hidden again. The wicket-specific addition is that the indicator is handled properly also when the page is not completely loaded but instead there is an ajax request being processed.

Code

Style a busy indicator:


style type="text/css"
#bysy_indicator {
  display: none;
  float: right;
  background: rgb(255,241,168);
  margin-top: 5px;
  z-index: 1000;
  width: 200;
  font-weight: bold;
  text-align: center;
  font-size: 1em;
}
/style


Attach some _javascript_ to the page:


script type="text/_javascript_"
 window._onload_ = setupFunc;

 function setupFunc() {
   document.getElementsByTagName('body')[0]._onclick_ = clickFunc;
   hideBusysign();
 Wicket.Ajax.registerPreCallHandler(showBusysign);
 Wicket.Ajax.registerPostCallHandler(hideBusysign);
 Wicket.Ajax.registerFailureHandler(hideBusysign);
 }

 function hideBusysign() {
   document.getElementById('bysy_indicator').style.display ='none';
 }

 function showBusysign() {
   document.getElementById('bysy_indicator').style.display ='inline';
 }

 function clickFunc(eventData) {
   var clickedElement = (window.event) ? event.srcElement : eventData.target;
   if (clickedElement.tagName.toUpperCase() == 'BUTTON' || clickedElement.tagName.toUpperCase() == 'A' || clickedElement.parentNode.tagName.toUpperCase() == 'A'
 || (clickedElement.tagName.toUpperCase() == 'INPUT'  (clickedElement.type.toUpperCase() == 'BUTTON' || clickedElement.type.toUpperCase() == 'SUBMIT'))) {
 showBusysign();
   }
 }
/script


And finally render the busy indicator somewhere in your page:


div id="bysy_indicator"Loading .../div


This code has been tested on both IE and Firefox (06/2008).
with Wicket 6 one can use the following code



script type="text/_javascript_"
 window._onload_ = setupFunc;

 function setupFunc() {
   document.getElementsByTagName('body')[0]._onclick_ = clickFunc;
   hideBusysign();
   Wicket.Event.subscribe('/ajax/call/beforeSend', function( attributes, jqXHR, settings ) {
	   showBusysign()
	});
   Wicket.Event.subscribe('/ajax/call/complete', function( attributes, jqXHR, textStatus) {
	   hideBusysign()
	});
 }

 function hideBusysign() {
   document.getElementById('ajaxveil').style.display ='none';
 

[CONF] Apache Wicket Index

2013-03-08 Thread confluence







Index
Page edited by Ralf Eichinger


 Changes (1)
 




...
 h3. GUI-Components and Widgets 
Here is the reference for the standard Wicket GUI components: [Component Reference|http://wicketstuff.org/wicket14/compref/] Reference|http://www.wicket-library.com/wicket-examples-6.0.x/compref/] 
 h4. Output 
...


Full Content

Bookmarkable URL
Linking to the wikiTo help with the server loading, please only link to pages under the http://cwiki.apache.org/WICKET/ static root.

This wiki is dedicated to documenting the Wicket Java application framework. Wicket takes simplicity, separation of concerns and ease of development to a whole new level. The wiki is currently open to new users and contributors; see the contribution page for more information. To download Wicket, please visit the Wicket site.
Table of contents


About Wicket

What is Wicket?

Introduction to Java web applications

Why Wicket

Framework Comparisons

Who is using Wicket
Where to (get) help

IRC
Community initiatives
Communities on social networking sites
Contribute to Wicket
Commercial Services

What's next

Wish List for Next Version
Migrations

More about Wicket...

Videos, Talks, Screencasts
Wicket Press  User Stories
Companies Hiring Wicket Developers
External Links


Using Wicket

Development Environment

Java
Build tools
IDE
Application server
Portal server
Database

Development

Framework Documentation
GUI-Components and Widgets

Output

Wicket Component Packaging
Portlet Development
Development Aids

Testing




About Wicket

What is Wicket?

Wicket is one of the most recent in a long line of Java web development frameworks and stands on the shoulders of many that have come before it. Wicket is a component-based framework, which puts it in stark contrast to some of the earlier solutions to the sometimes monotonous task of web programming. Like other frameworks, Wicket builds on top of Sun's servlet API; however, unlike frameworks like Struts or Spring MVC, the developer using Wicket is mostly removed from the request/response nature that is inherent with the web and Servlets. Instead of building controllers that must service many users and threads simultaneously, taking in requests, returning responses, and never storing any state, the Wicket developer thinks in terms of stateful components. Instead of creating a controller or action class, he or she creates a page, places components on it, and defines how each component reacts to user input.

This may all sound familiar to those with desktop GUI experience; Microsoft's Visual Studio line, Sun's Swing API, and Borland's Delphi are all popular desktop GUI development tools that use component models. Using components allows the developer to spend less time on the visual tier of his or her app and more time implementing the core functionality. Even more important is how extensible this makes component-based GUIs. Adding additional functionality is simply a matter of adding one more component, which can act independently or in cooperation with other components in the view. These advantages have not been lost on web developers. In fact, many web framework projects have attempted to leverage the productivity and scalability of desktop applications. Apache Jakarta's Tapestry and Microsoft's own ASP.NET as well as Sun's Java Server Faces specification all present solutions to component-based development over the web and bring new ideas to the table. All of these technologies separate the page layout into a template file. JSF uses Sun's JSPs, ASP.NET uses ASP, and Tapestry use's it's own templating system based on standard HTML markup. These pages are rendered on each request, and as they are rendering, they make calls into a backing class to support dynamic content. As much as the word "template" would seem to suggest otherwise, this makes the page template king. Backing classes tends to be a series of listener methods, at the total mercy of the page template that is supposed to be merely defining the placement of components.

This works fine, and it is definitely a step up from a model 2 controller singleton class. Instead of a giant if block, we have well defined methods. Instead of being stateless, we can have instance variables. But now our Java code is a second-class citizen, existing merely to provide the page with the information it needs while it renders itself. Also, this backing class is always aware of the request-response cycle. It knows that getMember() is going to be called on every request, and reacts accordingly by getting a fresh copy from the database. Sure, the developer needs 

[CONF] Apache Wicket Wicket Native WebSockets

2013-03-19 Thread confluence







Wicket Native WebSockets
Page edited by Hendy Irawan


 Changes (2)
 




...
 For Jetty 7.5+ this is  
filter-classorg.apache.wicket.protocol.http.Jetty7WebSocketFilter/filter-class filter-classorg.apache.wicket.protocol.ws.jetty7.Jetty7WebSocketFilter/filter-class 
 For Tomcat 7.0.27+: 
filter-classorg.apache.wicket.protocol.http.Tomcat7WebSocketFilter/filter-class filter-classorg.apache.wicket.protocol.ws.tomcat7.Tomcat7WebSocketFilter/filter-class 
 h5. WebSocketBehavior 
...


Full Content



What ?
Why ?
How it works ?
How to use it ?


Maven dependency
Custom WicketFilter
WebSocketBehavior
Client side APIs


Testing
Differences with Wicket-Atmosphere module.
FAQ

Request and session scoped beans do not work.



Wicket Native WebSockets


What ?

Since version 6.0 Wicket provides an experimental module that provides integration with WebSocket support in the web containers like Jetty and Tomcat.

Why ?

Martin Grigorov looked at Typesafe's Console and the support for WebSockets in Play Framework as a whole and I decided that it will be a good addition to WicketStuff HTML5 project. Later Martijn Dashorst suggested that such projects should be added to Apache Wicket as experimental modules and when they become more mature they can be promoted as production ready, or if they are not used/liked then they can be moved to WicketStuff project. 

How it works ?

Each of the integrations provide a custom implementation of org.apache.wicket.protocol.http.WicketFilter that first checks whether the current web request needs to upgrade its protocol from HTTP to WebSocket. This is done by checking the request headers for the special header with name "Upgrade". If the request is an upgrade then the filter registers an endpoint for the web socket connection. Later this endpoint is used to read/write messages from/to the client. 
All messages sent through the web socket connection are not intercepted by WicketFilter. This is how the web containers currently work.
When a client is connected it is being registered in a global (application scoped) registry using as a key the application, the client session and the id of the page that registered it. Later when the server needs to push a message it uses this registry to filter which clients need to receive the message.
When a message is received from the client Wicket uses the associated page id for the web connection and loads the Wicket Page as Ajax requests do, then it broadcasts a IWebSocketMessage (Wicket 1.5 Event system) to all its components so they can react on it.
The server-side can push plain text and binary messages to the client - pure web socket messages, but can also add components for re-render, prepend/append _javascript_ as you do with AjaxRequestTarget.

How to use it ?

Maven dependency

Add dependency to either org.apache.wicket:wicket-native-websocket-jetty or org.apache.wicket:wicket-native-websocket-tomcat.

Custom WicketFilter 

Setup the custom WicketFilter implementation for the chosen web container in your web.xml.

For Jetty 7.5+ this is 
  filter-classorg.apache.wicket.protocol.ws.jetty7.Jetty7WebSocketFilter/filter-class

For Tomcat 7.0.27+:
  filter-classorg.apache.wicket.protocol.ws.tomcat7.Tomcat7WebSocketFilter/filter-class

WebSocketBehavior

org.apache.wicket.protocol.ws.api.WebSocketBehavior is much like Ajax behaviors that you may know from earlier versions of Wicket.
Add WebSocketBehavior to the page that will use web socket communication:

MyPage.java

public class MyPage extends WebPage {

  public MyPage()
  {
add(new WebSocketBehavior() {
  @Override
  protected void onMessage(WebSocketRequestHandler handler, TextMessage message)
  {
  }
});
  }
}



Use message.getText() to read the message sent by the client and use the passed handler.push(String) to push a text message to the connected client. Additionally you can use handler.add(Component...) to add Wicket components for re-render, handler#prependJavaScript(CharSequence) and handler#appendJavaScript(CharSequence) as you do with AjaxRequestTarget.

See the demo application at martin-g's GitHub. It is written with Scala and uses Akka which are not available at Maven central repository so it cannot be hosted at Apache Git servers.

Client side APIs

By adding a WebSocketBehavior to your component(s) Wicket will contribute wicket-websocket-jquery.js library which provides some helper functions to write your client side code. There is a default websocket connection per Wicket Page opened for you which you can use like Wicket.WebSocket.send('{msg: "my message"}').

If you need more WebSocket connections then you can do: var ws = 

[CONF] Apache Wicket Wicket Native WebSockets

2013-03-19 Thread confluence







Wicket Native WebSockets
Page edited by Hendy Irawan


 Changes (3)
 




...
h5. Maven dependency  
Add dependency to either org.apache.wicket:wicket-native-websocket-jetty9, org.apache.wicket:wicket-native-websocket-jetty, or org.apache.wicket:wicket-native-websocket-tomcat. 
 h5. Custom WicketFilter  
...
Setup the custom WicketFilter implementation for the chosen web container in your web.xml.  
For Jetty 7.5+ 9.0+ this is 
  filter-classorg.apache.wicket.protocol.ws.jetty9.Jetty9WebSocketFilter/filter-class  For Jetty 7.5+ - 8.x this is  
  filter-classorg.apache.wicket.protocol.ws.jetty7.Jetty7WebSocketFilter/filter-class  
...


Full Content



What ?
Why ?
How it works ?
How to use it ?


Maven dependency
Custom WicketFilter
WebSocketBehavior
Client side APIs


Testing
Differences with Wicket-Atmosphere module.
FAQ

Request and session scoped beans do not work.



Wicket Native WebSockets


What ?

Since version 6.0 Wicket provides an experimental module that provides integration with WebSocket support in the web containers like Jetty and Tomcat.

Why ?

Martin Grigorov looked at Typesafe's Console and the support for WebSockets in Play Framework as a whole and I decided that it will be a good addition to WicketStuff HTML5 project. Later Martijn Dashorst suggested that such projects should be added to Apache Wicket as experimental modules and when they become more mature they can be promoted as production ready, or if they are not used/liked then they can be moved to WicketStuff project. 

How it works ?

Each of the integrations provide a custom implementation of org.apache.wicket.protocol.http.WicketFilter that first checks whether the current web request needs to upgrade its protocol from HTTP to WebSocket. This is done by checking the request headers for the special header with name "Upgrade". If the request is an upgrade then the filter registers an endpoint for the web socket connection. Later this endpoint is used to read/write messages from/to the client. 
All messages sent through the web socket connection are not intercepted by WicketFilter. This is how the web containers currently work.
When a client is connected it is being registered in a global (application scoped) registry using as a key the application, the client session and the id of the page that registered it. Later when the server needs to push a message it uses this registry to filter which clients need to receive the message.
When a message is received from the client Wicket uses the associated page id for the web connection and loads the Wicket Page as Ajax requests do, then it broadcasts a IWebSocketMessage (Wicket 1.5 Event system) to all its components so they can react on it.
The server-side can push plain text and binary messages to the client - pure web socket messages, but can also add components for re-render, prepend/append _javascript_ as you do with AjaxRequestTarget.

How to use it ?

Maven dependency

Add dependency to either org.apache.wicket:wicket-native-websocket-jetty9, org.apache.wicket:wicket-native-websocket-jetty, or org.apache.wicket:wicket-native-websocket-tomcat.

Custom WicketFilter 

Setup the custom WicketFilter implementation for the chosen web container in your web.xml.

For Jetty 9.0+ this is 
  filter-classorg.apache.wicket.protocol.ws.jetty9.Jetty9WebSocketFilter/filter-class

For Jetty 7.5+ - 8.x this is 
  filter-classorg.apache.wicket.protocol.ws.jetty7.Jetty7WebSocketFilter/filter-class

For Tomcat 7.0.27+:
  filter-classorg.apache.wicket.protocol.ws.tomcat7.Tomcat7WebSocketFilter/filter-class

WebSocketBehavior

org.apache.wicket.protocol.ws.api.WebSocketBehavior is much like Ajax behaviors that you may know from earlier versions of Wicket.
Add WebSocketBehavior to the page that will use web socket communication:

MyPage.java

public class MyPage extends WebPage {

  public MyPage()
  {
add(new WebSocketBehavior() {
  @Override
  protected void onMessage(WebSocketRequestHandler handler, TextMessage message)
  {
  }
});
  }
}



Use message.getText() to read the message sent by the client and use the passed handler.push(String) to push a text message to the connected client. Additionally you can use handler.add(Component...) to add Wicket components for re-render, handler#prependJavaScript(CharSequence) and handler#appendJavaScript(CharSequence) as you do with AjaxRequestTarget.

See the demo application at martin-g's GitHub. It is written with Scala and uses Akka which are not available at Maven central repository so it cannot be hosted at Apache Git servers.

Client side APIs

By adding a 

[CONF] Apache Wicket Wicket Blogs

2013-03-24 Thread confluence







Wicket Blogs
Page edited by Cedric Gatay


Comment:
Added Bloggure.info


 Changes (1)
 




...
* [Sergei Sizov: Software Engineering with Java and Wicket |http://vozis.blogspot.com] * [Dan Simko: Czech Blog about Wicket|http://wickeria.com/blog] (runs on Wicket and Brix) 
* [There is no place like ::1|http://www.bloggure.info/category/work/java-work/wicket-work] Wicket tips and tricks from a French startup developer 
  
...


Full Content

Wicket Blogs

There are several blogs available with news, experiences, hints and tricks concerning Wicket. Here's a list of those blogs we have discovered so far. Please add your own blog to this list if you write something interesting on Wicket.


	Nadeem's Blog on Wicket (Editable Grid, Ajax Radio Button, Wicket loose coupling, Wicket XML RPC  )
	WorldTurner blog
	A Wicket Diary
	Geertjan's blog
	Eelco's blog new attempt
	Jonathan's blog
	Jonathan's new blog
	Jeremy Thomerson's blog
	Jesse Sightler's blog
	Coderspiel (runs on Wicket)
	Ruud en Marco's Weblog
	Matt Raible's Raible Designs
	Erik van Oosten's Blog
	Ryan Sonnek's Blog
	Here Be Beasties (Al Maw's blog)
	rue's headroom (Rüdiger Schulz' blog)
	Wicket Blog in China wanglei's blog
	Blog do Bruno Borges (pt_BR)
	Java for Dinner (pt_BR)
	Java Thoughts (Julian Sinai's blog)
	Carlo's Blog
	Eirik Rude's Blog
	Daan's blog, especially everything tagged 'Wicket'
	Nino's blog with screencasts, especially everything tagged 'Wicket'
	Wicket Praxis
	The Wicket Evangelist
	Mystic Blog
	WicketByExample
	Jeff's Blog
	Devproof Blog and Wicket articles (blog/portal is completely written in Wicket and downloadable)
	codesmell.org
	Paul Szulc: Wicket and TDD
	Tomasz Dziurko: Code Hard Go Pro
	Martin Dilger: German Blog, in Depth Knowledge about Wicket
	Sergei Sizov: Software Engineering with Java and Wicket 
	Dan Simko: Czech Blog about Wicket (runs on Wicket and Brix)
	There is no place like ::1 Wicket tips and tricks from a French startup developer




These were listed here, but now seem somewhat dead/abandoned:


	steve-on-sakai
	John Banana Qwerty (Jean-Baptiste Quenot's blog)
	momania.net
	JavaGeek.org
	Phil Phil's Weblog
	Matej Knopp's blog
	Romain Guy get to love web development
	The code filled.. code story blog





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Index

2013-04-09 Thread confluence







Index
Page edited by Ralf Eichinger


Comment:
removed orphaned "Output"-widget list and added cool and sexy Wicket-Bootstrap to GUI-Components section


 Changes (2)
 




...
Here is the reference for the standard Wicket GUI components: [Component Reference|http://www.wicket-library.com/wicket-examples-6.0.x/compref/]  
h4. Output * [Label|http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.LabelPage] * [MultiLineLabel|http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=:org.apache.wicket.examples.compref.MultiLineLabelPage]  
You are looking for some additional additional cool Widgets, mainly _javascript_/AJAX style? Then have a look here:  * [Wicketstuff|http://wicketstuff.org/] - Wicket Stuff provides components that complement the Wicket framework. 
* [Wicket-Bootstrap|http://wb.agilecoders.de/] - Simple and flexible Wicket Components, HTML, CSS, and _javascript_ for popular user interface components and interactions. 
* [wiQuery|http://www.wiquery.org/] - wiQuery integrates jQuery and jQuery UI into the Apache Wicket framework. * [visural-wicket|http://code.google.com/p/visural-wicket/] - a set of open-source Wicket components, Apache 2.0 licensed. 
...


Full Content

Bookmarkable URL
Linking to the wikiTo help with the server loading, please only link to pages under the http://cwiki.apache.org/WICKET/ static root.

This wiki is dedicated to documenting the Wicket Java application framework. Wicket takes simplicity, separation of concerns and ease of development to a whole new level. The wiki is currently open to new users and contributors; see the contribution page for more information. To download Wicket, please visit the Wicket site.
Table of contents


About Wicket

What is Wicket?

Introduction to Java web applications

Why Wicket

Framework Comparisons

Who is using Wicket
Where to (get) help

IRC
Community initiatives
Communities on social networking sites
Contribute to Wicket
Commercial Services

What's next

Wish List for Next Version
Migrations

More about Wicket...

Videos, Talks, Screencasts
Wicket Press  User Stories
Companies Hiring Wicket Developers
External Links


Using Wicket

Development Environment

Java
Build tools
IDE
Application server
Portal server
Database

Development

Framework Documentation
GUI-Components and Widgets
Wicket Component Packaging
Portlet Development
Development Aids

Testing




About Wicket

What is Wicket?

Wicket is one of the most recent in a long line of Java web development frameworks and stands on the shoulders of many that have come before it. Wicket is a component-based framework, which puts it in stark contrast to some of the earlier solutions to the sometimes monotonous task of web programming. Like other frameworks, Wicket builds on top of Sun's servlet API; however, unlike frameworks like Struts or Spring MVC, the developer using Wicket is mostly removed from the request/response nature that is inherent with the web and Servlets. Instead of building controllers that must service many users and threads simultaneously, taking in requests, returning responses, and never storing any state, the Wicket developer thinks in terms of stateful components. Instead of creating a controller or action class, he or she creates a page, places components on it, and defines how each component reacts to user input.

This may all sound familiar to those with desktop GUI experience; Microsoft's Visual Studio line, Sun's Swing API, and Borland's Delphi are all popular desktop GUI development tools that use component models. Using components allows the developer to spend less time on the visual tier of his or her app and more time implementing the core functionality. Even more important is how extensible this makes component-based GUIs. Adding additional functionality is simply a matter of adding one more component, which can act independently or in cooperation with other components in the view. These advantages have not been lost on web developers. In fact, many web framework projects have attempted to leverage the productivity and scalability of desktop applications. Apache Jakarta's Tapestry and Microsoft's own ASP.NET as well as Sun's Java Server Faces specification all present solutions to component-based development over the web and bring new ideas to the table. All of these technologies separate the page layout into a template file. JSF uses Sun's JSPs, ASP.NET uses ASP, and Tapestry use's it's own templating system based on standard HTML markup. These 

[CONF] Apache Wicket Ideas for Wicket 7.0

2013-04-25 Thread confluence







Ideas for Wicket 7.0
Page edited by Martin Grigorov


Comment:
Link to a blog article explaining how to use animations while replacing a component.


 Changes (3)
 




...
Using attribute modifiers it is difficult to modify tags in proper ways such that existing classes on a class attribute remain, while adding/removing other tags. A DSL for manipulating the class value of a component would be really great.  
h3. -Make transitions possible/easy when replacing components using Ajax/Push- 
 
-Currently we replace the markup of components, which works for updating the components, but it doesnt provide an easy way to animate the outgoing and incoming markup using CSS transitions. For example if you add a hidden class to the class attribute of a component, and update it using Ajax, the markup gets replaced instead of updated.- 
See http://wicketinaction.com/2013/02/replace-components-with-animation/ 
 h3. Integrate [bindgen-wicket|http://code.google.com/p/bindgen-wicket/] 
...


Full Content



This page lists ideas what can be improved for Wicket 7.0.

Ajax back button support
Better stateless support
Implement JAX-RS on top of Wicket IResource
PageParameters improvements
Removal of auto-components
Java 7 as a minimum
Servlet 3 as a minimum
Improved tag manipulation
 Make transitions possible/easy when replacing components using Ajax/Push
Integrate bindgen-wicket
Minor API cleanups



This page lists ideas what can be improved for Wicket 7.0.

These are only ideas. Some of them may not be implemented though. There will be a separate Roadmap page that will have only the ideas on which we agreed.
To be approved an idea has to be discussed first in dev@ mailing list. A patch and/or Pull Request increases the chance to get your idea in.

Ajax back button support

Igor has already started something about this at his GitHub

Perhaps this is a better library than simple history: https://github.com/rails/turbolinks

Better stateless support


	add more stateless components (stateless versions of existing components)
	adopt Ajax stateless behaviors
	...



Implement JAX-RS on top of Wicket IResource

Crazy, but why not ...

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
  See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Removal of auto-components

Auto components caused some problems due to their special lifecycle - they appear only during the rendering process. This will simplify component queueing, resolvers+auto components, problems with enclosures, ...
The idea is to rework the auto-components to be first class citizens, i.e. once the markup is parsed they should be in the runtime component tree as manually added components are. And should be reachable in the action phase.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Improved tag manipulation

Using attribute modifiers it is difficult to modify tags in proper ways such that existing classes on a 'class' attribute remain, while adding/removing other tags. A DSL for manipulating the class value of a component would be really great.

Make transitions possible/easy when replacing components using Ajax/Push

Currently we replace the markup of components, which works for updating the components, but it doesn't provide an easy way to animate the outgoing and incoming markup using CSS transitions. For example if you add a 'hidden' class to the class attribute of a component, and update it using Ajax, the markup gets replaced instead of updated.
See http://wicketinaction.com/2013/02/replace-components-with-animation/

Integrate bindgen-wicket

The issue of fragile property expressions has not been given much love ever since. Bindgen-wicket solves this in a clean and elegant way. Moreover, annotation processing is no longer cumbersome (as it has become part of javac compilation process since java 6).
Discussion in dev@ mailing list: http://markmail.org/thread/z2ngjxxtpqqwsea6

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-25 Thread confluence







Wicket 7.0 Roadmap
Page  added by Martin Grigorov

 

 

This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum
Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements
Minor API cleanups




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas+for+Wicket+7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.
the chance to get your idea in.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964




   
Change Notification Preferences
   
   View Online
  |
   Add Comment
   








[CONF] Apache Wicket Pages

2013-04-25 Thread confluence







Pages
Page edited by Phu-Hiep DUONG


 Changes (1)
 




...
 {{http://hostname:port/appname/?bookmarkablePage=org.wicket-wiki.example.MyPage}} 
\[Updated\]\[wicket 6.7\] {{http://localhost:8080/wicket/bookmarkable/org.example.MyPage}} 
 See [Newuserguide / An interactive HelloWorld|An interactive HelloWorld] for a verbose example. 
...


Full Content

Introduction 
Wicket uses Java classes to represent pages. Most of the time, you will create a subclass of WebPage:

MyPage.java

package org.wicket-wiki.example;
public class MyPage extends WebPage {}



And the markup:
MyPage.html

html
  body
 ... content ...
  /body
/html



You can reach this class under the following URL:

http://hostname:port/appname/?bookmarkablePage=org.wicket-wiki.example.MyPage
[Updated][wicket 6.7] http://localhost:8080/wicket/bookmarkable/org.example.MyPage

See Newuserguide / An interactive HelloWorld for a verbose example.

Pages are objects 

Because pages are Java objects, you can create new instances and pass them around like any other object. You can use the constructor, for instance:

MyPage.java

public class MyPage extends WebPage {
   public MyPage(String name) {
  add(new Label("name", name));
   }
}



Usage:
Link handler in AnotherPage.java

public void onClick() {
   // creating another page instance and going to that page
   setResponsePage(new MyPage("keuner"));
}



Because the entire page stays in the session, you do not have to put client related state in the session explicitly. 

Page types
In Wicket pages can have two characteristics, they can be bookmarkable and / or stateless. 

Bookmarkable pages are pages which have a constructor with no arguments or a constructor that accepts a PageParameters argument (which wraps any query string parameters for a request). In case the page has both constructors, the constructor with PageParameters will be used only if there are parameters in the URL, though you should not rely on this behavior and both constructors should do the same thing.


public class MyPage extends WebPage...
public MyPage() {
this(new PageParameters());
}

public MyPage(final PageParameters parameters) {
...
}


See also Bookmarkable pages and links.

Stateless pages are pages which are bookmarkable and contain only stateless components and stateless behaviors. Unlike stateful page Wicket doesn't store stateless pages in Session (to be precise in a PageMap). See Stateless pages for more information.

Here is a simple table showing how bookmarkability and statelessness are related:




bookmarkable
not-bookmarkable


stateless
may be
never


stateful
may be
may be





Page URLs
For this discussion of page URLs I found it useful to distinguish between three "types" of page URLs:

	URL to page class (requesting it will cause page creation)
	URL to page instance (requesting it retrieves page instance from Session where it is stored)
	URL to component on a page (requesting it calls component event handler)



Stateful bookmarkable pages
For stateful bookmarkable pages URL to page class will look like :
http://.../?wicket:bookmarkablePage=page class
This type of pages can also be "mounted". Mounting means assigning a URL to bookmarkable page (not-bookmarkable pages cannot be mounted).


public class MyApplication extends WebApplication...
@Override
protected void init() {
mountBookmarkablePage("mountedURL", MyPage.class);
mountBookmarkablePage("login", LoginPage.class);
}


For mounted pages URL to page class will look like:
http://.../mountedURL

URL to page instances for stateful bookmarkable pages will look like:
http://.../?wicket:interface=data to get page from Session
URL to components on the page will look like:
http://.../?wicket:interface=data to get page from Session including path to component

Not-bookmarkable pages
There are no URLs to page class for stateful not-bookmarkable pages (note that not-bookmarkable always implies stateful). Since non-bookmarkable pages don't have constructor which can be used by Wicket to create them, they can be only created explicitly in user code. The only way user can go to not-bookmarkable page is to be redirected from bookmarkable page with code like:


add(new Link("linkToNotBookmarkablePage") {
public void onClick() {
setResponsePage(new MyNotBookmarkablePage(... some constructor parameters ...));
}
}


URL to page instances and components for not-bookmarkable pages is the same as for bookmarkable pages, i.e.:
http://.../?wicket:interface=...

Stateless bookmarkable pages
For stateless bookmarkable pages (note that stateless always implies bookmarkable) URL to page class will look the same as for bookmarkable 

[CONF] Apache Wicket Pages

2013-04-25 Thread confluence







Pages
Page edited by Phu-Hiep DUONG


 Changes (1)
 




...
 {{http://hostname:port/appname/?bookmarkablePage=org.wicket-wiki.example.MyPage}} 
\[Updated\]\[wicket 6.7\] {{http://localhost:8080/wicket/bookmarkable/org.example.MyPage}} 
 See [Newuserguide / An interactive HelloWorld|An interactive HelloWorld] for a verbose example. 
...


Full Content

Introduction 
Wicket uses Java classes to represent pages. Most of the time, you will create a subclass of WebPage:

MyPage.java

package org.wicket-wiki.example;
public class MyPage extends WebPage {}



And the markup:
MyPage.html

html
  body
 ... content ...
  /body
/html



You can reach this class under the following URL:

http://hostname:port/appname/?bookmarkablePage=org.wicket-wiki.example.MyPage
[Update][wicket 6.7] http://localhost:8080/wicket/bookmarkable/org.example.MyPage

See Newuserguide / An interactive HelloWorld for a verbose example.

Pages are objects 

Because pages are Java objects, you can create new instances and pass them around like any other object. You can use the constructor, for instance:

MyPage.java

public class MyPage extends WebPage {
   public MyPage(String name) {
  add(new Label("name", name));
   }
}



Usage:
Link handler in AnotherPage.java

public void onClick() {
   // creating another page instance and going to that page
   setResponsePage(new MyPage("keuner"));
}



Because the entire page stays in the session, you do not have to put client related state in the session explicitly. 

Page types
In Wicket pages can have two characteristics, they can be bookmarkable and / or stateless. 

Bookmarkable pages are pages which have a constructor with no arguments or a constructor that accepts a PageParameters argument (which wraps any query string parameters for a request). In case the page has both constructors, the constructor with PageParameters will be used only if there are parameters in the URL, though you should not rely on this behavior and both constructors should do the same thing.


public class MyPage extends WebPage...
public MyPage() {
this(new PageParameters());
}

public MyPage(final PageParameters parameters) {
...
}


See also Bookmarkable pages and links.

Stateless pages are pages which are bookmarkable and contain only stateless components and stateless behaviors. Unlike stateful page Wicket doesn't store stateless pages in Session (to be precise in a PageMap). See Stateless pages for more information.

Here is a simple table showing how bookmarkability and statelessness are related:




bookmarkable
not-bookmarkable


stateless
may be
never


stateful
may be
may be





Page URLs
For this discussion of page URLs I found it useful to distinguish between three "types" of page URLs:

	URL to page class (requesting it will cause page creation)
	URL to page instance (requesting it retrieves page instance from Session where it is stored)
	URL to component on a page (requesting it calls component event handler)



Stateful bookmarkable pages
For stateful bookmarkable pages URL to page class will look like :
http://.../?wicket:bookmarkablePage=page class
This type of pages can also be "mounted". Mounting means assigning a URL to bookmarkable page (not-bookmarkable pages cannot be mounted).


public class MyApplication extends WebApplication...
@Override
protected void init() {
mountBookmarkablePage("mountedURL", MyPage.class);
mountBookmarkablePage("login", LoginPage.class);
}


For mounted pages URL to page class will look like:
http://.../mountedURL

URL to page instances for stateful bookmarkable pages will look like:
http://.../?wicket:interface=data to get page from Session
URL to components on the page will look like:
http://.../?wicket:interface=data to get page from Session including path to component

Not-bookmarkable pages
There are no URLs to page class for stateful not-bookmarkable pages (note that not-bookmarkable always implies stateful). Since non-bookmarkable pages don't have constructor which can be used by Wicket to create them, they can be only created explicitly in user code. The only way user can go to not-bookmarkable page is to be redirected from bookmarkable page with code like:


add(new Link("linkToNotBookmarkablePage") {
public void onClick() {
setResponsePage(new MyNotBookmarkablePage(... some constructor parameters ...));
}
}


URL to page instances and components for not-bookmarkable pages is the same as for bookmarkable pages, i.e.:
http://.../?wicket:interface=...

Stateless bookmarkable pages
For stateless bookmarkable pages (note that stateless always implies bookmarkable) URL to page class will look the same as for bookmarkable 

[CONF] Apache Wicket Getting a url for display

2013-04-25 Thread confluence







Getting a url for display
Page
comment added by  Phu-Hiep DUONG



   I don't know where to put

application.getPages().putClassAlias(MyPage.class, "myAlias");?

is it obsolete for wicket 6.7?




   
Change Notification Preferences
   
   View Online
  |
   Reply To This
   









[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-26 Thread confluence







Wicket 7.0 Roadmap
Page edited by Igor Vaynberg


 Changes (1)
 




...
Status: Not started Jira: [WICKET-4964|https://issues.apache.org/jira/browse/WICKET-4964] 
 h3. API Tweaks  h4.SimpleFormComponentLabel should output the required class just like wicket:for  h4. ajaxbehavior#updateAjaxAttributes() should get component passed in  otherwise referencing the component as needed in throttle settings is annoying  {code} queryField.add(new AjaxFormComponentUpdatingBehavior(onkeydown) { 	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) { 		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1))); ^ {code}  h4. throttling settings should be mutable to make it easier to override just the duration without having to figure out an id  h4. _javascript_ResourceReference#getDependencies() should return an appendable List  so we can do {code} class MyReference extends _javascript_Reference {   getDependencies() { List? list=super.getDependencies(); list.add(...); return list; } } {code} 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.
the chance to get your idea in.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: mgrigorov
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Not started
Jira: 

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: mgrigorov
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Not started
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^



throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-26 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
} {code} 
 h4. XyzValidator#decorate() should work with IValidationError instead of ValidationError 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.
the chance to get your idea in.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: mgrigorov
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Not started
Jira: 

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: mgrigorov
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Not started
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^



throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}



XyzValidator#decorate() should work with IValidationError instead of ValidationError



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-27 Thread confluence







Wicket 7.0 Roadmap
Page edited by Igor Vaynberg


 Changes (1)
 




...
 h4. XyzValidator#decorate() should work with IValidationError instead of ValidationError 
 h4. Refactor checkgroup/radiogroup to make them non-components.  * it is awkward to require a parent container as a wicket component. most of the time it needs to be attached to wicket:container tag because there is no reason to have an actual parent tag or a parent tag is impossible (in case of trs, lis, etc) * having groups as non-components will allow for nested sets of checks and radios * having groups as non-components will allow for disjointed sets of checks and radios in a cleaner fashion 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: mgrigorov
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Not started
Jira: 

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: mgrigorov
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Not started
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^



throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}



XyzValidator#decorate() should work with IValidationError instead of ValidationError

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. most of the time it needs to be attached to wicket:container tag because there is no reason to have an actual parent tag or a parent tag is impossible (in case of trs, lis, etc)
	having groups as non-components will allow for nested sets of checks and radios
	having groups as non-components will allow for disjointed sets of checks and radios in a cleaner fashion






Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-28 Thread confluence







Wicket 7.0 Roadmap
Page edited by Igor Vaynberg


 Changes (1)
 




...
* having groups as non-components will allow for nested sets of checks and radios * having groups as non-components will allow for disjointed sets of checks and radios in a cleaner fashion 
 h4. cdi 1.1 upgrade  wicket-cdi should use cdi 1.1 which should remove dependency onto seam-conversation module.  


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: mgrigorov
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Not started
Jira: 

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: mgrigorov
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Not started
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^



throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}



XyzValidator#decorate() should work with IValidationError instead of ValidationError

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. most of the time it needs to be attached to wicket:container tag because there is no reason to have an actual parent tag or a parent tag is impossible (in case of trs, lis, etc)
	having groups as non-components will allow for nested sets of checks and radios
	having groups as non-components will allow for disjointed sets of checks and radios in a cleaner fashion



cdi 1.1 upgrade

wicket-cdi should use cdi 1.1 which should remove dependency onto seam-conversation module. 



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-04-29 Thread confluence







Migration to Wicket 7.0
Page  added by Martin Grigorov

 

 Migrating to Wicket 7.0



Environment
Item 1

Sub item



Environment


	Wicket 7.0 requires at least Java 7
	Wicket 7.0 requires Servlet 3.0



Item 1

Sub item

Some explanation


   
Change Notification Preferences
   
   View Online
  |
   Add Comment
   








[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-29 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
[Ideas for Wicket 7.0] list some more ideas but to add a task in the Roadmap it has to be discussed first in the [dev mailing list|mailto:d...@wicket.apache.org]. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.  
{info:title=How to help us}Pick a task from the Roadmap wiki page or from Jira with Fix Version = 7.0. Implement it (+ tests when possible) and make a Pull Request at GitHub (apache/wicket). We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment. Add a comment to the ticket in Jira when you start on it. Just to prevent two or more people working on the same thing. {info}   
h3. Java 7 as a minimum  
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help usPick a task from the Roadmap wiki page or from Jira with "Fix Version" = 7.0.
Implement it (+ tests when possible) and make a Pull Request at GitHub (apache/wicket). We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
Add a comment to the ticket in Jira when you start on it. Just to prevent two or more people working on the same thing.


Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: mgrigorov
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Not started
Jira: 

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: mgrigorov
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Not started
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^



throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}



XyzValidator#decorate() should work with IValidationError instead of ValidationError

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-04-29 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
 wicket-cdi should use cdi 1.1 which should remove dependency onto seam-conversation module.  
 h4. Upgrade dependencies to their latest stable version  Guice, Spring, JUnit, Mockito, Velocity, ... 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub (apache/wicket). We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same thing.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: mgrigorov
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Not started
Jira: 

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: mgrigorov
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Not started
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^



throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}



XyzValidator#decorate() should work with IValidationError instead of ValidationError

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. most of the time it needs to be attached to wicket:container tag because there is no reason to have an actual parent tag or a parent tag is impossible (in case of trs, lis, etc)
	having groups as non-components will allow for nested sets of checks and radios
	having groups as non-components will allow for 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-01 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (6)
 




...
h3. Environment  
* h4. Wicket 7.0 requires at least Java 7 
* Wicket 7.0 requires Servlet 3.0 
 
h3. Item 1 
h4. Wicket 7.0 requires Servlet 3.0 
 
h4. Sub item  Some explanation 
h5. The HTTP response is not flushed automatically when the request is started in asynchronous mode. [WICKET-5152|https://issues.apache.org/jira/browse/WICKET-5152] This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0s AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request. 


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152




Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-02 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
h5. org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) [WICKET-4964|https://issues.apache.org/jira/browse/WICKET-4964] Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions. 
 h5. org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem [WICKET-5124|https://issues.apache.org/jira/browse/WICKET-5124] The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies. With the new API it is as easy as:  {code:title=MyResourceReference.java|borderStyle=solid} @Override public ListHeaderItem getDependencies() {   ListHeaderItem dependencies = super.getDependencies();   dependencies.add(dep1);   dependencies.add(dep2);   return dependencies; } {code}  


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124




Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}

 



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-02 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
  return dependencies; } 
{code} 
 h5. org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value [WICKET-4972|https://issues.apache.org/jira/browse/WICKET-4972] There were two problems with the old way: * since the _parameters_ argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the defaultValue from the parameters * it wasnt possible to use lazy evaluation of the default value  If in your application you have code like: {code:title=MyComponent.java|borderStyle=solid} StringResourceModel model = new StringResourceModel(resourceKey, model, Some default value, new Object[] [param1, param2]); {code}  then the simplest solution is to use _Model.of(Some default value)_: {code:title=MyComponent.java|borderStyle=solid} StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of(Some default value), new Object[] [param1, param2]); {code} 


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972




Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is to use Model.of("Some default value"):
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]);









Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-02 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of(Some default value), new Object[] [param1, param2]); {code} 
  h3. Behavior changes  h5. org.apache.wicket.request.Url#getQueryString [WICKET-4774|https://issues.apache.org/jira/browse/WICKET-4774] TODO  h5. org.apache.wicket.request.http.WebResponse encodes the value of the filename in Content-Disposition header [WICKET-4934|https://issues.apache.org/jira/browse/WICKET-4934] The value of the file name used in Content-Disposition response header can contain characters which should be [encoded|http://greenbytes.de/tech/tc2231/] 


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4774
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934




Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is to use Model.of("Some default value"):
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]);




Behavior changes

org.apache.wicket.request.Url#getQueryString WICKET-4774
TODO

org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
The value of the file name used in "Content-Disposition" response header can contain characters which should be encoded



Change Notification 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-02 Thread confluence







Migration to Wicket 7.0
Page edited by Cedric Gatay


Comment:
Added behavior changes involved by WICKET-4664


 Changes (3)
 




...
 h5. org.apache.wicket.request.Url#getQueryString [WICKET-4664|https://issues.apache.org/jira/browse/WICKET-4664] 
TODO 
Url#getQueryString() now behaves as HttpServletRequest behaves :  
 
 * returns the query string without the leading ?  * returns null when there is no query string  RequestUtils#decodeParameters() now strips the ? from the output value.  
h5. org.apache.wicket.request.http.WebResponse encodes the value of the filename in Content-Disposition header [WICKET-4934|https://issues.apache.org/jira/browse/WICKET-4934] The value of the file name used in Content-Disposition response header can contain characters which should be [encoded|http://greenbytes.de/tech/tc2231/] 


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934




Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is to use Model.of("Some default value"):
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]);




Behavior changes

org.apache.wicket.request.Url#getQueryString WICKET-4664
Url#getQueryString() now behaves as HttpServletRequest behaves : 


	returns the query string 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-02 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
 Guice, Spring, JUnit, Mockito, Velocity, ... 
 h4. Vote which experimental modules should become stable  The experimental modules can be promoted as stable and use the same version as wicket-core module. This will make them first class citizens and may be more users will start using them, and at least will simplify their release process. 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: 
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done

XyzValidator#decorate() should work with IValidationError instead of ValidationError

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. most of the time it needs to be attached to wicket:container tag because 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-02 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
 h4. throttling settings should be mutable to make it easier to override just the duration without having to figure out an id 
Status: *Done* Assignee: mgrigorov JIRA: [WICKET-5173|https://issues.apache.org/jira/browse/WICKET-5173] 
 h4. _javascript_ResourceReference#getDependencies() should return an appendable List 
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: 
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done

XyzValidator#decorate() should work with IValidationError instead of ValidationError

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. most of the 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-02 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
{code}  
h5. org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with _IValidationError_ [WICKET-5174|https://issues.apache.org/jira/browse/WICKET-5174] This method now accepts IValidationError as an argument and returns IValidationError. This way it can be used with other IValidationError implementations like RawValidationError for example. 
 h3. Behavior changes 
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934




Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is to use Model.of("Some default value"):
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]);



org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
This method now accepts IValidationError as an argument and returns IValidationError. This way it can be used with other IValidationError implementations like RawValidationError for example.

Behavior changes

org.apache.wicket.request.Url#getQueryString WICKET-4664
Url#getQueryString() now behaves as HttpServletRequest 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-02 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (2)
 




...
{code} Status: *Done* 
Assignee: mgrigorov Jira: [WICKET-5124|https://issues.apache.org/jira/browse/WICKET-5124] 
 h4. XyzValidator#decorate() should work with IValidationError instead of ValidationError 
Status: *Done* Assignee: mgrigorov Jira: [WICKET-5174|https://issues.apache.org/jira/browse/WICKET-5174] 
 h4. Refactor checkgroup/radiogroup to make them non-components. 
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: 
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done
Assignee: mgrigorov
Jira: WICKET-5124

XyzValidator#decorate() should work with IValidationError instead of ValidationError
Status: Done
Assignee: 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-02 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
h5. org.apache.wicket.request.http.WebResponse encodes the value of the filename in Content-Disposition header [WICKET-4934|https://issues.apache.org/jira/browse/WICKET-4934] The value of the file name used in Content-Disposition response header can contain characters which should be [encoded|http://greenbytes.de/tech/tc2231/] 
 h3. Dependency updates  All libraries on which Wicket modules depend are updated to their latest stable versions. The most notable ones are: * Spring Framework 3.2.2 * ASM 4.1 * CGLIB 3.0 * SLF4J 1.7.5 * Jetty (in the quickstart) 8.1.10  


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is to use Model.of("Some default value"):
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]);



org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
This method now accepts IValidationError as an argument and returns IValidationError. This way it can be used with other IValidationError implementations like 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-02 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
Guice, Spring, JUnit, Mockito, Velocity, ...  
Assignee: mgrigorov Status: *Done* Jira: [WICKET-5175|https://issues.apache.org/jira/browse/WICKET-5175]  
h4. Vote which experimental modules should become stable  
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: 
Status: Not started
Jira: 

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: 

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done
Assignee: mgrigorov
Jira: WICKET-5124

XyzValidator#decorate() should work with IValidationError instead of ValidationError
Status: Done
Assignee: mgrigorov
Jira: WICKET-5174

Refactor checkgroup/radiogroup to make them non-components.


	it is awkward to require a parent container as a wicket component. most of the time it needs to be 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-02 Thread confluence







Wicket 7.0 Roadmap
Page edited by Igor Vaynberg


 Changes (1)
 




...
The experimental modules can be promoted as stable and use the same version as wicket-core module. This will make them first class citizens and may be more users will start using them, and at least will simplify their release process. 
 h4. Make css class strings used in the framework configurable  * in a few places in core we have hardcoded css strings like wicket_orderUp and classes used inside the feedback panel - these should be made into application settings so they can be configured to conform to the applications css infrastructure.  * once we extract wicket_orderUp we should get rid of cssprovider and defaultcssprovider classes.  * getApplication().getCssSettings().setSortOrderDownClass(sort-order-down); 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable
Make css class strings used in the framework configurable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Done

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: WICKET-4930

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173


[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-03 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (2)
 




...
* Rename renderHead(HtmlHeaderContainer) [https://issues.apache.org/jira/browse/WICKET-4964] Assignee: mgrigorov 
Status: *Done* 
Jira: [WICKET-4964|https://issues.apache.org/jira/browse/WICKET-4964]  
...
 h4.SimpleFormComponentLabel should output the required class just like wicket:for 
Assignee: mgrigorov Status: *Done* Jira: [WICKET-5177|https://issues.apache.org/jira/browse/WICKET-5177] 
 h4. -ajaxbehavior#updateAjaxAttributes() should get component passed in- 
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable
Make css class strings used in the framework configurable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Done

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: WICKET-4930

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
Assignee: mgrigorov
Status: Done
Jira: WICKET-5177

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-03 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
The value of the file name used in Content-Disposition response header can contain characters which should be [encoded|http://greenbytes.de/tech/tc2231/]  
h5. org.apache.wicket.markup.html.form.FormComponentLabel outputs required, disabled and error classes when its form component is either required, disabled or invalid.  [WICKET-5177|https://issues.apache.org/jira/browse/WICKET-5177] This way it is in sync with AutoLabel (the auto component that is used for wicket:for attribute).  
h3. Dependency updates  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is to use Model.of("Some default value"):
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, Model.of("Some default value"), new Object[] [param1, param2]);



org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-06 Thread confluence







Wicket 7.0 Roadmap
Page edited by Dominik Drzewiecki


 Changes (1)
 




...
h4. cdi 1.1 upgrade  
wicket-cdi should use cdi 1.1 which should remove dependency onto seam-conversation module. 
Jira: [WICKET-4951|https://issues.apache.org/jira/browse/WICKET-4951] 
 h4. Upgrade dependencies to their latest stable version 
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable
Make css class strings used in the framework configurable




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Done

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: WICKET-4930

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
Assignee: mgrigorov
Status: Done
Jira: WICKET-5177

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done
Assignee: mgrigorov
Jira: WICKET-5124

XyzValidator#decorate() should work with IValidationError instead of ValidationError
Status: Done
Assignee: mgrigorov
Jira: WICKET-5174

[CONF] Apache Wicket Ideas for Wicket 7.0

2013-05-06 Thread confluence







Ideas for Wicket 7.0
Page edited by Dominik Drzewiecki


 Changes (1)
 




...
 * Rename renderHead(HtmlHeaderContainer) [https://issues.apache.org/jira/browse/WICKET-4964] 
 h3. Use webjars instead of embedded libraries  ... and integrate [wicket-webjars|https://github.com/l0rdn1kk0n/wicket-webjars] 


Full Content



This page lists ideas what can be improved for Wicket 7.0.

Ajax back button support
Better stateless support
Implement JAX-RS on top of Wicket IResource
PageParameters improvements
Removal of auto-components
Java 7 as a minimum
Servlet 3 as a minimum
Improved tag manipulation
 Make transitions possible/easy when replacing components using Ajax/Push
Integrate bindgen-wicket
Minor API cleanups
Use webjars instead of embedded libraries



This page lists ideas what can be improved for Wicket 7.0.

These are only ideas. Some of them may not be implemented though. There will be a separate Roadmap page that will have only the ideas on which we agreed.
To be approved an idea has to be discussed first in dev@ mailing list. A patch and/or Pull Request increases the chance to get your idea in.

Ajax back button support

Igor has already started something about this at his GitHub

Perhaps this is a better library than simple history: https://github.com/rails/turbolinks

Better stateless support


	add more stateless components (stateless versions of existing components)
	adopt Ajax stateless behaviors
	...



Implement JAX-RS on top of Wicket IResource

Crazy, but why not ...

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
  See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Removal of auto-components

Auto components caused some problems due to their special lifecycle - they appear only during the rendering process. This will simplify component queueing, resolvers+auto components, problems with enclosures, ...
The idea is to rework the auto-components to be first class citizens, i.e. once the markup is parsed they should be in the runtime component tree as manually added components are. And should be reachable in the action phase.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Improved tag manipulation

Using attribute modifiers it is difficult to modify tags in proper ways such that existing classes on a 'class' attribute remain, while adding/removing other tags. A DSL for manipulating the class value of a component would be really great.

Make transitions possible/easy when replacing components using Ajax/Push

Currently we replace the markup of components, which works for updating the components, but it doesn't provide an easy way to animate the outgoing and incoming markup using CSS transitions. For example if you add a 'hidden' class to the class attribute of a component, and update it using Ajax, the markup gets replaced instead of updated.
See http://wicketinaction.com/2013/02/replace-components-with-animation/

Integrate bindgen-wicket

The issue of fragile property expressions has not been given much love ever since. Bindgen-wicket solves this in a clean and elegant way. Moreover, annotation processing is no longer cumbersome (as it has become part of javac compilation process since java 6).
Discussion in dev@ mailing list: http://markmail.org/thread/z2ngjxxtpqqwsea6

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964



Use webjars instead of embedded libraries

... and integrate wicket-webjars



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-06 Thread confluence







Migration to Wicket 7.0
Page edited by Cedric Gatay


Comment:
Update for WICKET-4837


 Changes (1)
 




...
This way it is in sync with AutoLabel (the auto component that is used for wicket:for attribute).  
h5. org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message [WICKET-4831|https://issues.apache.org/jira/browse/WICKET-4831] The css class is now only applied to the li element and not to the span inside. Additionally a FeedbackPanel#newMessageItem() method has been added to allow customization of each feedback message item (similar to DataTable#newRowItem()).  
h3. Dependency updates  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



The same is done for org.apache.wicket.markup.head.HeaderItem#getDependencies() too.

org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
There were two problems with the old way:

	since the parameters argument type is Object..., i.e. varargs, it was hard for the compiler and runtime to differentiate the "defaultValue" from the "parameters"
	it wasn't possible to use lazy evaluation of the default value



If in your application you have code like:
MyComponent.java

StringResourceModel model = new StringResourceModel(resourceKey, model, "Some default value", new Object[] [param1, param2]);



then the simplest solution is 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-09 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
 * getApplication().getCssSettings().setSortOrderDownClass(sort-order-down); 
  h4. Remove deprecated in Wicket 6.x classes and methods  For example:  * the old Swing based implementation of Tree * the backward compatibility helper methods in AbstractDefaultAjaxBehavior * WicketTester#startComponent() * ... 


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Java 7 as a minimum

Generics for org.apache.wicket.Component

Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
_javascript_ResourceReference#getDependencies() should return an appendable List
XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable
Make css class strings used in the framework configurable
Remove deprecated in Wicket 6.x classes and methods




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Done

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: WICKET-4930

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Started
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
Assignee: mgrigorov
Status: Done
Jira: WICKET-5177

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done
Assignee: mgrigorov
Jira: WICKET-5124

XyzValidator#decorate() should work with 

[CONF] Apache Wicket Wicket Ajax

2013-05-22 Thread confluence







Wicket Ajax
Page edited by Martin Grigorov


Comment:
Add an entry for the new Ajax attribute - EventPropagation


 Changes (1)
 




...
| request timeout | a timeout to abort the request if there is no response. | 0 (no timeout) | rt | | allow default | a boolean flag which indicates whether to allow the default behavior of the HTML element which listens for the event. For example: clicking on Ajax checkbox should allow the default behavior to actually check the box. | false | ad | 
| stop propagation | an enum which controls whether to stop the propagation of the _javascript_ event to its targets parent nodes. Possible values: STOP, STOP_IMMEDIATELY, BUBBLE. | STOP | sp | 
| async | a boolean flag that indicates whether the Ajax call should be asynchronous or not. | true | async | | throttling settings | settings which define whether the Ajax call should be throttled and for how long. See the javadoc of org.apache.wicket.ajax.attributes.ThrottlingSettings for more information. | no throttling | tr | 
...


Full Content



What ?
Why ?
Design and implementation
Table with renamed methods from the previous version
Configuration

Setup
Resource dependencies

AjaxRequestAttributes
Migration steps

o.a.w.ajax.IAjaxCallDecorator is replaced with o.a.w.ajax.attributes.IAjaxCallListener.
Global Ajax call listeners
Automatically migrated attributes.

Tests for the client side Wicket Ajax functionality
Blog articles
FAQ

How to check whether my custom version of the backing _javascript_ library (jQuery) doesn't break Wicket internals somehow ?
What parameters are passed to the handlers ?
How to use the preconditions with non-native/_javascript_-based confirm dialogs ?



What ?

Since version 6.0 Wicket uses jQuery as a backing library for its Ajax functionality.

Why ?

The previous implementations of wicket-ajax.js and wicket-event.js were home baked solutions that worked well but also suffered from the differences in the browsers. Often users complained that some functionality doesn't work on particular version of particular browser. That's why the Wicket team chose to use jQuery to deal with browser inconsistencies and leave us to do our business logic.

Design and implementation

The new implementations (wicket-ajax-jquery.js and wicket-event-jquery.js) use jQuery internally but expose Wicket.* API similar to the previous version.

All Java components and behaviors should still use the Wicket.* API. This way if someday we decide to not use jQuery anymore we will have less work to do. Also if a user uses Dojo/YUI/ExtJS/... and prefer to not have jQuery in her application then she will be able to provide wicket-ajax-xyz.js implementation and replace the default one.

Table with renamed methods from the previous version




 1.5 
 6.0 


 Wicket.fixEvent 
 Wicket.Event.fix 


 Wicket.stopEvent 
 Wicket.Event.stop 


 Wicket.show 
 Wicket.DOM.show 


 Wicket.showIncrementally 
 Wicket.DOM.showIncrementally 


 Wicket.hide 
 Wicket.DOM.hide 


 Wicket.hideIncrementally 
 Wicket.DOM.hideIncrementally 


 Wicket.decode 
 Wicket.Head.Contributor.decode 


 Wicket.ajaxGet, wicketAjaxGet 
 Wicket.Ajax.get 


 Wicket.ajaxPost, wicketAjaxPost 
 Wicket.Ajax.post 


 Wicket.submitForm 
 Wicket.Ajax.submitForm 


 Wicket.submitFormById 
 Wicket.Ajax.submitForm 


 Wicket.replaceOuterHtml 
 Wicket.DOM.replace 


 Wicket.Form.doSerialize 
 Wicket.Form.serializeForm 






Configuration

Setup

To replace any of the _javascript_ files the user application may use:

MyApplication#init():


public void init() {
  super.init();

  IJavaScriptLibrarySettings jsSettings = getJavaScriptLibrarySettings();

  jsSettings.setJQueryReference(new MyJQueryReference());

  jsSettings.setWicketEventReference(new DojoWicketEventReference());

  jsSettings.setWicketAjaxReference(new DojoWicketAjaxReference());

}



Resource dependencies

Since Wicket 6.0 ResourceReference can have dependencies and it is recommended to properly define the dependency chain between this classes.
See the code of org.apache.wicket.ajax.WicketAjaxJQueryResourceReference to see how the default jQuery based implementation does that.

If the user application needs to upgrade/downgrade to new/old version of jQuery then just the first line above is needed:


  getJavaScriptLibrarySettings().setJQueryReference(new AnotherVersionOfJQueryReference());



If the user application needs to use Dojo instead of jQuery then it has provide _javascript_ResourceReferences for wicket-event-dojo.js and wicket-ajax-dojo.js (e.g. DojoWicketEventReference and DojoWicketAjaxReference). Those references should define dependency to 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-22 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


Comment:
Add notes to the change of allowDefault Ajax attribute


 Changes (2)
 




...
This method now accepts IValidationError as an argument and returns IValidationError. This way it can be used with other IValidationError implementations like RawValidationError for example.  
h5. org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault [WICKET-5197|https://issues.apache.org/jira/browse/WICKET-5197] This is done to make it more consistent with _javascript_ API.  
h3. Behavior changes  
...
The css class is now only applied to the li element and not to the span inside. Additionally a FeedbackPanel#newMessageItem() method has been added to allow customization of each feedback message item (similar to DataTable#newRowItem()).  
h5. AjaxEventBehavior doesnt prevent the default behavior of the _javascript_ event [WICKET-5197|https://issues.apache.org/jira/browse/WICKET-5197] From now on only AjaxFallback** components prevent the default _javascript_ event behavior so only the Ajax call is made when _javascript_ is enabled in the browser. If the default behavior should be prevented in any use case then use:  {code:borderStyle=solid} attributes.setPreventDefault(true); {code}
h3. Dependency updates  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-22 Thread confluence







Migration to Wicket 7.0
Page edited by Sven Meier


Comment:
WICKET-5198 eventPropagation


 Changes (2)
 




...
This is done to make it more consistent with _javascript_ API.  
h5. org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default [WICKET-5198|https://issues.apache.org/jira/browse/WICKET-5198] This is done to make it more consistent with _javascript_ API.  
h3. Behavior changes  
...
{code}  
h5. Ajax behaviors let _javascript_ events bubble by default [WICKET-5198|https://issues.apache.org/jira/browse/WICKET-5198] If _javascript_ events should not bubble then use:  {code:borderStyle=solid} attributes.setEventPropagation(EventPropagation.STOP); {code} or: {code:borderStyle=solid} attributes.setEventPropagation(EventPropagation.STOP_IMMEDIATE); {code} 
  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  dependencies.add(dep2);
  return dependencies;
}



The same is done for org.apache.wicket.markup.head.HeaderItem#getDependencies() 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-23 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


Comment:
WICKET-5196


 Changes (1)
 




...
This is done to make it more consistent with _javascript_ API.  
h5. org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesnt use static methods anymore [WICKET-5196|https://issues.apache.org/jira/browse/WICKET-5196] To use AjaxFormValidatingBehavior in Wicket 6.x the application code should do something like: {code:title=MyComponent.java|borderStyle=solid} AjaxFormValidatingBehavior.addToAllFormComponents(form, keydown, Duration.ONE_SECOND); {code} Due to the usage of static method it wasnt possible to extend this behavior and override for example #updateAjaxAttributes(AjaxRequestAttributes).  The behavior has been reworked a bit to allow this. The new usage is: {code:title=MyComponent.java|borderStyle=solid} form.add(new AjaxFormValidatingBehavior(keydown, Duration.ONE_SECOND); {code} or {code:title=MyComponent.java|borderStyle=solid} formComponent.add(new AjaxFormValidatingBehavior(keydown, Duration.ONE_SECOND); {code} in this case the formComponents owning Form will be used. 
h3. Behavior changes  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-24 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (2)
 




...
{code}  
h3. Deprecated classes/methods/fields are removed 
 
h5. AbstractDefaultAjaxBehaviors #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed. They were deprecated since 6.0.0 and were there only for backward compatibility. Use #updateAjaxAttributes() to configure the same functionalities.  h5. The old Tree component in wicket-extensions is removed. It was based on Swing APIs and many people complained about this. Use the new Tree component introduced in Wicket 6.0.0 instead.   
h3. Dependency updates  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Deprecated classes/methods/fields are removed


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = super.getDependencies();
  dependencies.add(dep1);
  

[CONF] Apache Wicket Index

2013-05-29 Thread confluence







Index
Page edited by Ilkka Seppälä


 Changes (1)
 




...
h3. External Links * [Wicket Spirals|http://www.webinaria.com/video.php?VID=477] teaching method by Dzenan Ridjanovic 
* [Online Maven Book|http://www.sonatype.com/book/index.html] Book|http://books.sonatype.com/mvnref-book/reference/] Get help understanding Maven 
* [Chinese Wicket WebSite|http://gocom.primeton.com/modules/newbb/viewforum.php?forum=41cat_id=11] A forum about wicket in china. * [Introduction to Apache Wicket (in German)|http://www.ralfebert.de/wicket/] 
...


Full Content

Bookmarkable URL
Linking to the wikiTo help with the server loading, please only link to pages under the http://cwiki.apache.org/WICKET/ static root.

This wiki is dedicated to documenting the Wicket Java application framework. Wicket takes simplicity, separation of concerns and ease of development to a whole new level. The wiki is currently open to new users and contributors; see the contribution page for more information. To download Wicket, please visit the Wicket site.
Table of contents


About Wicket

What is Wicket?

Introduction to Java web applications

Why Wicket

Framework Comparisons

Who is using Wicket
Where to (get) help

IRC
Community initiatives
Communities on social networking sites
Contribute to Wicket
Commercial Services

What's next

Wish List for Next Version
Migrations

More about Wicket...

Videos, Talks, Screencasts
Wicket Press  User Stories
Companies Hiring Wicket Developers
External Links


Using Wicket

Development Environment

Java
Build tools
IDE
Application server
Portal server
Database

Development

Framework Documentation
GUI-Components and Widgets
Wicket Component Packaging
Portlet Development
Development Aids

Testing




About Wicket

What is Wicket?

Wicket is one of the most recent in a long line of Java web development frameworks and stands on the shoulders of many that have come before it. Wicket is a component-based framework, which puts it in stark contrast to some of the earlier solutions to the sometimes monotonous task of web programming. Like other frameworks, Wicket builds on top of Sun's servlet API; however, unlike frameworks like Struts or Spring MVC, the developer using Wicket is mostly removed from the request/response nature that is inherent with the web and Servlets. Instead of building controllers that must service many users and threads simultaneously, taking in requests, returning responses, and never storing any state, the Wicket developer thinks in terms of stateful components. Instead of creating a controller or action class, he or she creates a page, places components on it, and defines how each component reacts to user input.

This may all sound familiar to those with desktop GUI experience; Microsoft's Visual Studio line, Sun's Swing API, and Borland's Delphi are all popular desktop GUI development tools that use component models. Using components allows the developer to spend less time on the visual tier of his or her app and more time implementing the core functionality. Even more important is how extensible this makes component-based GUIs. Adding additional functionality is simply a matter of adding one more component, which can act independently or in cooperation with other components in the view. These advantages have not been lost on web developers. In fact, many web framework projects have attempted to leverage the productivity and scalability of desktop applications. Apache Jakarta's Tapestry and Microsoft's own ASP.NET as well as Sun's Java Server Faces specification all present solutions to component-based development over the web and bring new ideas to the table. All of these technologies separate the page layout into a template file. JSF uses Sun's JSPs, ASP.NET uses ASP, and Tapestry use's it's own templating system based on standard HTML markup. These pages are rendered on each request, and as they are rendering, they make calls into a backing class to support dynamic content. As much as the word "template" would seem to suggest otherwise, this makes the page template king. Backing classes tends to be a series of listener methods, at the total mercy of the page template that is supposed to be merely defining the placement of components.

This works fine, and it is definitely a step up from a model 2 controller singleton class. Instead of a giant if block, we have well defined methods. Instead of being stateless, we can have instance variables. But now our Java code is a second-class citizen, existing merely to provide the page with the information it needs while it renders itself. Also, this 

[CONF] Apache Wicket Wicket Blogs

2013-05-29 Thread confluence







Wicket Blogs
Page edited by Nagaraja Yellapu


 Changes (1)
 




...
* [Dan Simko: Czech Blog about Wicket|http://wickeria.com/blog] (runs on Wicket and Brix) * [There is no place like ::1|http://www.bloggure.info/category/work/java-work/wicket-work] Wicket tips and tricks from a French startup developer 
* [Wicket + JPA without DI framework : http://ynagaraja.blogspot.in/2013/05/developing-web-application-with-apache.html] 
 
These were listed here, but now seem somewhat dead/abandoned:  
...


Full Content

Wicket Blogs

There are several blogs available with news, experiences, hints and tricks concerning Wicket. Here's a list of those blogs we have discovered so far. Please add your own blog to this list if you write something interesting on Wicket.


	Nadeem's Blog on Wicket (Editable Grid, Ajax Radio Button, Wicket loose coupling, Wicket XML RPC  )
	WorldTurner blog
	A Wicket Diary
	Geertjan's blog
	Eelco's blog new attempt
	Jonathan's blog
	Jonathan's new blog
	Jeremy Thomerson's blog
	Jesse Sightler's blog
	Coderspiel (runs on Wicket)
	Ruud en Marco's Weblog
	Matt Raible's Raible Designs
	Erik van Oosten's Blog
	Ryan Sonnek's Blog
	Here Be Beasties (Al Maw's blog)
	rue's headroom (Rüdiger Schulz' blog)
	Wicket Blog in China wanglei's blog
	Blog do Bruno Borges (pt_BR)
	Java for Dinner (pt_BR)
	Java Thoughts (Julian Sinai's blog)
	Carlo's Blog
	Eirik Rude's Blog
	Daan's blog, especially everything tagged 'Wicket'
	Nino's blog with screencasts, especially everything tagged 'Wicket'
	Wicket Praxis
	The Wicket Evangelist
	Mystic Blog
	WicketByExample
	Jeff's Blog
	Devproof Blog and Wicket articles (blog/portal is completely written in Wicket and downloadable)
	codesmell.org
	Paul Szulc: Wicket and TDD
	Tomasz Dziurko: Code Hard Go Pro
	Martin Dilger: German Blog, in Depth Knowledge about Wicket
	Sergei Sizov: Software Engineering with Java and Wicket 
	Dan Simko: Czech Blog about Wicket (runs on Wicket and Brix)
	There is no place like ::1 Wicket tips and tricks from a French startup developer
	Wicket + JPA without DI framework : http://ynagaraja.blogspot.in/2013/05/developing-web-application-with-apache.html



These were listed here, but now seem somewhat dead/abandoned:


	steve-on-sakai
	John Banana Qwerty (Jean-Baptiste Quenot's blog)
	momania.net
	JavaGeek.org
	Phil Phil's Weblog
	Matej Knopp's blog
	Romain Guy get to love web development
	The code filled.. code story blog





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Wicket Blogs

2013-05-29 Thread confluence







Wicket Blogs
Page edited by Nagaraja Yellapu


 Changes (1)
 




...
* [Dan Simko: Czech Blog about Wicket|http://wickeria.com/blog] (runs on Wicket and Brix) * [There is no place like ::1|http://www.bloggure.info/category/work/java-work/wicket-work] Wicket tips and tricks from a French startup developer 
* [Wicket + JPA without DI framework : http://ynagaraja.blogspot.in/2013/05/developing-web-application-with-apache.html] framework|http://ynagaraja.blogspot.in/2013/05/developing-web-application-with-apache.html] 
 These were listed here, but now seem somewhat dead/abandoned: 
...


Full Content

Wicket Blogs

There are several blogs available with news, experiences, hints and tricks concerning Wicket. Here's a list of those blogs we have discovered so far. Please add your own blog to this list if you write something interesting on Wicket.


	Nadeem's Blog on Wicket (Editable Grid, Ajax Radio Button, Wicket loose coupling, Wicket XML RPC  )
	WorldTurner blog
	A Wicket Diary
	Geertjan's blog
	Eelco's blog new attempt
	Jonathan's blog
	Jonathan's new blog
	Jeremy Thomerson's blog
	Jesse Sightler's blog
	Coderspiel (runs on Wicket)
	Ruud en Marco's Weblog
	Matt Raible's Raible Designs
	Erik van Oosten's Blog
	Ryan Sonnek's Blog
	Here Be Beasties (Al Maw's blog)
	rue's headroom (Rüdiger Schulz' blog)
	Wicket Blog in China wanglei's blog
	Blog do Bruno Borges (pt_BR)
	Java for Dinner (pt_BR)
	Java Thoughts (Julian Sinai's blog)
	Carlo's Blog
	Eirik Rude's Blog
	Daan's blog, especially everything tagged 'Wicket'
	Nino's blog with screencasts, especially everything tagged 'Wicket'
	Wicket Praxis
	The Wicket Evangelist
	Mystic Blog
	WicketByExample
	Jeff's Blog
	Devproof Blog and Wicket articles (blog/portal is completely written in Wicket and downloadable)
	codesmell.org
	Paul Szulc: Wicket and TDD
	Tomasz Dziurko: Code Hard Go Pro
	Martin Dilger: German Blog, in Depth Knowledge about Wicket
	Sergei Sizov: Software Engineering with Java and Wicket 
	Dan Simko: Czech Blog about Wicket (runs on Wicket and Brix)
	There is no place like ::1 Wicket tips and tricks from a French startup developer
	Wicket + JPA without DI framework



These were listed here, but now seem somewhat dead/abandoned:


	steve-on-sakai
	John Banana Qwerty (Jean-Baptiste Quenot's blog)
	momania.net
	JavaGeek.org
	Phil Phil's Weblog
	Matej Knopp's blog
	Romain Guy get to love web development
	The code filled.. code story blog





Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-29 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (2)
 




...
in this case the formComponents owning Form will be used.  
 
h5. org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced [WICKET-5212|https://issues.apache.org/jira/browse/WICKET-5212] With [WICKET-4958|https://issues.apache.org/jira/browse/WICKET-4958] has been introduced org.apache.wicket.ajax.AjaxRequestTarget.AbstractListener which is an empty implementation of AjaxRequestTarget.IListener to be able to introduce AbstractListener#updateAjaxAttributes() method - a place where an application can configure globally the Ajax attributes. With [WICKET-5212|https://issues.apache.org/jira/browse/WICKET-5212] this new method is moved to the interface as well. From now on it is recommended all implementations of AjaxRequestTarget.IListener to extend from AjaxRequestTarget.AbstractListener. This way they wont need to a implement another method when a new one is added in a major release.  
  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to 

[CONF] Apache Wicket Wicket 7.0 Roadmap

2013-05-29 Thread confluence







Wicket 7.0 Roadmap
Page edited by Martin Grigorov


 Changes (1)
 




...
Jira: [WICKET-5167|https://issues.apache.org/jira/browse/WICKET-5167]  
h4. Update the quickstart archetype as well. Should we use @WebFilter for the quickstart ?!  Assignee: Status: Jira:  
h3. Tickets in Jira with Fix Version = 7.0  
...


Full Content



This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

 Java 7 as a minimum

Generics for org.apache.wicket.Component

 Servlet 3 as a minimum
Tickets in Jira with "Fix Version" = 7.0


PageParameters improvements
Minor API cleanups


API Tweaks

 SimpleFormComponentLabel should output the "required" class just like wicket:for
 ajaxbehavior#updateAjaxAttributes() should get component passed in
 throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
 _javascript_ResourceReference#getDependencies() should return an appendable List
 XyzValidator#decorate() should work with IValidationError instead of ValidationError
Refactor checkgroup/radiogroup to make them non-components.
cdi 1.1 upgrade
 Upgrade dependencies to their latest stable version
Vote which experimental modules should become stable
Make css class strings used in the framework configurable
Remove deprecated in Wicket 6.x classes and methods




This page lists the tasks the Wicket team agreed to implement for Wicket 7.0.

Ideas for Wicket 7.0 list some more ideas but to add a task in the Roadmap it has to be discussed first in the dev mailing list. Ideas with attached patch in Jira ticket or Pull Request have a bigger chance to be included in the Roadmap.

How to help us
	Pick a task from this wiki page or from Jira with "Fix Version" = 7.0.0.
	Implement it (+ tests when possible) and make a Pull Request at GitHub. We do not own the GitHub repo but it is easy to pull from your repos and apply the code. It is also easy to make code reviews and comment.
If there is no ticket in Jira for an entry in the Roadmap please create one. Always add a comment to the ticket in Jira when you start on it. Just to prevent two or  more people working on the same task.
	Add an entry to the Migration page with description of the change and short code sample of the old way and the new way of doing something.



Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Assignee: mgrigorov
Status: Done

Generics for org.apache.wicket.Component

Using Java 7 will allow to use the "diamonds operator", i.e. 
MyPage.java

  ComponentEntity c = new SomeComponent("id", model);



Assignee: 
Status: Not started
Jira: WICKET-4930

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Assignee: mgrigorov
Status: Done
Jira: WICKET-5167

Tickets in Jira with "Fix Version" = 7.0

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Assignee: 
Status: Not started

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964
Assignee: mgrigorov
Status: Done
Jira: WICKET-4964



API Tweaks

SimpleFormComponentLabel should output the "required" class just like wicket:for
Assignee: mgrigorov
Status: Done
Jira: WICKET-5177

ajaxbehavior#updateAjaxAttributes() should get component passed in

otherwise referencing the component as needed in throttle settings is annoying



queryField.add(new AjaxFormComponentUpdatingBehavior("onkeydown") {
	protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
		attributes.setThrottlingSettings(new ThrottlingSettings(queryField.getMarkupId(), Duration.seconds(1)));
^


The component is easily reachable via AbstractAjaxBehavior#getComponent()

throttling settings should be mutable to make it easier to override just the duration without having to figure out an id
Status: Done
Assignee: mgrigorov
JIRA: WICKET-5173

_javascript_ResourceReference#getDependencies() should return an appendable List

so we can do


class MyReference extends _javascript_Reference {
  getDependencies() { List? list=super.getDependencies(); list.add(...); return list; }
}


Status: Done
Assignee: mgrigorov
Jira: WICKET-5124

XyzValidator#decorate() should work with IValidationError instead of ValidationError
Status: 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-05-29 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
From now on it is recommended all implementations of AjaxRequestTarget.IListener to extend from AjaxRequestTarget.AbstractListener. This way they wont need to a implement another method when a new one is added in a major release.   
h5. org.apache.wicket.ISessionListener#onUnbound(String) is added [WICKET-5213|https://issues.apache.org/jira/browse/WICKET-5213] This way all registered ISessionListeners will be notified when a Session is unbound. 
  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
The old API returned Iterable? extends HeaderItem and was inconvenient to override and add additional dependencies.
With the new API it is as easy as:

MyResourceReference.java

@Override
public ListHeaderItem getDependencies() {
  ListHeaderItem dependencies = 

[CONF] Apache Wicket Ideas for Wicket 7.0

2013-05-29 Thread confluence







Ideas for Wicket 7.0
Page edited by Bertrand Guay-Paquet


 Changes (1)
 




...
 - add more stateless components (stateless versions of existing components) 
- adopt Ajax stateless behaviors (allow stateless ajax callbacks) 
- ...  
...


Full Content



This page lists ideas what can be improved for Wicket 7.0.

Ajax back button support
Better stateless support
Implement JAX-RS on top of Wicket IResource
PageParameters improvements
Removal of auto-components
Java 7 as a minimum
Servlet 3 as a minimum
Improved tag manipulation
 Make transitions possible/easy when replacing components using Ajax/Push
Integrate bindgen-wicket
Minor API cleanups
Use webjars instead of embedded libraries



This page lists ideas what can be improved for Wicket 7.0.

These are only ideas. Some of them may not be implemented though. There will be a separate Roadmap page that will have only the ideas on which we agreed.
To be approved an idea has to be discussed first in dev@ mailing list. A patch and/or Pull Request increases the chance to get your idea in.

Ajax back button support

Igor has already started something about this at his GitHub

Perhaps this is a better library than simple history: https://github.com/rails/turbolinks

Better stateless support


	add more stateless components (stateless versions of existing components)
	adopt Ajax stateless behaviors (allow stateless ajax callbacks)
	...



Implement JAX-RS on top of Wicket IResource

Crazy, but why not ...

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
  See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Removal of auto-components

Auto components caused some problems due to their special lifecycle - they appear only during the rendering process. This will simplify component queueing, resolvers+auto components, problems with enclosures, ...
The idea is to rework the auto-components to be first class citizens, i.e. once the markup is parsed they should be in the runtime component tree as manually added components are. And should be reachable in the action phase.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Improved tag manipulation

Using attribute modifiers it is difficult to modify tags in proper ways such that existing classes on a 'class' attribute remain, while adding/removing other tags. A DSL for manipulating the class value of a component would be really great.

Make transitions possible/easy when replacing components using Ajax/Push

Currently we replace the markup of components, which works for updating the components, but it doesn't provide an easy way to animate the outgoing and incoming markup using CSS transitions. For example if you add a 'hidden' class to the class attribute of a component, and update it using Ajax, the markup gets replaced instead of updated.
See http://wicketinaction.com/2013/02/replace-components-with-animation/

Integrate bindgen-wicket

The issue of fragile property expressions has not been given much love ever since. Bindgen-wicket solves this in a clean and elegant way. Moreover, annotation processing is no longer cumbersome (as it has become part of javac compilation process since java 6).
Discussion in dev@ mailing list: http://markmail.org/thread/z2ngjxxtpqqwsea6

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) https://issues.apache.org/jira/browse/WICKET-4964



Use webjars instead of embedded libraries

... and integrate wicket-webjars



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Ideas for Wicket 7.0

2013-05-29 Thread confluence







Ideas for Wicket 7.0
Page edited by Bertrand Guay-Paquet


 Changes (2)
 




...
 - add more stateless components (stateless versions of existing components) 
- adopt Ajax stateless behaviors (allow stateless ajax callbacks) behavior listeners) 
- ...  
In Wicket 6, any behavior implementing IBehaviorListener becomes stateful. This includes all subclasses of AbstractAjaxBehavior. Overriding this behavior by making getStatelessHint() return true for an ajax behavior with a listener interface is tricky. The listeners url cannot be assumed to be stable unless the number and order of behaviors added to components does not change between the page creation and the ajax request.  
h3. Implement JAX-RS on top of Wicket IResource  
...


Full Content



This page lists ideas what can be improved for Wicket 7.0.

Ajax back button support
Better stateless support
Implement JAX-RS on top of Wicket IResource
PageParameters improvements
Removal of auto-components
Java 7 as a minimum
Servlet 3 as a minimum
Improved tag manipulation
 Make transitions possible/easy when replacing components using Ajax/Push
Integrate bindgen-wicket
Minor API cleanups
Use webjars instead of embedded libraries



This page lists ideas what can be improved for Wicket 7.0.

These are only ideas. Some of them may not be implemented though. There will be a separate Roadmap page that will have only the ideas on which we agreed.
To be approved an idea has to be discussed first in dev@ mailing list. A patch and/or Pull Request increases the chance to get your idea in.

Ajax back button support

Igor has already started something about this at his GitHub

Perhaps this is a better library than simple history: https://github.com/rails/turbolinks

Better stateless support


	add more stateless components (stateless versions of existing components)
	adopt Ajax stateless behaviors (allow stateless ajax behavior listeners)
	...



In Wicket 6, any behavior implementing IBehaviorListener becomes stateful. This includes all subclasses of AbstractAjaxBehavior. Overriding this behavior by making getStatelessHint() return true for an ajax behavior with a listener interface is tricky. The listener's url cannot be assumed to be stable unless the number and order of behaviors added to components does not change between the page creation and the ajax request.

Implement JAX-RS on top of Wicket IResource

Crazy, but why not ...

PageParameters improvements


	read-only
	make it possible to differentiate between named indexed parameters and query string ones.
  See WICKET-4594, http://markmail.org/thread/cc7yjwshqugj4wic, WICKET-4441



Removal of auto-components

Auto components caused some problems due to their special lifecycle - they appear only during the rendering process. This will simplify component queueing, resolvers+auto components, problems with enclosures, ...
The idea is to rework the auto-components to be first class citizens, i.e. once the markup is parsed they should be in the runtime component tree as manually added components are. And should be reachable in the action phase.

Java 7 as a minimum

Java 7 has nice support for generics, better annotations, and Java 6 is reaching its end of life pretty soon.

Servlet 3 as a minimum

While we opted to not require servlet 3 for wicket 6, it has bitten us a couple of times solving issues in wicket 6. Servlet 3 has been out for ages, so we should move with the times.

Improved tag manipulation

Using attribute modifiers it is difficult to modify tags in proper ways such that existing classes on a 'class' attribute remain, while adding/removing other tags. A DSL for manipulating the class value of a component would be really great.

Make transitions possible/easy when replacing components using Ajax/Push

Currently we replace the markup of components, which works for updating the components, but it doesn't provide an easy way to animate the outgoing and incoming markup using CSS transitions. For example if you add a 'hidden' class to the class attribute of a component, and update it using Ajax, the markup gets replaced instead of updated.
See http://wicketinaction.com/2013/02/replace-components-with-animation/

Integrate bindgen-wicket

The issue of fragile property expressions has not been given much love ever since. Bindgen-wicket solves this in a clean and elegant way. Moreover, annotation processing is no longer cumbersome (as it has become part of javac compilation process since java 6).
Discussion in dev@ mailing list: http://markmail.org/thread/z2ngjxxtpqqwsea6

Minor API cleanups


	Rename renderHead(HtmlHeaderContainer) 

[CONF] Apache Wicket How to write JSON response

2013-05-31 Thread confluence







How to write JSON response
Page edited by Kristian Rosenvold


Comment:
Updated to 1.5 syntax


 Changes (1)
 




...
	public JsonWebPage(PageParameters pageParameters) {  
getRequestCycle().setRequestTarget(new getRequestCycle().scheduleRequestHandlerAfterCurrent(new IRequestTarget() { 
 			@Override 
...
 } 
... {code} 
...


Full Content

In your WebPage...



...

public class JsonWebPage extends WebPage {

	public JsonWebPage(PageParameters pageParameters) {

		getRequestCycle().scheduleRequestHandlerAfterCurrent(new IRequestTarget() {

			@Override
			public void detach(RequestCycle requestCycle) {
// Nothing to do here.
			}

			@Override
			public void respond(RequestCycle requestCycle) {
// Add JSON-encoded string to the response.
requestCycle.getResponse().write("{\"jsonKey\":\"jsonValue\"}");
			}

		});

	}

}
...




NOTE: You DO NOT need to manually write JSON response, there are libraries like http://json-lib.sourceforge.net/ available that will allow you to convert an object hierarchy to something more useful in terms of JSON rather easily. For details, check the documentation at: http://json-lib.sourceforge.net/usage.html. 

Another library for JSON processing/generation is jackson.

NOTE Wicket = 1.5.x: see https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/autocomplete-tagit-parent for an example 



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket How to write JSON response

2013-05-31 Thread confluence







How to write JSON response
Page edited by Martin Grigorov


 Changes (5)
 




...
	public JsonWebPage(PageParameters pageParameters) {  
getRequestCycle().scheduleRequestHandlerAfterCurrent(new IRequestTarget() IRequestHandler() { 
 			@Override 
...
			public void respond(RequestCycle requestCycle) { // Add JSON-encoded string to the response. 
Response response = requestCycle.getResponse(); 
requestCycle.getResponse().write({\jsonKey\:\jsonValue\}); response.setContentType(application/json); 
response.write({\jsonKey\:\jsonValue\}); 
			} 
		}); 
	} 
} ... {code}  
You can use TextRequestHandler to simplify the code above. 
 NOTE: You DO NOT need to manually write JSON response, there are libraries like [http://json-lib.sourceforge.net/] available that will allow you to convert an object hierarchy to something more useful in terms of JSON rather easily. For details, check the documentation at: [http://json-lib.sourceforge.net/usage.html].  
...


Full Content

In your WebPage...



...

public class JsonWebPage extends WebPage {

	public JsonWebPage(PageParameters pageParameters) {

		getRequestCycle().scheduleRequestHandlerAfterCurrent(new IRequestHandler() {

			@Override
			public void detach(RequestCycle requestCycle) {
// Nothing to do here.
			}

			@Override
			public void respond(RequestCycle requestCycle) {
// Add JSON-encoded string to the response.
Response response = requestCycle.getResponse();
response.setContentType("application/json");
response.write("{\"jsonKey\":\"jsonValue\"}");
			}
		});
	}
}
...



You can use TextRequestHandler to simplify the code above.

NOTE: You DO NOT need to manually write JSON response, there are libraries like http://json-lib.sourceforge.net/ available that will allow you to convert an object hierarchy to something more useful in terms of JSON rather easily. For details, check the documentation at: http://json-lib.sourceforge.net/usage.html. 

Another library for JSON processing/generation is jackson.

NOTE Wicket = 1.5.x: see https://github.com/wicketstuff/core/tree/master/jdk-1.6-parent/autocomplete-tagit-parent for an example 



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-12 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (2)
 




...
This way all registered ISessionListeners will be notified when a Session is unbound.  
h5. (Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert junit.framework.Assert is deprecated. Due to this change org.junit.Assert#fail() throws now java.lang.AssertionError instead of junit.framework.AseertionFailedError 
 
h5. org.apache.wicket.Component#setMetaData() value could be only a Serializable [WICKET-5227|https://issues.apache.org/jira/browse/WICKET-5227] Component and Sessions meta data must be serializable.  
h3. Behavior changes  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-13 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
It was based on Swing APIs and many people complained about this. Use the new Tree component introduced in Wicket 6.0.0 instead.  
h5. PackageTextTemplate loads its content lazily [WICKET-4579|https://issues.apache.org/jira/browse/WICKET-4579] PackageTextTemplate will load its content at first usage of PackageTextTemplate#toString() or PackageTextTemplate#interpolate(Map) emthods. If its style/locale/variation/encoding are changed then it will reload its content. 
 h3. Dependency updates 
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.
PackageTextTemplate loads its content lazily WICKET-4579


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.

org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-13 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
If its style/locale/variation/encoding are changed then it will reload its content.  
h5. AbstractLink uses a Behavior to render itself as disabled [WICKET-4904|https://issues.apache.org/jira/browse/WICKET-4904]  org.apache.wicket.markup.html.link.AbstractLink#getDisablingBehavior() is introduced. This method can return a non-null Behavior that can render markup for the Link in disabled mode.  By default org.apache.wicket.markup.html.link.DisableLinkBehavior is used. It uses AbstractLink#getBeforeDisabledLink and AbstractLink#getAfterDisabledLink to prepend/append additional markup and changes the a to span.  
h3. Deprecated classes/methods/fields are removed [WICKET-5201|https://issues.apache.org/jira/browse/WICKET-5201]  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198
PackageTextTemplate loads its content lazily WICKET-4579
AbstractLink uses a Behavior to render itself as disabled WICKET-4904


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-13 Thread confluence







Migration to Wicket 7.0
Page edited by Sven Meier


Comment:
AbstractLink WICKET-4904


 Changes (4)
 




...
If its style/locale/variation/encoding are changed then it will reload its content.  
h5. AbstractLink uses a Behavior no longer alters its markup to render itself as disabled [WICKET-4904|https://issues.apache.org/jira/browse/WICKET-4904] 
 
org.apache.wicket.markup.html.link.AbstractLink#getDisablingBehavior() is introduced. This method can return a non-null Behavior that can render markup for the Link in disabled mode. 
The href and disabled attributes are still added/removed by AbstractLink as required. But no further mangling of markup is performed. org.apache.wicket.markup.html.link.DisabledLinkBehavior can be used to restore the pre-Wicket-7.x representation of disabled links with emspan/span/em (note that em and span swap their position though). 
 
By default org.apache.wicket.markup.html.link.DisableLinkBehavior is used. It uses AbstractLink#getBeforeDisabledLink and AbstractLink#getAfterDisabledLink to prepend/append additional markup and changes the a to span.  
h3. Deprecated classes/methods/fields are removed [WICKET-5201|https://issues.apache.org/jira/browse/WICKET-5201]  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198
PackageTextTemplate loads its content lazily WICKET-4579
AbstractLink no longer alters its markup to render itself as disabled WICKET-4904


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-14 Thread confluence







Migration to Wicket 7.0
Page edited by Sven Meier


Comment:
WICKET-5235


 Changes (1)
 




...
The href and disabled attributes are still added/removed by AbstractLink as required. But no further mangling of markup is performed. org.apache.wicket.markup.html.link.DisabledLinkBehavior can be used to restore the pre-Wicket-7.x representation of disabled links with emspan/span/em (note that em and span swap their position though). If the old behavior is need it can be easily re-applied by using org.apache.wicket.markup.html.link.DisabledLinkBehavior.LinkInstantiationListener.  
h5. Button no longer silently ignores exceptions [WICKET-5235|https://issues.apache.org/jira/browse/WICKET-5235] ... when it renders its model into the value attribute.   
h3. Deprecated classes/methods/fields are removed [WICKET-5201|https://issues.apache.org/jira/browse/WICKET-5201]  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198
PackageTextTemplate loads its content lazily WICKET-4579
AbstractLink no longer alters its markup to render itself as disabled WICKET-4904
Button no longer silently ignores exceptions WICKET-5235


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-18 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
Component and Sessions meta data must be serializable.  
h5. org.apache.wicket.Application#getHeaderContributorListenerCollection() is renamed to #getHeaderContributorListeners() This way it is consistent with the other #getXyzListeners() methods in Application class  
h3. Behavior changes  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227
org.apache.wicket.Application#getHeaderContributorListenerCollection() is renamed to #getHeaderContributorListeners()


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198
PackageTextTemplate loads its content lazily WICKET-4579
AbstractLink no longer alters its markup to render itself as disabled WICKET-4904
Button no longer silently ignores exceptions WICKET-5235


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
Component#renderHead(HtmlHeaderContainer) was very similar to the usually used Component#renderHead(IHeaderResponse). So it has been renamed to avoid any confusions.


[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-18 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
This way it is consistent with the other #getXyzListeners() methods in Application class  
h5. org.apache.wicket.authorization.IAuthorizationStrategy#isResourceAuthorized(IResource, PageParameters) is introduced [WICKET-5012|https://issues.apache.org/jira/browse/WICKET-5012]  Wicket 7.x supports authorization for requests to resources (IResource) additionally to authorization for components.  
h3. Behavior changes  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227
org.apache.wicket.Application#getHeaderContributorListenerCollection() is renamed to #getHeaderContributorListeners()
org.apache.wicket.authorization.IAuthorizationStrategy#isResourceAuthorized(IResource, PageParameters) is introduced WICKET-5012


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198
PackageTextTemplate loads its content lazily WICKET-4579
AbstractLink no longer alters its markup to render itself as disabled WICKET-4904
Button no longer silently ignores exceptions WICKET-5235


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
BoxBorder class has been deprecated in Wicket 6.x series

org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to 

[CONF] Apache Wicket Websites based on Wicket

2013-06-19 Thread confluence







Websites based on Wicket
Page edited by Ian Marshall


Comment:
Added MarketTree.co.uk to the list of public sites


 Changes (1)
 




...
* *Loved.by* \- [a simple way to get rewarded for your recommendations|http://loved.by] includes Facebook and Twitter integration * *lyhoo.com.cn* \- [Lyhoo|http://lyhoo.com.cn] A personalized product search, user needs matching and alerting site in Chinese. Migrated from Spring MVC. 
* *MarketTree.co.uk* \- [MarketTree.co.uk|http://MarketTree.co.uk] Trading exchange which uses Wicket throughout. 
* *mauswerks.net* \- [mauswerks.net|http://www.mauswerks.net] US-based ISV/ISP focused on Java application hosting, Brix CMS, and custom transactional solutions. * *me.dium.com* \- [Me.dium.com|http://me.dium.com] Social browsing company bringing a unique experience to the online world. 
...
* *www.songtexte.com* \- [Songtexte.com|http://www.songtexte.com/] A social network for music geeks including lyrics, videos,  Uses Wicket, Spring, Hibernate. * *www.svnsite.com* \- [SVNsite Subversion Hosting|http://www.svnsite.com] \- commercial SVN hosting service built on top of Wicket, JPA and Wicket RAD. 
* *www.srmvision.com* \- [SRMvision ITIL  e-SCM platform|http://www.srmvision.com] \- SRMvision is a whole platform allowing IT departments to manage their activities : assets, cases, services, requests... The application is made using Wicket + JPA + EJBs. 
* *taivallus.fi* \- [Taivallus|http://taivallus.fi] Social networking portal for people interested in travelling. * *www.teachus.dk* \- [TeachUs|http://www.teachus.dk/] Open Source booking system designed for teachers with one-to-one tuition. [Online demo|http://demo.teachus.dk/] (login with leif/leif). [Project website|http://dev.teachus.dk] 
...


Full Content

You can also submit your website to Built with Wicket, along with a screenshot.

(sorted alphabetically by web URL)

Public Sites


	AirBank.cz  A web of a bank and internet banking app.
	Vodafone web  See Vodafone Park
	TipSpot.com
	appgravity.com  appgravity.com Android App search engine.
	www.icecreamwear.com  www.icecreamwear.com Multilingual commercial website developed in Wicket: Personalized Yoga Clothing and Fitness Apparel for Women.
	www.fira.nl  www.fira.nl Sustainability rating system using both wicket and brix.
	pixmeaway.com  PixMeAway.cz Find your travel destination by pictures or get inspired for planning your next vacation
	pohlidame.cz  Pohlidame.cz Monitoring of a state web service called "Insolvenční rejstřík".
	preventivoonline.com  www.preventivoonline.com Italian search engine companies, with small business blog service for each registered company and other services.
	1100ad.com  1100AD Online massive multiplayer strategy game (web site on php, but the game itself on Wicket)
	8vents.com  8vents Message, Photo, File sharing service.
	beTurtle.com  beTurtle 'Green' social networking and information portal.
	Braziland  Braziland Brazilian dance and capoeira shows and classes based in Nice, Côte d'Azur, France.
	cronmaker.com  CronMaker A utility to generate cron expressions.
	datawink.com  datawink an online chart pattern recognition search engine
	dbserver.ics.upjs.sk/davano  Davano Collaborative storytelling and Play-by-post-RPG supporting system. Rewritten from from PHP to Wicket+Spring+Hibernate.
	deect.com  Deect Multilingual dictionary, lexicon, language-learning portal
	Equity Market Data.com  EquityMarketData Financial Data Provider
	evri.com  Evri Real-time news
	ewmix.com  eWmix.com Brazilian e-commerce website.
	exerciselog.eu, trainingslog.dk, træningslog.dk  Exerciselog An exercise log for your monitoring your progress.(different sites branded a bit)
	fabulously40.com  Fabulously40 40 woman's social network. Rails site gone wicket.
	genietown.com  GenieTown GenieTown is building a unique online community of customers and service providers. The site is designed to restore the lost experience of Main Street, where business was conducted in a personal way, the resources were local, and reputation was paramount.
	GreyWay.com  GreyWay.com Digital Signature and Professional Portfolio Management Web Site, based on Apache Wicket 1.4.7 and myBatis 3.01 ORM libraries. Open to General Public.
	homestaybay.com  HomestayBay An online homestay community that connects international ESL students with host families.
	home-account.com  Billed as "The best way to get a mortgage loan".
	insidewood.lib.ncsu.edu  InsideWood InsideWood contains brief descriptions of fossil and modern woody dicots (hardwoods) from more than 200 plant families, and is searchable by an interactive, multiple-entry key. There are over 34,000 images 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-20 Thread confluence







Migration to Wicket 7.0
Page edited by Martin Grigorov


 Changes (1)
 




...
Wicket 7.x supports authorization for requests to resources (IResource) additionally to authorization for components.  
h5. org.apache.wicket.Component#setResponsePage() now accepts org.apache.wicket.request.component.IRequestablePage instead of org.apache.wicket.Page org.apache.wicket.Component#setResponsePage(page) just delegates to org.apache.wicket.request.cycle.RequestCycle#setResponsePage() that required just IRequestablePage.  
h3. Behavior changes  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227
org.apache.wicket.Application#getHeaderContributorListenerCollection() is renamed to #getHeaderContributorListeners()
org.apache.wicket.authorization.IAuthorizationStrategy#isResourceAuthorized(IResource, PageParameters) is introduced WICKET-5012
org.apache.wicket.Component#setResponsePage() now accepts org.apache.wicket.request.component.IRequestablePage instead of org.apache.wicket.Page


Behavior changes


org.apache.wicket.request.Url#getQueryString WICKET-4664
org.apache.wicket.request.http.WebResponse encodes the value of the "filename" in Content-Disposition header WICKET-4934
org.apache.wicket.markup.html.form.FormComponentLabel outputs "required", "disabled" and "error" classes when its form component is either required, disabled or invalid. WICKET-5177
org.apache.wicket.markup.html.panel.FeedbackPanel Do not set CSS class on the li  span element for a feedback message WICKET-4831
AjaxEventBehavior doesn't prevent the default behavior of the _javascript_ event WICKET-5197
Ajax behaviors let _javascript_ events bubble by default WICKET-5198
PackageTextTemplate loads its content lazily WICKET-4579
AbstractLink no longer alters its markup to render itself as disabled WICKET-4904
Button no longer silently ignores exceptions WICKET-5235


Deprecated classes/methods/fields are removed WICKET-5201


AbstractDefaultAjaxBehavior's #getSuccessHandler(), #getFailureHandler(), #getChannel() and #getPrecondition() are removed.
The old Tree component in wicket-extensions is removed.


Dependency updates


Environment

Wicket 7.0 requires at least Java 7

Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152
This is an improvement in Wicket 7.0 which should not affect any application migrating from Wicket 6.x. But if you use Servlet 3.0's AsyncContext in IResource in Wicket 7 then make sure that your code flushes the http response after completing the request.

API changes

org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
CheckingObjectOutputStream accepts a list of org.apache.wicket.core.util.objects.checker.IObjectChecker objects which are used to check for different kind of problems during object serialization. Commit diff: d0441059e0

org/apache/wicket/markup/html/border/BoxBorder 

[CONF] Apache Wicket Migration to Wicket 7.0

2013-06-21 Thread confluence







Migration to Wicket 7.0
Page edited by Cedric Gatay


Comment:
Wicket-5246


 Changes (12)
 




...
 h5. org.apache.wicket.request.Url#getQueryString [WICKET-4664|https://issues.apache.org/jira/browse/WICKET-4664] 
Url#getQueryString() now behaves as HttpServletRequest behaves :  
 
 * returns the query string without the leading ?  * returns null when there is no query string 
Url#getQueryString() now behaves as HttpServletRequest behaves : 
 
* returns the query string without the leading ? * returns null when there is no query string  
RequestUtils#decodeParameters() now strips the ? from the output value.  
...
The value of the file name used in Content-Disposition response header can contain characters which should be [encoded|http://greenbytes.de/tech/tc2231/]  
h5. org.apache.wicket.markup.html.form.FormComponentLabel outputs required, disabled and error classes when its form component is either required, disabled or invalid.   [WICKET-5177|https://issues.apache.org/jira/browse/WICKET-5177] 
 
This way it is in sync with AutoLabel (the auto component that is used for wicket:for attribute).  
...
 h5. AjaxEventBehavior doesnt prevent the default behavior of the _javascript_ event [WICKET-5197|https://issues.apache.org/jira/browse/WICKET-5197] 
 
From now on only AjaxFallback*\* components prevent the default _javascript_ event behavior so only the Ajax call is made when _javascript_ is enabled in the browser. 
If the default behavior should be prevented in any use case then use: {code:borderStyle=solid} 
...
 h5. Ajax behaviors let _javascript_ events bubble by default [WICKET-5198|https://issues.apache.org/jira/browse/WICKET-5198] 
 
If _javascript_ events should not bubble then use: {code:borderStyle=solid} 
...
 h5. Button no longer silently ignores exceptions [WICKET-5235|https://issues.apache.org/jira/browse/WICKET-5235] 
... when it renders its model into the value attribute.  
 
... when it renders its model into the value attribute.  
h3. Deprecated classes/methods/fields are removed [WICKET-5201|https://issues.apache.org/jira/browse/WICKET-5201]  
...
It was based on Swing APIs and many people complained about this. Use the new Tree component introduced in Wicket 6.0.0 instead.  
h5. Wicket.Window.unloadConfirmation has been removed [WICKET-5246|https://issues.apache.org/jira/browse/WICKET-5246]  In Wicket 6, Modal settings have been introduced, deprecating the old way of disabling unloadConfirmation. Please consider updating your _javascript_ to remove calls to Wicket.Window.unloadConfirmation.  
h3. Dependency updates  
...


Full Content

Migrating to Wicket 7.0



Environment

Wicket 7.0 requires at least Java 7
Wicket 7.0 requires Servlet 3.0

The HTTP response is not flushed automatically when the request is started in asynchronous mode. WICKET-5152


API changes


org/apache/wicket/core/util/io/SerializableChecker is replaced with org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream WICKET-4817
org/apache/wicket/markup/html/border/BoxBorder is removed with no replacement WICKET-4966.
org.apache.wicket.Component#renderHead(HtmlHeaderContainer) is renamed to Component#internalRenderHead(HtmlHeaderContainer) WICKET-4964
org.apache.wicket.request.resource.ResourceReference#getDependencies() now returns a mutable ListHeaderItem WICKET-5124
org.apache.wicket.model.StringResourceModel constructor accepts IModelString for its default value WICKET-4972
org.apache.wicket.extensions.validation.validator.+Xyz+Validator#decorate() now works with IValidationError WICKET-5174
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#setAllowDefault is renamed to #setPreventDefault WICKET-5197
org.apache.wicket.ajax.attributes.AjaxRequestAttributes#eventPropagation is now BUBBLE by default WICKET-5198
org.apache.wicket.ajax.form.AjaxFormValidatingBehavior doesn't use static methods anymore WICKET-5196
org.apache.wicket.ajax.AjaxRequestTarget.IListener#updateAjaxAttributes() is introduced WICKET-5212
org.apache.wicket.ISessionListener#onUnbound(String) is added WICKET-5213
(Base)WicketTester uses org.junit.Assert instead of junit.framework.Assert
org.apache.wicket.Component#setMetaData() value could be only a Serializable WICKET-5227

[CONF] Apache Wicket Migration to Wicket 6.0

2012-05-08 Thread confluence







Migration to Wicket 6.0
Page edited by Martin Grigorov


 Changes (1)
 




...
| org.apache.wicket.util.resource.**| org.apache.wicket.core.util.resource.** (OSGi friendly) | | org.apache.wicket.util.string.**| org.apache.wicket.core.util.string.** (OSGi friendly) | 
| org.apache.wicket.request.UrlEncoder | org.apache.wicket.util.encoding.UrlEncoder | 
 h3. Refactorings 
...


Full Content

Migrating to Wicket 6.0



Environment
Repeaters
Form Processing

Validation
Feedback Storage Refactoring

Ajax

Use JQuery as a backing library for Wicket Ajax functionality
AjaxRequestTarget is an interface

IHeaderResponse, including decorators and filters
Order of Header contributions and wicket:head
package.properties renamed to wicket-package.properties
List of renamed classes and methods
Refactorings
o.a.w.IComponentSource and o.a.w.ComponentSourceEntry are removed
o.a.w.Component#onMarkupAttached() has been dropped in favour of o.a.w.Component#onInitialize().
IInitializers are initialized before Application#init()
PackageResourceReference can load a minified version of a package resource
Files#getLocalFileFromUrl(URL) decodes url before returning file


Environment


	Wicket 6.0 requires at least Java 6




Repeaters

	`IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages (WICKET-1175).



Form Processing

Validation


	`StringValidator` will add the `maxlength` attribute if added to a component attached to an input tag
	`AbstractValidator` has been removed
	`ValidationError` now makes creating standard error keys (classname and classname.subtype) easier. Before one had to do: new ValidationError().addMessageKey(validator.getClass().getSimpleName()) to construct the default key, now you can simply say new ValidationError(validator) and it will do the above for you. Also, for more specific keys one had to do new ValidationError().addMessageKey(validator.getClass().getSimpleName()+".variant"), now you can do new ValidationError(validator, "variant").
	Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors. For example, to add an extra resource key for the error message to StringValidator one can do 


class MyStringValidator extends StringValidator {
ValidationError decoreate(ValidationError error, IValidatable validatable) {
   error.addKey("mystringerror");
   return error;
}
}


	org.apache.wicket.validation.RawValidationError is introduced. It can be used to bring a raw Serializable object which is registered as FeedbackMessage with org.apache.wicket.Component#error(Serializable).
	IFormValidator can have its own resource bundle as other IValidator implementations. WICKET-3879



Feedback Storage Refactoring


	Feedback messages reported against components are now stored in component's metadata rather then in session. This will allow them to survive across requests, see WICKET-2705.
	Previously the cleanup of messages was controlled by RequestCycle#cleanupFeedbackMessages(), now it is controlled by an IFeedbackMessageFilter set via IApplicationSettings#setFeedbackMessageCleanupFilter(). When session and components are detached they will run this filter on any stored messages, all messages accepted by the filter are removed. The default filter will accept any rendered message, so by default feedback messages are removed once rendered.
	Form components will clear any stored messages when validate() is called. This will remove any unredered, but now stale, messages.
	Since messages are now stored in session and in component tree retrieving them is not as simple as Session.getFeedbackMessages(). To assist with this common usecase please see FeedbackCollector.
	In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can now call WicketTester#cleanupFeedbackMessages() to clean up message just like it would be done at the end of a request. Alternatively, WicketTester#clearFeedbackMessages() can be used to clear all feedback messages. By default WicketTester will not clean any feedback messages.



Ajax

Use JQuery as a backing library for Wicket Ajax functionality

Apache Wicket needed to improve the implementation of its _javascript_ libraries used for Ajax functionality (wicket-ajax.js and wicket-event.js) by using any of the bigger _javascript_ libraries and delegate to it the handling of the differences in the browsers (DOM, events, 

[CONF] Apache Wicket Migration to Wicket 6.0

2012-05-08 Thread confluence







Migration to Wicket 6.0
Page edited by Martijn Dashorst


 Changes (1)
 




...
* In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can now call WicketTester#cleanupFeedbackMessages() to clean up message just like it would be done at the end of a request. Alternatively, WicketTester#clearFeedbackMessages() can be used to clear all feedback messages. By default WicketTester will not clean any feedback messages.  
h4. Feedback messages now use ${label} instead of ${input}  You should use form component.setLabel(...) to provide a good (internationalized) label for your form components such as text fields. If no label is set on your form fields, Wicket will use the component identifier as the label. This will change the feedback messages from:  * 12345a is not a valid integer  To:  * Number is not a valid integer  Provided that the field has a Number label.  
h3. Ajax  
...


Full Content

Migrating to Wicket 6.0



Migrating to Wicket 6.0


Environment
Repeaters
Form Processing

Validation
Feedback Storage Refactoring
Feedback messages now use $Unknown macro: {label}  instead of $Unknown macro: {input} 

Ajax

Use JQuery as a backing library for Wicket Ajax functionality
AjaxRequestTarget is an interface

IHeaderResponse, including decorators and filters
Order of Header contributions and wicket:head
package.properties renamed to wicket-package.properties
List of renamed classes and methods
Refactorings
o.a.w.IComponentSource and o.a.w.ComponentSourceEntry are removed
o.a.w.Component#onMarkupAttached() has been dropped in favour of o.a.w.Component#onInitialize().
IInitializers are initialized before Application#init()
PackageResourceReference can load a minified version of a package resource
Files#getLocalFileFromUrl(URL) decodes url before returning file




Environment


	Wicket 6.0 requires at least Java 6




Repeaters

	`IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages (WICKET-1175).



Form Processing

Validation


	`StringValidator` will add the `maxlength` attribute if added to a component attached to an input tag
	`AbstractValidator` has been removed
	`ValidationError` now makes creating standard error keys (classname and classname.subtype) easier. Before one had to do: new ValidationError().addMessageKey(validator.getClass().getSimpleName()) to construct the default key, now you can simply say new ValidationError(validator) and it will do the above for you. Also, for more specific keys one had to do new ValidationError().addMessageKey(validator.getClass().getSimpleName()+".variant"), now you can do new ValidationError(validator, "variant").
	Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors. For example, to add an extra resource key for the error message to StringValidator one can do 


class MyStringValidator extends StringValidator {
ValidationError decoreate(ValidationError error, IValidatable validatable) {
   error.addKey("mystringerror");
   return error;
}
}


	org.apache.wicket.validation.RawValidationError is introduced. It can be used to bring a raw Serializable object which is registered as FeedbackMessage with org.apache.wicket.Component#error(Serializable).
	IFormValidator can have its own resource bundle as other IValidator implementations. WICKET-3879



Feedback Storage Refactoring


	Feedback messages reported against components are now stored in component's metadata rather then in session. This will allow them to survive across requests, see WICKET-2705.
	Previously the cleanup of messages was controlled by RequestCycle#cleanupFeedbackMessages(), now it is controlled by an IFeedbackMessageFilter set via IApplicationSettings#setFeedbackMessageCleanupFilter(). When session and components are detached they will run this filter on any stored messages, all messages accepted by the filter are removed. The default filter will accept any rendered message, so by default feedback messages are removed once rendered.
	Form components will clear any stored messages when validate() is called. This will remove any unredered, but now stale, messages.
	Since messages are now stored in session and in component tree retrieving them is not as simple as Session.getFeedbackMessages(). To assist with this common usecase please see FeedbackCollector.
	In test land cleanup of feedback messages was 

[CONF] Apache Wicket Migration to Wicket 6.0

2012-05-08 Thread confluence







Migration to Wicket 6.0
Page edited by Martijn Dashorst


 Changes (1)
 




...
* In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can now call WicketTester#cleanupFeedbackMessages() to clean up message just like it would be done at the end of a request. Alternatively, WicketTester#clearFeedbackMessages() can be used to clear all feedback messages. By default WicketTester will not clean any feedback messages.  
h4. Feedback messages now use \${label} $\{label\} instead of \${input} $\{input\} 
 You should use form component.setLabel(...) to provide a good (internationalized) label for your form components such as text fields. If no label is set on your form fields, Wicket will use the component identifier as the label. This will change the feedback messages from: 
...


Full Content

Migrating to Wicket 6.0



Environment
Repeaters
Form Processing

Validation
Feedback Storage Refactoring
Feedback messages now use ${label} instead of ${input}

Ajax

Use JQuery as a backing library for Wicket Ajax functionality
AjaxRequestTarget is an interface

IHeaderResponse, including decorators and filters
Order of Header contributions and wicket:head
package.properties renamed to wicket-package.properties
List of renamed classes and methods
Refactorings
o.a.w.IComponentSource and o.a.w.ComponentSourceEntry are removed
o.a.w.Component#onMarkupAttached() has been dropped in favour of o.a.w.Component#onInitialize().
IInitializers are initialized before Application#init()
PackageResourceReference can load a minified version of a package resource
Files#getLocalFileFromUrl(URL) decodes url before returning file


Environment


	Wicket 6.0 requires at least Java 6




Repeaters

	`IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages (WICKET-1175).



Form Processing

Validation


	`StringValidator` will add the `maxlength` attribute if added to a component attached to an input tag
	`AbstractValidator` has been removed
	`ValidationError` now makes creating standard error keys (classname and classname.subtype) easier. Before one had to do: new ValidationError().addMessageKey(validator.getClass().getSimpleName()) to construct the default key, now you can simply say new ValidationError(validator) and it will do the above for you. Also, for more specific keys one had to do new ValidationError().addMessageKey(validator.getClass().getSimpleName()+".variant"), now you can do new ValidationError(validator, "variant").
	Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors. For example, to add an extra resource key for the error message to StringValidator one can do 


class MyStringValidator extends StringValidator {
ValidationError decoreate(ValidationError error, IValidatable validatable) {
   error.addKey("mystringerror");
   return error;
}
}


	org.apache.wicket.validation.RawValidationError is introduced. It can be used to bring a raw Serializable object which is registered as FeedbackMessage with org.apache.wicket.Component#error(Serializable).
	IFormValidator can have its own resource bundle as other IValidator implementations. WICKET-3879



Feedback Storage Refactoring


	Feedback messages reported against components are now stored in component's metadata rather then in session. This will allow them to survive across requests, see WICKET-2705.
	Previously the cleanup of messages was controlled by RequestCycle#cleanupFeedbackMessages(), now it is controlled by an IFeedbackMessageFilter set via IApplicationSettings#setFeedbackMessageCleanupFilter(). When session and components are detached they will run this filter on any stored messages, all messages accepted by the filter are removed. The default filter will accept any rendered message, so by default feedback messages are removed once rendered.
	Form components will clear any stored messages when validate() is called. This will remove any unredered, but now stale, messages.
	Since messages are now stored in session and in component tree retrieving them is not as simple as Session.getFeedbackMessages(). To assist with this common usecase please see FeedbackCollector.
	In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can now call 

[CONF] Apache Wicket Migration to Wicket 6.0

2012-05-08 Thread confluence







Migration to Wicket 6.0
Page edited by Martijn Dashorst


 Changes (1)
 




...
* In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can now call WicketTester#cleanupFeedbackMessages() to clean up message just like it would be done at the end of a request. Alternatively, WicketTester#clearFeedbackMessages() can be used to clear all feedback messages. By default WicketTester will not clean any feedback messages.  
h4. Feedback messages now use \${label} instead of \${input} 
 You should use form component.setLabel(...) to provide a good (internationalized) label for your form components such as text fields. If no label is set on your form fields, Wicket will use the component identifier as the label. This will change the feedback messages from: 
...


Full Content

Migrating to Wicket 6.0



Migrating to Wicket 6.0


Environment
Repeaters
Form Processing

Validation
Feedback Storage Refactoring
Feedback messages now use \$Unknown macro: {label}  instead of \$Unknown macro: {input} 

Ajax

Use JQuery as a backing library for Wicket Ajax functionality
AjaxRequestTarget is an interface

IHeaderResponse, including decorators and filters
Order of Header contributions and wicket:head
package.properties renamed to wicket-package.properties
List of renamed classes and methods
Refactorings
o.a.w.IComponentSource and o.a.w.ComponentSourceEntry are removed
o.a.w.Component#onMarkupAttached() has been dropped in favour of o.a.w.Component#onInitialize().
IInitializers are initialized before Application#init()
PackageResourceReference can load a minified version of a package resource
Files#getLocalFileFromUrl(URL) decodes url before returning file




Environment


	Wicket 6.0 requires at least Java 6




Repeaters

	`IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages (WICKET-1175).



Form Processing

Validation


	`StringValidator` will add the `maxlength` attribute if added to a component attached to an input tag
	`AbstractValidator` has been removed
	`ValidationError` now makes creating standard error keys (classname and classname.subtype) easier. Before one had to do: new ValidationError().addMessageKey(validator.getClass().getSimpleName()) to construct the default key, now you can simply say new ValidationError(validator) and it will do the above for you. Also, for more specific keys one had to do new ValidationError().addMessageKey(validator.getClass().getSimpleName()+".variant"), now you can do new ValidationError(validator, "variant").
	Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors. For example, to add an extra resource key for the error message to StringValidator one can do 


class MyStringValidator extends StringValidator {
ValidationError decoreate(ValidationError error, IValidatable validatable) {
   error.addKey("mystringerror");
   return error;
}
}


	org.apache.wicket.validation.RawValidationError is introduced. It can be used to bring a raw Serializable object which is registered as FeedbackMessage with org.apache.wicket.Component#error(Serializable).
	IFormValidator can have its own resource bundle as other IValidator implementations. WICKET-3879



Feedback Storage Refactoring


	Feedback messages reported against components are now stored in component's metadata rather then in session. This will allow them to survive across requests, see WICKET-2705.
	Previously the cleanup of messages was controlled by RequestCycle#cleanupFeedbackMessages(), now it is controlled by an IFeedbackMessageFilter set via IApplicationSettings#setFeedbackMessageCleanupFilter(). When session and components are detached they will run this filter on any stored messages, all messages accepted by the filter are removed. The default filter will accept any rendered message, so by default feedback messages are removed once rendered.
	Form components will clear any stored messages when validate() is called. This will remove any unredered, but now stale, messages.
	Since messages are now stored in session and in component tree retrieving them is not as simple as Session.getFeedbackMessages(). To assist with this common usecase please see FeedbackCollector.
	In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can 

[CONF] Apache Wicket Migration to Wicket 6.0

2012-05-09 Thread confluence







Migration to Wicket 6.0
Page edited by Martin Grigorov


Comment:
WICKET-4535


 Changes (1)
 




...
h3. Repeaters * `IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages ([WICKET-1175|https://issues.apache.org/jira/browse/WICKET-1175]). 
* All classes in wicket-extensions which are related to repeaters with sorting behavior have improved generics related to the sorting property ([WICKET-4535|https://issues.apache.org/jira/browse/WICKET-4535]). In most cases you just have to add *, String* to the previous parameterized type. For example: _IColumnEntity_ becomes _IColumnEntity, String_. But now it is possible to use other type for the sort property than java.lang.String too. 
 h3. Form Processing 
...


Full Content

Migrating to Wicket 6.0



Environment
Repeaters
Form Processing

Validation
Feedback Storage Refactoring
Feedback messages now use ${label} instead of ${input}

Ajax

Use JQuery as a backing library for Wicket Ajax functionality
AjaxRequestTarget is an interface

IHeaderResponse, including decorators and filters
Order of Header contributions and wicket:head
package.properties renamed to wicket-package.properties
List of renamed classes and methods
Refactorings
o.a.w.IComponentSource and o.a.w.ComponentSourceEntry are removed
o.a.w.Component#onMarkupAttached() has been dropped in favour of o.a.w.Component#onInitialize().
IInitializers are initialized before Application#init()
PackageResourceReference can load a minified version of a package resource
Files#getLocalFileFromUrl(URL) decodes url before returning file


Environment


	Wicket 6.0 requires at least Java 6




Repeaters

	`IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages (WICKET-1175).
	All classes in wicket-extensions which are related to repeaters with sorting behavior have improved generics
related to the sorting property (WICKET-4535). In most cases you just have to add ', String' to the previous parameterized type. For example: IColumnEntity becomes IColumnEntity, String. But now it is possible to use other type for the sort property than java.lang.String too.



Form Processing

Validation


	`StringValidator` will add the `maxlength` attribute if added to a component attached to an input tag
	`AbstractValidator` has been removed
	`ValidationError` now makes creating standard error keys (classname and classname.subtype) easier. Before one had to do: new ValidationError().addMessageKey(validator.getClass().getSimpleName()) to construct the default key, now you can simply say new ValidationError(validator) and it will do the above for you. Also, for more specific keys one had to do new ValidationError().addMessageKey(validator.getClass().getSimpleName()+".variant"), now you can do new ValidationError(validator, "variant").
	Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors. For example, to add an extra resource key for the error message to StringValidator one can do 


class MyStringValidator extends StringValidator {
ValidationError decoreate(ValidationError error, IValidatable validatable) {
   error.addKey("mystringerror");
   return error;
}
}


	org.apache.wicket.validation.RawValidationError is introduced. It can be used to bring a raw Serializable object which is registered as FeedbackMessage with org.apache.wicket.Component#error(Serializable).
	IFormValidator can have its own resource bundle as other IValidator implementations. WICKET-3879



Feedback Storage Refactoring


	Feedback messages reported against components are now stored in component's metadata rather then in session. This will allow them to survive across requests, see WICKET-2705.
	Previously the cleanup of messages was controlled by RequestCycle#cleanupFeedbackMessages(), now it is controlled by an IFeedbackMessageFilter set via IApplicationSettings#setFeedbackMessageCleanupFilter(). When session and components are detached they will run this filter on any stored messages, all messages accepted by the filter are removed. The default filter will accept any rendered message, so by default feedback messages are removed once rendered.
	Form components will clear any stored messages when validate() is called. This will remove any unredered, but now stale, messages.
	Since messages are now stored 

[CONF] Apache Wicket How to use the same Form for editing and new

2012-05-10 Thread confluence







How to use the same Form for editing and new
Page edited by Peter Henderson


Comment:
Added another way of makeing a textfield readonly.


 Changes (1)
 




...
 When you set isReadOnly to true now, the controls will be read-only, and will have the format you defined in your stylesheet 
  h2. or another avoiding deprecated apis...  From version 1.5 Wicket has depricated the constructor {code} AttributeModifier(java.lang.String attribute, boolean addAttributeIfNotPresent, IModel? replaceModel) {code}  To avoid using attribute modifiers you can sub class the TextField and override a couple of fields.  An example in Scala {code}   val commentTF = new TextField(commentTF, commentModel) { override def isEnabled() = !isReadOnly(); override def onDisabled(tag: ComponentTag) = tag.put(readonly, readonly);   }   form.add(commentTF); {code} 


Full Content

Table of contents


One way
or another...
or another avoiding deprecated apis...


One way


import wicket.markup.html.WebPage;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.markup.html.form.Form;
import wicket.markup.html.form.TextField;
import wicket.markup.html.form.Button;
import wicket.markup.html.link.Link;
import wicket.markup.html.basic.Label;
import wicket.markup.html.list.ListView;
import wicket.markup.html.list.ListItem;
import wicket.model.CompoundPropertyModel;
import wicket.IFeedback;

import java.util.List;

class PersonList extends WebPage {
private List peopleList;

public PersonList(final List peopleList) {
this.peopleList = peopleList;
this.peopleList.add(new Person("Lila"));
this.peopleList.add(new Person("Bender"));
this.peopleList.add(new Person("Fry"));

add(new ListView("peopleList", this.peopleList) {
protected void populateItem(ListItem listItem) {
final Person person = (Person) listItem.getModelObject();
add(new Label("name", person.getName()));
add(new Link("editPerson") {

public void onClick() {
setResponsePage(new PersonEdit(person, peopleList));
}
});
}
});

add(new Link("newPerson") {

public void onClick() {
setResponsePage(new PersonEdit(new Person(), peopleList));
}
});
}
}

class PersonEdit extends WebPage {
private FeedbackPanel feedbackPanel;
private Person person;
private List peopleList;

public PersonEdit(Person person, List peopleList) {
feedbackPanel = new FeedbackPanel("feedbackPanel");
add(feedbackPanel);

add(new PersonForm("personForm", person, feedbackPanel));
}

class PersonForm extends Form {
public PersonForm(String s, Person person, IFeedback iFeedback) {
super(s, new CompoundPropertyModel(person), iFeedback);
add(new TextField("name"));
add(new Button("save"));
}

public void onSubmit() {
if (!peopleList.contains(person)) {
peopleList.add(person);
}
setResponsePage(new PersonList(peopleList));
}
}
}


class Person {
public Person() {
}

public Person(String name) {
this.name = name;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

private String name;
}




or another...
Very useful, thanks.

In similar vein, when you want to have a Form either editable or Read-only, and you don't want to create two different Markups, WebPages etc. One way of doing it, is to use exactly the same WebPage, Form and Markup, and add an AttributeModifyer to each form component (input... tag).  You'd then set a boolean field to true when you want the page to be displayed/edited.

So normally you'd have something like this:



 add(new TextField("total").add(IntegerValidator.INT));


(of course you don't always need an IntegerValidator)

Now create an AttributeModifyer that adds a readonly="readonly" attribute to the markup.  The boolean field isReadOnly dictates whether the attribute is actually added to the output.



 boolean isReadOnly = true; // set to true if you want the form to be readOnly; false to be editable

 AttributeModifier ro = 
  new AttributeModifier("readonly", isReadOnly, new Model("readonly"));  // For most Form components
 AttributeModifier disabled = 
  new AttributeModifier("disabled", isReadOnly, new Model("disabled"));  // For DropDowns etc.



And if you don't like the Gray-ish, washed-out look of read-only controls, define a style in your stylesheet and
add that as 

[CONF] Apache Wicket Companies that provide services

2012-05-15 Thread confluence







Companies that provide services
Page edited by Carl-Eric Menzel


 Changes (1)
 




...
* [Rivièra Online|http://riviera-online.fr/] is a French company based on the Côte dAzur that provides Wicket development. * [George Armhold|http://armhold.com/] is a Cleveland-area consultant specializing in Wicket, Java and SOLR. 
* [C1 SetCon|http://www.c1-setcon.de/] offers Wicket coaching and training in Germany, as well as general development and testing support. 


Full Content

List of companies that provide commercial services for Wicket.


Wicket Support Services


	Jonathan Locke originated Wicket and provides consulting services.
	JTeam is a leading Dutch solutions company and sister company of SpringSource, offering Wicket training courses in Holland and Belgium in partnership with jWeekend.
	Zenika is a leading French training company, offering Wicket courses in Paris in partnership with jWeekend.
	Wicket Support is a company that provides training, consultations and commercial support for Wicket.
	Wicket Training provides training classes, on-site training, and consulting for Wicket (US-Based).
	Jaywayis a premier Java consulting group that via its Malaysian subsidiary provides services for Wicket development, especially running Wicket in OSGi environments.
	Jayway DKis a premier Java consulting group located in Denmark provides services for Wicket development, course etc.
	Skillsmatteris a leading provider of training, mentoring and project based skills transfer. Amongst other things, they provide Wicket courses.
	Anyware Technologies is a french company  that provides many training courses, including Wicket.
	jWeekend provides consultancy, product development and  weekday/weekend, expert training globally, in Java technologies, Scala, OO  also in Wicket, since 2007.
	comSysto GmbH provides Wicket consulting and training in Germany in cooperation with jWeekend. Furthermore they provide consulting services in Spring and Oracle BI.
	Doculibre Inc. is a Canadian company that provides Wicket support and development.
	Xavier Hanin is a french independent consultant who provides services for Wicket development and training.
	Curalia is Java consulting company that provides services for Wicket development.
	The Macau Productivity and Technology Transfer Center is a non-profit organization that is including Wicket in its extensive training programs.
	Reaktor Innovations is a Finnish company that provides Wicket development and training.
	Ralf Ebert is a German independent consultant who provides services for Wicket development and German Wicket training courses.
	JointEffort is a small Dutch company that provides training, consultations and services for Wicket development.
	Leverage IT is a small South African IT Consulting and Development company that specializes in the use of Java Open Source Technologies, Platforms and Frameworks, including Wicket.
	XENTUM is a Polish company that provides Wicket development and support.
	automação.info is a Brazilian company that provides Wicket development.
	Genuco Systems is a company with offices in Hong Kong and Canada that provide leading edge Wicket development solutions as well as financial services.
	Devotek IT is the corporate identity of Thomas Mäder. I offer contracting, consulting and training for Wicket and Eclipse (where I used to be a committer).
	footprint e.K. / Jan Kriesten provides training and consulting with Wicket, Java and Scala. Jan Kriesten is located in Hamburg, Germany, but will be available on-site in other countries as well.
	Studio M2J of Juan Moreno  C.is a company located in Milan Italy offering Wicket development/J2ee integration, Trainig in Java and Wicket/Tapestry, Eclipse and hibernate, embedded solutions too.
	3FConsulting is a company located in Florence Italy offering Wicket development/J2ee integration and embedded solutions too.
	Mystic Coders, LLC is a company that has developed Wicket solutions for many large to small companies and is available for consulting, developing, training and speaking engagements.
	Metaprime is a Hungarian company developing Wicket web applications and offering consulting and development services, training sessions for small to medium sized teams.
	Richard Paul Wicket Consulting Services in the Greater Chicago Area.
	Solvation Java  Wicket consulting based in Copenhagen, Denmark.
	Bouvet ASA is a Scandinavian provider of consultancy and development services within information technology. Bouvet has about 480 employees in 10 offices in Norway and Sweden.
	Richard Nichols Offers Wicket consultation in Melbourne, Australia.
	Kodcu.com  is a Turk company that provides consultations, training, and services for Wicket development
	Rivièra Online is a French company based on the 

[CONF] Apache Wicket Wicket Ajax

2012-05-18 Thread confluence







Wicket Ajax
Page edited by Martin Grigorov


Comment:
Add FAQ section


 Changes (1)
 




...
 At [ajax.js|http://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=blob;f=wicket-core/src/test/js/ajax.js;hb=master] you may see the currently available _javascript_ unit tests that we have for the Ajax functionality in wicket-ajax.js 
 h3. FAQ  h4. How to check whether my custom version of the backing _javascript_ library (jQuery) doesnt break Wicket internals somehow ?  # Clone Wicket from its Git repositorygit clone http://git-wip-us.apache.org/repos/asf/wicket.git  # Open _wicket-core/src/test/js/all.html_ and change it to point to your version of the backing library.  # Run the non-Ajax tests by opening _file:///path/to/wicket/wicket-core/src/test/js/all.html_  # To run the Ajax tests see the description at the top of _wicket-core/src/test/js/ajax.js_. It is required to run them through Web Server 


Full Content



What ?
Why ?
Design and implementation
Table with renamed methods from the previous version
Configuration

Setup
Resource dependencies

AjaxRequestAttributes
Migration steps

o.a.w.ajax.IAjaxCallDecorator is replaced with o.a.w.ajax.attributes.IAjaxCallListener.
Global Ajax call listeners
Automatically migrated attributes.

Tests for the client side Wicket Ajax functionality
FAQ

How to check whether my custom version of the backing _javascript_ library (jQuery) doesn't break Wicket internals somehow ?



What ?

Since version 6.0 Wicket uses JQuery as a backing library for its Ajax functionality.

Why ?

The previous implementations of wicket-ajax.js and wicket-event.js were home baked solutions that worked well but also suffered from the differences in the browsers. Often users complained that some functionality doesn't work on particular version of particular browser. That's why the Wicket team chose to use JQuery to deal with browser inconsistencies and leave us to do our business logic.

Design and implementation

The new implementations (wicket-ajax-jquery.js and wicket-event-jquery.js) use JQuery internally but expose Wicket.** API similar to the previous version. 

All Java components and behaviors should still use the Wicket.** API. This way if someday we decide to not use JQuery anymore we will have less work to do. Also if a user uses Dojo/YUI/ExtJS/... and prefer to not have JQuery in her application then she will be able to provide wicket-ajax-xyz.js implementation and replace the default one.

Table with renamed methods from the previous version




 1.5 
 6.0 


 Wicket.fixEvent 
 Wicket.Event.fix 


 Wicket.stopEvent 
 Wicket.Event.stop 


 Wicket.show   
 Wicket.DOM.show 


 Wicket.showIncrementally   
 Wicket.DOM.showIncrementally 


 Wicket.hide  
 Wicket.DOM.hide 


 Wicket.hideIncrementally  
 Wicket.DOM.hideIncrementally 


 Wicket.decode  
 Wicket.Head.Contributor.decode 


 Wicket.ajaxGet, wicketAjaxGet  
 Wicket.Ajax.get 


 Wicket.ajaxPost, wicketAjaxPost  
 Wicket.Ajax.post 


 Wicket.submitForm  
 Wicket.Ajax.submitForm 


 Wicket.submitFormById  
 Wicket.Ajax.submitForm 


 Wicket.replaceOuterHtml 
 Wicket.DOM.replace 


 Wicket.Form.doSerialize 
 Wicket.Form.serializeForm 






Configuration

Setup
To replace any of the _javascript_ files the user application may use:

MyApplication#init():


public void init() {
  super.init();

  IJavaScriptLibrarySettings jsSettings = getJavaScriptLibrarySettings();

  jsSettings.setBackingLibraryReference(new DojoReference());

  jsSettings.setWicketEventReference(new DojoWicketEventReference());
  
  jsSettings.setWicketAjaxReference(new DojoWicketAjaxReference());

}



Resource dependencies

Since Wicket 6.0 ResourceReference can have dependencies and it is recommended to properly define the dependency chain between this classes.
See the code of org.apache.wicket.ajax.WicketAjaxJQueryResourceReference to see how the default JQuery based implementation does that.

If the user application needs to upgrade/downgrade to new/old version of JQuery then just the first line above is needed:


  getJavaScriptLibrarySettings().setBackingLibraryReference(new AnotherVersionOfJQueryReference());



AjaxRequestAttributes

Each Ajax behavior and component can use o.a.w.ajax.attributes.AjaxRequestAttributes to configure how exactly the Ajax call should be executed and how its response should be handled. To do this use:

AnyAjaxComponent/AnyAjaxBehavior.java:


  protected void updateAjaxAttributes(AjaxRequestAttributes attributes)
  {
  super.updateAjaxAttributes(AjaxRequestAttributes attributes);

  attributes.[set some attribute]();
  }



The available attributes are:



 Name 
 Description 
 

[CONF] Apache Wicket Wicket Ajax

2012-05-18 Thread confluence







Wicket Ajax
Page edited by Martin Grigorov


Comment:
Update docs for handlers' parameters


 Changes (8)
 




...
 Since Wicket Ajax now register DOM events (like click, change, ...) instead of using inline attributes like onclick, onchange, ... there is no more a script to decorate. Instead the new implementation provides points to listen to: 
- precondition - executed earlier. If it returns _false_ then the Ajax call (and all handlers below) is not executed at all 
- before handler - executed before the fire of the Ajax call 
- after handler - executed after the fire of the Ajax call but before it returns (if the Ajax call is asynchronous) 
- after handler - if the Ajax call is asynchronous then it is executed right after its firing. If it is synchronous then it is executed after the complete handler 
- success handler - executed on successful return of the Ajax call - failure handler - executed on unsuccessful return of the Ajax call 
...
  } {code} 
There are also handy methods like _onBefore(CharSequence)_, _onComplete(CharSequence)_, ... but they do not provide access to the component which is bound with the Ajax behavior. 
 An Ajax request can have 0 or more IAjaxCallListeners. 
...
- /ajax/call/complete  
Those replaces the old Wicket.Ajax.(registerPreCallHandler|registerPostCallHandler|registerFailureHandler) methods. 
Those replaces the old Wicket.Ajax.(registerPreCallHandler|registerPostCallHandler|registerFailureHandler) methods and uses publish/subscribe mechanism. 
 Example (_javascript_): {code} 
Wicket.Event.subscribe(/ajax/call/failure, function(jqEvent, errorThrown, attributes, jqXHR, errorThrown, textStatus) { 
  // do something when an Ajax call fails }); 
...
 # To run the Ajax tests see the description at the top of _wicket-core/src/test/js/ajax.js_. It is required to run them through Web Server 
 h4. What parameters are passed to the handlers ?  # before handler - attributes (the Ajax call attributes), jqXHR (the jQuery XMLHttpRequest object), settings (the jQuery ajax settings) # after handler  - attributes # success handler - attributes, jqXHR, data (the response), textStatus (the response status) # failure handler - attributes, errorMessage (the error message from jQuery) # complete handler - attrs, jqXHR, textStatus  The global listeners receive the same parameters prepended by _jqEvent_. This is the event triggered by jQuery. See section *Global Ajax call listeners* above. 


Full Content



What ?
Why ?
Design and implementation
Table with renamed methods from the previous version
Configuration

Setup
Resource dependencies

AjaxRequestAttributes
Migration steps

o.a.w.ajax.IAjaxCallDecorator is replaced with o.a.w.ajax.attributes.IAjaxCallListener.
Global Ajax call listeners
Automatically migrated attributes.

Tests for the client side Wicket Ajax functionality
FAQ

How to check whether my custom version of the backing _javascript_ library (jQuery) doesn't break Wicket internals somehow ?
What parameters are passed to the handlers ?



What ?

Since version 6.0 Wicket uses JQuery as a backing library for its Ajax functionality.

Why ?

The previous implementations of wicket-ajax.js and wicket-event.js were home baked solutions that worked well but also suffered from the differences in the browsers. Often users complained that some functionality doesn't work on particular version of particular browser. That's why the Wicket team chose to use JQuery to deal with browser inconsistencies and leave us to do our business logic.

Design and implementation

The new implementations (wicket-ajax-jquery.js and wicket-event-jquery.js) use JQuery internally but expose Wicket.** API similar to the previous version. 

All Java components and behaviors should still use the Wicket.** API. This way if someday we decide to not use JQuery anymore we will have less work to do. Also if a user uses Dojo/YUI/ExtJS/... and prefer to not have JQuery in her application then she will be able to provide wicket-ajax-xyz.js implementation and replace the default one.

Table with renamed methods from the previous version




 1.5 
 6.0 


 Wicket.fixEvent 
 Wicket.Event.fix 


 Wicket.stopEvent 
 Wicket.Event.stop 


 Wicket.show   
 Wicket.DOM.show 


 Wicket.showIncrementally   
 Wicket.DOM.showIncrementally 


 Wicket.hide  
 Wicket.DOM.hide 


 Wicket.hideIncrementally  
 Wicket.DOM.hideIncrementally 


 Wicket.decode  
 Wicket.Head.Contributor.decode 


 

[CONF] Apache Wicket Wicket without web.xml (embedded Jetty)

2012-05-28 Thread confluence







Wicket without web.xml (embedded Jetty)
Page  added by Pouyan Fotouhi Tehrani

 

 
Table of contents


Motivation
Configuring Jetty

Adding Wicket Filter to Jetty
Extra Servlet for static resources




Motivation
There are situation, when you don't want to export your application as a WAR file and have the conventional WAR structure. Or for any other reason you want to avoid using web.xml file. In the following we configure an embedded version of Jetty without using web.xml.

The following code should work with Wicket 1.5 and Jetty 8.

Configuring Jetty
Following is an example of web.xml:


?xml version="1.0" encoding="ISO-8859-1"?
web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	version="2.5"

	display-namemyproject/display-name

	!--
		There are three means to configure Wickets configuration mode and they 
		are tested in the order given.
		
		1) A system property: -Dwicket.configuration 
		2) servlet specific init-param 
		3) context specific context-param

		The value might be either "development" (reloading when templates change) or 
		"deployment". If no configuration is found, "development" is the default. --

	filter
		filter-namewicket.myproject/filter-name
		filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
		init-param
			param-nameapplicationClassName/param-name
			param-valuecom.mycompany.WicketApplication/param-value
		/init-param
	/filter

	filter-mapping
		filter-namewicket.myproject/filter-name
		url-pattern/*/url-pattern
	/filter-mapping
/web-app



What we need to do is simply configure embedded Jetty to exhibit the same behaviour in case of missing web.xml

Adding Wicket Filter to Jetty


server = new Server();
/* Setup server (port, etc.) */
ServletContextHandler sch = new ServletContextHandler(ServletContextHandler.SESSIONS);
ServletHolder sh = new ServletHolder(WicketServlet.class);
sh.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM, WinterfaceApplication.class.getName());
sh.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
/* Define a variable DEV_MODE and set to false
 * if wicket should be used in deployment mode
 */
if(!DEV_MODE) {
	sh.setInitParameter("wicket.configuration", "deployment");
}
sch.addServlet(sh, "/*");
server.setHandler(sch)


The Code above configures Jetty in a manner similar to given web.xml file. Note that we use a ServletHolder which encapsulates both context and class of a servlet. The ServletHolder is then added to ServletContextHandler which as finally added as the only handler to our Jetty Server.

Extra Servlet for static resources
WicketFilter automatically passes the requests, which it cannot (or does not want to) process down the chain. In that case you can simply define another Servlet and add it to ServletContextHandler. This can be used, for example, if you want to access static data accessible under /static/ folder of your application:



// Static resources
String staticPath = this.getClass().getClassLoader().getResource("static/").toExternalForm();
ServletHolder resourceServlet = new ServletHolder(DefaultServlet.class);
resourceServlet.setInitParameter("dirAllowed", "true");
resourceServlet.setInitParameter("resourceBase", staticPath);
resourceServlet.setInitParameter("pathInfoOnly", "true");


Using the following code if you haven't already configured Wicket to handle a request such as localhost:8080/static/js/jquery.js, it will be passed down the handler chain to resourceServlet and it will retrieve the desired file from staticPath. For more init parameters see DefaultServlet


   
Change Notification Preferences
   
   View Online
  |
   Add Comment
   








[CONF] Apache Wicket Calling Wicket from Javascript

2012-05-28 Thread confluence







Calling Wicket from _javascript_
Page edited by Travis Carlson


Comment:
Updated API for Wicket 1.5


 Changes (4)
 




...
Ok, this is actually quite ugly, but you get the optional arguments in the response method like this: {code:title=Java} 
Map map = ((WebRequestCycle) RequestCycle.get()).getRequest().getParameterMap(); 
IRequestParameters params = RequestCycle.get().getRequest().getRequestParameters(); 
{code} 
Alternatively, you can Or to retrieve a single parameter by its key: 
{code:title=Java} 
String paramFoo = RequestCycle.get().getRequest().getParameter(foo); RequestCycle.get().getRequest().getRequestParameters().getParameterValue(foo); 
{code}  


Full Content

This mini tutorial shows you how to call Wicket from _javascript_. It is based on an e-mail from Michael Sparer.

Setting up the Wicket response to the _javascript_ call

Add the AbstractDefaultAjaxBehavior to the component you'd like to call from _javascript_. You then have to override the respond method of AbstractDefaultAjaxBehavior to perform your actions and to append your changes to the response

For example in your panel:


final AbstractDefaultAjaxBehavior behave = new AbstractDefaultAjaxBehavior() {
protected void respond(final AjaxRequestTarget target) {
target.add(new Label("foo", "Yeah I was just called from _javascript_!"));
}
};
add(behave);



Invoking _javascript_ from your Java Wicket component

Any component can add _javascript_ to the page header by implementing IHeaderContributor, that's where the
response-object gets passed.
TODO: add an example of Java code.

Alternatively, you can add a Wicket label containing _javascript_ to your page:
HTML

script type="text/_javascript_" wicket:id="myScript"/* script will be rendered here *//script



Java

Label myScript = new Label("myScript", "callWicket();");
myScript.setEscapeModelStrings(false); // do not HTML escape _javascript_ code
add(myScript);



Calling your Java Wicket component from _javascript_
If you add any class that extends AbstractDefaultAjaxBehavior to your page, wicket-ajax.js will be added to the header ofyour web page. wicket-ajax.js provides you with two basic methods to call your component:
function wicketAjaxGet(url, successHandler, failureHandler, precondition, channel) 
and
function wicketAjaxPost(url, body, successHandler, failureHandler, precondition, channel)

Don't POST without POST contentNote that some web servers gulp on HTTP POST requests with no POST content (in other words: "wicketAjaxPost($URL);" is evil).
This is due to some browsers (Firefox, ...) not sending the mandatory header "content-length" when the POST body is empty.
Jetty is generous in this case, while Tomcat might respond with an HTTP 411 error code.
So if you have to use HTTP POST requests, then make sure that at least a dummy _javascript_ object is added as POST data. 

Here is an example:
_javascript_

function callWicket() {
   var wcall = wicketAjaxGet('$url$' + '$args$', function() { }, function() { });
}

 

'$url$' is obtained from the method behave.getCallbackUrl(). If you paste the String returned from that method into your browser, you'll invoke the respond method, the same applies for the _javascript_ method.

You can optionally add arguments by appending these to the URL string. They take the form foo=bar.

Obtaining the GET/POST arguments on the server side

Ok, this is actually quite ugly, but you get the optional arguments in the response method like this:
Java

IRequestParameters params = RequestCycle.get().getRequest().getRequestParameters();


Or to retrieve a single parameter by its key:
Java

String paramFoo = RequestCycle.get().getRequest().getRequestParameters().getParameterValue("foo");






Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


Comment:
Updated doctype to match html5


 Changes (2)
 




...
 {code:html} 
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd 
!DOCTYPE html 
 html   xmlns=http://www.w3.org/1999/xhtml 
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
 Wicket Filter Mapping

 Wicket 1.4.x  1.5.x
 Ignoring paths

Wicket Servlet Mapping

Wicket 1.1.x  1.2.x
Wicket 1.3.x
More info

Anonymous Inner classes
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Wicket Filter Mapping


Wicket 1.4.x  1.5.x

On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, it's possible to map/instead of/app/. But remember to configuretheignorePathsparameter to ignore static resources and leave them to be handled by the container.

Ignoring paths

If you want to leave static resources to be handled by the container, configure theignorePathsinit parameter as follows:



filter
	filter-namewicket.app/filter-name
	filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
	init-param
		param-nameapplicationClassName/param-name
		param-valuecom.myproject.MyApplication/param-value
	/init-param
	init-param
		param-namefilterMappingUrlPattern/param-name
		param-value/*/param-value
	/init-param
	init-param
		param-nameignorePaths/param-name
		param-value/css,/js,/images,/icons/param-value
	/init-param
/filter



Wicket Servlet Mapping

Wicket 1.1.x  1.2.x

It is best to map the servlet as /app/ instead of /. The /app/ mapping allows static resources to be handled by the webserver as opposed to the wicket servlet.

You may experience difficulties with form POSTs if you map to /. For example, if a GET request on a Wicket form produces a URL like http://www.examplehost.com/examplecontext/?wicket:interface=wicket-0:2:3, you will find that Wicket writes an action="" attribute to the form\ element. Because of the missing / before the ?, the container may not recognise the resulting POST as a request for the Wicket servlet. This behaviour has been observed with:

	Jetty 6
	mod_jk when mounted to accept requests for a subdirectory beneath the root web directory (i.e. "JkMount / exampleworker" works but not "JkMount /examplesubdirectory/ exampleworker")



Wicket 1.3.x

To avoid this issue with Wicket 1.3, the recommandation has been changed to use a ServletFilter rather than a servlet - See the Migrate-1.3 page for details of the changes required.

More info

(Thanks, Igor)
Usually static resources are handled by the application server. The server knows it is serving a file and thus sets the last modified date of the resource to the last modified date of a file.

So, for example, let's say you have /myapp/images/foo.gif and you map your wicket servlet to /

What happens is that when a request comes in for /myapp/images/foo.gif it will match the wicket servlet - so now it is wicket servlet's job to serve this file to the browser. now we are nice enough to provide support for this - but obviously we cannot do as good a job as the application server which has a lot more context.

So for 1.1  1.2,  we recommend mapping the servlet to something like /app/ so that foo.gif will be processed by the application server and only wicket-specific requests are processed by the servlet.

For 1.3 and onward, what we do is instead of using a servlet,  use a filter.

The advantage of a filter is that, unlike a servlet, it can choose not to process the request and let whatever is next in chain try. So when using a wicket filter and a request comes in for foo.gif the filter can choose not to process it 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


Comment:
Added some antipatterns


 Changes (4)
 




...
The advantage of a filter is that, unlike a servlet, it can choose not to process the request and let whatever is next in chain try. So when using a wicket filter and a request comes in for {{foo.gif}} the filter can choose not to process it because it knows it is not a wicket-related request. Since the filter didnt process it, it falls on to the application server to try, and then it works.  
h2. Antipatterns 
 
h2. Anonymous Inner classes 
Anti-Pattern #1. 
 
{code} public FooPanel(String id,IModelUser userMdl) { super(id,userMdl); final User user = getModelObject(); IModelListUser model = new LoadableDetachableModelListUser() { private static final long serialVersionUID = 1L;  @Override protected ListUser load() { // A Stale User entity is now serialized with each page view // This can consume lots of session space if the user entity is large. return getWebSession().getUserService().getUserFriends(user); } }; }  Here is the correct way to do this //IModel needs to be a LoadableDetachableModel! public FooPanel(String id,IModelUser userMdl) { super(id,userMdl); final User user = getModelObject(); IModelListUser model = new LoadableDetachableModelListUser() { private static final long serialVersionUID = 1L; @Override protected ListUser load() { User u = FooPanel.this.getModelObject(); return getWebSession().getUserService().getUserFriends(u); } }; }  The entity is fetched each page view, and NOT serialized with the page. The only thing that gets serialized is the fetching model. {code}  Anti-Pattern #2. {code} public FooPanel(String id,IModelUser userMdl) { super(id.userMdl); User user = getModelObject(); // Doh! user is not serialized with each page view, the PropertyModel holds a reference! add(new Label(name,new PropertyModel(user,screenName))); }  Here is the correct way to do this public FooPanel(String id,IModelUser userMdl) { super(id.userMdl); add(new Label(name,new PropertyModel(userMdl,screenName))); }  The PropertyModel holds a reference to the Model which fetches the User on each page view. That way the User object is always fresh and is not serialized with the page. {code]  Anti-Pattern #3.  {code} public FooPanel(String id,User user) { // The stale User object will be in your session // for the life span of the stateful page. super(id.new Model(user)); }  Here is the correct way to do this, though not very elegant. public FooPanel(String id,User user) { super(id); final int id = user.getId(); setModel(new LoadableDetachableModelListUser() { @Override protected ListUser load() { return getUserDao().findById(id); } {code} (antipattern 1-3 from blog letsgetdugg, thanks)   Anti-pattern#4 - Anonymous Inner classes  
Dont do this: {code} 
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
 Wicket Filter Mapping

 Wicket 1.4.x  1.5.x
 Ignoring paths

Wicket Servlet Mapping

Wicket 1.1.x  1.2.x
Wicket 1.3.x
More info

Antipatterns



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Wicket Filter Mapping


Wicket 1.4.x  1.5.x

On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, it's possible to map/instead of/app/. But remember to configuretheignorePathsparameter to ignore static resources and leave them to be handled by the container.

Ignoring paths

If you want to leave static resources to be handled by the container, configure theignorePathsinit parameter as follows:



filter
	filter-namewicket.app/filter-name
	filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
	init-param
		param-nameapplicationClassName/param-name
		

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (3)
 




...
} {code} 
(antipattern 1-3 from blog letsgetdugg, thanks) 
antipattern 1-3 from blog letsgetdugg, thanks 
  
Anti-pattern #4. - Anonymous Inner classes 
 Dont do this: 
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
 Wicket Filter Mapping

 Wicket 1.4.x  1.5.x
 Ignoring paths

Wicket Servlet Mapping

Wicket 1.1.x  1.2.x
Wicket 1.3.x
More info

Antipatterns



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Wicket Filter Mapping


Wicket 1.4.x  1.5.x

On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, it's possible to map/instead of/app/. But remember to configuretheignorePathsparameter to ignore static resources and leave them to be handled by the container.

Ignoring paths

If you want to leave static resources to be handled by the container, configure theignorePathsinit parameter as follows:



filter
	filter-namewicket.app/filter-name
	filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
	init-param
		param-nameapplicationClassName/param-name
		param-valuecom.myproject.MyApplication/param-value
	/init-param
	init-param
		param-namefilterMappingUrlPattern/param-name
		param-value/*/param-value
	/init-param
	init-param
		param-nameignorePaths/param-name
		param-value/css,/js,/images,/icons/param-value
	/init-param
/filter



Wicket Servlet Mapping

Wicket 1.1.x  1.2.x

It is best to map the servlet as /app/ instead of /. The /app/ mapping allows static resources to be handled by the webserver as opposed to the wicket servlet.

You may experience difficulties with form POSTs if you map to /. For example, if a GET request on a Wicket form produces a URL like http://www.examplehost.com/examplecontext/?wicket:interface=wicket-0:2:3, you will find that Wicket writes an action="" attribute to the form\ element. Because of the missing / before the ?, the container may not recognise the resulting POST as a request for the Wicket servlet. This behaviour has been observed with:

	Jetty 6
	mod_jk when mounted to accept requests for a subdirectory beneath the root web directory (i.e. "JkMount / exampleworker" works but not "JkMount /examplesubdirectory/ exampleworker")



Wicket 1.3.x

To avoid this issue with Wicket 1.3, the recommandation has been changed to use a ServletFilter rather than a servlet - See the Migrate-1.3 page for details of the changes required.

More info

(Thanks, Igor)
Usually static resources are handled by the application server. The server knows it is serving a file and thus sets the last modified date of the resource to the last modified date of a file.

So, for example, let's say you have /myapp/images/foo.gif and you map your wicket servlet to /

What happens is that when a request comes in for /myapp/images/foo.gif it will match the wicket servlet - so now it is wicket servlet's job to serve this file to the browser. now we are nice enough to provide support for this - but obviously we cannot do as good a job as the application server which has a lot more context.

So for 1.1  1.2,  we recommend mapping the servlet to something like /app/ so that foo.gif will be processed by the application server and only wicket-specific requests are processed by the servlet.

For 1.3 and onward, what we do is instead of using a servlet,  use a filter.

The advantage of a filter is that, unlike a servlet, it can choose not to process the request and let whatever is next in chain try. So when using a wicket filter and a request comes in for foo.gif the filter can choose not to process it because it knows it is not a wicket-related request. Since the filter didnt process it, it falls on to the application server to try, and then it works.

Antipatterns

Anti-Pattern #1.



public FooPanel(String id,IModelUser userMdl) {
super(id,userMdl);
final User user = getModelObject();
IModelListUser model = new LoadableDetachableModelListUser() {
private static final long serialVersionUID = 1L;

@Override
protected ListUser load() {
// A Stale User entity is now serialized with each page view
   

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (1)
 




...
 The PropertyModel holds a reference to the Model which fetches the User on each page view. That way the User object is always fresh and is not serialized with the page. 
{code]} 
 Anti-Pattern #3. 
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
 Wicket Filter Mapping

 Wicket 1.4.x  1.5.x
 Ignoring paths

Wicket Servlet Mapping

Wicket 1.1.x  1.2.x
Wicket 1.3.x
More info

Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Wicket Filter Mapping


Wicket 1.4.x  1.5.x

On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, it's possible to map/instead of/app/. But remember to configuretheignorePathsparameter to ignore static resources and leave them to be handled by the container.

Ignoring paths

If you want to leave static resources to be handled by the container, configure theignorePathsinit parameter as follows:



filter
	filter-namewicket.app/filter-name
	filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
	init-param
		param-nameapplicationClassName/param-name
		param-valuecom.myproject.MyApplication/param-value
	/init-param
	init-param
		param-namefilterMappingUrlPattern/param-name
		param-value/*/param-value
	/init-param
	init-param
		param-nameignorePaths/param-name
		param-value/css,/js,/images,/icons/param-value
	/init-param
/filter



Wicket Servlet Mapping

Wicket 1.1.x  1.2.x

It is best to map the servlet as /app/ instead of /. The /app/ mapping allows static resources to be handled by the webserver as opposed to the wicket servlet.

You may experience difficulties with form POSTs if you map to /. For example, if a GET request on a Wicket form produces a URL like http://www.examplehost.com/examplecontext/?wicket:interface=wicket-0:2:3, you will find that Wicket writes an action="" attribute to the form\ element. Because of the missing / before the ?, the container may not recognise the resulting POST as a request for the Wicket servlet. This behaviour has been observed with:

	Jetty 6
	mod_jk when mounted to accept requests for a subdirectory beneath the root web directory (i.e. "JkMount / exampleworker" works but not "JkMount /examplesubdirectory/ exampleworker")



Wicket 1.3.x

To avoid this issue with Wicket 1.3, the recommandation has been changed to use a ServletFilter rather than a servlet - See the Migrate-1.3 page for details of the changes required.

More info

(Thanks, Igor)
Usually static resources are handled by the application server. The server knows it is serving a file and thus sets the last modified date of the resource to the last modified date of a file.

So, for example, let's say you have /myapp/images/foo.gif and you map your wicket servlet to /

What happens is that when a request comes in for /myapp/images/foo.gif it will match the wicket servlet - so now it is wicket servlet's job to serve this file to the browser. now we are nice enough to provide support for this - but obviously we cannot do as good a job as the application server which has a lot more context.

So for 1.1  1.2,  we recommend mapping the servlet to something like /app/ so that foo.gif will be processed by the application server and only wicket-specific requests are processed by the servlet.

For 1.3 and onward, what we do is instead of using a servlet,  use a filter.

The advantage of a filter is that, unlike a servlet, it can choose not to process the request and let whatever is next in chain try. So when using a wicket filter and a request comes in for foo.gif the filter can choose not to process it because it knows it is not a wicket-related request. Since the filter didnt process it, it 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


Comment:
removed obsolete info for 1.1, 1.2, look for it in mailing lists, cleaned up info


 Changes (5)
 




...
  
h3. {color:#00}{*}Wicket 1.4.x  1.5.x{*}{color} 
h3. {color:#00}{*}Wicket 1.4.x and upwards {*}{color} 
 On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, its possible to mapnbsp;{{/\*}}nbsp;instead ofnbsp;{{/app/\*}}. But remember to configurenbsp;thenbsp;{{ignorePaths}}nbsp;parameter to ignore static resources and leave them to be handled by the container. 
...
{code}  
h2. Wicket Servlet Mapping 
Otherwise, theres a risk the wicketservlet will handle the job to serve static resources, instead of the container.  For example,lets say you have {{/myapp/images/foo.gif}} and you map your wicket servlet to {{/\*}} and dpnt have set ignorePaths. 
 
h3. Wicket 1.1.x  1.2.x  It is best to map the servlet as {{/app/\*}} instead of {{/\*}}. The {{/app/\*}} mapping allows static resources to be handled by the webserver as opposed to the wicket servlet.  You may experience difficulties with form POSTs if you map to {{/\*}}. For example, if a GET request on a Wicket form produces a URL like {{[http://www.examplehost.com/examplecontext/?wicket:interface=wicket-0:2:3]}}, you will find that Wicket writes an {{action="" attribute to the {{\|form\}} element. Because of the missing {{/}} before the {{?}}, the container may not recognise the resulting POST as a request for the Wicket servlet. This behaviour has been observed with: * Jetty 6 * mod_jk when mounted to accept requests for a subdirectory beneath the root web directory (i.e. {{JkMount /\* exampleworker}} works but not {{JkMount /examplesubdirectory/\* exampleworker}})  h3. Wicket 1.3.x  To avoid this issue with Wicket 1.3, the recommandation has been changed to use a ServletFilter rather than a servlet - See the [Migrate-1.3|Migrate-1.3] page for details of the changes required.  h3. More info  _(Thanks, Igor)_ Usually static resources are handled by the application server. The server knows it is serving a file and thus sets the last modified date of the resource to the last modified date of a file.  So, for example, lets say you have {{/myapp/images/foo.gif}} and you map your wicket servlet to {{/\*}}  What happens is that when a request comes in for {{/myapp/images/foo.gif}} it will match the wicket servlet - so now it is wicket servlets job to serve this file to the browser. now we are nice enough to provide support for this - but obviously we cannot do as good a job as the application server which has a lot more context.  So for 1.1  1.2,  we recommend mapping the servlet to something like {{/app/\*}} so that {{foo.gif}} will be processed by the application server and only wicket-specific requests are processed by the servlet.  For 1.3 and onward, what we do is instead of using a servlet,  use a filter.  The advantage of a filter is that, unlike a servlet, it can choose not to process the request and let whatever is next in chain try. So when using a wicket filter and a request comes in for {{foo.gif}} the filter can choose not to process it because it knows it is not a wicket-related request. Since the filter didnt process it, it falls on to the application server to try, and then it works.  
h2. Antipatterns  
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
 Wicket Filter Mapping

 Wicket 1.4.x and upwards {}
 Ignoring paths

Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Wicket Filter Mapping


Wicket 1.4.x and upwards {}

On these versions, you should 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


Comment:
Added do's and dont's from orange 11


 Changes (2)
 




...
{code}  
h2. Dos and dont (thanks orange11-blog)  h3. Do use models  Dont do this {code}  public IncomePanel(String id, Person person) {   super(id);   add(new Label(salary, person.getSalary()); // no model! } {code}  But this - {code}  public IncomePanel(String id, IModelPerson personModel) {   super(id,personModel);   add(new Label(salary, new PropertyModel(personModel, salary)); } {code}  Or even this: {code} 	 public IncomePanel(String id, IModelPerson personModel) {   super(id, new CompoundPropertyModel(personModel);   add(new Label(salary); } {code}   Why - because A) we dont want to risk serialize an object, models are lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value. With a model, the label will update the value from the entity its using.  h3. Dont use an Ajax library without intimate knowledge of the library May collide with wicket code, make sure your JS-library well h3. Do make sure you understand the repeaters for high performance sites  Wicket by default provides the following repeater:  Loop, ListView, RepeatingView, RefreshingView, DataTable. This list is not even exhaustive; there are some more variations. Every repeater constructs a transient component for each iteration: the loop item. Every loop item has a Wicket model to look up the items data.  Here are some points to consider to choose the most optimal repeater:  * Moment of data retrieval. Is it during construction only, or for each render again?  * During a re-render, is all data retrieved at once or one by one? * Moment the loop-items model is created. First time only, or again for each render, or does it retain existing models and only add/remove models as the underlying data changes (ItemReusePolicy)?  * Can you control the model creation? * Is pagination/sorting needed?  h3. Dont overuse inheritance - use composition h3. Do keep markup in sync with the component code h3. Dont try to do authorization from a servlet filter h3. Do take your time to override key Wicket features   
h2. {color:#00}{*}Wicket Filter Mapping{*}{color}  
...
On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, its possible to mapnbsp;{{/\*}}nbsp;instead ofnbsp;{{/app/\*}}. But remember to configurenbsp;thenbsp;{{ignorePaths}}nbsp;parameter to ignore static resources and leave them to be handled by the container.  
h34. {color:#00}{*}Ignoring paths{*}{color} 
 If you want to leave static resources to be handled by the container, configure thenbsp;{{ignorePaths}}nbsp;init parameter as follows: 
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
Do's and dont (thanks orange11-blog)

Do use models
Don't use an Ajax library without intimate knowledge of the library
Do make sure you understand the repeaters for high performance sites
Don't overuse inheritance - use composition
Do keep markup in sync with the component code
Don't try to do authorization from a servlet filter
Do take your time to override key Wicket features

 Wicket Filter Mapping

 Wicket 1.4.x and upwards {}

 Ignoring paths


Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Do's and dont (thanks orange11-blog)

Do use models

Don't do this

 
public IncomePanel(String id, Person person) {
  super(id);
  add(new Label("salary", person.getSalary()); // no model!
}



But this -

 
public IncomePanel(String id, IModelPerson personModel) {
  

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (7)
 




...
{code}  
h2. Dos and dont (thanks orange11-blog) 
(thanks orange11-blog) 
 h3. Do use models 
...
 h3. Dont overuse inheritance - use composition 
 Signs youre in trouble are:  * common layout turned out to be slightly different on every page, * components are created by abstract methods (constructors should not call these), * there are getters to your components (breaks data hiding), * the constructor of the sub-class replaces a component that was created by the super-class (wasteful and unmaintainable) or * you add components while the wicket:id is not in the markup file of the current class (maintenance nightmare).  The remedy is to split of parts of the screen to separate components (e.g. Panels) and manage the complexity there. 
h3. Do keep markup in sync with the component code h3. Dont try to do authorization from a servlet filter 
...
  
h2. {color:#00}{*}Wicket Filter Mapping{*}{color} 
h2. Wicket Filter Mapping 
  
h3. {color:#00}{*}Wicket 1.4.x and upwards {*}{color} 
h3. Wicket 1.4.x and upwards 
 On these versions, you should prefer to use WicketFilter instead of WicketServlet. If you want, its possible to mapnbsp;{{/\*}}nbsp;instead ofnbsp;{{/app/\*}}. But remember to configurenbsp;thenbsp;{{ignorePaths}}nbsp;parameter to ignore static resources and leave them to be handled by the container. 
...


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
Do's and dont

Do use models
Don't use an Ajax library without intimate knowledge of the library
Do make sure you understand the repeaters for high performance sites
Don't overuse inheritance - use composition
Do keep markup in sync with the component code
Don't try to do authorization from a servlet filter
Do take your time to override key Wicket features

Wicket Filter Mapping

Wicket 1.4.x and upwards

 Ignoring paths


Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Do's and dont
(thanks orange11-blog)

Do use models

Don't do this

 
public IncomePanel(String id, Person person) {
  super(id);
  add(new Label("salary", person.getSalary()); // no model!
}



But this -

 
public IncomePanel(String id, IModelPerson personModel) {
  super(id,personModel);
  add(new Label("salary", new PropertyModel(personModel, "salary"));
}

 
Or even this:

 	
public IncomePanel(String id, IModelPerson personModel) {
  super(id, new CompoundPropertyModel(personModel);
  add(new Label("salary");
}

 

Why - because A) we don't want to risk serialize an object, models are lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value. With a model, the label will update the value from the entity it's using.

Don't use an Ajax library without intimate knowledge of the library
May collide with wicket code, make sure your JS-library well
Do make sure you understand the repeaters for high performance sites

Wicket by default provides the following repeater:  Loop, ListView, RepeatingView, RefreshingView, DataTable. This list is not even exhaustive; there are some more variations. Every repeater constructs a transient component for each iteration: the loop item. Every loop item has a Wicket model to look up the item's data.

Here are some points to consider to choose the most optimal repeater:


	Moment of data retrieval. Is it during construction only, or for each render again?
	During a re-render, is all data retrieved at once or one by one?
	Moment the 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (2)
 




...
textarea wicket:id=mytextContent to be replaced by Wicket/textarea {code} 
\-\-[Jay|User__seeker136] 
 * Links with stuff not yet integrated: [http://www.devproof.org/wicket_best_practice - Devproof best practices] 


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
Do's and dont

Do use models
Don't use an Ajax library without intimate knowledge of the library
Do make sure you understand the repeaters for high performance sites
Don't overuse inheritance - use composition
Don't try to do authorization from a servlet filter
Do take your time to override key Wicket features

Wicket Filter Mapping

Wicket 1.4.x and upwards
Ignoring paths

Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Do's and dont
(thanks orange11-blog)

Do use models

Don't do this

 
public IncomePanel(String id, Person person) {
  super(id);
  add(new Label("salary", person.getSalary()); // no model!
}



But this -

 
public IncomePanel(String id, IModelPerson personModel) {
  super(id,personModel);
  add(new Label("salary", new PropertyModel(personModel, "salary"));
}

 
Or even this:

 	
public IncomePanel(String id, IModelPerson personModel) {
  super(id, new CompoundPropertyModel(personModel);
  add(new Label("salary");
}

 

Why - because A) we don't want to risk serialize an object, models are lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value. With a model, the label will update the value from the entity it's using.

Don't use an Ajax library without intimate knowledge of the library
May collide with wicket code, make sure your JS-library well
Do make sure you understand the repeaters for high performance sites

Wicket by default provides the following repeater:  Loop, ListView, RepeatingView, RefreshingView, DataTable. This list is not even exhaustive; there are some more variations. Every repeater constructs a transient component for each iteration: the loop item. Every loop item has a Wicket model to look up the item's data.

Here are some points to consider to choose the most optimal repeater:


	Moment of data retrieval. Is it during construction only, or for each render again?
	During a re-render, is all data retrieved at once or one by one?
	Moment the loop-item's model is created. First time only, or again for each render, or does it retain existing models and only add/remove models as the underlying data changes (ItemReusePolicy)?
	Can you control the model creation?
	Is pagination/sorting needed?



Don't overuse inheritance - use composition

Signs you're in trouble are:


	common layout turned out to be slightly different on every page,
	components are created by abstract methods (constructors should not call these),
	there are getters to your components (breaks data hiding),
	the constructor of the sub-class replaces a component that was created by the super-class (wasteful and unmaintainable) or
	you add components while the wicket:id is not in the markup file of the current class (maintenance nightmare).



The remedy is to split of parts of the screen to separate components (e.g. Panels) and manage the complexity there.

Don't try to do authorization from a servlet filter

It just won't work. Wicket is full of generated URLs (yes, even if you mount every page) so authorization based on the URL is a fruitless exercise. You are better off by writing an IAuthorizationStrategy and configuring this in your Wicket application. Study the code of wicket-auth-roles to see how this can work. In addition you'll get component based authorization, not just page based! (By the 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (4)
 




...
{code}   
Why - because A) we dont want to risk serialize an object, models are fine though - lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value to our label. With a model, the label will update the value from the entity its using. 
 h3. Dont use an Ajax library without intimate knowledge of the library 
May collide with wicket code, make sure you know your JS-library well 
h3. Do make sure you understand the repeaters for high performance sites  
...
  
h2. onInitialize for adding components. If you need to , and for components that are not a Page, you can override the new onInitialize callback to add components, which is only called once after construction, when the component has been added to the page (so that component.getPage() doesnt return null).  Another option is to use addOrReplace() instead of add.
h2. Wicket Filter Mapping  
...
* Links with stuff not yet integrated: [http://www.devproof.org/wicket_best_practice - Devproof best practices] 
[http://blog.worldturner.com/worldturner/entry/wicket_best_practices_components_vs blog worldtuner] 


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
Do's and dont

Do use models
Don't use an Ajax library without intimate knowledge of the library
Do make sure you understand the repeaters for high performance sites
Don't overuse inheritance - use composition
Don't try to do authorization from a servlet filter
Do take your time to override key Wicket features

onInitialize for adding components.
Wicket Filter Mapping

Wicket 1.4.x and upwards
Ignoring paths

Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Do's and dont
(thanks orange11-blog)

Do use models

Don't do this

 
public IncomePanel(String id, Person person) {
  super(id);
  add(new Label("salary", person.getSalary()); // no model!
}



But this -

 
public IncomePanel(String id, IModelPerson personModel) {
  super(id,personModel);
  add(new Label("salary", new PropertyModel(personModel, "salary"));
}

 
Or even this:

 	
public IncomePanel(String id, IModelPerson personModel) {
  super(id, new CompoundPropertyModel(personModel);
  add(new Label("salary");
}

 

Why - because A) we don't want to risk serialize an object, models are fine though - lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value to our label. With a model, the label will update the value from the entity it's using.

Don't use an Ajax library without intimate knowledge of the library
May collide with wicket code, make sure you know your JS-library well
Do make sure you understand the repeaters for high performance sites

Wicket by default provides the following repeater:  Loop, ListView, RepeatingView, RefreshingView, DataTable. This list is not even exhaustive; there are some more variations. Every repeater constructs a transient component for each iteration: the loop item. Every loop item has a Wicket model to look up the item's data.

Here are some points to consider to choose the most optimal repeater:


	Moment of data retrieval. Is it during construction only, or for each render again?
	During a re-render, is all data retrieved at once or one by one?
	Moment the loop-item's model is created. First time only, or again for each render, or does it retain existing models and only add/remove models as the underlying data changes (ItemReusePolicy)?
	Can you 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (2)
 




...
{code}  
* h2. Links with stuff not yet integrated: 
[http://www.devproof.org/wicket_best_practice - Devproof best practices] [http://blog.worldturner.com/worldturner/entry/wicket_best_practices_components_vs blog worldtuner] 
[http://www.small-improvements.com/10-things-about-apache-wicket-i-love/wicket:pageMapName/wicket-0 - 10 things to know..] 


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
Do's and dont

Do use models
Don't use an Ajax library without intimate knowledge of the library
Do make sure you understand the repeaters for high performance sites
Don't overuse inheritance - use composition
Don't try to do authorization from a servlet filter
Do take your time to override key Wicket features

onInitialize for adding components.
Wicket Filter Mapping

Wicket 1.4.x and upwards
Ignoring paths

Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)
Links with stuff not yet integrated:



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Do's and dont
(thanks orange11-blog)

Do use models

Don't do this

 
public IncomePanel(String id, Person person) {
  super(id);
  add(new Label("salary", person.getSalary()); // no model!
}



But this -

 
public IncomePanel(String id, IModelPerson personModel) {
  super(id,personModel);
  add(new Label("salary", new PropertyModel(personModel, "salary"));
}

 
Or even this:

 	
public IncomePanel(String id, IModelPerson personModel) {
  super(id, new CompoundPropertyModel(personModel);
  add(new Label("salary");
}

 

Why - because A) we don't want to risk serialize an object, models are fine though - lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value to our label. With a model, the label will update the value from the entity it's using.

Don't use an Ajax library without intimate knowledge of the library
May collide with wicket code, make sure you know your JS-library well
Do make sure you understand the repeaters for high performance sites

Wicket by default provides the following repeater:  Loop, ListView, RepeatingView, RefreshingView, DataTable. This list is not even exhaustive; there are some more variations. Every repeater constructs a transient component for each iteration: the loop item. Every loop item has a Wicket model to look up the item's data.

Here are some points to consider to choose the most optimal repeater:


	Moment of data retrieval. Is it during construction only, or for each render again?
	During a re-render, is all data retrieved at once or one by one?
	Moment the loop-item's model is created. First time only, or again for each render, or does it retain existing models and only add/remove models as the underlying data changes (ItemReusePolicy)?
	Can you control the model creation?
	Is pagination/sorting needed?



Don't overuse inheritance - use composition

Signs you're in trouble are:


	common layout turned out to be slightly different on every page,
	components are created by abstract methods (constructors should not call these),
	there are getters to your components (breaks data hiding),
	the constructor of the sub-class replaces a component that was created by the super-class (wasteful and unmaintainable) or
	you add components while the wicket:id is not in the markup file of the current class (maintenance nightmare).



The remedy is to split of parts of the screen to separate components (e.g. Panels) and manage the complexity there.

Don't try to do authorization from a servlet filter

It just won't work. Wicket is full of generated URLs (yes, even if you mount every page) so authorization based on the URL is a 

[CONF] Apache Wicket Best Practices and Gotchas

2012-06-02 Thread confluence







Best Practices and Gotchas
Page edited by Josef


 Changes (1)
 




...
[http://blog.worldturner.com/worldturner/entry/wicket_best_practices_components_vs blog worldtuner] [http://www.small-improvements.com/10-things-about-apache-wicket-i-love/wicket:pageMapName/wicket-0 - 10 things to know..] 
[http://stronglytypedblog.blogspot.se/2009/04/wicket-patterns-and-pitfalls-5.html Wicket pitfalls 5 articles] [http://wicketinaction.com/ in action - lots of good stuff if searching here]  


Full Content

This page will contain the accumulated thoughts on what the wicket best practices are. It will also list situations that cause erroneus behaviours and are hard to track down.
Table of contents


Best Practices

Html Template Declaration
Do's and dont

Do use models
Don't use an Ajax library without intimate knowledge of the library
Do make sure you understand the repeaters for high performance sites
Don't overuse inheritance - use composition
Don't try to do authorization from a servlet filter
Do take your time to override key Wicket features

onInitialize for adding components.
Wicket Filter Mapping

Wicket 1.4.x and upwards
Ignoring paths

Antipatterns
Debugging NotSerializableException

Gotchas

Empty URL Parameter in CSS Style ( background-image: url(""); )
BODY:onLoad in Panel not added without wicket:head
Adding wicket:head to a Page
Starting download after form submission (Wicket 1.1)
Starting download after form submission (Wicket 1.2)
Starting download after form submission (Wicket 2.0)
PackageResources and relative paths
PBEWithMD5AndDES not found
Adding id attribute to a tag
Avoid using empty elements (i.e. textarea /)
Links with stuff not yet integrated:



More Potential IssuesInternalCloningError  Potential Serialization IssueWicket and localized URLs

Best Practices

Html Template Declaration



!DOCTYPE html
 html
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:wicket="http://wicket.apache.org/"
  xml:lang="en"
  lang="en"



Do's and dont
(thanks orange11-blog)

Do use models

Don't do this

 
public IncomePanel(String id, Person person) {
  super(id);
  add(new Label("salary", person.getSalary()); // no model!
}



But this -

 
public IncomePanel(String id, IModelPerson personModel) {
  super(id,personModel);
  add(new Label("salary", new PropertyModel(personModel, "salary"));
}

 
Or even this:

 	
public IncomePanel(String id, IModelPerson personModel) {
  super(id, new CompoundPropertyModel(personModel);
  add(new Label("salary");
}

 

Why - because A) we don't want to risk serialize an object, models are fine though - lightweight and ok. And we want to let the component take care of the detach when the request is done B) With an direct-entity we would set an nondynamic value to our label. With a model, the label will update the value from the entity it's using.

Don't use an Ajax library without intimate knowledge of the library
May collide with wicket code, make sure you know your JS-library well
Do make sure you understand the repeaters for high performance sites

Wicket by default provides the following repeater:  Loop, ListView, RepeatingView, RefreshingView, DataTable. This list is not even exhaustive; there are some more variations. Every repeater constructs a transient component for each iteration: the loop item. Every loop item has a Wicket model to look up the item's data.

Here are some points to consider to choose the most optimal repeater:


	Moment of data retrieval. Is it during construction only, or for each render again?
	During a re-render, is all data retrieved at once or one by one?
	Moment the loop-item's model is created. First time only, or again for each render, or does it retain existing models and only add/remove models as the underlying data changes (ItemReusePolicy)?
	Can you control the model creation?
	Is pagination/sorting needed?



Don't overuse inheritance - use composition

Signs you're in trouble are:


	common layout turned out to be slightly different on every page,
	components are created by abstract methods (constructors should not call these),
	there are getters to your components (breaks data hiding),
	the constructor of the sub-class replaces a component that was created by the super-class (wasteful and unmaintainable) or
	you add components while the wicket:id is not in the markup file of the current class (maintenance nightmare).



The remedy is to split of parts of the screen to separate components (e.g. Panels) and manage the complexity there.

Don't try to do authorization from a servlet filter

It just won't work. Wicket is full of generated URLs (yes, even if you mount every page) so 

[CONF] Apache Wicket Migration to Wicket 6.0

2012-06-15 Thread confluence







Migration to Wicket 6.0
Page edited by Sven Meier


Comment:
minor change in IErrorMessageSource


 Changes (1)
 




...
* Files#getLocalFileFromUrl(URL) decodes url before returning file * WizardStep header labels encode their model values by default, override WizardStep#getHeader() if you need the old behavior (i.e. model values not encoded) 
* IErrorMessageSource#substitute(MapString,Object) was merged into IErrorMessageSource#getMessage(String, MapString,Object) 


Full Content

Migrating to Wicket 6.0



Environment
Repeaters
Form Processing

Validation
Feedback Storage Refactoring
Feedback messages now use ${label} instead of ${input}

Ajax

Use JQuery as a backing library for Wicket Ajax functionality
AjaxRequestTarget is an interface

IHeaderResponse, including decorators and filters
Order of Header contributions and wicket:head
package.properties renamed to wicket-package.properties
List of renamed classes and methods
Refactorings
o.a.w.IComponentSource and o.a.w.ComponentSourceEntry are removed
o.a.w.Component#onMarkupAttached() has been dropped in favour of o.a.w.Component#onInitialize().
IInitializers are initialized before Application#init()
PackageResourceReference can load a minified version of a package resource
Minor changes


Environment


	Wicket 6.0 requires at least Java 6




Repeaters

	`IDataProvider` was converted to using `long` instead of `int` to better line up with JPA and other persistence frameworks. This has caused a rather large cascade of `int` to `long` changes all over the repeater packages (WICKET-1175).
	All classes in wicket-extensions which are related to repeaters with sorting behavior have improved generics
related to the sorting property (WICKET-4535). In most cases you just have to add ', String' to the previous parameterized type. For example: IColumnEntity becomes IColumnEntity, String. But now it is possible to use other type for the sort property than java.lang.String too.



Form Processing

Validation


	`StringValidator` will add the `maxlength` attribute if added to a component attached to an input tag
	`AbstractValidator` has been removed
	`ValidationError` now makes creating standard error keys (classname and classname.subtype) easier. Before one had to do: new ValidationError().addMessageKey(validator.getClass().getSimpleName()) to construct the default key, now you can simply say new ValidationError(validator) and it will do the above for you. Also, for more specific keys one had to do new ValidationError().addMessageKey(validator.getClass().getSimpleName()+".variant"), now you can do new ValidationError(validator, "variant").
	Most validators provide a `decorate(ValidationError, Validatable)` method for overriding how they report errors. For example, to add an extra resource key for the error message to StringValidator one can do 


class MyStringValidator extends StringValidator {
ValidationError decorate(ValidationError error, IValidatable validatable) {
   error.addKey("mystringerror");
   return error;
}
}


	org.apache.wicket.validation.RawValidationError is introduced. It can be used to bring a raw Serializable object which is registered as FeedbackMessage with org.apache.wicket.Component#error(Serializable).
	IFormValidator can have its own resource bundle as other IValidator implementations. WICKET-3879



Feedback Storage Refactoring


	Feedback messages reported against components are now stored in component's metadata rather then in session. This will allow them to survive across requests, see WICKET-2705.
	Previously the cleanup of messages was controlled by RequestCycle#cleanupFeedbackMessages(), now it is controlled by an IFeedbackMessageFilter set via IApplicationSettings#setFeedbackMessageCleanupFilter(). When session and components are detached they will run this filter on any stored messages, all messages accepted by the filter are removed. The default filter will accept any rendered message, so by default feedback messages are removed once rendered.
	Form components will clear any stored messages when validate() is called. This will remove any unredered, but now stale, messages.
	Since messages are now stored in session and in component tree retrieving them is not as simple as Session.getFeedbackMessages(). To assist with this common usecase please see FeedbackCollector.
	In test land cleanup of feedback messages was controlled by RequestCycle#set/isCleanupFeedbackMessagesOnDetach(), but this method is now deprecated. Instead, in testland you can now call WicketTester#cleanupFeedbackMessages() to clean up message just like it would be done at the end of a request. Alternatively, 

[CONF] Apache Wicket Wicket without web.xml (embedded Jetty)

2012-06-22 Thread confluence







Wicket without web.xml (embedded Jetty)
Page edited by Pouyan Fotouhi Tehrani


 Changes (1)
 




...
ServletContextHandler sch = new ServletContextHandler(ServletContextHandler.SESSIONS); ServletHolder sh = new ServletHolder(WicketServlet.class); 
sh.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM, WinterfaceApplication.class.getName()); WicketApplication.class.getName()); 
sh.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, /*); /* Define a variable DEV_MODE and set to false 
...


Full Content


Table of contents


Motivation
Configuring Jetty

Adding Wicket Filter to Jetty
Extra Servlet for static resources




Motivation
There are situation, when you don't want to export your application as a WAR file and have the conventional WAR structure. Or for any other reason you want to avoid using web.xml file. In the following we configure an embedded version of Jetty without using web.xml.

The following code should work with Wicket 1.5 and Jetty 8.

Configuring Jetty
Following is an example of web.xml:


?xml version="1.0" encoding="ISO-8859-1"?
web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	version="2.5"

	display-namemyproject/display-name

	!--
		There are three means to configure Wickets configuration mode and they 
		are tested in the order given.
		
		1) A system property: -Dwicket.configuration 
		2) servlet specific init-param 
		3) context specific context-param

		The value might be either "development" (reloading when templates change) or 
		"deployment". If no configuration is found, "development" is the default. --

	filter
		filter-namewicket.myproject/filter-name
		filter-classorg.apache.wicket.protocol.http.WicketFilter/filter-class
		init-param
			param-nameapplicationClassName/param-name
			param-valuecom.mycompany.WicketApplication/param-value
		/init-param
	/filter

	filter-mapping
		filter-namewicket.myproject/filter-name
		url-pattern/*/url-pattern
	/filter-mapping
/web-app



What we need to do is simply configure embedded Jetty to exhibit the same behaviour in case of missing web.xml

Adding Wicket Filter to Jetty


server = new Server();
/* Setup server (port, etc.) */
ServletContextHandler sch = new ServletContextHandler(ServletContextHandler.SESSIONS);
ServletHolder sh = new ServletHolder(WicketServlet.class);
sh.setInitParameter(ContextParamWebApplicationFactory.APP_CLASS_PARAM, WicketApplication.class.getName());
sh.setInitParameter(WicketFilter.FILTER_MAPPING_PARAM, "/*");
/* Define a variable DEV_MODE and set to false
 * if wicket should be used in deployment mode
 */
if(!DEV_MODE) {
	sh.setInitParameter("wicket.configuration", "deployment");
}
sch.addServlet(sh, "/*");
server.setHandler(sch)


The Code above configures Jetty in a manner similar to given web.xml file. Note that we use a ServletHolder which encapsulates both context and class of a servlet. The ServletHolder is then added to ServletContextHandler which as finally added as the only handler to our Jetty Server.

Extra Servlet for static resources
WicketFilter automatically passes the requests, which it cannot (or does not want to) process down the chain. In that case you can simply define another Servlet and add it to ServletContextHandler. This can be used, for example, if you want to access static data accessible under /static/ folder of your application:



// Static resources
String staticPath = this.getClass().getClassLoader().getResource("static/").toExternalForm();
ServletHolder resourceServlet = new ServletHolder(DefaultServlet.class);
resourceServlet.setInitParameter("dirAllowed", "true");
resourceServlet.setInitParameter("resourceBase", staticPath);
resourceServlet.setInitParameter("pathInfoOnly", "true");


Using the following code if you haven't already configured Wicket to handle a request such as localhost:8080/static/js/jquery.js, it will be passed down the handler chain to resourceServlet and it will retrieve the desired file from staticPath. For more init parameters see DefaultServlet



Change Notification Preferences

View Online
|
View Changes
|
Add Comment









  1   2   3   4   5   6   7   8   9   10   >