如何限制只有一条记录的输入框

时间:2015-05-05 11:53:25

标签: html jsp jstl el displaytag

我有以下数据以表格形式显示。当我点击更新按钮时,所有名称字段都变成输入形式,而我只希望在显示更新按钮的地方输入该特定记录。在这种情况下该怎么做?

<display:column  title="Name" >
    <c:choose>
        <c:when test="${param.button == 'Update'}">
            <input type="input" name="name" value="${record.name}"/>
        </c:when>
        <c:otherwise>
        <c:out value="${record.name}"></c:out>
        </c:otherwise>
    </c:choose>
    </display:column>
    <display:column media="html">
        <c:choose>
            <c:when test="${param.button == 'Update' }">
                    <input type="hidden" name="name" value="${record.name}" />
                    <input type="submit" name="button" value="Save" />
            </c:when>
            <c:otherwise>
                <input type="submit" name="button" value="Update" />
            </c:otherwise>
        </c:choose>
        <c:choose>
            <c:when test="${param.button == 'Update' }">
                <input type="submit" name="button" value="Cancel" />
            </c:when>
            <c:otherwise>
                <input type="button" value="View"/>
            </c:otherwise>
        </c:choose>
    </display:column>
</display:table>

0 个答案:

没有答案