Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-10610

Support the @ValueFrom suffix for the :name and :nameHint parameters

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • Servlets POST 2.4.6
    • None
    • None

    Description

      Currently the :name and :nameHint properties are not considering or handling the @ValueFrom suffix. This makes reusing the same text for some property and the :name/:nameHint value require a form that uses the @ValueFrom suffix on the other field and looks something like this:

       

      <form method="POST" action="/content/page" enctype="multipart/form-data">
          <input type="hidden" name="message@ValueFrom" value=":nameHint" />
          <input type="text" name=":nameHint" />
          <input type="Submit" />
      </form>
      

      Notice that the :nameHint field is the one the user is typing the text into and the "message" field gets the same value.

       

      This form structure seems counter intuitive as the "message" field is the one that would ultimately contain the text the user typed but the user is sending the text as the :nameHint parameter.

      Plus, consider the use case where you have a create and update script for a resource that are nearly identical except for how you are defining the name.  Having this field juggling in the create script makes it more difficult to reuse that form as the create and update forms would require different logic.

      If the :name and :nameHint handling supported and handled the @ValueFrom suffix, then the script could be more intuitive and easier to re-use the common parts for the create/update scenario.

      For example:

      <form method="POST" action="/content/page" enctype="multipart/form-data">
        <input type="hidden" name=":nameHint@ValueFrom" value="message" />
        <input type="text" name="message" />
        <input type="Submit" />
      </form>
      

       

      Attachments

        Issue Links

          Activity

            People

              enorman Eric Norman
              enorman Eric Norman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m