Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DateItem in SearchForm?

    Hi. This is a strange one.
    I had a SearchForm for a patient database and I wanted to add "date of birth" as a selection criteria.

    If you put a DateItem in a SearchForm, it is rendered as a DateRangeItem.
    If you put a DateRangeItem in a SearchForm, it is rendered as a Text item.

    You can see this if you go to
    http://www.smartclient.com/docs/10.0....html#dateItem
    and change the DynamicForm to a SearchForm.

    There is no problem with DynamicForms, only SearchForms.

    Andrew

    #2
    If you are specifying type="date", it's normal for a SearchForm to use a DateRangeItem, because that's the right default control for searching a date field.

    Likewise type="DateRangeItem" would be invalid, since "type" should be a data type.

    Given this information, if you still think you are seeing misbehavior, be specific about how you are specifying field types and editors.

    Comment


      #3
      A range is correct when searching for a DateTime or a Time, but not necessarily for a Date. There are scenarios where it is appropriate to search for events that occurred on a specific date as opposed to a date range. Searching for a patient using their date of birth is one.

      I would ask that you consider providing a mechanism for allowing a DateItem to be present on a SearchForm.

      In the meantime, I will simply use a DynamicForm instead of a SerchForm.

      all the best,
      Andrew

      Comment


        #4
        A DateRangeItem can filter to a single day.

        Use editorType="DateItem" to use a DateItem. DateRangeItem is just the default for a SearchForm, not something forced.

        Comment

        Working...
        X