package com.udapsoft.modular.web.tags;

import java.util.Map;

import javax.servlet.jsp.tagext.Tag;

public class KeyTag extends TemplateBasedRequestContextAwareTag {

	private static final long serialVersionUID = -5449552670589762641L;
	private String id;

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	protected int doBuildModelForStartTag(Map model) throws Exception {
		Tag tag = getParent();
		if ((tag instanceof SearchTag)) {
			SearchTag psgt = (SearchTag) tag;
			model.put("searchId", psgt.getId());
		}
		evaluateStringAndSetModel(model, "id", this.pageContext);
		return 1;
	}

}
