Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Illegal Model Reference

843844Jul 18 2007 — edited Jul 31 2007
Hi! I have this problem, I get "Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.briteId}'." everytime I try to submit.

The jsf page that araises this problem has a form that is supposed to edit data stored in a database. The message above appears for all form items.

The form looks like this:

<h:form id="details">
<h:panelGrid rendered="#{outboundBean.dataItem.meldingstype == 'CertificateIssuedNotification'}" columns="2" columnClasses="header, noStyle, noStyle">
<h:outputText value="#{bundle['Date']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value="#{outboundBean.dataItem.date}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value="#{outboundBean.dataItem.date}" id="date"/>
<h:outputText value="#{bundle['Id']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value="#{outboundBean.dataItem.localId}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value="#{outboundBean.dataItem.localId}" readonly="true" id="id"/>
<h:outputText value="#{bundle['BriteId']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.briteId}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.briteId}" id="briteId"/>
<h:outputText value="#{bundle['CompanyType']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.companyType}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.companyType}" id="companyType"/>
<h:outputText value="#{bundle['CompanyREID']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.companyREID}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.companyREID}" id="companyREID"/>
<h:outputText value="#{bundle['CompanyName']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.companyName}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.companyName}" id="companyName"/>
<h:outputText value="#{bundle['NewBRId']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.newBRId}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.newBRId}" id="newBRId"/>
<h:outputText value="#{bundle['OldBRId']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.oldBRId}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.oldBRId}" id="oldBRId"/>
<h:outputText value="#{bundle['CertificateDocRef']}" styleClass="header"/>
<h:outputText rendered="#{outboundBean.dataItem.status == 'Sent'}" value=" #{outboundBean.dataItem.certificateDocRef}"/>
<h:inputText rendered="#{outboundBean.dataItem.status != 'Sent'}" value=" #{outboundBean.dataItem.certificateDocRef}" id="certificateDocRef"/>
<h:commandButton rendered="#{outboundBean.dataItem.status != 'Sent'}" action="#{outboundBean.newCertificateIssuedNotification}" value="Register"/>
</h:panelGrid>
</h:form>

OutboundBean is the managed bean, dataItem is a reference to a datastorage class, and briteId etc. reffers to the getters and setters in this class.

The form gets filled out, so the getters works. But if I try to submit, the errormessages appears.

"Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.briteId}'. Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.oldBRId}'. Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.newBRId}'. Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.companyName}'. Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.companyREID}'. Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.certificateDocRef}'. Illegal Model Reference in this context for expression ' #{outboundBean.dataItem.companyType}'."

For some reason, "date" and "localId" gives no errormessage. All values in this form is String.

I use JSF 1.1, Servlet 2.4 and JSP 2.0, if this matters.

Somebody have an idea how I can solve this problem? I've tried google and searching this forum, without any luck.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2007
Added on Jul 18 2007
8 comments
160 views