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

navCommandLink works different: partialResponse #501

Closed
ghost opened this issue Sep 8, 2016 · 14 comments
Closed

navCommandLink works different: partialResponse #501

ghost opened this issue Sep 8, 2016 · 14 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Sep 8, 2016

Using navCommandLink that way:

<h:form>
  <b:navBar fluid="true">
    <b:navbarLinks pull="left">
      <b:navCommandLink active="#{myBean.active}" action="#{myBean.toPage}" value="page" />
    </b:navbarLinks>
  </b:navBar>
</h:form>

gives me that response:

<?xml version="1.0" encoding="UTF-8"?>
<partial-response id="j_id__v_0">
<changes>
<update id="javax.faces.ViewRoot">
<![CDATA[<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
...

Why do I not get a complete new page as response as when I use

<b:commandButton action="#{myBean.toPage}" value="page" />

? This is what I would expect...
The problem is, that after getting the partial response, all my b:panel objects do not toggle anymore, so sth. gets damaged on that partial response thing. Is there a way to make the navCommandLinks return a complete page instead of a partial response (didn't find an attribute for that now)?

@MitchTalmadge
Copy link
Contributor

I think if you want it to redirect you need to add <redirect /> to your navigation case in faces-config.xml... see here: https://www.mkyong.com/jsf2/jsf-page-forward-vs-page-redirect/

I'm not entirely sure this is the problem but try it out at least

@stephanrauh
Copy link
Collaborator

You could also try to set ajax="false". If that doesn't work, I'd consider it a bug.

@ghost
Copy link
Author

ghost commented Sep 20, 2016

@MitchTalmadge: no, I didn't want to redirect, I just wanted to get a complete html page as answer to my request as the commandButton does.

@stephanrauh: confirmed this behaviour as a bug. I added ajax="false" attribute to all my navCommandButtons:

<b:navBar fluid="true">
  <b:navbarLinks pull="left">
    <b:navCommandLink action="#{...}" active="#{...}" value="#{...}" ajax="false" />
    ...
  </b:navbarLinks>
</b:navBar>

but the answer is still a partial response like that:

<?xml version="1.0" encoding="UTF-8"?>
<partial-response id="j_id__v_0">
<changes>
<update id="javax.faces.ViewRoot">
<![CDATA[<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="viewport" content="width=device-width, initial-scale=1"/>

navBar and navbarLinks do not have an ajax attribute to deactivate partial response, do they?

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Oh, I forgot to mention... this is about bootsfaces 0.9.1 from maven...

        <dependency>
            <groupId>net.bootsfaces</groupId>
            <artifactId>bootsfaces</artifactId>
            <version>0.9.1</version>
        </dependency>

@stephanrauh
Copy link
Collaborator

stephanrauh commented Sep 20, 2016 via email

@ghost
Copy link
Author

ghost commented Sep 20, 2016

Ok, I thought that way. But navCommandLink does support ajax="false" and an action attribute, but it gives back a partial response anyway. What else do you expect from me (as status is still in waiting for user answer)? As I've written above, this seems to be a bug...

@stephanrauh
Copy link
Collaborator

This noon, I used the e-mail interface to answer to your last comment, so I couldn't update the tags. Currently, we don't need further information from you. It's just that I didn't carry my laptop to lunch, so I had to use the tiny cell phone keyboard.

@ghost
Copy link
Author

ghost commented Sep 21, 2016

Ok, thanks for the information.

@ghost
Copy link
Author

ghost commented Oct 18, 2016

so far there has been no post here for about a month... can I assist in anything to help you find the bug and reduce the time until it is fixed?

@stephanrauh
Copy link
Collaborator

Yes, that would be nice. You can clone the BootsFaces-OSP repository and import it as a Maven project to your IDE. After that, you can debug BootsFaces. Most likely, the bug is in the class NavLinkRenderer. The AJAX implementation itself is very difficult, but I don't think you need to debug the AJAXRenderer, so that shouldn't be a problem. I suppose the problem is we call the AJAXRenderer even in the non-AJAX mode.

@ghost
Copy link
Author

ghost commented Oct 20, 2016

created a pull request (#528) with the part of the code that I suppose to be responsible for the bug. But after all, I'm still not sure with that and would like you to have a look at it.

@stephanrauh stephanrauh added this to the v1.0.0 milestone Oct 21, 2016
@stephanrauh
Copy link
Collaborator

The page http://showcase.bootsfaces.net/layout/navigationAndAJAX.jsf is broken with the source code version of BootsFaces.

@stephanrauh
Copy link
Collaborator

This bug has been solved by Jottyfans's PR #528 and the latest bugfix #534.

@ghost
Copy link
Author

ghost commented Oct 31, 2016

I can confirm that in current release 0.9.2-SNAPSHOT this bug is resolved. Great work, thanks a lot!

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

No branches or pull requests

3 participants