Announcement

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

  • shortpasta
    replied
    BTW, setCanEdit() works for me as well, so if it does not work for you, could you post a stand-alone test case?

    Leave a comment:


  • vijragha
    replied
    I found the solution: Answer is

    textitem.setAttribute("readOnly",true);

    Leave a comment:


  • Isomorphic
    replied
    setCanEdit() is defined and does the job.

    Leave a comment:


  • shortpasta
    replied
    Try StaticTextItem instead.

    BTW, if setCanEdit () is not defined or does not do the job, and you want to toggle the same TextItem between readOnly and not readOnly, I am guessing that you are stuck creating both StaticTextItem and a TextItem, keeping the values in sync between the 2, and then showing only one or the other...

    Leave a comment:


  • Isomorphic
    replied
    That API does indeed exist, it's inherited from FormItem.

    Leave a comment:


  • vijragha
    started a topic TextItem readonly

    TextItem readonly

    Hi,

    I want to set the value for TextItem by using setValue() method.

    And also I want to make it readOnly to TextItem. I tried setCanEdit(false). It shows error.(The method setCanEdit(boolean) is undefined for the type TextItem)

    My Code is

    updatedBy = new TextItem(ITPC_USER_HELP.UPDATED_BY);
    updatedBy.setValue(remoteUser);
    updatedBy.setCanEdit(false);

    Please let me know how to make it readonly.
Working...
X