1
votes

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

2
Hmm.. in my notes (and gues in every other to) the button is working fine.(exep for item not found) What customizations are you talking about? The Page Source of you button seems ok but check if there is a code like: XSP.attachEvent("view:_id1:_id18", "view:_id1:button4", "onclick", null, true, 2); on your page.Michael Saiz
By chance are you using Firefox? If so have you cleared the cache and restarted it? I occasionally have a problem with FF and buttons not firing and that usually clears it up for a little while. I find it happens more often if I use Firebug so that might be another think to look at.RoyRumaner
I can assure you that this is not a problem with the ExtLib layout control. I am using it too with no problems. But: cann you ensure that other code does not affect your DOM, esp. the form-element as this is needed to submit i.e. fire the event code. Maybe just place a script below the button like <script type="text/javascript">alert(document.forms[0])</script> It should display something like [Object] if the form element is still accessible in the DOM.Oliver Busse
I am trying to use SSJS and I even tried a simple _dump() statement and it will not print to the log.nsf. I have restarted Firefox, cleared the cache and had the admin reboot the server too.Dan
Can you create a <xp:text> with SSJS computed value? If yes try going to the Package-Explorer to Local/xsp/ and check if there is a YourXPageName.java File and check the Code inside it for the button and the event handler.Michael Saiz

2 Answers

1
votes

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.

0
votes

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.