2

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

Dan
  • 940
  • 2
  • 14
  • 42
  • 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 Jun 12 '13 at 14:30
  • 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 Jun 12 '13 at 14:38
  • 1
    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 It should display something like [Object] if the form element is still accessible in the DOM. – Oliver Busse Jun 12 '13 at 19:50
  • 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 Jun 12 '13 at 21:45
  • Can you create a `` 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 Jun 13 '13 at 09:22
  • Are there any javascript errors shown in firebug? When there is a javascript error somewhere on your page event handlers sometimes dont work anymore.. Do you see a post / get to the server when you press the button with the ssjs eventhandler ? – jjtbsomhorst Jun 13 '13 at 20:28
  • was a solution to this error ever found? I am having the same issue, same circumstances. I have a button in the center facet of an application layout control. The data is a java bean and EL is used for most of the bindings. Client side script can be fired from the button, but server side script is completely ignored whether a simple "prinltln" or view.postscript("alert('fired')"). No errors shown. – Greg Feb 05 '15 at 08:10

2 Answers2

1

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.

0

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.

stwissel
  • 20,110
  • 6
  • 54
  • 101