FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



May 18, 2016, 2:28 AM
42 Posts
topic has been resolvedResolved

Button not firing on a page

  • Category: Debugging
  • Platform: All
  • Release: 9.0.1
  • Role: Developer
  • Tags:
  • Replies: 2

Hi,

 

Am working on an application, there are couple of buttons on each page - log on and search (takes you to a search page).  These are statc pages, not open for editing. For some reason, which I can't figure out, when I click on the button NOTHING happens. Below is the code for the page to open the search button.

 

                                       <xp:button id="button2" styleClass="btn btn-default">
                                            <span class="icon-search"></span>Search
                                           <xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="true">
                                                <xp:this.script><![CDATA[window.open("Search.xsp","_self")]]></xp:this.script>
                                            </xp:eventHandler>
                                        </xp:button>

Just to be certain I've just tried

                                     <xp:button id="button2" styleClass="btn btn-default">
                                            <span class="icon-search"></span>Search
                                            <xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="true">
                                                
                                                <xp:this.action>
                                                    <xp:openPage
                                                        name="/Search.xsp">
                                                    </xp:openPage>
                                                </xp:this.action></xp:eventHandler>
                                        </xp:button>

Same, nothing happens.  Even further....

                                        <xp:button id="button2" styleClass="btn btn-default">
                                            <span class="icon-search"></span>Search
                                            <xp:eventHandler event="onclick" submit="true" refreshMode="complete" immediate="true">
                                                
                                                <xp:this.action>

                                                    <xp:actionGroup>
                                                    <xp:executeScript>
                                                            <xp:this.script><![CDATA[#{javascript:print("Is this being clicked??")}]]></xp:this.script>
                                                        </xp:executeScript>
                                                        <xp:openPage
                                                            name="/Search.xsp">
                                                        </xp:openPage>
                                                        
                                                    </xp:actionGroup>
                                                </xp:this.action></xp:eventHandler>
                                        </xp:button>

Nothing written in the log. Am hoping someone might have some suggestions.

 

Thanks,

 

Cameron

May 18, 2016, 8:21 AM
589 Posts
hmmm

I'd be interested in you posting the complete code...  not just the button and variants.  

 

For instance, I've seen an eventhandler get attached to the main xp:view tag by accident. That has broken buttons from working.

 

That's all I can think of at the moment.  You say nothing is written to the log... which to me imply's the server console log.nsf.  The other thing to make sure to check is to go into debug mode on your browser and see if there's anything showing in that log.  An unexpected error there could break buttons from working.

 

Good Luck

 

 

May 18, 2016, 6:09 PM
42 Posts
Solved it

Hi David,

 

Thanks for the reply. As per usual, walk away from something and it clears your head. Was the ordering of a couple of Javascript libraries. Changed the order and now it's working.

 

Cameron


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.