应用程序布局中的 onClick 事件横幅 [英] onClick Event Banner in Application Layout

查看:25
本文介绍了应用程序布局中的 onClick 事件横幅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有图像作为横幅的应用程序布局.是否可以将带有 onclick 事件的事件处理程序绑定到横幅中的图像?

I have got an application layout with an image as banner. Is it possible to bind an event handler with an onclick event to the image in the banner?

    <xe:applicationLayout id="applicationLayout1"><xp:this.facets></xp:this.facets>
        <xp:callback facetName="facetMiddle" id="facetMiddle"></xp:callback>
        <xe:this.configuration>
            <xe:oneuiApplication productLogo="/ise_logo.png"
                productLogoHeight="70px" productLogoWidth="250px">
                <xe:this.bannerUtilityLinks>
                </xe:this.bannerUtilityLinks>
                <xe:this.titleBarTabs>
                </xe:this.titleBarTabs>
                <xe:this.footerLinks>
                </xe:this.footerLinks>
            </xe:oneuiApplication>
        </xe:this.configuration>
        </xe:applicationLayout>

推荐答案

使用 productLogoClass="applicationLogo" 将类作为应用程序布局横幅的参数添加到您的徽标中.

Add a class to your logo as Application Layout Banner's parameter with productLogoClass="applicationLogo".

然后在客户端加载时为此类添加一个客户端 onclick 事件

Add then a client side onclick event for this class on client load with

    var applicationLogo= dojo.query('.applicationLogo')[0];
    applicationLogo.onclick = function() {
            alert('clicked on logo');
    } 

在客户端事件代码中,您可以使用 XSP.partialRefreshGet 或 XSP.partialRefreshPost 执行部分刷新,如图所示 这里.

In client side event code you can execute a partial refresh with XSP.partialRefreshGet or XSP.partialRefreshPost like shown here.

这篇关于应用程序布局中的 onClick 事件横幅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆