click on left menu

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

20 May 2020, 16:28

Hi, how can i click on a ultima left menu item using javascript ?
I'd like to put a button on my page which causes the click on a certain submenu item which contians menuitems

thanks
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

17 Jun 2020, 10:13

Please try;

Code: Select all

<script type="text/javascript">
//<![CDATA[
    function onSampleButtonClick() {
        var sampleLink = $(PrimeFaces.escapeClientId('menuform:um_sample')).children('a');
        sampleLink.trigger('click');

        var href = sampleLink.attr('href');
        if(href && href !== '#') {
            window.location.href = href;
        }
    }
//]]>
</script>


<p:commandButton value="Sample" oncomplete="onSampleButtonClick()"></p:commandButton>

spadovan
Posts: 178
Joined: 05 Jun 2013, 12:04

17 Jun 2020, 10:18

Thanks a lot !
Simolne
Primefaces 12.0.2, Wildfly 24.0.1, JDK 11

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

23 Jun 2020, 14:31

You're welcome!

Best Regards,

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest