2 Replies Latest reply: Jul 10, 2012 12:51 PM by Lars Hedman RSS

Seam 2.3 migration - problem with f:converter as s:convertEntity workaround

Lars Hedman Newbie

Hi,

I am working on converting a seam 2.2 application to seam 2.3 (CR1-SNAPSHOT). I'm having trouble with the proposed workaround for s:convertEntity (JBOSS-4955). I use the converters in an conversational context. This is my (simplified code) where I replaced s:convertEntity with f:converter:

 

<h:form>

   <h:inputText value="#{article.bid}"/>

   ...  

   <h:selectOneMenu value="#{article.articleGroup}">

      <s:selectItems value="#{allArticleGroups.resultList}" var="ag"

                     label="#{ag.bid} #{ag.name}"

                     noSelectionLabel="Please select article group"/>

      <!--s:convertEntity/-->

      <f:converter converterId="org.jboss.seam.ui.EntityConverter"/>

   </h:selectOneMenu>

   ...

   <h:commandButton action="#{articleManager.cancelEdit()}"

                    immediate="true"

                    value="Cancel"/>

   <h:commandButton action="#{articleManager.update()}"

                    value="Save"/>

</h:form>

 

This code is working in Seam 2.2 ( both with s:convertEntity and f:converter ). When used in Seam 2.3 the page loads but when the form is posted ( both update AND cancelEdit ) I get the following error:

 

17:22:03,452 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (http--127.0.0.1-8080-1) /core/_articlePanel_e.xhtml @17,74 value="#{article.bid}": Target Unreachable, identifier 'article' resolved to null: javax.el.PropertyNotFoundException: /core/_articlePanel_e.xhtml @17,74 value="#{article.bid}": Target Unreachable, identifier 'article' resolved to null

 

The component 'article' is still present in the conversation scope which I can verify in the dubug.seam page. If I remove the f:converter tag ( so there is no converter at all ) the 'cancelEdit' call will work as expected and the 'update' call will not generate the above error either ( but of course give a data validate error ).

 

So there is a problem when f:converter is present. I do not understand the root cause of this, but the effect seems to be that the conversation scope is left so that the conversation scoped components are not reachable.

 

I'm grateful for all help with this.