XPages Button on page will not fire

2019-07-24 13:10发布

问题:

I have an XPages with a button on it that will not do anything no matter how simple the code is. There are no errors appearing, nothing in the logs showing me why it does not work.

Here is the test button that does nothing:

        <xp:button value="Print" id="button4">
            <xp:eventHandler event="onclick" submit="true"
                refreshMode="complete">
                <xp:this.action><![CDATA[#{javascript:context.redirectToPage("invoices_page1_doc.xsp");}]]></xp:this.action>
            </xp:eventHandler>
        </xp:button>

I do not see that code would not allow this button to fire.

I am using the Extension Library ApplicationLayout control that has a few customizations to it, but not sure why it would limit a button on the XPage not to work.

I did notice in the Page Source that it looks like there is no "a href" or "onclick" parameter in a browser. The Place Bar actions are correctly rendered, but a button in a panel on the XPage does not seem to render:

<button class="lotusBtn" type="button" name="view:_id1:_id2:OneUIMainAreaCallback:button4" id="view:_id1:_id2:OneUIMainAreaCallback:button4">Print</button>

I am not sure where else to turn on this.

Appreciate any help.

Thanks! Dan

回答1:

The event handler is added at the end of the page using the XSP object, so there won't be any JS or URL with the link. Check in Firebug if that code is loading.



回答2:

I know this is an old post, but if anyone ever comes across a similar issue, be sure to check if there are any validation checks that could be failing anywhere else on the page. If there are, to bypass the checks, on your event handler check the 'do not validate or update data' if the action is not dependent on any data, or set execution mode to partial and include only the part of the page necessary.