Search in sources :

Example 1 with AbstractJspPage

use of cn.cerc.jmis.page.AbstractJspPage in project summer-mis by cn-cerc.

the class UIHeader method initHeader.

public void initHeader() {
    IForm form = ((AbstractJspPage) this.getOwner()).getForm();
    // 刷新
    if (this.pageTitle != null) {
        leftMenus.add(new UrlRecord("javascript:location.reload()", this.pageTitle));
    }
    if (leftMenus.size() > 2) {
        if (form.getClient().isPhone()) {
            UrlRecord first = leftMenus.get(0);
            UrlRecord last = leftMenus.get(leftMenus.size() - 1);
            leftMenus.clear();
            leftMenus.add(first);
            leftMenus.add(last);
        }
    }
    if (leftMenus.size() == 0) {
        leftMenus.add(new UrlRecord("/", "首页"));
        leftMenus.add(new UrlRecord("javascript:history.go(-1);", "刷新"));
    }
    // 兼容老的jsp文件使用
    form.getRequest().setAttribute("barMenus", leftMenus);
    form.getRequest().setAttribute("subMenus", rightMenus);
}
Also used : AbstractJspPage(cn.cerc.jmis.page.AbstractJspPage) IForm(cn.cerc.jbean.form.IForm) UrlRecord(cn.cerc.jpage.core.UrlRecord)

Aggregations

IForm (cn.cerc.jbean.form.IForm)1 AbstractJspPage (cn.cerc.jmis.page.AbstractJspPage)1 UrlRecord (cn.cerc.jpage.core.UrlRecord)1