Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class WicketPropertyResolver implements IComponentResolver {
- private static final long serialVersionUID = 1L;
- static {
- WicketTagIdentifier.registerWellKnownTagName("property");
- }
- public boolean resolve(final MarkupContainer arg0, final MarkupStream arg1, final ComponentTag arg2) {
- if(arg2.getId().equals("_property")) {
- if(arg0 instanceof MarkupContainer) {
- IModel<?> model = ((Component)arg0).getDefaultModel();
- if(model != null){
- String propertyName = String.valueOf(arg2.getString("name"));
- boolean toEscape = Boolean.valueOf(String.valueOf(arg2.getString("escape")));
- IModel<?> pModel = new PropertyModel<String>(model,propertyName);
- arg0.autoAdd(new Label(propertyName,pModel).setEscapeModelStrings(toEscape), arg1);
- }
- }
- arg1.next();
- return true;
- }
- return false;
- }
- }
Add Comment
Please, Sign In to add comment