Dealing with conditional contentPage edited by Derek E
Comment:
Adding section to describe the best practices for implementing component visibility changes per the user mailing list
Changes (1)
Full ContentDealing with Conditional ContentMany web frameworks allow you to specify page content that appears conditionally from within the html or template file with a tag or logical instruction of some sort, such as an if tag. In keeping with the seperation of view from the controller, wicket does not offer this functionality. A common question, then, is how to conditionally render some content. Perhaps you want to display a form element only if appropriate, or a footer only on pages concerning a particular subject. In wicket, there are two ways of dealing with this situation: The Visibility Method
Example: JSP: Unknown macro: {val}
"/> Wicket: Unknown macro: {
return blah;
}
} template: Extended version: JSP: Unknown macro: {val}
"/> Wicket: WebMarkupContainer blahRow = new WebMarkupContainer ("blahrow") { Unknown macro: {
return blah;
}
} template: Clarification on defining component visibilityBased on the user mailing list, here are some things to keep in mind when dealing with conditional visibility.
The Panel Method
Change Notification Preferences
View Online
|
View Changes
|
Add Comment
|
