on 07-31-2008 12:16 AM
Hi,
Can somebody share a sample program for the following scenario -
Pass values and display values in a new window, basically using the function window.open(); Appreciate it.
Regards,
V M.
Hi VM,
Here is the sample program for your scenario -
1. Pass values through URL
window.open ("http://" + Servername + "/xyz/abc.htm?"var1"-"var2"-"+var3,"","width=300,height=200");
hyphen symbol("-") is a separator for the values of var1, var2 and var3.
2. From parent window
opener.document.Appletname.getGridObject().getSelectedCellValue();
Regards,
Anil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are passing a value via the URL (ie, http://<servername>/mypage.irpt?MYURLPARAM=somevalue)
then on the popup irpt page, just reference the "somevalue" in squrily braces ( )
My popup window shows up but its not displaying the values. Can somebody tell me what might be wrong? I have the following set up in my JavaScript -
Parent -
function JCOCall1(f){
var Confirmation = f.txtCode1.value;
window.open("ProductionOrderConfirmations-2.htm?"+Confirmation,"new");
}
Popup -
function JCOCall(){
document.GetDataApplet1.getQueryObject().setParam(1, "{Confirmation}");
if(document.GetDataApplet1.executeCommand()) {
document.frmConfirmation.SAPSuccess1.value = document.GetDataApplet1.getFirstValue("OperationQuantity")
document.frmConfirmation.SAPSuccess2.value = document.GetDataApplet1.getFirstValue("QuantityConfirmed")
document.frmConfirmation.SAPSuccess3.value = document.GetDataApplet1.getFirstValue("QuantityScrapped")
}
}
Thanks,
V M.
here is some details for the web scripting:
DataQuery getQueryObject()
Obtains a reference to the underlying query object that supplies data to the applet. Once a reference is obtained, its properties can be manipulated.
void refresh()
Updates the query to the current time and redraws the applet.
void setPropertyValue(String propertyName, String newValue)
Sets a named value that can be accessed by any applet during the browser session. Once the browser is closed, the value is no longer available. This can be used to create properties that can be passed between Web pages. For example, if you select a batch on one Web page, a new Web page with a detailed list of the materials consumed in the batch could appear. The batch number could be placed in a session parameter on the main page and picked up by the dialog box. These properties can also be used to pass values to SAP xApp Manufacturing Integration and Intelligence (SAP xMII) reports.
String getPropertyValue(String propertyName)
Gets a named value that was set using the setPropertyValue method. This value can be used to set the applet.
void showDetail()
Displays an HTML page in which the raw data associated with the current applet is displayed in a table.
void showHelp()
Displays the applet help.
void saveAsCSVFile()
Initiates a transfer of the raw data associated with the current chart to a local CSV file.
void showXMLDetail()
Displays an HTML page that contains an XML view of the raw data associated with the current applet.
void showDetailUsingGet()
Displays an HTML page in which the raw data associated with the current applet using HTML Get is displayed in a table.
String saveImage()
Gets the URL reference to the GIF representation of the image displayed by the applet; it is only supported by iGrid, iChart, and iSPCChart.
void showStatistics()
Displays an HTML page that contains the statistical metrics associated with the chart. It is only available when the underlying query is from a Tag connector.
void showCurrent()
Displays an HTML page that contains the values associated with the chart. It is only available when the underlying query is from a Tag connector.
boolean getSelectionEventEnabled()
void setSelectionEventEnabled(boolean newValue)
Gets and sets the property that enables a selection event on an applet. This method enables or disables the event through Web page scripting.
boolean getUpdateEventEnabled()
void setUpdateEventEnabled(boolean newValue)
Gets and sets the property that enables an update event on an applet. This method enables or disables the event through Web page scripting. You can use it to synchronize the scrolling of multiple applets.
Object createColor(String strColor)
Controls colors at runtime. The value of the strColor parameter can be a color name or an HTML color string in the format #RRGGBB. The returned color object can be assigned to a color property in an applet.
String colorToString(Color cColor)
Controls colors at runtime. A color property of an applet property can be converted to a string and used in HTML.
String encodeURLItem(String strItem)
Takes a string as an input and the URL encodes the string so it can be passed over the URL command line. The returned string has spaces and other unrecognized attributes replaced with URL codes.
String formatDate(String strDate, String fromFormat, String toFormat)
Reformats date/time strings. The parameters include the incoming date/time string, the incoming format (so the string can be properly parsed), and the outgoing format. The resulting date/time string is returned.
String formatNumber(double dValue, String sFormat)
Returns a string for the value in the specified format.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi, v m
i suppose ur case a in the xmii, and if it is
so u can just code like this:
YourApplet.setPropertyValue("value",var);
and when window.open() is executed, u can get the value like this:
YourApplet.getPropertyValue(var);
have a nice day
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you are working on an xMII session, you can first set the values as sessions variables from parent window and then fetch them back on the new window.
Else if, you just want to pass it through javascript, you can add the values as the url parameters. For example, the url in window.open() would look like something like this -
http://localhost/MyPage.html?variable1=value1&variable2=value2
Hope it helps.
Regards,
Ankit Jain.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.