Make query field uneditable and added document listener to resource field