Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b:dropMenu and b:navCommandLink behavior after action executed. #522

Closed
edugarciagt opened this issue Oct 11, 2016 · 4 comments
Closed

b:dropMenu and b:navCommandLink behavior after action executed. #522

edugarciagt opened this issue Oct 11, 2016 · 4 comments

Comments

@edugarciagt
Copy link

Hi, I started using BootFaces a few weeks ago. My question is why after clicking a navCommandLink (inside a dropMenu) and executing the action (JSF action), the entire dropMenu gets unavailable?

In order to make it available again, I have to click another navCommandLink (outside dropMenu), and then the dropMenu works again...

Here is my testing code:

<?xml version="1.0" encoding="UTF-8" ?>
<f:view xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:b="http://bootsfaces.net/ui"
    xmlns:f="http://java.sun.com/jsf/core">
    <h:form style="padding: 0; margin: 0; background-color:silver">
        <b:container fluid="true">
            <b:navBar inverse="true" brandHref="#" fluid="true" rendered="#{empty login.company? false : true}" style="padding: 0; margin: 0;"
                >
                <b:navbarLinks  >
                    <b:navCommandLink href="#"  value="Inicio" iconAwesome="home" action="home" />
                    <b:dropMenu id="fin" value="Financiero">
                        <b:dropMenu id="books" value="Libros">
                            <b:navCommandLink href="#" value="Diario" tooltip="Diario" action="journal" update="@form" />
                            <b:navCommandLink href="#" value="Mayor" tooltip="Mayor" action="ledger"/>
                            <b:navCommandLink href="#" value="Balance" tooltip="Balance General" action="balancesheet" />
                            <b:navCommandLink href="#" value="Resultados" tooltip="Estado de Resultados" action="incomestatement" />
                            <b:dropMenu value="Auxiliares">
                                <b:navCommandLink href="#" value="Bancos" tooltip="Bancos" action="banks" />
                            </b:dropMenu>
                        </b:dropMenu>
                        <b:navLink />
                        <b:navCommandLink id="acc" value="Cuentas" tooltip="Catálogo de Cuentas" action="accounts" />
                        <b:navCommandLink id="yrs" value="Periodos" tooltip="Periodos Fiscales" action="periods" />
                    </b:dropMenu>
                    <b:navCommandLink href="#" value="Ventas" action="sales" />
                    <b:navCommandLink href="#" value="RRHH" action="hhrr" />
                    <b:navCommandLink href="#" value="Operaciones" action="operations" />
                </b:navbarLinks>
            </b:navBar>
        </b:container>
    </h:form>
</f:view>

Which is included in a page by the use of ui:include tag as follows:

<b:row> 
    <ui:insert name="topmenu">
        <ui:include src="top_menu.xhtml" />
    </ui:insert>
</b:row>

Environment:
JDK 1.8 (OpenJDK)
BootFaces-OSP-0.9.1
MyFaces 2.2
TomEE Plume - 1.7.4
Browsers:
Mozilla Firefox 49
Google Chrome 53.0.2785.143

@edugarciagt edugarciagt changed the title b:dropMenu and b:navCommandLink behaviour after action executed. b:dropMenu and b:navCommandLink behavior after action executed. Oct 11, 2016
@TheCoder4eu
Copy link
Owner

We couldn't reproduce your bug, so I'm not sure my answer solves the problem, but I spot two things that are a bit odd:

  • If you provide an action, you don't need the href="#" bit. It's simply ignored if there's an action.
  • The action is meant to be an EL expression. It seems to work in your case, too, but the generated code is inefficient. Plus, it generates an AJAX request due to a bug (navCommandLink works different: partialResponse #501). Try replacing it with a non-AJAX <b:navLink />:
<b:navLink href="forms/blockUI.xhtml" value="Bancos" tooltip="Bancos" />

or

<b:navLink href="forms/blockUI.jsf" value="Bancos" tooltip="Bancos" />

@edugarciagt
Copy link
Author

I'm going to give it a try. I will post the results , it could help someone else. Thank you!!

@stephanrauh
Copy link
Collaborator

@edugarciagt Did our hints help you?

@stephanrauh
Copy link
Collaborator

Let's close the issue. We can re-open it if someone shows us how to reproduce the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants