Disable/Enable a Selector style Lookup Field

Posted by IramK on 04-Feb-2015 04:14

Hello,

I am trying to disable and then enable a selector style lookup field. I've tried it to do it this way but it doesn't work like that:

$('#R12345 img, #txtR12345').hide();

I would like to hide both the text field and the selector button and if there are any values associated with that lookup field. I've seen a post like this before but it did not help me much.

https://community.progress.com/community_groups/rollbase/f/25/t/7264.aspx

Could you possibly point me in the right direction?

Posted by Santosh Patel on 04-Feb-2015 04:46

You are better off hiding the field and its label. The following will work

$('#rbi_F_R12345, #rbi_L_R12345').hide();

All Replies

Posted by Chandrasekhar Gontla on 04-Feb-2015 04:34

Hi,

We can hide the lookup field using 'Design this Page' option.

Find attached screen shot.

Please let me know if you have any questions.

Thanks and Regards,

Chandra.

Posted by IramK on 04-Feb-2015 04:37

I would like to do that programmatically based on a checkbox selection, i.e. if the checkbox is selected make the lookup field (along with the selector) disabled .. else make that enabled.

Posted by Santosh Patel on 04-Feb-2015 04:46

You are better off hiding the field and its label. The following will work

$('#rbi_F_R12345, #rbi_L_R12345').hide();

Posted by IramK on 04-Feb-2015 05:20

And if I want to set that lookup field's value to null? Would I have use setfieldvalue in that case?

Posted by Santosh Patel on 04-Feb-2015 05:31

setFieldValue will do the job of setting the field's actual value to null but for the visual aid (list of related items beneath the textbox) you will have to do something extra.

$('#rtable_R12345').children().remove();

Posted by IramK on 04-Feb-2015 05:38

Ok that really does help. Thanks for that.

This thread is closed