[
https://issues.apache.org/jira/browse/WICKET-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851460#action_12851460
]
David Chang commented on WICKET-2809:
-------------------------------------
This is a fantastic news. It makes sense in many ways to keep HTMLElement's id
without overwriting it.
--- On Tue, 3/30/10, Martin Grigorov (JIRA) <[email protected]> wrote:
> Add convenience method to reuse a component's ID as markup ID
> -------------------------------------------------------------
>
> Key: WICKET-2809
> URL: https://issues.apache.org/jira/browse/WICKET-2809
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Environment: no restrictions.
> Reporter: David Chang
> Assignee: Igor Vaynberg
> Priority: Minor
>
> Currently, here is the follow pattern I follow to reuse a wicket component's
> ID as the element's markup ID.
> Label abc = new Label("efg", "xyz");
> abc.setOutputMarkupId(true).setMarkupId(abc.getId());
> It takes two lines to do this. A helper method as James Carmen suggested
> protected <T extends ComponentT setMarkupId(T
> component, String markupId)
> {
> component.setMarkupId(markupId);
> return component;
> }
> It does the trick, but it does not seem to the optimal solution. I hope to
> see a convience method on Component such as the following:
> Component setMarkupIdToWicketId()
> This method should does two things in one method call:
> setOutputMarkupId(true).setMarkupId(abc.getId());
> Thanks!
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.