Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

This is an example (based on Link-o-matic of wicket-examples) of how to use customized state tracking.

Play with this and see how it reacts on using your back-button.

Code Block
// Action link counts link clicks on works with onclick handler
final Link actionOnClickLink = new Link("actionOnClickLink")
{
	public void onClick()
	{
		addStateChange(new Change()
		{
			private int tmpCount = Home.this.onClickLinkClickCount;
			public void undo()
			{
				onClickLinkClickCount = tmpCount;
			}
		});
		onClickLinkClickCount++;
	}
};