• Post Reply Bookmark Topic Watch Topic
  • New Topic

JBoss Seam - JSF clear

 
Danny Jackson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm unable to clear a list that is defined as a @Factory list:

List is defined as:
@Factory(value = "manualReconRemitRemarks1", scope = ScopeType.CONVERSATION)

Reference in xhtml is:
<h:selectManyListbox size="8" id="remCode" required="false" value="#{manualReconClaim.entity.remitCode}" style="width:500px;" >
<f:selectItems id="sel1"

value="#{manualReconSelections.manualReconRemitRemarks1}"/>


</h:selectManyListbox>


The list "manualReconRemitRemarks1" is created dynamically and is not attached to a bean. The containing Java class is defined as @Scope(SESSION).

After the page is submitted and updates have been made I've set the containing bean to null along with
clearing all of the attached items.

When the user navigates back to the initial page the list is still visible on the old page. How can I elegantly clear this @Factory(value = "manualReconRemitRemarks1", scope = ScopeType.CONVERSATION) value (there are 4 more of them also)?

I am using JSF 1.2, RichFaces 3.1.1 and JBoss Seam 1.2 and cannot upgrade at this time.

Any help is greatly appreciated!

 
Tim Holloway
Bartender
Posts: 18414
58
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've edited your title in the hopes that a JBoss Seam fan will see it and offer help. I'm afraid I never really got involved with Seam myself.

Contrary to what you said, your SelectItem list is attached to a bean (manualReconSelections). Since you're limited to JSF version 1, there's no View scope and I'm presuming that the factory does whatever magic it does when that bean is first created. So to clear the item, you'll either need some sort of magic Seam command, or you'll have to ensure that the old instance of manualReconSelections is destroyed and a new one is created, thus re-invoking the Factory. View Scope would make that automatic, but since you don't have that option, you're just going to have to grab the FacesContext, use that to get the HttpSession object and forcibly remove manualReconSelections from the session. I outsource that sort of work to my "JSFUtils" bean so that I can just say "JSFUtils.removeBean("manualReconSelections");"
 
Danny Jackson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks - I was afraid I was going to have to do something like what you suggested. Will give it a shot :)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!