onClick Event Banner in Application Layout

风格不统一 提交于 2019-12-11 10:35:11

问题


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>

回答1:


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

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');
    } 

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



来源:https://stackoverflow.com/questions/26606544/onclick-event-banner-in-application-layout

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!