xpagesxpages-extlib

The onComplete for a button contained in the XPages extlib mobile controls does not fire on mobile devices but works fine in desktop browser


The onComplete for a button contained in the XPages extlib mobile controls does not fire on mobile devices but works fine in any desktop browser. I tested on both iPhone and Android phones. Here is the source for my buttonClear butto which clears the search fields (tied to the scope properties) and then "clicks" the buttonFilterSearch button in its onComplete.

                    <xp:button id="buttonClear" value="Clear/Reset"
                        styleClass="buttonMarginBottom" style="width:200.0px;height:30.0px" icon="/undo-4-24.png">
                        <xp:eventHandler event="onclick" submit="true" refreshMode="partial" id="eventHandler1"
                            refreshId="panelOppSearch">
                            <xp:this.action><![CDATA[#{javascript:
                            sessionScope.query2 = "" ;
                            sessionScope.query2Location = "" ;
                            sessionScope.query2Activity = "" ;
                            sessionScope.query2FromDate = "";
                            sessionScope.query2ToDate = "";
                            sessionScope.query2searchbox = "" ;
                            sessionScope.query2AssignmentStatus = "Needed";
                            }]]></xp:this.action>
                            <xp:this.onComplete><![CDATA[dojo.byId("#{id:buttonFilterSearch}").click();]]></xp:this.onComplete>
                        </xp:eventHandler>
                    </xp:button>
                </xp:td>
            </xp:tr>
        </xp:table>
    </xe:djxmRoundRectList>
... more ...
... more ...
</xe:appPage>

The complete xe:appPage mobile page is contained in a custom control which is one of many mobile pages (all via CCs) contained in the xe:singlePageApp on my mobileXPage.

Any ideas appreciated.


Solution

  • onComplete is supposed to run client side.

    These are the steps I would take

    1) Is javascript enabled on the mobile browser?
    2) Test with a different O/S by getting another phone.
    3) Install Opera, Firefox, Chrome and test with those.
    4) Replace the .click() with a alert('it fires').
    5) Is it does not fire, is the Javascript rendered in the client?
    6) If Alert() fires, then make sure the element can be found with by Id, put another alert after you get a handle to the element...
    7) Does the element have a a click event attached? Depending on the browser the mobile app is using
    8) Can you tap the button to manually click it?

    http://perfectionkills.com/detecting-event-support-without-browser-sniffing/