added a note about markup id generator

Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/fc90ad7c
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/fc90ad7c
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/fc90ad7c

Branch: refs/heads/master
Commit: fc90ad7cedca5120305248ad8985be17eda2f2bc
Parents: 071e5a0
Author: Andrea Del Bene <[email protected]>
Authored: Fri Apr 10 18:11:37 2015 +0200
Committer: Andrea Del Bene <[email protected]>
Committed: Fri Apr 10 18:11:37 2015 +0200

----------------------------------------------------------------------
 .../src/docs/guide/keepControl/keepControl_3.gdoc    | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/fc90ad7c/wicket-user-guide/src/docs/guide/keepControl/keepControl_3.gdoc
----------------------------------------------------------------------
diff --git a/wicket-user-guide/src/docs/guide/keepControl/keepControl_3.gdoc 
b/wicket-user-guide/src/docs/guide/keepControl/keepControl_3.gdoc
index 286453e..b83542a 100644
--- a/wicket-user-guide/src/docs/guide/keepControl/keepControl_3.gdoc
+++ b/wicket-user-guide/src/docs/guide/keepControl/keepControl_3.gdoc
@@ -1 +1,14 @@
-Tag attribute @id@ plays a crucial role in web development as it allows 
JavaScript to identify a DOM element. That's why class @Component@ provides two 
dedicated methods to set this attribute. With method @setOutputMarkupId(boolean 
output)@ we can decide if the @id@ attribute will be rendered or not in the 
final markup (by default is not rendered). The value of this attribute will be 
automatically generated by Wicket and it will be unique for the entire page. If 
we need to specify this value by hand, we can use method @setMarkupId(String 
id)@. The value of the id can be retrieved with method @getMarkupId()@.
\ No newline at end of file
+Tag attribute @id@ plays a crucial role in web development as it allows 
JavaScript to identify a DOM element. That's why class @Component@ provides two 
dedicated methods to set this attribute. With method @setOutputMarkupId(boolean 
output)@ we can decide if the @id@ attribute will be rendered or not in the 
final markup (by default is not rendered). The value of this attribute will be 
automatically generated by Wicket and it will be unique for the entire page. 
+If we need to specify this value by hand, we can use method 
@setMarkupId(String id)@. The value of the id can be retrieved with method 
@getMarkupId()@.
+
+Wicket generates markup ids using an instance of interface 
@org.apache.wicket.IMarkupIdGenerator@. The default implementation is 
@org.apache.wicket.DefaultMarkupIdGenerator@ and it uses a session-scoped 
counter to generate the final id. A different generator can be set with the 
markup settings class @org.apache.wicket.settings.MarkupSettings@ available in 
the application class:
+
+{code}
+@Override
+public void init()
+{
+       super.init();
+       //wrap disabled links with <b> tag
+       getMarkupSettings().setMarkupIdGenerator(myGenerator);          
+}
+{code}

Reply via email to