Hi,
(In the following text, I am abbreviating Baccking Bean as BB)

 A JSF- Trinidad page (Page1.jsp, BB = Page1BB.java) has to be opened in a 
dialog. The page contains of a tr:outputText- id="txt", BB binding="txt". In 
its getter method  we have to set the value of the component  from an 
attribute-"ConfirmMsg" from the PageFlowScope.
 
If attribute's  value is found not null, then it is set on the component 
txt(say - msg1), otherwise a default value (say- msg2) is set on the 
component-txt.

After the value has been set, the attribute-"ConfirmMsg" is removed from the 
pageFlowScope as following:
RequestContext.getCurrentInstance().getPageFlowScope.remove("ConfirmMsg");

Within the same BB  (Page1BB) there is a static method which contains the code 
for programmatically
 launching the dialog of the same page whose BB it is.

Now another jsp page has two command buttons - submit and cancel , whose action 
methods are submitAction and cancelAction respectively.

In cancelAction I am calling the static method of Page1BB to launch a dialog 
containing Page1.jsp. As well as I am setting an attribute -"ConfirmMsg", in 
the PageFlowScope as following:
RequestContext.getCurrentInstance().getPageFlowScope.put("ConfirmMsg",msg1);

In submitAction, I am calling the static method of Page1BB to launch a dialog 
containing Page1.jsp. But I am not setting any attribute on PageFlowScope.

Step 1. Initially on clicking on "submit" a dialog is launched, which contains 
the default message-msg2. On returning from the dialog and Then on clicking on 
"cancel" again a dialog is launched with the message provided in 
PageFlowScope(msg1). 
Now in Page1BB, this attribute had been removed after its value was set on the 
component in
 the dialog.
Step 2. After returning again if we click on "submit" (not sending any params 
this time) the content in the dialog should be the default message (msg2) But 
it is coming as msg1- the value of the attribute that was removed.

However, if we clear the PageFlowScope inside the action method of the return 
button in the dialog page(by which we are returning from the dialog) then 
repeat steps 1 and 2 we get msg2 as desired in the dialog.

What might be the reason for this? Help please.

Thanks,
Dushyant
Then on clicking  on 




      Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Reply via email to