Tony Nelson
unread,Jun 28, 2011, 6:35:06 PM6/28/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ColdMVC
I've been thinking about cleaning up some of the markup that's
generated by the custom tags. I'd like for the generated HTML to be as
minimal and yet useful as possible.
Right now, if you have a <c:input name="firstName" />, the following
HTML will be generated:
<div class="wrapper" id="wrapper_for_firstName">
<div class="label">
<label id="label_for_firstName" for="firstName"
title="First Name">First Name:</label>
</div>
<div class="field">
<input type="text" name="firstName" id="firstName"
title="First Name" value="" />
</div>
</div>
You'll notice that ColdMVC automatically generates unique IDs for the
wrapper and label.
I thought the IDs might come in handy when performing tasks such as
validation, but you can get at the tags relatively easily by
traversing the DOM. For example, $
('#firstName').closest('div.wrapper').find('label').
Do you guys find these IDs useful, or can I remove them?
If you feel I shouldn't remove them, can I at least disable them by
default and allow them to be enabled by adding a config setting like
coldmvc.html.generateIDs = true or something along those lines?
Let me know your thoughts, especially since this change would break
backwards compatibility and I don't want to screw anybody over. :)
-Tony