Announcement

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

    DateItem : Not allow user to type the date

    SmartClient Version: v11.0p_2017-02-11/PowerEdition Deployment (built 2017-02-11)

    Hi,

    I want to allow the user to just pick the date from the date picker and not allow him to type the date. Please let me know how can I achieve the same?

    Thanks

    #2
    Hi sidharth1917.

    there is setTextFieldProperties(), did you try it already?

    Best regards
    Blama

    Comment


      #3
      You can setCanEdit(false) on the DateItem and then re-enable the icon with setNeverDisable(true) via setPickerIconProperties()

      Comment


        #4
        Thanks Isomorphic ,the above solution worked in the Form. I also want to achieve the same in listgrid. The type in listgrid is datetime. Could you please suggest me how can I restrict user to select value from date picker only.? Thanks in advance.

        Comment


          #5
          You can do the same thing - see ListGridField.setEditorProperties().

          If you want to do this for all Date items, you can do so globally via DateItem/DatetimeItem.setDefaultProperties()

          Comment


            #6
            I tried setEditorProperties(new DateItem()) but no success. My requirement is to disable the textbox in listgrid field and just show a calendar icon to choose date. There is no setPickerIconProperties() in listgridfield. Kindly suggest.

            Comment


              #7
              setEditorProperties(new DateItem()) doesn't apply any custom properties.

              You need to create a DateItem, set the properties you want to enforce on it, and then pass it to setEditorProperties().

              Comment

              Working...
              X