cancel
Showing results for 
Search instead for 
Did you mean: 
donald_mcnally
Nintex Newbie

Clear People Picker that is Disabled by rule

I have a PeoplePicker control that I have disabled by rule because I am populating it via jQuery based on a selection in a drop down list.  I am using the NF.peoplePickerApi to set the value, which works fine.  However, if I change the value of the drop down list, the field does not clear and I get more than one name in the field which causes an error.  If the field is NOT disabled, the code works properly but I need the field disabled so it isn't modified manually by a user.

Is it by design that the clear method doesn't work if the field is read only?  Is there another way to clear the field?

Reply
5 Replies
Automation Master
Automation Master

Re: Clear People Picker that is Disabled by rule

how do you disable it? by a control's appearance setting or by  a formatting rule?

I would recommend to use rule.

furthermore, do not apply the rule directly on control but rather place control into a panel and apply rule to the panel.

Reply
juku
Nintex Newbie

Re: Clear People Picker that is Disabled by rule

Hello,

try to disable it by JS so nobody can make changes but you can interact with the control.

NWF$('#'+pplDisabled).prop("readonly", true);

Cheers,

0 Kudos
Reply
joseph_cervi
Nintex Newbie

Re: Clear People Picker that is Disabled by rule

Tried this and it didn't work. 

Nintex Forms 2013 v2.10.0.0

0 Kudos
Reply
joseph_cervi
Nintex Newbie

Re: Clear People Picker that is Disabled by rule

Tried this and it didn't work. 

Nintex Forms 2013 v2.10.0.0

0 Kudos
Reply
joseph_cervi
Nintex Newbie

Re: Clear People Picker that is Disabled by rule

My workaround uses a yes/no control (on a hidden panel) that disables the person control when yes.  I'm using javascript to uncheck this control to enable the person control that then allow the clear function to work.  Once this has been completed then check the control to disable the person control.

var PersonControl = new NF.PeoplePickerApi("#"+TheseUsers);
NWF$('#'+PersonControlDisable).click();
PersonControl.clear();  
NWF$('#'+PersonControlDisable).click();

Reply