- The tabbed menu bar will be rendered in the browser using the ul and li tags which is a common practice employed by web page designers. When combined with the correct style sheet attributes the list can be rendered horizontally:
- The number of tabs displayed in the menu bar must be dynamic and defined by a model which in essence would consist of a list of menu tab items. Below is the MenuItem Java class that I defined to represent a single menu bar tab:
- As for usability, the control must be configurable and provide options that specify styling for the selected and non selected tabs, identity of the current tag, a model representing the list of MenuItems, and an id which will be used to render the html id attribute of the containing html div tag for the control's child html elements. The id is important because it will be used to customize the JavsScript that is rendered to provide client-side scripting of the control but more on that later. Here's the Java code for the custom control:
And here is how the control appears when it is rendered in the client browser:
Overall, developing custom controls for Wicket applications isn't difficult and I find it much more intuitive than when I've done similar tasks with other frameworks . I use sort of a top-down approach to this kind of task, which allows for an iterative development process where each iteration adds more functionality and specificity.
There were a number of topics that I admitedly didn't touch on here such as the generation of the client-side JavaScript and the use of the AbstractReadOnlyModel class. I will discuss these in a future article.
Hi Jeff
ReplyDeleteMy name is Irshad,
I read that you are developing a Website and I want to develop a Website too. I'm interested doing it using Wicket.
I'm a bit confused, because I did some research on the Web and many people say that in these days it is worthwhile developing a website using a CMS.
Can you tell me if you used a CMS to develop your Website and if so, how did you integrate it with your framework?
I would appreciate if you can give me an overview!
Thank you
Irshad
Irshad,
ReplyDeleteA full discussion of the advantages and disadvantages of employing a CMS is beyond the scope of what I can reply to but there is a lot of information that can be found on the web.
I will say that in my opinion CMS lend themselves to sites where the end users themselves have some level of controlling and altering content, including the creation of web pages with varied content.
Jeff