@Override
	public void update(Observable o, Object arg) {
		if (arg instanceof SearchModel) {
			this.model = (SearchModel) arg;
		}
		
		/**-50 to count for the offset of the textbox*/
		show(this.textField, -50, this.textField.getHeight());
		List<PictureObject> pictures = this.model.getPictures();
		this.setListItems(pictures);
		
		this.panel.removeAll();

		/**Adds the search results to the popup, if result resulted in no matches, add
		a no result label.*/
		if (!pictures.isEmpty()) {
			if (pictures.size() > 2) {
				this.messageItem.setMessage(SearchConstants.SEE_MORE);
				this.panel.add(this.messageItem);
				this.panel.add(new JSeparator());
			}

			int nbrOfItems = 0;
			for (JPopupListItem item : listItems) {
				if (item.hasPicture()) {
					this.panel.add(item);
					nbrOfItems++;
				}
			}

			setPopupSize(250, (nbrOfItems * 70));
			
		} else {
			this.messageItem.setBackground(Color.GRAY);
			this.messageItem.setMessage(SearchConstants.NO_ITEMS);
			this.panel.add(this.messageItem);
			setPopupSize(250, 40);
		}

		this.panel.revalidate();
	}