//open the url in a liferay popup function showWPPopup(url) { var url = url; // this is one way of calling a pop-up in liferay // this way is specific to liferay Liferay.Util.openWindow( { dialog: { cache: false, width:700, height: 550, modal: true }, id: 'testPopupIdUnique', title: 'Select the dataset', uri: url } ); } //handle the event from ws explorer Liferay.on('getSelectedItem', function(event) { var id = event.id; var name = event.name; var chip = $(''+ event.name + ' '+ ''); $("#attachedFiles").append(chip); }); function removeFromParent(el) { $(el).parent().remove(); }