cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh page or refresh frame

Former Member
0 Kudos

Hello all,

I have the following installed:

Client 7.0 SP14

MAM 3.0 SP4 P8

I have a screen with 2 frames on it. The first one is the standard equipment detail and the second one is a customized edit screen.

On the customized edit screen I have a button "Save". When pushed the application had to do some business logic and in case of error the frame must be refreshed, otherwise an other screen must be shown. (Refresh page). How can this be realized?

This is the code which I now use for the button, but it always refreshed the page. If I use the commented line (framename) it always refresh the frame:


	<% {
	String js = helper.genericEventURL(
	new String[]{"onSaveZEquipMeasureDocs"}, 
//	new String[]{"ZEquipMeasureDocs"}, 
	new String[]{"page"}, 
	new String[][]{new String[]{}}, 
	new String[][]{new String[]{}});
	%>

TIA

Patrick Willems

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Patrick,

First of all, I hope you are using the screen generator to do this enhancement. This is the recommended way and the most effective. I am guessing the edit frame is showing perfectly and the save button reaches your controller.

Once it reaches the controller, you should do you logic and have 2 different forward for your error page and your success page. You should always refresh the frame.

One jsp is displaying the error. I am guessing this is also pretty straightforward.

Second jsp is reloading the main page using a javascript. You can find this javascript in mam_ie5.js:

/**
 * This function is called by default to navigate from
 * one page to another. It means that the provided event
 * in the url will be fired to the main page, hence the
 * whole screen will be refreshed. The inputs of all frames
 * will be collected.
 *
 * Since this is the default function, it has to handle the
 * special popup case: when an event is fired from a popup, 
 * it means that by default, it should be fired to the caller 
 * frame and not to the main page. If a popup wants to fire 
 * an event to the main page, it must uses the navigateAll 
 * function.
 *
 * @param url The url containing the event. Used to refresh
 *            the page. 
 */
function navigateTop(url) {
	if (url.indexOf("searchEvent") != -1 && isInPopupContainer()) {
		return navigatePopup(url);
	}
	var callerFrame = getCallerFrame();
	var tmp = collectPageInput(false);
	
	if (callerFrame != null && isInPopupContainer()) {
	    top.urtlMapi_PopupWindow_Close('popup_picker');
	    submitEvent(callerFrame.document,url,tmp);
		top.document.getElementById('iframepicker').src = top.applicationURL + '/blank.jsp';
	}
	else{
	    submitEvent(top.document,url,tmp);
	}
}

For examples of this, you can look at the error page (which does similar thing when a single frame is in error, the page refresh with the error) and the install/dismantle equipment frame.

Thank you,

Julien.

msc mobile Canada.

Former Member
0 Kudos

Hello Julien and others,

I have read your answer and I understand what you say, but I can't find the piece of code where the call to reloading is done.

I hope someone can put me in the right direction or even better where this piece of code is and how to use it.

Regards,

Patrick Willems

Former Member
0 Kudos

Hello Patrick,

What is the piece you are missing? You only have to have a JSP that will load in the frame and call this javascript which in return will reload the entire page.

You have to create your JSP and have the javascript executed:

using the on load=" navigate To(...)" of the body

or s imple script tag in the body

Julien.

Edited by: Julien Guimont on Oct 10, 2008 9:15 PM

Answers (0)