6 Replies Latest reply on May 6, 2009 7:33 AM by Waqas Arshad

    FacesMessage(s) have been enqueued, but may not have been di

    Waqas Arshad Novice

      Can't able to see the error message on the screen rather its printing on the console, saying:

      FacesMessage(s) have been enqueued, but may not have been displayed
      I used:

      <h:message for="r_mgmt_form"></h:message>
      


      if(this.getHours().equals("")) {
       context = FacesContext.getCurrentInstance();
       FacesMessage message = new FacesMessage("Hours missing for "+ sel_date);
       context.addMessage("r_mgmt_form", message);
       this.deleteUsrc();
       return;
       }//end if
      


        • 2. Re: FacesMessage(s) have been enqueued, but may not have bee
          Waqas Arshad Novice

          is it use in the same way as h:message? Can't we do that using h:message?

          • 3. Re: FacesMessage(s) have been enqueued, but may not have bee
            Nick Belaevski Master

            How does "r_mgmt_form" look like? Please post full page code.

            • 4. Re: FacesMessage(s) have been enqueued, but may not have bee
              Waqas Arshad Novice

               

              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
              <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
              <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
              <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
              
              <html xmlns="http://www.w3.org/1999/xhtml">
              <head>
              <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
              <title>C-Track4ECS-Create Supplement for Regular Timesheet</title>
              <link rel="stylesheet" href="css/menucss.css" type="text/css" />
              <link rel="stylesheet" href="css/menucss1.css" type="text/css" />
              <link rel="stylesheet" href="css/fontcss.css" type="text/css" />
              <script type="text/javascript" src="js/menujs.js">
              </script>
              
              <script type="text/javascript">
               function continue_change(name, path)
               {
               document.getElementById(name).src = path;
               }//continue_change()
               function continue_back(name, path)
               {
               document.getElementById(name).src = path;
               }//continue_back()
              
               function add_row_change()
               {
               document.getElementById('r_mgmt_form:add_row').src = "images/add_btn-2.jpg";
               }//add_row_change()
               function add_row_back()
               {
               document.getElementById('r_mgmt_form:add_row').src = "images/add_btn-1.jpg";
               }//add_row_back()
              
              </script>
              </head>
              
              <body bgcolor="#1E2E32" >
              <f:view>
              <f:loadBundle basename="tsheet.messages.message" var="message"/>
              <h:form id="r_mgmt_form" rendered="true">
              <table width="845" height="596" border="0" align="center" cellspacing="0" cellpadding="0">
               <tr>
               <td height="84" colspan="3" align="center" valign="top"><table width="930" height="64" border="0" cellspacing="0" cellpadding="0">
               <tr>
               <td height="45" width="423" rowspan="2" bgcolor="#000000"><img src="images/interface_without-tabs_03.jpg" width="423" height="84" /></td>
               <td height="23" width="495" bgcolor="#1E2E32" class="header">
               <script language=javascript src="js/today.js">
               </script>
               <script language=javascript>
               document.write(today);
               </script>
               <br /><br />Welcome: <%= session.getAttribute("user") %> (<%= session.getAttribute("emp_desig") %>)
               </td>
               <td height="24" width="12" rowspan="2"><img src="images/banner_right_end.jpg" width="11" height="84" /></td>
               </tr>
               <tr>
               <td width="535" height="38" align="right" bgcolor="#F6FBFE" ><a href="menu.faces"><img src="images/home_icon.jpg" alt="Home" border="0"/></a>  <h:commandLink type="button" id="logout" action="#{logOff.logout}" immediate="true"><h:graphicImage alt="Logout" value="images/logout_icon.jpg" style="border: 0"></h:graphicImage></h:commandLink></td>
               </tr>
               </table></td>
               </tr>
               <tr>
               <td width="4" rowspan="2" background="images/bar_left.jpg"></td>
               <td width="914" height="47" valign="middle" >
               <jsp:include page="menuMaster.jsp" />
              
               <script type="text/javascript">
               //dolphintabs.init("ID_OF_TAB_MENU_ITSELF", SELECTED_INDEX)
               dolphintabs.init("dolphinnav", 2)
               </script>
               </td>
              
               <td width="12" height="40" bgcolor="#F6FBFE" ><img src="images/bar_right_menu.bmp" height="62" width="12"/></td>
               </tr>
               <tr>
               <td height="434" align="center" valign="top" bgcolor="#F6FBFE"><p> </p>
               <table width="897" height="376" border="0" align="center">
               <tr>
               <td width="14" valign="top" align="left"> </td>
               <td width="858" valign="top" align="center">
               <table width="852" height="132" border="0" class="body" bordercolor="#F6FBFE" cellpadding="0" cellspacing="0">
               <tr>
               <td colspan="4" class="heading" align="center">CREATE MANAGEMENT TIMESHEET</td>
               </tr>
               <tr>
               <td colspan="4"> </td>
               </tr>
               <tr class="body_effect">
               <td colspan="4" class="table_heading"> SHEET INFORMATION</td>
               </tr>
               <tr class="body_effect">
               <td colspan="4"> </td>
               </tr>
               <tr align="left" class="body_effect">
               <td width="113">Date</td>
               <td width="322" class="error">
               <h:outputText id="head_date" value="#{CreateMgtTsheet.sheet_date}"/>
               <h:inputHidden value="#{CreateMgtTsheet.sheet_date}"/>
               </td>
               <td width="110" >
               Name </td>
               <td width="307" class="error">
               <h:outputText id="head_name" value="#{CreateMgtTsheet.sheet_name}"/>
               <h:inputHidden value="#{CreateMgtTsheet.sheet_name}"/>
               </td>
               </tr>
               <tr align="left" class="body_effect">
               <td width="113">UUID</td>
               <td width="322" class="error">
               <h:outputText id="head_uuid" value="#{CreateMgtTsheet.sheet_uuid}"/>
               <h:inputHidden value="#{CreateMgtTsheet.sheet_uuid}"/>
               </td>
               <td width="110" >
               RC Code</td>
               <td width="307" class="error">
               <h:outputText id="head_rc_code" value="#{CreateMgtTsheet.sheet_rc}"/>
               <h:inputHidden value="#{CreateMgtTsheet.sheet_rc}"/>
               </td>
               </tr>
              
               <tr align="left" class="body_effect">
               <td width="113">Week Starting<br /></td>
               <td width="322" class="error">
               <h:outputText id="head_wk_starting" value="#{CreateMgtTsheet.week_starting}"/>
               <h:inputHidden value="#{CreateMgtTsheet.week_starting}"/>
               </td>
               <td width="110" >Week Ending<br /></td>
               <td width="307" class="error">
               <h:outputText id="head_wk_ending" value="#{CreateMgtTsheet.week_ending}"/>
               <h:inputHidden value="#{CreateMgtTsheet.week_ending}"/>
               </td>
               </tr>
              
               <tr align="left">
               <td height="19"> </td>
               <td class="error">
               </td>
               <td> </td>
               <td> </td>
               </tr>
               </table>
               <table id="main_table" width="855" height="77" border="0" cellpadding="0" cellspacing="0" bordercolor="#F6FBFE" class="body">
               <tr class="body_effect">
               <td width="92" class="record_table_heading"> Abesent Status</td>
               <td width="97" class="record_table_heading"> Day</td>
               <td width="76" class="record_table_heading"> Hours</td>
               <td width="83" class="record_table_heading"> Symbol</td>
               <td width="96" class="record_table_heading">Job No </td>
               <td width="95" class="record_table_heading"> Cost Code </td>
               <td width="92" class="record_table_heading"> Eq Code </td>
               <td width="224" class="record_table_heading"> Remarks</td>
               </tr>
               <tr>
               <td colspan="8"> </td>
               </tr>
              
               <tr>
               <a4j:region selfRendered="true" id="mgmt_data">
               <td class="record_table">
               <h:selectBooleanCheckbox id="absent_report" value="#{CreateMgtTsheet.absent_report}"> </h:selectBooleanCheckbox> </td>
               <td class="record_table" >
               <h:selectOneMenu id="day" value="#{CreateMgtTsheet.t_date}" styleClass="text_body" required="true">
               <f:selectItems value="#{CreateMgtTsheet.date_list}"/>
               </h:selectOneMenu>
               <t:saveState id = "day_state1" value="#{CreateMgtTsheet.t_date}" />
               <t:saveState id = "day_state2" value="#{CreateMgtTsheet.date_list}" /> </td>
               <td class="record_table">
               <h:inputText id="hours1" styleClass="text_body" size="5" maxlength="5"
               value="#{CreateMgtTsheet.hours}"></h:inputText></td>
               <td class="record_table">
               <h:selectOneMenu id="symbol1" value="#{CreateMgtTsheet.symbol}" styleClass="text_body" required="true">
               <f:selectItems value="#{PopulateInfo.symbol_list}" />
               </h:selectOneMenu> </td>
               <td class="record_table">
               <h:selectOneMenu id="job_no" value="#{CreateMgtTsheet.job_no}" styleClass="text_body" >
               <f:selectItems value="#{PopulateInfo.job_no_list}" />
               <a4j:support event="onchange" reRender="cost_code1, eq_code1"
               action="#{CreateMgtTsheet.updateList}"/>
               </h:selectOneMenu> </td>
               <td class="record_table">
               <h:selectOneMenu id="cost_code1" value="#{CreateMgtTsheet.cost_code}" styleClass="text_body" >
               <f:selectItems value="#{CreateMgtTsheet.cost_code_list}"/>
               </h:selectOneMenu>
               <t:saveState value="#{CreateMgtTsheet.cost_code_list}"/>
               <t:saveState value="#{CreateMgtTsheet.cost_code}"/> </td>
               <td class="record_table">
               <h:selectOneMenu id="eq_code1" value="#{CreateMgtTsheet.eq_code}" styleClass="text_body" >
               <f:selectItems value="#{CreateMgtTsheet.eq_code_list}"/>
               </h:selectOneMenu>
               <t:saveState value="#{CreateMgtTsheet.eq_code}"/>
               <t:saveState value="#{CreateMgtTsheet.eq_code_list}"/> </td>
               <td class="record_table">
               <h:selectOneMenu id="remarks1" value="#{CreateMgtTsheet.remakrs}" styleClass="text_body" >
               <f:selectItems value="#{PopulateInfo.remarks_list}" />
               </h:selectOneMenu> </td>
               </a4j:region>
               </tr>
              
               <td colspan="8" align="center" class="error">  </td>
               </tr>
               <tr class="body_effect">
               <td colspan="2" align="left">  </td>
               <td colspan="6" align="right">
               <a4j:commandButton id="update"
               image="images/create_manager_timesheet_bt.gif"
               onmouseover="continue_change('r_mgmt_form:update', 'images/create_manager_timesheet-11.gif')"
               onmouseout="continue_back('r_mgmt_form:update', 'images/create_manager_timesheet_bt.gif')"
               action="#{CreateMgtTsheet.createMgmt}"
               reRender="hours1, day, symbol1, cost_code1, eq_code1, remarks1, job_no,
               absent_report" />
               <a href="menu.faces" > <img id="cont" src="images/exit_btn-1.jpg"
               onmouseover="continue_change('cont', 'images/exit_btn-2.jpg')"
               onmouseout="continue_back('cont', 'images/exit_btn-1.jpg')" border="0"/></a> </td>
               </tr>
              
               <tr >
               <td colspan="8" align="center" class="error">
               <h:message id= "mgmt_form_error_msg" for="r_mgmt_form"></h:message>
               </td>
               </tr>
               </table>
               </td>
               <td width="11"> </td>
               </tr>
               </table>
               <p> </p>
               </td>
               <td background="images/bar_right.bmp"> </td>
               </tr>
               <tr>
               <td height="30" colspan="3" valign="top" bgcolor="#1E2E32" class="footer">© 2006
               C-Track for ECS. All Rights Reserved.</td>
               </tr>
              </table>
              </h:form>
              </f:view>
              </body>
              </html>
              


              • 5. Re: FacesMessage(s) have been enqueued, but may not have bee
                Ilya Shaikovsky Master

                in order to make h:message works properly with a4j components you should wrap it to output panel with ajaxRendered=true ..
                Or just replace it with rich:message. It not differs from standard message component by default.. Just extended to be properly updated via ajax.

                • 6. Re: FacesMessage(s) have been enqueued, but may not have bee
                  Waqas Arshad Novice

                  thanks problem resolved with rich message