on 01-12-2007 9:40 PM
we created a form and delpoyed in Portal. It has two pages. in the first page user will enter the info and once it submit, they will get conformation. in that there is one more button to RETURN, click on it it will go back to portal.
My problem is if the user did not click on the RETURN button, adn they will close the window. Next time user click on the ivew, they are getting the Conformation Page, not the initial page. How can we correct it. every time user click on the iview, it will come with the initial page.
here is the some of the coding part
private void ensureBeanIsSetup(String type) {
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentSession session = request.getComponentSession();
ILogger logger = PortalUtils.getLogger();
// reset any bean value just to make sure.
bean = null;
Object o = session.getValue(BEAN_KEY);
if (o instanceof FSIeLearningClassRoomRequestBean) {
bean = (FSIeLearningClassRoomRequestBean) o;
}
if (bean == null) {
// no bean or probably wrong class.
// We simply instantiate a new bean and put
// it into the session
bean = new FSIeLearningClassRoomRequestBean();
bean.setFormState(INITIAL_STATE);
UserInformation.getUserInformation(bean,(IPortalComponentRequest) this.getRequest());
session.putValue(BEAN_KEY, bean);
}
}
************************************
public void doProcessBeforeOutput() throws PageException {
ILogger logger = PortalUtils.getLogger();
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentSession session = request.getComponentSession();
switch (bean.getFormState()) {
case INITIAL_STATE:
setJspName("FSIeLearningClassroomRequest.jsp");
break;
case ANOTHER_STATE:
setJspName("Confirmation.jsp");
break;
}
}
***************************************************
public void onSendButtonClicked(Event event) throws PageException {
ILogger logger = PortalUtils.getLogger();
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentSession session = request.getComponentSession();
UserInformationBean bean = (UserInformationBean)session.getValue(BEAN_KEY);
String senderEmailAddress = null;
getUserData(this,bean,"");
if(validateUserData(bean,""))
{
String emailContent = getEmailContent(bean, "type");
sendEmail(bean.getEmailAddress(),
"a@b.com",
"eLearing class room request form submission",
emailContent);
bean.setFormState(ANOTHER_STATE);
/*sendEmail(bean.getEmailAddress(),
bean.getEmailAddress(),
"eLearing class room request form submission",
emailContent);
bean.setFormState(ANOTHER_STATE);
*/
}
else
{
bean.setFormState(INITIAL_STATE);
}
logger.severe(" error occured : "+bean.getError());
session.putValue(BEAN_KEY, bean);
}
Hi ttpala,
Instead of setting the pagestatus to the bean and retrieving it in
doProcessBeforeOutput()
Take another variable and declare it to
PAGE_STATUS = INITIAL_STATE; //set INITIAL_STATE to be default value
before the doInitialization()
Now change the PAGE_STATUS variable in ur methods and set the PAGE_STATUS in the bean.
Make these changes... (condition)
public void doProcessBeforeOutput() throws PageException {
ILogger logger = PortalUtils.getLogger();
IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
IPortalComponentSession session = request.getComponentSession();
switch (PAGE_STATUS) {
case INITIAL_STATE:
setJspName("FSIeLearningClassroomRequest.jsp");
break;
case ANOTHER_STATE:
setJspName("Confirmation.jsp");
break;
}
}
hope it helped
Swathi
Pls offer points:-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hello ttpala,
it seems that you only have 2 states, INITIAL and ANOTHER. since the user had
already been to the INITIAL state, it will stay on the ANOTHER state from there on.
try adding another state and transit to this state when your session had ended after
the conformation. this way when the conformed user returns, your userstate will be
your 3rd state, and you can redirect him to the portal.
hope this helps.
jo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.