Why MouseEvent doesn't work?
Hello, everyone.
I added a movieclip and named "bot_mc" in another movieclip. Then, In Action panel, I use bot_mc.addEventListener(MouseEvent.DOWN, xxxx). However, when I drag and drop the container movieclip on the main stage and compile. There is no error occurs but the MouseEvent doesn't work. How can I slove this problem. I need some help
there's no MouseEvent.DOWN unless you create it.
use:
MouseEvent.MOUSE_DOWN
Similar Messages
-
One reason why commandLink doesn't work in dataTable
Ok, so I think I've got an explanation why commandLink doesn't work in dataTable when the model bean is request scoped. Maybe somebody can tell me if I'm wrong.
I have a model bean that generates table rows based on some input criteria (request parameters).
So, we validate the inputs, apply them to the bean and render the page. Once the inputs have been applied to the bean, a request for table rows returns rows, no problem.
However, we put a commandLink in each row, so we can expand the details. Maybe we even get smart and repeat the input row-generating criteria as a hidden field in the page.
Unfortunately, when the user hits the commandLink, the list page simply refreshes, maybe even w/out table rows. The user doesn't get the details page as expected.
Why not?
Because: in the DECODE phase (even before validation and before "immediate" values have had their valueChangeListeners called), we ask the model bean for the table rows, so we can decode the commandLinks. Unfortunately, in "decode" phase, the request-scoped model bean has not had its row-generating criteria updated (that happens in the "update model" normally, or at the END of the decode phase if we got cute by (1) setting the "immediate" attribute on the row-generating criteria to "true" AND (2) set a valueChangeListener to allow us to update the model bean early. The END of the decode phase isn't good enough -- in the middle of that phase, when we're attempting to deocde commandLinks, the model bean has no citeria, so there's no row data. No row data means no iteration over commandLinks to decode them and queue ActionEvents. So, we march through the rest of the phases, process no events, and return to the screen of origin (the list screen) with no errors.
So, what's the solution?
One solution is to make the model bean session-scoped. Fine, maybe we can store a tiny bit of data in it (the search criteria), so it's not such a memory drag to have it live in the session forever. How do we get that data in? A managed property in faces-config.xml with value #{param.PARENT_KEY} won't work because it's assigning request-scoped data to a session-scoped holder. JBoss balks, and rightly so. Do we write code in the model bean that pulls the request parameter out of thin air? (FacesContext.getExternalContext()....) I don't really like to code the name of a specific http request parameter into the bean, I think it's the job of the JSP or faces-config.xml to achieve that binding (request parameter to model propery). Plus, I'd be sad to introduce a dependency on Faces in what was previously just a bean.
Is there a better way?
In my particular situation, we're grafting some Faces pages onto an already-existing non-Faces application. I don't get the luxury of presenting the user an input field and binding it to a bean. All I've got to work with is a request parameter.
Hmm, I guess I just answered my own question. if all I've got to work with is a request parameter, some ugliness is inevitable, I guess.
I guess the best fix is to cheat and have the bean constructor look for a request parameter. If it finds it, it initializes the criteria field (which, in my case, is the key of an object that has a bunch of associated objects (the rows data), but could be more-general d/b search criteria).
(I looked at the "repeater" example code in the RI, but it basically statically-generates its data and then uses 100% Faces (of course) to manage the paging (where "page number" is essentially the "criteria").
Comments? Did I miss something obvious?
John....or I could just break down and do the thing I was hoping to avoid (outputLink instead of commandLink):
<h:outputLink value="/faces/Detail.jsp">
<f:param name="PARENT_KEY" value="#{bean.parentKey}"/>
<h:outputText value="#{bean.label}"/>
</h:outputLink>It's still a "hardcoded" parameter name, but at least the binding is in the JSP and faces-config.xml, not the bean Java code. -
Confused as to why this doesn't work...
I wrote this code correctly, but it doesn't seem to work. I'm not sure if I'm leaving something out or not using something correctly. If anyone can tell me why this doesn't work, it would be greatly appreciated!
P.S. in the actionPerformed method, I want to put the window to close once someone clicks an "ok" button. How is this done? I've tried using setDefaultCloseOperation(3), but it doesn't seem to work.
peace,
Mark
//?2002 Copyright. MJA Technologies. All Rights Reserved.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class About extends JFrame implements ActionListener
JTextArea textarea;
JPanel panel1;
JButton okbutton;
String output;
public About()
super("Pages");
Container container = getContentPane();
textarea = new JTextArea();
textarea.setText("Pages 1.0 beta 0\n?2002 MJA Technologies.\nAll Rights Reserved.");
container.add(textarea);
setDefaultCloseOperation( 3);
setVisible(true);
setSize(400, 300);
public void actionPerformed(ActionEvent event)
if(event.getSource() == okbutton)Oh see, you said this:
"P.S. in the actionPerformed method, I want to put the window to close once someone clicks an "ok" button. How is this done? I've tried using setDefaultCloseOperation(3), but it doesn't seem to work."
so I said this:
"setVisible(false)"
NOOOOOOOOOOOW you say the TextArea doesn't show up...that's a whole other problem.
Jeeeeeeeeeeeeeeeez.
So what layout manager are you using in the container? (hint hint) -
Why FaceTime doesn't work in Saudi Arabia ?
why FaceTime doesn't work in Saudi Arabia ?
we have stores sell apple products some of them sell with faetime at a high rate,
and some other sell apple products without facetime at a normal price.
finaly we need apple stores in Saudi Arabia to prevent this fraud.
thank you
what you're saying here is that some people parallel import apple products around the normal channels and they are from other countries so they havent got facetime blocked
and others normally import apple products and they are blocked
and then you go on believing that if apple had a store in saudi things would be better rest asured that if they did they would sell products with facetime blocked -
Hello,
I bought an iMac few days ago. I would like to sync ical on my iMac with my professional calendar I use in my company (from outlook web access).
I was easy to manage it on my iPhone (I just add a new "exchange" mail account and ask for a calendar sync only) and it worked very quickly.
But I cannot do it with the iMac, and I don't undersatnd why?
the domain is is used for my iPhone is the following :
owa.companyname.com
I tried all the solutions I found in this forum but it doesn't work.
Many thanks in advancefor your help.
MattDoes it have to be an applet?
If you want the same behaviour as in the code with traffic lights, change
class MortgageApplet extends JApplet implements ActionListener {
to
class MortgageApplet extends JFrame implements ActionListener {
and change
public void init() {
to
public MortgageApplet() { -
XML SQL Utility:Why it doesn't work?
I am trying to use the XML SQL Utility
by modifying the given example samp1.java
for the JDBC-ODBC driver but errors emerged.
Is there any thing wrong? Thanks.
(The classpath setting is ok, I think)
***** Here is the error message:
D:\OracleXSU\sample>java Sample
Exception in thread "main" java.lang.NoClassDefFoundError: oracle/sql/Datum
at oracle.xml.sql.query.OracleXMLQuery.<init>(OracleXMLQuery.java:127)
at Sample.main(Sample.java:42)
D:\OracleXSU\sample>
***** Here is the source code:
/** Simple example on using Oracle XMLSQL API; this class queries the database with "select * from emp" in scott/tiger schema; then from the results of query it generates an XML document */
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
// import oracle.jdbc.*;
// import oracle.jdbc.driver.*;
public class Sample
//========================================
// main() - public static void
public static void main(String args[]) throws SQLException
String tabName = "sbook";
String user = "scott/tiger";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
// DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//init a JDBC connection
// Connection conn =
// DriverManager.getConnection("jdbc:oracle:oci8:"+user+"@");
Connection conn = DriverManager.getConnection("jdbc:odbc:SQLUtil");
// create statement and execute it to get the ResultSet
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery("select * from "+tabName );
if(rset!=null)
// init the OracleXMLQuery; note we could have passed the sql query string
// instead of the ResultSet
OracleXMLQuery qry = new OracleXMLQuery(conn,rset);
// get the XML document is the string format
String xmlString = qry.getXMLString();
// print out the result
System.out.println(" OUPUT IS:\n"+xmlString);
nullFirstly I think it is because the XML SQL Utility does not work with JDBC-ODBC driver.
So I try it again with Oracle driver.
But it still doesn't work? Why?
***** Here is the source code:
/** Simple example on using Oracle XMLSQL API; this class queries the database with "select * from emp" in scott/tiger schema; then from the results of query it generates an XML document */
import java.sql.*;
import java.math.*;
import oracle.xml.sql.query.*;
import oracle.jdbc.*;
import oracle.jdbc.driver.*;
public class Sample2
//========================================
// main() - public static void
public static void main(String args[]) throws SQLException
String tabName = "emp";
String user = "scott/tiger";
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
//init a JDBC connection
// Connection conn =
// DriverManager.getConnection("jdbc:oracle:oci8:"+user+"@");
//init a JDBC connection
Connection conn = DriverManager.getConnection ("...Connection information...");
// create statement and execute it to get the ResultSet
Statement stmt = conn.createStatement();
// ResultSet rset = stmt.executeQuery("select * from "+tabName );
ResultSet rset = stmt.executeQuery("select * from COFFEES" );
// Test if connection is sucessful -- it works!
int i=0;
while(rset.next())
i++;
System.out.println("Total rows="+i);
// init the OracleXMLQuery; note we could have passed the sql query string
// instead of the ResultSet
OracleXMLQuery qry = new OracleXMLQuery(conn,rset);
// get the XML document is the string format
String xmlString = qry.getXMLString();
// print out the result
System.out.println(" OUPUT IS:\n"+xmlString);
null -
Why EL doesn't work with custom tags ?!
I don't know why expression lang. doesn't work with me.
here's an example, and please tell me why :
--- the jsp page with EL ==> doesn't work :
<%-- In the name of ALLAH most gacious most merciful --%>
<%@ page language="java" %>
<%@ taglib uri="/cartlib" prefix="cart" %>
<html>
<jsp:useBean id="product" class="ch16.cart.ProductCatalog" scope="application" />
<cart:showCatalog productCatalog="${product}" addToShoppingCartUri="<%= response.encodeURL("AddToShoppingCart.jsp") %>" />
</html>
when using expressions instead, the page works .
the new page is :
<%-- In the name of ALLAH most gacious most merciful --%>
<%@ page language="java" %>
<%@ taglib uri="/cartlib" prefix="cart" %>
<html>
<jsp:useBean id="product" class="ch16.cart.ProductCatalog" scope="application" />
<cart:showCatalog productCatalog="<%= product %>"
addToShoppingCartUri="<%=
response.encodeURL("AddToShoppingCart.jsp") %>" />
</html>
The error was :
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: jsp.error.beans.property.conversion
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper
.java:512)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: jsp.error.beans.property.conversion
org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(Js
pRuntimeLibrary.java:885)
org.apache.jsp.ShowProductCatalog_jsp._jspService(ShowProductCatalog_jsp.java:77
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.Regarding setup, see this post reply #6
http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0
Other potential things to check: make sure you are getting the right value passed in
productCatalog="${applicationScope.product}"
${product} by preference would take a pageContext, request or session attribute before the application level one (it uses pageContext.findAttribute).
What do you get if you just print out ${product} on the screen?
It should call a toString() on it for rendering purposes. -
Error while creating my first project on SP15 and why Help doesn't work?
Hello sdnrs,
I have a fresh SP15 installtion.
I have 2 problems creating my first webdynpro project.
1.When I go to file-new-project-webdynpro->(enter name)->next , I have windows poped up with the following error:
Plug in name: Web Dynpro Archive Builder
Plug in id: com.sap.ide.webdynpro.archivebuilder
class: com.sap.ide.webdynpro.archivebuilder.project.WebDynproStandaloneProjectWizard
Method: createJavaProject(IProject, IProgressMonitor)
Message: Problems encountered while setting project description.
Exeption: org.eclipse.core.runtime.CoreException: Problems encountered while setting project description.
I am frustrated cause I can't do any step futher...! Is there any special settings on the SDK, Window-Preferences, etc?
2.My Help doesn't work at all - it used to be (with SP11 slim) when i go - 'Help-SAP was docum-SAP webdynpro appl ' and I had my help window poped up.Now I dont have anything!
Thank you much in advance!
BobFor your information there's another solution if you don't wanna reinstall your NDS or if the reinstallaion doesn't work.
The error is in the resources so you have to replace some plugin resources to correct the error. Because of that you need access to the resources from somewhere else.
1. Go to c:\Documents and Settings\"username"\Documents\SAP\workspace\.metadata\.plugins and replace org.eclipse.core.resources with a "working" resource
2. Go to C:\Program Files\SAP\JDT\eclipse\plugins and replace org.eclipse.core.resources.win32_2.1.0 and org.eclipse.core.resources_2.1.1 with a "working" resource.
Restart NDS and it ought to work
Best regards,
Ole Mose -
Why Earpods doesn't work on Ipod Shuffle 3G?
I just got my new earpods because I have an ipod shuffle that I didnt use for a couple months because I lost the earphones, but it seems this new ones dont work, I cant turn volume up/down or anything I can just ear the music with the default volume,,, in the manual it says it is suppose to work on iPod shufle 3rd generation or later... I think it is a lie.. or somebody found a way to make them work yet?
Only Apple would know the answer to why they won't work with the 3G.
B-rock -
Alt + mouse scroll (Zoom-In/Out) doesn't work in my illustrator program.
What should I do?It is a know issue, no solution for the moment.
But Adobe is working on this see here-> http://forums.adobe.com/message/5423070#5423070 -
Why rollback doesn't work?
hello,
I am mantaining a servlet application with Tomcat and MySQL 4.0.16 .
Here is a part of the code that is giving me lots of problems with concurrent users:
public void saveUpdate(String gameName, int IDAzienda, int periodo) throws ClassNotFoundException, SQLException, NamingException, Exception {
Connection con = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
Statement stmt = null;
try {
con = DBConnect.connect("DB");
con.setAutoCommit(false);
// many updates
con.commit();
con.setAutoCommit(true);
con.close();
catch ( SQLException sqle ){
con.rollback();
throw sqle;
finally {
if ( rs != null ){
try {rs.close();}
catch ( Exception e ) { }
rs = null;
if ( stmt != null ){
try {stmt.close();}
catch ( Exception e ) { }
stmt = null;
if ( pstmt != null ){
try {pstmt.close();}
catch ( Exception e ) { }
pstmt = null;
if ( con != null ){
try {con.close();}
catch ( Exception e ) { }
}When concurrent users click on the submit button on the same istant to read/write on the db (there are many more similar methods called by different servlets), sometimes something goes wrong and it throws an exception (this is a problem I will set out later in the Servlet forum).
The problem with above code is that when such an event occur, the tables stay modified and are saved with incoherent values.
I am using InnoDB tables, so rollback() should be fully implemented.
Do you think that I should move con.rollback() from the catch block to the finally block? anyway, why is this not working?
thank you
alessandrothanks for your quick replies.
1. connections are always in setAutocommit(false)
2. there are no DDL or other implicit commit statements
so I guess too this is a locking problem. each method reads or updates the same 50 tables in a single transaction. what will happen if I use a SERIALIZABLE isolation level when 2 or more users are concurrent? will each method complete its transaction before another one is called?
or do I have to LOCK manually the whole 50 tables at the beginning of each transaction? though I read that if a thread gets a LOCK, it automatically commits the changes made up to that point (also by other threads), so it might not be transaction-safe if one thread gets a LOCK while another one is still operating.
alessandro -
Help, why keyRepeated doesn't work
Hello,
I created a class to extend GameCanvas in midp2.0. In this class, I overwrote "keyPressed ()","keyReleased()","keyRepeated()" three methods.
"keyPressed ()","keyReleased()" both work very well to capture the key.
But keyRepeated doesn't work. It looks it hasn't been called back by system.
I used wtk2.0 DefaultColorPhone to test the code. Does the emulator not support KeyRepeated() ?
Can anybody help me this?
Thanks in advance.
henryi not using wtk 2.0 but u can try hasRepeatEvents method to check the availability of repeat actions
-
Why Hotmail Doesn't Work Properly Anymore???
Hotmail recently upgraded their look and as a result, it doesn't work properly via my iphone when I use Safari. It tells me to upgrade my web browser to Safari, IE or Firefox, however my iphone has the newest upgrade available...........so what is the fix?
In short, my hotmail doesn't work properly (Doesn't display emails in the preview pane) so I can't check emails essentially.See the post abut this that you posted in a few minutes ago. Allan has answered the question.
http://discussions.apple.com/thread.jspa?threadID=1786751&tstart=0 -
Why "fixedcolumn" doesn't work in tableview?
Hi,
I have a tableview which use iterator on BSP page. I set "fixedcolumn" attribute for one column in iterator->GET_COLUMN_DEFINITIONS
tv_column-columnname = 'pvname'.
concatenate '' text-002 '' into tv_column-title.
tv_column-width = '35%'.
tv_column-fixedcolumn = 'X'.
append tv_column to p_column_definitions.
And in iterator->RENDER_CELL_START, I put textview in each cell:
when 'PVNAME'.
assign component 'PVNAME' of structure <row> to <col>.
lv_string = <col>.
create object htmlb_textview.
htmlb_textview->text = lv_string.
p_replacement_bee = htmlb_textview.
On BSP page, I define the tableview:
<htmlb:tableView id = "system_view"
table = "<%= model->sys_view %>"
width = "100%"
footerVisible = "False"
design = "alternating"
iterator = "<%= iterator %>"
sort = "server" />
But when I run page, I found the "fixedcolumn" doesn't work. the cell's background color changed. But still each cell has same content, not grouped in one cell.
What's the reason? Thanks!
Best regards,
Longi have been using this method which works fine.
page attribute:
coldef TYPE TABLEVIEWCONTROLTAB
wa_coldef TYPE TABLEVIEWCONTROL
oncreate:
refresh: coldef .
clear: coldef, wa_coldef .
wa_coldef-columnname = 'CARRID'.
wa_coldef-title = 'Carrier.'.
wa_coldef-fixedcolumn = 'X' .
append wa_coldef to coldef.
clear wa_coldef .
wa_coldef-columnname = 'CONNID'.
wa_coldef-title = 'Connection.'.
wa_coldef-fixedcolumn = 'X' .
append wa_coldef to coldef.
clear wa_coldef .
<htmlb:tableView id = "LW"
headerText = "header text %>"
headerVisible = "TRUE"
table = "<%= finlwdets %>"
visibleRowCount = "25"
navigationMode = "BYLINE"
iterator = "<%= iterator %>"
columnDefinitions = "<%= coldef %>" /> -
Why WordFinder Doesn't work?
Okay so i have an e-book that you can highlight text, select text and copy paste and so forth. But Wordfinder doesn't work it tries searching but can never find a word no matter what.
So i don't get whats the error going on here.What do you mean by WordFinder? The plug-in API PDWordFinder?
Maybe you are looking for
-
NEED HELP UPDATING MY PHONE WONT TURN ON ONLY WHILE IT ON CHARGE BUT I NEED IOS 6 UPDATE
-
Am I backscattering? and non mail user accounts having mail received.
10.6.4 Server fresh install on a new Mac Pro. I have configured our mail server using only Server Admin. Junk mail is set to be redirected to the junkmail account and not bounced. FIRST ISSUE - am I backscattering? In looking at the logs I see what l
-
Issue with retrieving variables
Hi. Got help with some code on here before. Basically, it retrieves values from my php page and displays them in my flash movie. The code I am using is var n:uint=1; var tl:MovieClip=this; try { var keyStr:String; var valueStr1:String;
-
Urgent! Visa processing and tracking using JDE?
Hello, Kindly let me know if Visa processing and tracking is possible in JDE? Gathering information about employee on visa requirements can be maintained in supplemental data and reports can be run to generate Visa information. But can we actually tr
-
Theme Editor, changing size of all elements
Hi all, I'd like to enlarge the font size of all elements in my WebDynpro ABAP application. I made a copy of sap_tradeshow in the stand-alone Theme Editor and set the parameter "Base Font Size" for "Text" in "Global Styles Content Area" to xx-large.