<p>In a JSP page, I created a <code>&lt;h:form enctype="multipart/form-data"&gt;</code> with some elements: <code>&lt;t:inputText&gt;</code>, <code>&lt;t:inputDate&gt;</code>, etc. Also, I added some <code>&lt;t:message for="someElement"&gt;</code> And I wanted to allow the user upload several files (one at a time) within the form (using <code>&lt;t:inputFileUpload&gt;</code> ) At this point my code works fine.</p>

<hr>

<p>The headache comes when I try to put the form inside a <code>&lt;t:panelTabbedPane serverSideTabSwitch="false"&gt;</code> (and thus of course, inside a <code>&lt;t:panelTab&gt;</code> )  </p>

<p>I copied the structure shown in the source code for TabbedPane example from <a href="http://www.irian.at/myfacesexamples/tabbedPane.jsf" rel="nofollow noreferrer">Tomahawk's examples</a>, by using the <code>&lt;f:subview&gt;</code> tag and putting the panelTab tag inside a new jsp page (using <code>&lt;jsp:include page="somePage.jsp"&gt;</code> directive)</p>

<p>First at all, the <code>&lt;t:inputFileUpload&gt;</code> fails to load the file at the value assigned in the Managed Bean UploadedFile attribute <code>#{myBean.upFile}</code></p>

<p>Then, <a href="http://markmail.org/message/b4nht4f6xb74noxp" rel="nofollow noreferrer" title="That has no answer when I readed it">googling for a clue</a>, I knew that <code>&lt;t:panelTabbedPane&gt;</code> generates a form called "autoform", so I was getting nested forms. Ok, I fixed that creating the <code>&lt;h:form&gt;</code> out of the <code>&lt;t:panelTabbedPane&gt;</code> and eureka! file input worked again! (the autoform doesn't generate)  </p>

<p>But, oh surprise! oh terrible Murphy law! All my <code>&lt;h:message&gt;</code> begins to fail. The Eclipse console's output show me that all <code>&lt;t:message&gt;</code> are looking for nonexistents elements ID's (who have their ID's in part equals to they are looking for, but at the end of the ID's their names change)</p>

<p>At this point, I put a <code>&lt;t:mesagges&gt;</code> tag (note the "s" at the end) to show me all validation errors at once at the beginning of the Panel, and it works fine. So, validation errors exists and they show properly at the beginning of the Panel.</p>

<p>All validation error messages generated in this page are the JSF built-in validation messages. The backing bean at this moment doesn't have any validators defined.</p>

<h3>¿How can I get the <code>&lt;t:message for="xyz"&gt;</code> working properly?</h3>

<hr>

<p>I'm using Tomahawk-1.1.6 with myFaces-impl-1.2.3 in a eclipse Ganymede project with Geronimo as Application Server (Geronimo gives me the myFaces jar implementation while I put the tomahawk jar in the WEB-INF/lib folder of application)  </p>

<hr>

<h2>"SOLVED": This problem is an issue reported to myFaces forum.</h2>

<p>Thanks to Kyle Renfro for the soon response and information. (Good job Kyle!)
<a href="https://issues.apache.org/jira/browse/MYFACES-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12567158#action_12567158" rel="nofollow noreferrer">See the issue</a></p>

<hr>

<p><strong>EDIT 1</strong></p>

<p>1.- Thanks to Kyle Renfro for his soon response. The forceID attribute used inside the input element doesn't works at first time, but doing some very tricky tweaks I could make the <code>&lt;t:message for="xyz"&gt;</code> tags work.</p>

<p>What I did was:<br>
1. Having my tag <code>&lt;inputText id="name" forceId="true" required="true"&gt;</code> The <code>&lt;t:message&gt;</code> doesn't work.<br>
2. Then, after looking the error messages on eclipse console, I renamed my "id" attribute to this: &lt;inputText id="<strong>namej_id_1</strong>" forceId="true" required="true"&gt;<br>
3. Then the <code>&lt;t:message&gt;</code> worked!! but after pressing the "Submit" button of the form the second time. ¡The second time! (I suspect that something is going on at the JSF lifecycle)<br>
4. This implies that the user have to press 2 times the submit button to get the error messages on the page.<br>
5. And using the "j_id_1" phrase at the end of IDs is very weird.  </p>

<hr>

<p><strong>EDIT 2</strong></p>

<p>Ok, here comes the code, hope it not be annoying.</p>

<p>1.- <strong>mainPage.jsp</strong> (here is the <code>&lt;t:panelTabbedPane&gt;</code> and <code>&lt;f:subview&gt;</code> tags)  </p>

<pre><code>&lt;%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%&gt;  
&lt;%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%&gt;  
&lt;%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%&gt;  
&lt;html&gt;  
&lt;body&gt;  
&lt;f:view&gt;  
&lt;h:form enctype="multipart/form-data"&gt;  
&lt;t:panelTabbedPane serverSideTabSwitch="false" &gt;  

            &lt;f:subview id="subview_tab_detail"&gt;  
                &lt;jsp:include page="detail.jsp"/&gt;  
            &lt;/f:subview&gt;  

        &lt;/t:panelTabbedPane&gt;  
    &lt;/h:form&gt;  

&lt;/f:view&gt;  
&lt;/body&gt;  
&lt;/html&gt;  
</code></pre>

<p><br />
2.- <strong>detail.jsp</strong> (here is the <code>&lt;t:panelTab&gt;</code> tag)  </p>

<pre><code>&lt;%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%&gt;  
&lt;%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%&gt;  
&lt;%@ taglib prefix="t" uri="http://myfaces.apache.org/tomahawk"%&gt;  

&lt;t:panelTab label="TAB_1"&gt;  
        &lt;t:panelGrid columns="3"&gt;  
            &lt;f:facet name="header"&gt;  
                &lt;h:outputText value="CREATING A TICKET" /&gt;  
            &lt;/f:facet&gt;  

            &lt;t:outputLabel for="ticket_id" value="TICKET ID" /&gt;  
            &lt;t:inputText id="ticket_id" value="#{myBean.ticketId}" required="true" /&gt;  
            &lt;t:message for="ticket_id" /&gt;  

            &lt;t:outputLabel for="description" value="DESCRIPTION" /&gt;  
            &lt;t:inputText id="description" value="#{myBean.ticketDescription}" required="true" /&gt;
            &lt;t:message for="description" /&gt;  

            &lt;t:outputLabel for="attachment" value="ATTACHMENTS" /&gt;  
            &lt;t:panelGroup&gt;  
                &lt;!-- This is for listing multiple file uploads --&gt;  
                &lt;!-- The panelGrid binding make attachment list grow as the user inputs several files (one at a time) --&gt;  
                &lt;t:panelGrid columns="3" binding="#{myBean.panelUpload}" /&gt;  
                &lt;t:inputFileUpload id="attachment"  value="#{myBean.upFile}" storage="file" /&gt;  
                &lt;t:commandButton value="ADD FILE" action="#{myBean.upload}" /&gt;  
            &lt;/t:panelGroup&gt;  
            &lt;t:message for="attachment" /&gt;  

            &lt;t:commandButton action="#{myBean.create}" value="CREATE TICKET" /&gt;  
        &lt;/t:panelGrid&gt;  
&lt;/t:panelTab&gt;  
</code></pre>

<hr>

<p><strong>EDIT 3</strong></p>

<p>On response to Kyle Renfro follow-up:</p>

<blockquote>
  <p>Kyle says:</p>
  
  <blockquote>
    <p>"At the first view of the page, if you press the "CREATE TICKET" button with nothing in any of the inputTexts and no files uploaded, do the message tags work for the inputTexts? (ie. required = true) I'm just curious if the messages for the inputTexts are working but the message for the inputFileUpload is not."  </p>
  </blockquote>
</blockquote>

<p>Here is the behavior found:<br>
1.- There is no validation error messages shown at all (the message tags don't work) Even when I try to test only one validation error message (for example, testing the message for the first input text) none of them shows up.<br>
2.- The eclipse console shows me these internal errors:  </p>

<pre><code>ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'ticket_id' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_5j_id_1'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.  
ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'description' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_8j_id_1'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.  
ERROR [HtmlMessageRendererBase] Could not render Message. Unable to find component 'attachment' (calling findComponent on component 'j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_14j_id_1'). If the provided id was correct, wrap the message and its component into an h:panelGroup or h:panelGrid.  
</code></pre>

<p>Here is when I saw the <code>"j_id_1"</code> word at the generated IDs, for example, for the id "ticket_id":  </p>

<pre><code>j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:j_id_jsp_1716158401_5j_id_1
</code></pre>

<p>And, viewing the resulting HTML generated page, I saw that the IDs names are like this (whitout using "ForceId" atribute): </p>

<pre><code>&lt;input id="j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:ticket_idj_id_1" name="j_id_jsp_1383779881_1:subview_tab_detail:j_id_jsp_1716158401_0j_id_1:ticket_idj_id_1"&gt;  
</code></pre>

<hr>

[{'answer_id': 72243, 'author': 'Kyle Renfro', 'author_id': 8187, 'author_profile': 'https://Stackoverflow.com/users/8187', 'pm_score': 1, 'selected': False, 'text': '<p>The <em>forceId</em> attribute of the tomahawk components should solve this problem.</p>\n\n<p>something like:</p>\n\n<pre><code>&amp;lt;t:outputText id="xyz" forceId="true" value="#{mybean.stuff}"/&amp;gt;\n</code></pre>\n\n<p>At the first view of the page, if you press the "CREATE TICKET" button with nothing in any of the inputTexts and no files uploaded, do the message tags work for the inputTexts? (ie. required = true)  I\'m just curious if the messages for the inputTexts are working but the message for the inputFileUpload is not. </p>\n'}, {'answer_id': 115177, 'author': 'Kyle Renfro', 'author_id': 8187, 'author_profile': 'https://Stackoverflow.com/users/8187', 'pm_score': 1, 'selected': True, 'text': '<p>Looks like it may be related a bug in myfaces. There is a newer version of myfaces and tomahawk that you might try.  I would remove the subview functionality as a quick test - copy the detail.jsp page back into the main page.</p>\n\n<p><a href="https://issues.apache.org/jira/browse/MYFACES-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12567158#action_12567158" rel="nofollow noreferrer">https://issues.apache.org/jira/browse/MYFACES-1807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&amp;focusedCommentId=12567158#action_12567158</a></p>\n'}]
['https://Stackoverflow.com/questions/66912', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9818/']