Uploaded image for project: 'HTML Form Entry Module'
  1. HTML Form Entry Module
  2. HTML-706

<obsFromFragment></obsFromFragment> tag to save single obs from included GSP fragment's input field

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Code Review (Post-Commit)
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Complexity:
      M

      Description

      1. Background

      The UI Framework's UiUtils.includeFragment(..) allows to embed GSP components at will, and this can be done in HFE forms as well. However it is not possible as of now to "connect" the included GSP component to the saving process of one (or multiple) obs.

      This ticket will look at designing a mechanism to capture a well targeted input recorded through the fragment, so that this specific input is saved as an obs.

      The workflow would be as such:

      • The fragment is included in the form.
      • The user uses the fragment to key in values.
        For instance to key in a date with when a date picker fragment is included, to key in a location name when a location selector is included... etc.
      • The tag handler would obtain the target value (a date, a location name, ... etc) from the fragment's HTML and save it as an obs.

      2. Design

      We will introduce a new <obsFromFragment/> tag as such:

      <obsFromFragment
       conceptId="..."
       provider="..."
       fragment="..."
       fragmentParams="formFieldName=foo&..."
       ... />
      

      Where

      • conceptId is the concept for the obs, in particular its data type will drive the obs type as it happens with the <obs/> tag.
      • provider, fragment and fragmentParams are the usual arguments for UiUtils.includeFragment(..).
      • fragmentParams should reference formFieldName, the name of the form's input field that we target (when there is only one.)

      The idea is to

      1. Use the value of formFieldName to locate the target input field.
      2. The input field should be an <input/> HTML element (TBC).
      3. Save that value as an obs of the provided concept.
      4. For cases were the same concept is used more than once on the same form ie. Like in two <obsFromFragment/> tags, this implies that more than one Obs will be linked to the same concept. Now this is normally fine depending to the context of use but for our usecase it's not. The issue will be guessing which <obsFromFragment/> widget owned which Obs value since it's the concept driving the tag. We solved this by simply setting the formFieldName of the widget as it's Obs comment. This helps to map Observations to their widgets!

      3. Example Use: UI Commons' field/datetimepicker

      <obsFromFragment conceptId="CIEL:1190" provider="uicommons" fragment="field/datetimepicker" fragmentParams="formFieldName=my-date&amp;label=My+Date&amp;useTime=true" />
      

      This would configure UI Commons' field/datetimepicker fragment to be the source for a date value that should be saved as date-time obs based on concept CIEL:1190.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              samuel34 Samuel Male
              Reporter:
              mksd Dimitri R
              Designated Committer:
              Dimitri R
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated: