Uploaded image for project: 'MyFaces CODI'
  1. MyFaces CODI
  2. EXTCDI-275

The possibility of show an error message in the @InitView method when the page load for the first time

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.4
    • 1.0.5
    • None
    • JDK 7u3, JEE6, Glassfish 3.1.2, CODI 1.0.4, Mojarra 2.1.6,
      Netbeans 7.1.1, Windows 7, Google Chrome,

    Description

      How can i show an error message when the page load for the first time, this only work if i go to another page and back to the original (this) then the message in index.xhml show.

      This only work's in the second request!!!

      @Named(value="myBean")
      @ViewAccessScoped
      @Model
      @View(Index.class)
      public class MyBean implements Serializable{
      @InitView
      public void init()

      { //do something if something its wrong then: FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "msg", "msg detail")); }

      Thanks.

      Email by Gerhard Petracek

      hi jose,

      since we need an initial redirect to add the window-id to the url, you
      don't see it on the very first page which is displayed in a window (because
      you only see the result of the 2nd request).
      please file a jira issue. for now you can provide a custom implementation
      of JsfModuleConfig and override #isInitialRedirectEnabled to change the
      default behaviour.

      regards,
      gerhard

      Attachments

        Activity

          People

            gpetracek Gerhard Petracek
            maxtorzito José Luis Cetina (maxtorzito)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: