• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JBoss Seam - JSF clear

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!

 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 :)
 
reply
    Bookmark Topic Watch Topic
  • New Topic