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

tabs damage usage of file upload #855

Closed
ghost opened this issue Sep 5, 2017 · 4 comments
Closed

tabs damage usage of file upload #855

ghost opened this issue Sep 5, 2017 · 4 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Sep 5, 2017

verified behavior in version 1.1.3 of bootsfaces:

import javax.servlet.http.Part;

@ManagedBean
@SessionScoped
public class MyBean {
  private Part file;
  public Part getFile() {
    return this.file;
  }
  public void setFile(Part file) {
    this.file = file;
  }
  public String upload() {
    if (file == null) {
      FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("file is null"));
    }
  }
}
<b:tabView>
  <b:tab title="damaged">
    <h:form enctype="multipart/form-data">
      <h:inputFile value="#{myBean.file}" />
      <b:commandButton action="#{myBean.upload}" value="upload" />
    </h:form>
  </b:tab>
</b:tabView>

produces a "file is null" message, while

<b:panel title="undamaged">
  <h:form enctype="multipart/form-data">
    <h:inputFile value="#{myBean.file}" />
    <b:commandButton action="#{myBean.upload}" value="upload" />
  </h:form>
</b:panel>

doesn't crash. Therefore, using tabs with file uploads is not possible yet.

@stephanrauh
Copy link
Collaborator

Just double-checking: tabs complain a lot if you don't put them inside a form tag (at least in the developer stage). Did you do so? In other words: does your program nest two forms into each other?

@ghost
Copy link
Author

ghost commented Sep 5, 2017

Simply take the examples, there is no form in a form. I've even tried it with b:form, but the error still is the same.

I want to have a form inside of multiple tabs, therefore, a h:form outside of the tabView is no solution.

@stephanrauh
Copy link
Collaborator

The bug is a side effect of #807. I've uploaded a new version of BootsFaces-1.2.0-SNAPSHOT to Maven Central. As usual, see #369 on how to get it. Would you mind to run a test and confirm the bug has been fixed?

@stephanrauh stephanrauh self-assigned this Sep 12, 2017
@stephanrauh stephanrauh added this to the v1.2.0 milestone Sep 12, 2017
@ghost
Copy link
Author

ghost commented Sep 12, 2017

Yes, with version 1.2.0-SNAPSHOT, the bug is fixed. Thanks for the fast solution, looking forward to see 1.2.0 soon. 👍

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

1 participant