I'm using jsp tag files to solve this problem. Here are some samples:
FormRowDatePicker.tag
<%@ include file="/WEB-INF/jsp-commons/TaglibWithoutEncoding.jsp"%>
<%@ attribute name="id" required="false"%>
<%@ attribute name="field" required="true"%>
<%@ attribute name="tabIndex" required="false"%>
<c:if test="${empty id}">
        <c:set var="id"><ct:UUID /></c:set>
</c:if>
<c:if test="${empty tabIndex}">
        <c:set var="tabIndex" value="" />
</c:if>
<tr>
        <th><s:label name="${field}" /></th>
        <td><s:text class="form" name="${field}" id="${id}"
tabindex="${tabIndex}" /><br />
        <s:errors field="${field}" /></td>
</tr>
<script type="text/javascript">
        $j( function() {
                $j('#${id}').datepicker();
        });
</script>

FormRowText.tag
<%@ include file="/WEB-INF/jsp-commons/TaglibWithoutEncoding.jsp"%>
<%@ attribute name="id" required="false"%>
<%@ attribute name="field" required="true"%>
<%@ attribute name="tabIndex" required="false"%>
<%@ attribute name="label" required="false"%>
<c:if test="${empty id}">
        <c:set var="id">
                <ct:UUID />
        </c:set>
</c:if>
<c:if test="${empty tabIndex}">
        <c:set var="tabIndex" value="" />
</c:if>
<tr>
        <th>
                <c:choose>
                        <c:when test="${empty label}">
                                <s:label name="${field}" />
                        </c:when>
                        <c:otherwise>${label}</c:otherwise>
                </c:choose>
        </th>
        <td>
                <s:text class="form" name="${field}" id="${id}" 
tabindex="${tabIndex}" />
                <br />
                <s:errors field="${field}" />
        </td>
</tr>

UUID.tag
<%= java.util.UUID.randomUUID().toString() %>

This has the advantage that I do have full IDE support for the form
rows and their attributes.

On Mon, Jun 22, 2009 at 9:28 PM, Daryl Handley<[email protected]> wrote:
> Nick Stuart wrote:
>> Are you talking about the JSP side of things?
> Sent this the other day, but it never made it to the list. Trying again.
>
> I wan't talking about the JSP side but that sounds like a good nice idea
> too.
>
> I usually decorate my date fields with the JQuery datepicker, this
> sounds like it may also be able to handle that so I don't have to add
> the Javascript to add a datepicker for every JSP page. I'll try out this
> idea too once I get the validation figured out.
>
> Thanks
> Daryl
>
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



-- 
Richard Hauswald
Blog: http://tnfstacc.blogspot.com/
LinkedIn: http://www.linkedin.com/in/richardhauswald

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to