Popup window by javax.script. API, help
Hello All,
anybody did something like
<h:commandButton id="errorpage" action="#{bean.errorPage}" value="Error Page" />
public void errorPage() {
try {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("JavaScript");
StringBuilder scriptCode = new StringBuilder();
scriptCode.append("window.open('/error.faces', 'popupWindow', 'height=400'," +
"'width=500'," +
"'dependent=yes', " +
"'menubar=no'," +
" 'toolbar=no');");
engine.eval(scriptCode.toString());
} catch (Exception exception) {
exception.printStackTrace();
} I would like open popup window after some action generated in managed bean.
but I see some exception
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
also tryed but the same error
public void errorPage() {
try {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("JavaScript");
String win2 = "/error.jsf" + "Window2" + "width=310"+ "height=600"+ "scrollbars=yes";
engine.put("x", win2);
engine.eval("window.open(x)");
//engine.eval("onclick='window.open('/error.jsf', 'popupWindow', 'height=400','width=500','dependent=yes', 'menubar=no','toolbar=no');'");
} catch (Exception exception) {
exception.printStackTrace();
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
Similar Messages
-
Javax.script API maintaing the javascript vars
Hi All,
First is this the correct forum for javax.script questions? I can't find another....
Is there a way to maintain the state of a global javascript variable between calls?
I have a CompiledScript instance which I keep. I call eval once and then at various times I call functions in the javascript. The script has:
var a = 10;
at the top. When call a function can changes to var a be maintained between calls?also tryed but the same error
public void errorPage() {
try {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("JavaScript");
String win2 = "/error.jsf" + "Window2" + "width=310"+ "height=600"+ "scrollbars=yes";
engine.put("x", win2);
engine.eval("window.open(x)");
//engine.eval("onclick='window.open('/error.jsf', 'popupWindow', 'height=400','width=500','dependent=yes', 'menubar=no','toolbar=no');'");
} catch (Exception exception) {
exception.printStackTrace();
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "window" is not defined. (<Unknown source>#1) in <Unknown source> at line number 1
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:110)
at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:124)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247) -
Close the ADF popup window from deployed JSP in other server
I am attempting to open jsp page which one is deployed on tomcat server in adf pop up window from cmd button event.and this first jsp will forward to second jsp and i should able to close from pop window from second jsp close button.
This is what i did:
1) created pop-up window and run the delployed jsp on pop up page
2) i used window.close script in second jsp but not popup window is not get closed .
help me to achieve this pblm ....i was trying to open &close other server's jsp from ADF pop-up window ... so base is internal window (pop-up) only ,
and already i used onclick="window.close();" in command button...but its not closeing the adf pop-up window ... how that jsp cmd button onclick event take control of adf pop-up to close ?
help me ??? -
Apologies if this isn't the right place for this question, but I can't see a more appropriate forum.
I have some classes that use the Mozilla Rhino API for invoking javascript, and I was planning to upgrade this to use the new javax.script classes in Java 6. However, there's one particular feature that seems to be missing.
In Rhino, you invoke JS functions through the Function class (See http://www.mozilla.org/rhino/apidocs/org/mozilla/javascript/Function.html). This has a method construct() which invokes a JS function that has been implemented as a constructor, and returns the new JS object.
I can't find an equivalent method in the javax.script API. Am I missing something? Or was this feature deliberately left out because the new API is designed to be more general purpose, and support langauges that don't have constructors?
Thanks,
AlasdairIf it was me I wouldn't get all excited just because it seems like the java API implements something that previously required a third party library.
I know that when initially the logging api showed up I thought log4j would never be needed again. That was until I actually looked at what the logging api provided. It wasn't close. So sticking with log4j was and still is by far the better choice.
Besides the actual API you might also note that as the first version that it is more likely to have bugs than a third party library that has been around for a while. -
Hi, has anyone done an example where you are at a page, say Page1.jsp that has a text box and a button, when you click on the button a javascript popup window must open(Page2.jsp). Page2.jsp has a text box and a button. The user will enter a value in the text box and when they click the button it must close the popup window and populate the text box on Page1.jsp with the value entered on Page2.jsp.
Is this possible in JSF, I have tried but it doesn't work. On the popup windoow botton I have javascript code that saves the value in the session, submits the parent page and then closes the popup window.
On the parent page init, I look for the value saved in the session var and set the textbox's text to it. When I read the value of the text box, it is right but on the screen the value does not show up at all,
Does anyone have any idea, I can't seem to understand at all what could be wrong here.Hi,
You can use this code:
1. in the parent form you have a button and a text field named "textCallClass".
2. in the popup window you have listbox and a button.
When the button on the popup window is clicked, the selected list item is returned.
In you popup window, button on_click :
<script>
function handleOK() {
var myform = document.forms[0];
var listControl = myform['form1:listboxID'];
var openerField = window.opener.document.getElementById("form1:textCallClass");
if (listControl.selectedIndex == -1) {
alert ("Please select an item from the list !");
return false;
else {
openerField.value = listControl.options[listControl.selectedIndex].value;
window.close();
</script>In the parent form, button on_click:
function handleCallClassPopup() {
window.open("CallClassLookup.jsp", "Lookup", "width=250,height=300");
}A better way is to use the SessionBean to store and retrieve the data.
Catalin Florean. -
Is there a way to influence the size of popup windows? I am
developing help that will be displayed in a narrow panel, and
popups get to be ridiculously narrow. It seems that the autosizing
algorithm prioritizes tall over wide, so that a pupup topic that
fits in the help display without scrollbars doesn't use as much
width as it could. The width is extended as a last resort if the
amount of text would otherwise demand a scrollbar. I would like the
popups to be only a little narrower than the main window regardless
of the text amount.GEWB,.
Thanks. A bit of elaboration:
I make extensive use of popups to display screen shots in a
separate window so the user can browse help and go from topic to
topic without necessarily navigating in the parent application at
the same time. I also make the guide available in our DocWeb
library as a standalone guide, so the user can read it with the
parent application closed.
Sometimes the popup window contains a fair amount of text in
a subtopic that the user may need to read only once and never
summon again. He or she has the option of ignoring that popup link
on returning to the topic. It's the same principle as a Glossary
definition. The link is there, but once you read it, why bother if
you can remember it from last time?
I haven't used dropdowns much, but as I recall they appear in
the topic pane and push text down until they are dismissed. Useful,
yes, but they wouldn't accomplish my purpose for popups.
I looked through ehlpdhtm.js, which primarily serves IE. It
figures out the autosize dimensions on the fly, and performs the
dhtml effect on text, such as flying in and out, but
Firefox/Mozilla/NS don't use dhtml effects.
I can't find a place in ehlpdhtm.js where (if it's in this
file) the default popup window is sized (it's about 300 px wide by
150 px high).
BSSCDHTM.JS doesn't appear in WebHelp output. Much of it is
similar to the other js file. I have no idea how it's used. The RH
help topic on output files mentions ehlpdhtm.js, but there is no
reference to bsscdhtm.js.
Is it possible that ehlp... replaced bssc.. and bssc... never
was removed from the RH code? Or is bssc... perhaps used in
generating html help?
If it's in some dll file, I can't fiddle with it, unless you
can tell me how to edit and save a dll file without destroying its
dll file type. DHTMLFX.DLL has a lot of code that looks similar to
the two .js files, but I can't find the default size. That's why I
thought perhaps the non-ie browsers have a built-in default when
the html code doesn't specify a custom size.
I'm content with the workaround, using custom sizes for all
popup windows, unless a real developer (of which I am not one) can
help figure this out.
Thanks again.
Harvey -
Streaming data on a page or popup window.
I am creating a web application that will be spying on another application. I establish a socket connection between my web application and this other remote system. I send over a spy request from the web application and this other system starts sending over it's console data over the socket connection.
Is there a blog or a tutorial that will show how to create a page that will display the streaming data in real time as it happens? Any help would be greatly appreciated. Ideally I would like this to happen in a popup window, but will take whatever help anyone will give me.
Thanks in advanceHi There,
Im not aware of one at this time, I guess AJAX is the right way to go, but
Creator will be EOLed soon, Netbeans is the latest version of Creator. Pls post your question on NB mailing lists at http://www.netbeans.org/community/lists/top.html for better response.
Thanks
K -
How to disable in java script - a popup window
the below code works for enabledisable of the text box , but now the text box is a popup window, how do i refer to that, please help' Doug
function enableDisable(pValue)
if (pValue == '/')
document.getElementById("P4_END_ITEM_DESC").disabled = false;
else
document.getElementById("P4_END_ITEM_DESC").disabled = true;
footer
<script language="JavaScript">
enableDisable(document.getElementById('P4_END_ITEM_DESC').value);
</script>
onBlur="javascript:enableDisable(this.value); "Hi,
The popups are constructed differently from normal page items so are a bit more complicated to disable.
Try something like:
function disablePOPUP()
var r = html_CascadeUpTill('P1_ITEMNAME', 'FIELDSET');
var img = r.getElementsByTagName('IMG');
var i = r.getElementsByTagName('INPUT');
i[0].disabled = true;
img[0].style.visibility = 'hidden';
}Note that this disables the input field but hides the icon
Andy -
hi experts,
Can u send me a step by step procedure to create a pop up window in a screen.
I gone thro the example pgms, but i couldn't exactly how to start my things.
if u can able to send me a step by step procedure it will be of great help to me.
Regards...
Arun.Hi Arun,
Firstly, create the new window say ('POPUP') that you would like to display as a popup under your Web Dynpro Component. Embed the required views on it.
Now, lets say you have a button in a view of the current window, on click of which, you would like the popup to open. In the action handler of the button, type in the following -
DATA lo_window_manager TYPE REF TO if_wd_window_manager.
DATA lo_api_component TYPE REF TO if_wd_component.
DATA lo_window TYPE REF TO if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
lo_window = lo_window_manager->create_window(
window_name = 'POPUP'
message_display_mode = if_wd_window=>co_msg_display_mode_selected
close_button = abap_true
button_kind = if_wd_window=>co_buttons_ok
message_type = if_wd_window=>co_msg_type_none
default_button = if_wd_window=>co_button_ok
lo_window->open( ).
Here, you first get the window manager from the api, then create a window with the name 'POPUP' and then open that popup.
Regards,
Neha
<i><b>PS: Reward if helpful</b></i> -
Help with Flex based popup windows and data population.
Hello, I need a bit of help with Flex popups. I have a flex
application that uses a popup window when you click on a button and
displays information about the image above the button the user
clicked. I have about 4 images and I need to be able to display
information about each of them through the popup window when users
click on the buttons below the image.
At this time, I am trying to do this from somewhat of a
"static" point of view because I do not believe my hosting company
supports Flex Data services. You will find my code below.
First File.
<?xml version="1.0" encoding="utf-8"?>
<!--Application Initialization -->
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" width="850" height="750"
cornerRadius="10" borderColor="#000000"
backgroundGradientColors="[#1b3434, #000000]">
<!-- Popup-->
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
[Bindable]
private var win:IMSAI;
private function init():void{}
private function createPopup():void{
win=IMSAI(PopUpManager.createPopUp(this,IMSAI,true));
win.title = 'IMSAI.Net';
win.x = -500;
win.y = 0;
customMove.end();
customMove.play();
]]>
</mx:Script>
<mx:Style>
TitleWindow {
borderStyle:solid;
borderThickness:2;
</mx:Style>
<mx:Parallel id="customMove" target="{win}">
<mx:Move duration="2000" xTo="{(stage.width - win.width)
/ 2}" yTo="{(stage.height - win.height) / 2}" />
<mx:WipeDown duration="2000" />
</mx:Parallel>
This is the code to trigger the popup when a user clicks on
the button. The code below is the code for the popup.
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical" creationComplete="init()"
close="PopUpManager.removePopUp(this)"
showCloseButton="true" alpha=".8"
headerColors="[#000000,#1F3F62]" color="#FFFFFF"
minHeight="200" minWidth="300"
backgroundColor="#000000" title="IMSAI.net" width="520"
height="394" verticalAlign="middle" horizontalAlign="center">
<mx:Script>
<![CDATA[
import mx.managers.PopUpManager;
private function init():void{}
]]>
</mx:Script>
<mx:Canvas width="470" height="338">
<mx:Image x="10" y="10" width="140" height="103">
<mx:source>file:///C|/ColdFusion8/wwwroot/IMSAI/Web-App/Site_Images/IMSAI
Final Movie.swf</mx:source>
</mx:Image>
<mx:Text x="10" y="121" text="Description:" width="75"
height="25" fontWeight="bold" color="#ff0000"/>
<mx:Text x="158" y="10" text="Client:" width="52"
height="28" fontWeight="bold" color="#ff0000"/>
<mx:Text x="196" y="10" text="IMSAI Microcomputers
& Fischer-Freitas Company" width="252" height="39"/>
<mx:Text x="159" y="46" text="Industry:"
fontWeight="bold" color="#ff0000"/>
<mx:Text x="216" y="46" text="Computer &
Microcontroller Manufacturing." width="232" height="35"/>
<mx:Text x="83" y="121" text="IMSAI.net is the front-end
web application for IMSAI Computer " width="355"/>
<mx:Text x="10" y="136" text="manufacturing, customer
support, and order processing. Driven by a Microsoft database
back-end, this application includes rich flash forms, site search
capabilities, and flash content. Currently under phase II of a
three phase development plan, the e-commerce logic and processing
capabilities are under development. Once finished, this application
will be able to process orders provide customers with instant order
confirmation numbers, shipment dates, and payment processing."
width="428"/>
<mx:Text x="10" y="244" text="Technologies:"
fontWeight="bold" color="#ff0000"/>
<mx:Image x="100" y="244" width="50" height="50">
<mx:source>file:///C|/ColdFusion8/wwwroot/Sapphire
Development/content/cf8icon.jpg</mx:source>
</mx:Image>
<mx:Image x="244" y="244" width="50" height="50">
<mx:source>file:///C|/ColdFusion8/wwwroot/Sapphire
Development/content/flashlogo.jpg</mx:source>
</mx:Image>
<mx:Text x="53" y="290" text="Coldfusion 8 Enterprise"
height="30"/>
<mx:Text x="230" y="290" text="Adobe Flash 8"/>
</mx:Canvas>
What I want to do is either be able to create a popup file
for each button and photo, or find a way to pass a name like a
button ID that corresponds to a XML data structure and then
provides the appropriate data for the photo. I have tried altering
the first page of code with the "public" declaration to allow for a
second popup file for each button and image, but the IDE won't
allow me to do such because it creates errors stating I can only
have one public declaration of the kind and function above per
application. Help resolving this would be greatly appreciated.
Thank you.I have an idea of what I want to do. I am just having
difficulty articulating how to go about such. I know I want to find
a way so that if a user clicks on button 1, button 1 will send some
kind of variable. For example, a user clicks Btn1 under a picture.
Btn1 sends some kind of variable or binding to a data structure
which returns the picture's description, price, etc. and calls the
popup to display that data in a form like manner. Then the user
click Btn2 which does the same thing. The only purpose of the popup
is to display the data.
Do I create a data structure with a related name to say a
button name so when the btn is clicked, the a variable title btn1
will prepend itself to the data structure like
{btn1.imagename}
{btn1.price}
{btn1.description}.
I want each btn to call a different set of data about each
picture because right now, the code I have is allowing me multiple
buttons, but is just displays the popup. Is there a way to create a
separate popup window for each button? Thats seems as though it
would be easier. Thank you for your help. -
Need help with a popup window problem
I have this code within my certAppB.js page :
function AppSubmit() {
str1 = "Submitting this form will begin the approval process.";
str2 = "You will not be able to come back to this form to edit it again.";
str3 = "Do you want to continue submitting this form?";
if((confirm(str1 + "\n" + str2 + "\n" + str3))){
document.forms[0].status.value="Submitted";
document.forms[0].submit();
Which produces a popup windows that says:
Submitting this form will begin the approval process
You will not be able to come back to this form to edit it again
Do you want to continue submitting this form?
OK Cancel (these are 2 buttons)
I want to change this to say:
Submitting this form will begin the approval process. You will not be able to change this form once submitted. You also agree that the following statement is true and correct to the best of your knowledge and belief:
"I, [User Name], hereby certify and state on behalf of [Company Name] that the energy use data contained on this form are accurately determined and stated in accordance with federal test procedures set forth in 10 CFR Part 430 or 431, or 42U.S.C.�6314, as applicable, including authorized waivers, as they currently exist on [Date]."
Do you want to continue submitting this form?
OK Cancel
So I have to pull the users [User Name], [Company Name], and the [Date].
On the approverView.jsp login page ( which is the first login page users see after loggin) it shows
the users full name, so I nabbed the code from that page:
<body>
<jsp:include page="logo.jsp" />
<jsp:include page="unav-navigate.jsp" />
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="info">
<tr>
<td width="25%" valign="top">
<logic:present name="UserContainer" property="userView" scope="session">
<span class="welcome">Welcome
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
<span class="sm">If you are not this person, please click <html:link styleClass="norm" href="/fake_name/logoff.do">here</html:link>.</span></td>
<td width="2%"> </td>
<td width="73%" valign="top"><jsp:include page="instruction.jsp" /></td>
</tr>
</table>
and made this code out of it to pull the username,companyname:
<logic:present name="UserContainer" property="userView" scope="session">
<span class="User"> User
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
<logic:present name="UserContainer" property="userView" scope="session">
<span class="Company">Company
<bean:write name="UserContainer" property="userView.companyName" scope="session"/>
!</span><br>
</logic:present>
This is the userView.java page that is referanced :
* Created on Mar 28, 2003
* To change this generated comment go to
* Window>Preferences>Java>Code Generation>Code Template
package org.fake.name.view;
import java.io.Serializable;
import java.util.List;
import org.gama.cafs.businessobjects.TorqueDb;
* @author chris
public class UserView implements Serializable {
private int userId;
private int memberId;
private int companyId;
private String role;
private String firstName;
private String lastName;
private String companyTitle;
private String emailAddress;
private String phoneNumber;
private String companyName;
private String address1;
private String address2;
private String address3;
private String city;
private String state;
private String province;
private String postalCode;
private String countryName;
private List productTypes = null;
private List productTypeAcronyms = null;
private List productTypeIds = null;
private List tradeNameIds = null;
private List tradeNames = null;
private TorqueDb torqueDb = null;
public UserView() { }
* @return String
public String getAddress1() {
return address1;
* @return String
public String getAddress2() {
return address2;
* @return String
public String getAddress3() {
return address3;
* @return String
public String getCity() {
return city;
* @return String
public String getCompanyName() {
return companyName;
* @return String
public String getCompanyTitle() {
return companyTitle;
* @return String
public String getCountryName() {
return countryName;
* @return String
public String getEmailAddress() {
return emailAddress;
* @return String
public String getFirstName() {
return firstName;
* @return String
public String getLastName() {
return lastName;
* @return int
public int getMemberId() {
return memberId;
* @return String
public String getPhoneNumber() {
return phoneNumber;
* @return String
public String getPostalCode() {
return postalCode;
* @return Set
public List getProductTypes() {
return productTypes;
* @return String
public String getProvince() {
return province;
* @return String
public String getRole() {
return role;
* @return String
public String getState() {
return state;
* @return int
public int getUserId() {
return userId;
* Sets the address1.
* @param address1 The address1 to set
public void setAddress1(String address1) {
this.address1 = trimString(address1);
* Sets the address2.
* @param address2 The address2 to set
public void setAddress2(String address2) {
this.address2 = trimString(address2);
* Sets the address3.
* @param address3 The address3 to set
public void setAddress3(String address3) {
this.address3 = trimString(address3);
* Sets the city.
* @param city The city to set
public void setCity(String city) {
this.city = trimString(city);
* Sets the companyName.
* @param companyName The companyName to set
public void setCompanyName(String companyName) {
this.companyName = trimString(companyName);
* Sets the companyTitle.
* @param companyTitle The companyTitle to set
public void setCompanyTitle(String companyTitle) {
this.companyTitle = trimString(companyTitle);
* Sets the countryName.
* @param countryName The countryName to set
public void setCountryName(String countryName) {
this.countryName = trimString(countryName);
* Sets the emailAddress.
* @param emailAddress The emailAddress to set
public void setEmailAddress(String emailAddress) {
this.emailAddress = trimString(emailAddress);
* Sets the firstName.
* @param firstName The firstName to set
public void setFirstName(String firstName) {
this.firstName = trimString(firstName);
* Sets the lastName.
* @param lastName The lastName to set
public void setLastName(String lastName) {
this.lastName = trimString(lastName);
* Sets the memberId.
* @param memberId The memberId to set
public void setMemberId(int memberId) {
this.memberId = memberId;
* Sets the phoneNumber.
* @param phoneNumber The phoneNumber to set
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = trimString(phoneNumber);
* Sets the postalCode.
* @param postalCode The postalCode to set
public void setPostalCode(String postalCode) {
this.postalCode = trimString(postalCode);
* Sets the productTypes.
* @param productTypes The productTypes to set
public void setProductTypes(List productTypes) {
this.productTypes = productTypes;
* Sets the province.
* @param province The province to set
public void setProvince(String province) {
this.province = trimString(province);
* Sets the role.
* @param role The role to set
public void setRole(String role) {
this.role = trimString(role);
* Sets the state.
* @param state The state to set
public void setState(String state) {
this.state = trimString(state);
* Sets the userId.
* @param userId The userId to set
public void setUserId(int userId) {
this.userId = userId;
* @return List
public List getProductTypeAcronyms() {
return productTypeAcronyms;
* Sets the productTypeIds.
* @param productTypeIds The productTypeIds to set
public void setProductTypeAcronyms(List productTypeAcronyms) {
this.productTypeAcronyms = productTypeAcronyms;
public List getProductTypeIds() {
return productTypeIds;
public void setProductTypeIds(List productTypeIds) {
this.productTypeIds = productTypeIds;
private String trimString(String str) {
String tmp = null;
if (str != null)
tmp = str.trim();
else
tmp = str;
return tmp;
public List getTradeNameIds() {
return tradeNameIds;
public List getTradeNames() {
return tradeNames;
public void setTradeNameIds(List list) {
tradeNameIds = list;
public void setTradeNames(List list) {
tradeNames = list;
public TorqueDb getTorqueDb() {
return torqueDb;
public void setTorqueDb(TorqueDb db) {
torqueDb = db;
public int getCompanyId() {
return companyId;
public void setCompanyId(int i) {
companyId = i;
Question:
How do I insert the code I assembled:
<logic:present name="UserContainer" property="userView" scope="session">
<span class="User"> User
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
<logic:present name="UserContainer" property="userView" scope="session">
<span class="Company">Company
<bean:write name="UserContainer" property="userView.companyName" scope="session"/>
!</span><br>
</logic:present>
INTO the function:
function AppSubmit() {
str1 = "Submitting this form will begin the approval process.";
str2 = "You will not be able to come back to this form to edit it again.";
str3 = "Do you want to continue submitting this form?";
if((confirm(str1 + "\n" + str2 + "\n" + str3))){
document.forms[0].status.value="Submitted";
document.forms[0].submit();
So that the popup window will show the [username], [CompanyName], [Date]. I can�t find any doc�s on how to insert logic into a function with str�s.
Any help would be very much appreciated. Thanks in advance.
Applications used by me: Sun solaris 8 server, Tomcat 4.1.24, pulling from postgresql 7.3, and I edit in Eclipse 2.11.These two tags:
<logic:present name="UserContainer" property="userView" scope="session">
</logic:present>
surround things you only want to happen if there is a userView object present.
This tag:
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
is replaced with the value of userView.getFirstName().
So:
<logic:present name="UserContainer" property="userView" scope="session">
<span class="User"> User
<bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>
!</span><br>
</logic:present>
becomes:
User Jim Steinberger !
if the userView object is present and firstName == Jim and lastName == Steinberger.
To insert those values into your JavaScript function:
<logic:present name="UserContainer" property="userView" scope="session">
function AppSubmit() {
str1 = "Submitting this form will begin the approval process.";
str2 = "You will not be able to come back to this form to edit it again.";
str3 = "You also agree that the following statement is true and correct to the best of your knowledge and belief:";
str4 = "";
str5 = "I, <bean:write name="UserContainer" property="userView.firstName" scope="session"/>
<bean:write name="UserContainer" property="userView.lastName" scope="session"/>, hereby certify and state on behalf of <bean:write name="UserContainer" property="userView.companyName" scope="session"/> that the energy use data contained on this form are accurately determined and stated in accordance with federal test procedures set forth in 10 CFR Part 430 or 431, or 42U.S.C.?6314, as applicable, including authorized waivers, as they currently exist on " + new Date().getDate() + "/" + new Date().getMonth() + "/" + new Date().getFullYear() + ".";
str6 = "Do you want to continue submitting this form?";
if((confirm( str1 + "\n" + str2 + "\n" + str3 + "\n\n\n" + str4 + "\n" + str5 + "\n" + str6 ))){
document.forms[0].status.value="Submitted";
document.forms[0].submit();
</logic:present>
Should become:
function AppSubmit() {
str1 = "Submitting this form will begin the approval process.";
str2 = "You will not be able to come back to this form to edit it again.";
str3 = "You also agree that the following statement is true and correct to the best of your knowledge and belief:";
str4 = "I, Jim Steinberger, hereby certify and state on behalf of Dynamic Edge, Inc. that the energy use data contained on this form are accurately determined and stated in accordance with federal test procedures set forth in 10 CFR Part 430 or 431, or 42U.S.C.?6314, as applicable, including authorized waivers, as they currently exist on " + new Date().getDate() + "/" + new Date().getMonth() + "/" + new Date().getFullYear() + ".";
str6 = "Do you want to continue submitting this form?";
if((confirm( str1 + "\n" + str2 + "\n" + str3 + "\n\n" + str4 + "\n" + str5 + "\n\n" + str6 ))){
document.forms[0].status.value="Submitted";
document.forms[0].submit();
after being processed by Tomcat and Struts. (Note: the function will not appear if userView is missing)
By the way, you might be missing the closing bracket to function AppSubmit() { which might throw a JavaScript error. Just FYI :)
Good luck!
Jim Steinberger
[email protected] -
Can't get popup window to work, could use code help.
This is the first time I've tried to open a popup window in
flash, and I can't get it to work. The site I'm building has the
navigation buttons contained in an animated movie clip. All of the
navigation buttons work fine. But there's a link that the company
wants me to add that opens a window to another site who hosts a
video commercial for the company (it has to be a link to the other
site, it can't be added directly to the customers site).
The link the other company sent me is for javascript (I'll
include it in the attached code), and the code works great if I
just insert the javascript in the html. But I wanted to try and get
the link in the Flash menu. I've tried several versions of the
code, from applying it directly to the button to naming an instance
of it and attaching the actionscript in the movie clip. When I'm
done, I get two different problems. On my XP machine, I get a
warning error about the flash trying to open something to another
server. On my Vista machine, nothing happens at all.
Anyway, I'm including the original javascript and several
versions of the actionscript I've tried (with the actual site
information replaced with "fakeurl.com", wasn't sure how these
forums felt about including site info). Any help at all would be
greatly appreciated. I've searched and searched for about a week,
and I'm tempted to just do away with the Flash button and use a
cheesy javascript button for this one link.
Thanks!
MoAttIn article <[email protected]>,
[email protected] wrote:
> All I want to do is have a Close Window link in my popup window that works.
Select your text that you want to act as a trigger to close the window,
just as if you were going to create a link.
Then paste the following line of code into the link Inspector:
javascript:self.close();
That should do the trick.
Cheers Martin -
I upgraded to Mountain Lion (MacbookPro). Now when I open ical I get a popup window with a list I had added to Reminders app with the message 'Your calendar couldn't be refreshed' i--t won't go away-'delete' is greyed out--can't access calendar! Help!
I upgraded to Mountain Lion (MacbookPro). Now when I open ical I get a popup window with a list I had added to Reminders app with the message 'Your calendar couldn't be refreshed' i--t won't go away-'delete' is greyed out--can't access calendar! Help!
-
Need help with as3 for popup window
I am nearing the end of the semester in my Flash Animation class. I have learned very simple AS3 things, code snippets etc. I am trying to find the actionscript for coding a very simple popup window, but have not found a clue.
Here's what I want to do...I have a white box with some type on the stage. When a person clicks on the white box, I want a popup to open that is larger, that will contain the same type but larger. That box will have an x so it can be dismissed. I don't want to do this in html, only in Flash CS5. I don't want a browser window, I just want a bigger version of the smaller box. I know how to build both boxes, just don't know how to write the code. I know there will be an on-click mouse event listener, and then I am lost.
Can anyone help with the code I might use? It would be most appreciated.It would be something along the lines of... (using instance names relative to your description)...
popup.visible = false;
whiteBox.addEventListener(MouseEvent.CLICK, showPopup);
function showPopup(evt:MouseEvent):void {
popup.visible = true;
popup.popupX.addEventListener(MouseEvent.CLICK, hidePopup);
function hidePopup(evt:MouseEvent):void {
popup.visible = false; -
AIR: allow scripted window.open popup windows for specified sites ?
I'm adding desktop interaction to an existing webapp using AIR.
The webapp allows portlets to be undocked into their own window using a scripted "window.open" call.
When running the webapp in AIR, the "window.open" call is blocked (window ref returned is "undefined").
Presumably AIR is detecting the invocation of "window.open" isn't directly linked to the mouse click event.
With a "standard" browser, you can configure the popup blocker to allow popups for urls specified as Exceptions.
Is there a way to do this in AIR ? (either by config or by overriding one of the AIR classes).
I've looked at using a custom HtmlHost but the popup blocking occurs before the HtmlHost.createWindow () callI couldn't find a way to customize the pop-up blocker in AIR.
I tested the same thing with Safari 4.0.5 (AIR uses WebKit 4.0.3) and got the same result.
After some testing I found that changing the Javascript to ensure that the event was bound to "onClick" fixed it (previously was bound to "onMouseDown")
Maybe you are looking for
-
Tried to set up shared memory more than once?
Hi all, Im getting a pop up error on 10.7.3.. It pops up very fast and is almost impossible to read. Having checked the console, this is the error.. 01/04/2012 13:59:12.457 com.apple.launchd.peruser.501: (com.facebook.videochat.'MyName'.updater[486])
-
I accidently deleted my ap-manager interface How can I get it back? WLC440
I accidently deleted my ap-manager interface How can I get it back? WLC4400 Thanks in advance.. admin_users 1 301 10.147.1.8 Dynamic No hvac 1 268 172.19.15.8 Dynamic No management 1 447 10.147.8.8 Static No nwlan 1 862 10.147.6.8 Dynamic No service-
-
Photoshop CC The 3D Menu is greyed out so no options are able to be selected. If I try to use the 3D Window (Window>3D) then I get a message about enabling "Use Graphic Processor" even though its already enabled. I wanted to try out CC before upgradi
-
Hi All, We are getting a run time error with the text "No more storage space available for extending an internal table." tcode executedd is we02. kindly let me know if anyone has come acrossed this kind of error. pointers will be appreciated
-
My company has added a custom tab to RECN. On this tab we update a custom table containing additional information related to a real estate contract. Everything seems to be working just fine except one little thing: If I change some data on our new