You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2010/03/30 04:47:27 UTC
[jira] Resolved: (WICKET-2809) Add convenience method to reuse a
component's ID as markup ID
[ https://issues.apache.org/jira/browse/WICKET-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Igor Vaynberg resolved WICKET-2809.
-----------------------------------
Resolution: Won't Fix
Assignee: Igor Vaynberg
no space for such trivialities in the api
> 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.