[opencms-dev] Extending org.opencms.workplace.list.CmsListSearchAction

Cavva davide.cavarretta at gmail.com
Wed Jul 16 11:23:49 CEST 2014


Hi all,

I'm trying to extend the search bar on
org.opencms.workplace.list.A_CmsListDialog subclass. I found that the
CmsListSearchAction must be set in the setIndependentActions, but it is
still displaying the old CmsListSearchAction. It doesn't even pass through
the barHtml of my class neither the CmsListSearchAction.

this is my code:

	protected void setIndependentActions(CmsListMetadata metadata) {
		CmsListDateSearchAction search = new
CmsListDateSearchAction(metadata.getColumnDefinition(LIST_COLUMN_NAME));
		search.addSearchParameter(new CmsSearchParameter("date",
CmsSearchParameterType.DATE));
		metadata.setSearchAction(search);
	}

and an extract of my search class:

public class CmsListDateSearchAction extends CmsListSearchAction {
	private List<CmsSearchParameter> m_paramenters = new ArrayList<>();
	private boolean calendarJsPlaced = false;

	public CmsListDateSearchAction(CmsListColumnDefinition column) {
		super(column);

	}

	public void setSearchParameters(List<CmsSearchParameter> params) {
		this.m_paramenters = params;
	}

	public void addSearchParameter(CmsSearchParameter param) {
		if (m_paramenters == null)
			m_paramenters = new ArrayList<CmsSearchParameter>();
		m_paramenters.add(param);
	}

	@Override
	public String barHtml(CmsWorkplace wp) {
		if (wp == null) {
			wp = getWp();
		}
		StringBuffer html = new StringBuffer();
		for (CmsSearchParameter param : m_paramenters) {
			addParam(param, html, wp);
		}
		html.append(buttonHtml(wp));
		if (getShowAllAction() != null) {
			html.append("  ");
			html.append(getShowAllAction().buttonHtml());
		}
		return html.toString();
	}


I found org.opencms.workplace.list.CmsListMultiSearchAction. Where is it
used?



--
View this message in context: http://opencms.996256.n3.nabble.com/Extending-org-opencms-workplace-list-CmsListSearchAction-tp24351.html
Sent from the OpenCMS mailing list archive at Nabble.com.



More information about the opencms-dev mailing list