-
1. Re: prolblem with actionListener
andygibson.contact.andygibson.net Apr 29, 2008 7:38 PM (in response to bard123)I think what you are saying is that when you go to page 2, the button caption is fine, but when you click the button or open the popup, the button caption goes blank?
It appears that your button caption is being set from a stateless bean. When page2 is re-rendered, the stateless bean appears to have lost the value it had originally, probably because it is stateless.
It seems you need to keep the name of the button in a longer running scope, rather than returning it from a stateless bean.
One way you can do it is to outject the value with a longer scope :
i.e.
@Stateless @Name("gestionDocument") public class GestionDocumentBean implements GestionDocument{ // Variables d'instance // Variable pour le changer le // nom du bouton soit creer soit modifier @Out("buttonName",scope=ScopeType.Conversation) private String nomBoutonCreerDocument; // les getters et les setters ...
Then in your page, you can simple refer to
<ice:commandButton value="#{buttonName}" style="width:90px;" actionListener="#{gestionTypeTag.openPopup}"> </ice:commandButton>
The context variable, once it has been outjected from your stateless session bean, will be re-used on each page rendering depending on the scope used.
Cheers,
Andy Gibson
-
2. Re: prolblem with actionListener
bard123 Apr 30, 2008 9:31 AM (in response to bard123)Hi,
thank you for your answers, in fact that I @Stateless to each query there is a new instantiation of my variable. Suddenly, I created a class without @Stateless but with @Scope(ScopeType.SESSION), and first seen, it works
thank you