Yes, I would agree with Andrew: you should make sure that none of your
"binding" expressions point to session-scoped beans. Bindings to
anything that is not request-scoped has nasty effects.
I would also agree with Andrew that c:if is best avoided. Some of the
issues with c:if have been fixed in JSF1.2, but not all. Setting a
rendered flag is much safer.
The fact that you cannot find "j_id401" in your html source is no
surprise. Every JSF component must have an id (unique within a
naming-container), but not every component needs to render an html "id"
attribute. In this case, the error message shows that the problem id is
associated with an HtmlSimpleColumn component, which does not cause any
id to be rendered.
Regards,
Simon
Andrew Robinson schrieb:
Does it happen only on post-back?
Do you have any bound components? If so, have you made sure they are
all request scope?
-Andrew
On Tue, Sep 16, 2008 at 2:35 PM, dearkamesh
<[EMAIL PROTECTED]> wrote:
Yes,
i have replaced the c:if with <h:panelGrid rendered="true">, but still it
comes.
Also i'm surprised that that id it says as duplicated "j_id401" is not at
all there in the view source.
Not sure where this has come from..
Please let me know if anyone has any idea about this problem.
Andrew Robinson-5 wrote:
Does it still happen if you remove the c:if?
On Tue, Sep 16, 2008 at 1:31 PM, dearkamesh
<[EMAIL PROTECTED]> wrote:
Hi,
i'm using myfaces 1.2.3, tomahawk 1.1.6 and facelets 1.1.14
Getting the following error while using selectBooleanCheckbox under
t:dataTable as below.
This happens when i submit the form with clicking the checkbox and submit
the form. Please let me know if any solution. Thanks
<c:if test="${sarSubject.sarSubjectUpdate}">
<t:htmlTag value="div" styleClass="tablePagingControl">
<table cellspacing="0" cellpadding="0"
width="100%">
<tr>
<td><t:dataTable
id="subjectDetails"
styleClass="recordSetTable" headerClass="resultSetTableHeader"
rowClasses="cellDataAltRow,cellDataFirstRow"
renderedIfEmpty="false"
var="row" preserveDataModel="false"
binding="#{sarSubject.sarsList.data}"
value="#{sarSubject.sarsList.rows}"
rows="#{sarSubject.sarsList.numOfRowsToDisplay}"
sortColumn="#{sarSubject.sarsList.sortColumn}"
sortAscending="#{sarSubject.sarsList.sortAscending}"
preserveSort="true"
disabled="#{!sarSubject.editable}">
<t:column
styleClass="resultSetTableCells">
<h:selectBooleanCheckbox id="chk2"
binding="#{sarSubject.includeOnSARComponent}"
immediate="true" value="#{row.includeSubjectOnSarForm}"
valueChangeListener="#{sarSubject.updateSubjectsOnSar}"
disabled="#{!sarSubject.editable or (!row.suspectIndicator and
row.relationshipId!=2899)}"
onchange="formIsChanged();" />
<f:facet
name="header">
<t:commandSortHeader columnName="subjectOnSar" arrow="true"
actionListener="#{sarSubject.sortChanged}" immediate="true"
styleClass="cellDataHeader">
Include On SAR
</t:commandSortHeader>
</f:facet>
</t:column>
</tr>
</table>
</t:htmlTag>
</c:if>
java.lang.IllegalStateException: Client-id : j_id401 is duplicated in the
faces tree. Component : sarViewForm:subjectDetails:j_id401, path:
{Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
/sarView.xhtml][Class: javax.faces.component.html.HtmlForm,Id:
sarViewForm][Class: org.apache.myfaces.custom.div.Div,Id: myDiv][Class:
javax.faces.component.html.HtmlPanelGrid,Id: j_id104][Class:
org.apache.myfaces.custom.htmlTag.HtmlTag,Id: j_id121][Class:
org.apache.myfaces.component.html.ext.HtmlDataTable,Id:
subjectDetails][Class:
org.apache.myfaces.custom.column.HtmlSimpleColumn,Id:
j_id401]}
--
View this message in context:
http://www.nabble.com/Duplicate-ID-error-in-using-myfaces-and-facelets-tp19518814p19518814.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.
--
View this message in context:
http://www.nabble.com/Duplicate-ID-error-in-using-myfaces-and-facelets-tp19518814p19520062.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.