Results 1 to 2 of 2

Thread: Reusable Input Fields with Bind Tag

  1. #1

    Default Reusable Input Fields with Bind Tag

    I am using a servlet 2.3/jsp1.2 container and I want to create reusable fields i.e. text, checkbox, etc... One of the reason I am doing this is that I want to inject JS functions to all fields. For this to be truly generic, the path attribute should be dynamic. Can I do this?

    <!-- input.jsp -->
    <spring:bind path="${name}">
    <input type="text" name="${status.expression}" value="${status.value}" onfocus="callSomeJsFunction();"/>
    </spring:bind>

    <!-- Some sample JSP -->
    <tiles:insert page="/WEB-INF/jsp/templates/input.jsp">
    <tilesut name="id" value="someId"/>
    <tilesut name="name" value="pathAttributeNameString"/>
    </tiles:insert>

    Has anyone tried anything like that?
    J2EEGuru,
    The Spring Advocate

  2. #2
    Join Date
    Aug 2004
    Location
    Toulouse, France
    Posts
    148

    Default

    Without having tried this explicitely, I would guess it will work as expected. The path attribute of the spring:bind supports EL and should use the dynamic value (as expressed in http://www.springframework.org/docs/...g/BindTag.html). So give a try like this.

    Olivier

Similar Threads

  1. Replies: 19
    Last Post: Jul 26th, 2012, 02:23 AM
  2. Replies: 6
    Last Post: Sep 24th, 2006, 11:58 AM
  3. Replies: 1
    Last Post: May 29th, 2005, 07:51 PM
  4. Replies: 2
    Last Post: Apr 29th, 2005, 01:35 PM
  5. Replies: 3
    Last Post: Feb 14th, 2005, 06:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •