Tween class not resetting _y value
Hi,
I am trying to move a movieclip down using Actionscript. Then when a user fires a back event [which is successfully firing] the movieclip is then required to go up again. The code is:
trace("fholder _y org: " + folioholdermc._y); // THIS COMES OUT TO BE -601
var yDown1:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -601, -449, 3, true);
trace("step 1 called");
trace("fholder _y down1: " + folioholdermc._y); //THIS ALSO COMES OUT AS -601 ????? Though I can see the clip in the right position
yDown1.onMotionFinished = function()
trace("ydown1 done"); //This trace is fired and then it stops
var yDown2:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -449, -297, 3, true);
yDown2.onMotionFinished = function()
trace("fholder _y down2: " + folioholdermc._y);
trace("ydown2 done");
var yDown3:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -297, -148, 3, true);
yDown3.onMotionFinished = function()
trace("ydown3 done");
var yDown4:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -148, 0, 3, true);
yDown4.onMotionFinished = function()
trace("ydown4 done");
folioholdermc.addEventListener("back",rollBackUp); //Does not register the event which is successfully fired
function rollBackUp()
trace("got roll back");
folioholdermc.bclip.gotoAndStop("up");
var yUp1:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, folioholdermc._y, -148, 3, true);
trace("step 1 up called");
yUp1.onMotionFinished = function()
var yUp2:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, folioholdermc._y, -297, 3, true);
yUp2.onMotionFinished = function()
var yUp3:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, folioholdermc._y, -449, 3, true);
yUp3.onMotionFinished = function()
var yUp4:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, folioholdermc._y, -601, 3, true);
yUp4.onMotionFinished = function()
folioholdermc.bclip.soapmachine.gotoAndPlay(40);
What am I doing wrong here??? Any help will be greatly appreciated...
I can't say that I follow what you are trying to do, and thus what it is failing to do, but I see that you are declaring variables within functions, but then are also trying to assign things to them outside of the function. When you declare a variable inside a function, it only has scope within that function... So in the first instance if you change the coding to the following you can probably get that second tween's finished function to execute...
yDown1.onMotionFinished = function()
trace("ydown1 done");
var yDown2:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -449, -297, 3, true);
yDown2.onMotionFinished = yD2Finished;
function yD2Finished()
trace("fholder _y down2: " + folioholdermc._y);
trace("ydown2 done");
var yDown3:Tween = new Tween(folioholdermc, "_y", Bounce.easeOut, -297, -148, 3, true);
// etc...
Similar Messages
-
Tween Class not working in Projector
Hi all...
I have a very strange problem. I have a slideshow that uses
the Tween class to fade between jpg images. In the swf file and in
the standalone flash player, everything works just great. However,
when I make a projector file from the fla, either from within
Flash, or from the standalone player, the transitions stop working.
This behavior is identical on both a PC and a Mac.
Does anyone have a clue why projector would behave
differently?
Thanks.
Lance OngIn your custom UIComponent class, your never added your myAction instance. Try this for the MyUIComp constructor:
public function MyUIComp() {
myAction = new MyAction();
this.addChild(myAction);
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex / AIR Development, Training, and Support Services -
Class not returning all Values of Array
When I send an array with two elements to this class:
public class DrawingList {
public String[] dwglist;
public DrawingList(String[] list) {
this.dwglist = list;
public String[] getDwgList() {
return this.dwglist;
public static DrawingList getList(String[] list) {
return new DrawingList(list);
}It only returns the last element.
Can some one help me with this issue please.This is the class that generates the initial array which contains two elements:
import java.sql.*;
import com.ibm.as400.access.*;
* @author sde
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
public class DrawingConnectionBaseClass {
public String nameofdrawingb;
public String errorStringb;
public String literalerrorStringb;
public String[] dwgNoArray;
public DrawingConnectionBaseClass(String arg0) {
AS400JDBCDataSource datasource = new AS400JDBCDataSource("gvas400");
datasource.setUser("drawchg");
datasource.setPassword("webabc1");
try
Connection connection = datasource.getConnection();
Statement stmt = connection.createStatement();
String sqla = "select Count(*) As dwgcount from webprddt6.drawmstrp Where dm_drawing_number Like '%" + arg0 + "%'" ;
String sql = "select * from webprddt6.drawmstrp Where dm_drawing_number Like '%" + arg0 + "%'" ;
ResultSet rsa = stmt.executeQuery(sqla);
rsa.next();
int rowCount = rsa.getInt(1);
dwgNoArray = new String[rowCount];
errorStringb = "";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next())
for (int i = 0; i < rowCount - 1; ++i)
dwgNoArray[i] = rs.getString("DM_DRAWING_NUMBER");
errorStringb = "";
literalerrorStringb = "NoError";
catch (SQLException sqle)
errorStringb = "Warning!!! The Drawing Number you typed is not valid!";
literalerrorStringb = "Error";
}This is a servlet that calls the above class and then the DrawingList class to create a bean to be used on a JSP:
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.sql.*;
public class DrawingInquiryBaseServlet extends HttpServlet implements Servlet {
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
public DrawingInquiryBaseServlet() {
super();
public static String getliteralErrStringb;
public static String getErrMsgb;
public static String[] drawingList;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest arg0, HttpServletResponse arg1)
protected void doGet(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
this.doPost(arg0, arg1);
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest arg0, HttpServletResponse arg1)
protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException {
String drawingnumber = arg0.getParameter("dwgnobase");
DrawingConnectionBaseClass conn = new DrawingConnectionBaseClass(drawingnumber);
DrawingList drawingList = DrawingList.getList(conn.dwgNoArray);
ErrorHandling getErrMsgb = ErrorHandling.getErr(conn.errorStringb);
getliteralErrStringb = conn.literalerrorStringb;
HttpSession session = arg0.getSession(true);
if (getliteralErrStringb.equals("NoError")){
session.setAttribute("errorBean", getErrMsgb);
session.setAttribute("dwglist", drawingList);
else{
session.setAttribute("errorBean", getErrMsgb);
session.setAttribute("dwglist", drawingList);
RequestDispatcher disp = getServletContext().getRequestDispatcher("/DrawingDisplaybase.jsp");
disp.forward(arg0, arg1);
}This is my JSP where only one element is in the list:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM Software Development Platform">
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="theme/Master.css" rel="stylesheet"
type="text/css">
<TITLE>DrawingDisplay2.jsp</TITLE>
</HEAD>
<BODY>
<P><IMG border="0" src="Zodiac Z Blue (Hi Res).gif" width="73"
height="76"><B><B><FONT face="Times New Roman" color="navy" size="+2"> WEBER
AIRCRAFT LP</FONT></B></B><BR>
<BR>
<B><FONT size="+1" face="Times New Roman" color="navy"> Drawing Inquiry
Data</FONT></B></P>
<HR>
<P><B><FONT size="+2" color="red"><jsp:useBean id="errorBean"
type="com.ibm.drawinginquiry.rational.ErrorHandling" scope="session"></jsp:useBean>
<jsp:getProperty name="errorBean" property="errMsg" /></FONT></B></P>
<P>
Pick a Drawing number from list to see Details<BR>
<jsp:useBean id="dwglist"
type="com.ibm.drawinginquiry.rational.DrawingList" scope="session"></jsp:useBean><BR><SELECT size="5" name="dwgList">
<%
for (int i=0; i<dwglist.dwglist.length; i++){
%>
<option value="<%= i%>"><%= dwglist.dwglist%></option>
<%
%>
</SELECT></P>
<P><BR>
<BR>
<BR>
</P>
<FORM action="/DrawingInquiry/GetMainPageServlet"><INPUT type="submit"
name="anotherDrawing" value="Look Up Another Drawing"></FORM>
</BODY>
</HTML> -
Reset button not resetting the values.
Hi Experts,
I am using Reset Button in the dashboard.
When i click on the button the values are not getting reset.
Do i need to do any thing other than drag drop of the reset button on to the canvas.
Thanks in Advance,
Bhargava Bommidi.Hi Alam,
Thanks for your reply.
I have a label component linked ith a push button for data change. I.e evry time i click on the push button, the value in the label component changes. Now after playing with the push button if i want the dashboard to come to the original state i need to use reset button.
But the reset button is not bringing dashboard to the original state.
Thanks in Adavance,
Bhargava. -
Child class not acessing correct var value
I have 3 classes in different files:
Test.java:
public class Test {
public Test() {
public static void main(String[] args) {
Jog t = new Jog();
t.ini();
Jok.java:
class Jok extends Jog{
public Jok(){}
protected void pum(){
System.out.println(configP);
class Jog{
protected int configP=1;
public Jog(){
public void ini(){
configP = 5;
Jok j = new Jok();
j.pum();
My problem is that it looks like the var configP inside the class Jok is set with the value it was initialized and not the value it should be: 5, as set in the method ini of Jog...
Being Jok a child class of Jog i expect configP to be available with the correct value and i don't understand why this doesn't happen...
Any theory behind Java OO-Programing i'm missing? should this happen?
how to access configP in Jok class with the correct value? creating a getConfig in the Jog file and then calling it in the child class like: super.getConfig() also doesn't return the right value(5)? what is happening?
thanks in advance for your timethanks for your code change but as you can guess this was a problem in a bigger project i have where i can't do that solution.
Let me explain better my problem:
my understanding of java is that the child inherits the vars of the super class.
I have a super class that has a var configP, it's set for the default value 1, sometime in this class i change the value of this var, inside this class i print that value, it changes correctly.
I then create the object of the child class and inside it i print the var configP. configP in the super class is now with the value 5, because I changed to it but in the child class the value is the default 1. At the time i created the child object the value was already 5.
I now this is wrong but i can't understand why it's wrong in theory..
(if i change the configP in the construtor of the super class, the value is correctly displayed inside the child class) -
How to reset the value of a static attribute in a class (in SAP CRM)
Following the documentation in "C04_BB_ConfigGuide_EN_DE.doc".
I created a logical link for a remote ERP transaction from CRM7.0
The link to this file is http://help.sap.com/bp_crmv12007/CRM_DE/HTML/index.htm then Technical Information --> Building Block Library.
I made a mistake in the defining MappedLogSys name for the remote ERP system in Tcode CRMS_IC_CROSS_SYS.
Later I deleted the wrong entry using tcode CRMS_IC_CROSS_SYS and created the correct entry for the remote ERP system.
But whenever I try to create a new Link for ERP transaction in the CRM system using the wizard, (tcode CRMC_UI_ACTIONWZ), the wizard pickes up the deleted logsys name.
Using tcode SE24 & the Test icon (F8) I ran a test for the class CL_ERP_TX_MMBE and the value of the attribute "GV_MAPPEDLOGSYS" is set to the old deleted value.
How Can I fix this issue and make the class pickup the correct MappedLogSys value.I basically deleted the transaction launcher link and recreated a new one.
-
Hi all,
I'm trying to make a button which scales up on rollover and
scales down on rollout and I wanted to use the Tween class to do it
because I'm going to be making a bunch of these buttons and I want
the code to be as efficient as possible.
So right now I have a circle in a movie clip, and here's what
I have on the first frame of that circle's actions layer:
import mx.transitions.Tween;
import mx.transitions.easing.*;
function grow(who) {
var tw:Tween = new Tween(who, "_xscale", Strong.easeOut,
100, 400, 1, true);
var tw2:Tween = new Tween(who, "_yscale", Strong.easeOut,
100, 400, 1, true);
function shrink(who) {
var tw3:Tween = new Tween(who, "_xscale", Strong.easeOut,
400, 100, 1, true);
var tw4:Tween = new Tween(who, "_yscale", Strong.easeOut,
400, 100, 1, true);
this.onEnterFrame = function() {
trace(rewind);
if (rewind == true) {
shrink(this);
this.onRollOver = function() {
rewind = false;
grow(this);
this.onRollOut = function() {
rewind = true;
The circle scales up just fine but when I rollout it doesn't
scale back down. I did a trace to see if my tween was being called
and sure enough it was. So I did another trace to see if the
_xscale or _yscale was changing and they both were going down to
around 290 on rollOut although there's no noticeable difference in
the size of the button, it just looks like it's sitting there.
I was also wondering if importing the whole class library
will add very much to my file size?
Also, since I'm going to have a lot of these buttons on the
stage at the same time (these buttons will be like markers all over
a map so there'll probably be around 50+) would it be a bad idea to
have that many onEnterFrame checks running simultaneously? Is that
going to slow the user's CPU way down?Thanks for the suggestions guys.
I tried your code and got the rollOut to work but the button
blinks rapidly if the user rolls out and then rolls back in
quickly. Here is a link to the swf:
http://www.stationarynotes.com/studioI/buttonTest.swf
It also has to reach a complete stop the first time the
button expands or else it won't run the shrink function on rollOut.
I put all of my code on the first frame of the movie clip's
actions layer so here's what mine looks like:
import mx.transitions.Tween;
import mx.transitions.easing.*;
function grow(who) {
var tw:Tween = new Tween(who, "_xscale", Strong.easeOut,
100, 400, 1, true);
var tw2:Tween = new Tween(who, "_yscale", Strong.easeOut,
100, 400, 1, true);
tw.onMotionFinished=function():Void{
who.onRollOut = function() {
shrink(who);
function shrink(who) {
var tw3:Tween = new Tween(who, "_xscale", Strong.easeOut,
400, 100, 1, true);
var tw4:Tween = new Tween(who, "_yscale", Strong.easeOut,
400, 100, 1, true);
this.onRollOver = function() {
grow(this); -
Release strategy does not reset after PO change - tried changeability 4 & 6
Hi,
After my PO is released, I change the item quantity/price such that the net PO value (increased) is changed MORE than the tolerance % set in the changeability. I expect that the PO release should be reset but it does not.
However if my PO value is changed (increase) such that my PO value is now in a different "release bracket/range" -- as it falls into a different release strategy, then the release is reset.
Could anyone advise me what is wrong? I tried everything - i tried changeability = 4 and 6. i deleted the whole release class, release strategies and recreated -- nothing.
According to OSS note 493900 below, it should reset when the tolerance % is breached.
I'm on SAP 4.7.
Anyone could advise?
thanks!
3. Question :
Why is the release strategy not reset ?
Answer :
A reset of the release strategy only takes place if
- the changeability of the release indicator is set to '4' in
case of a purchase requisition and '4' or '6' in case of
another purchasing document (purchase order, request for
quotation, contract, scheduling agreement),
- the document is still subject to the previous release
strategy,
- the new TOTAL NET ORDER VALUE is higher than the old one.
The total net order value is linked to CEKKO-GNETW for a purchase order,
CEBAN-GSWRT for a purchase requisition item-wise release and CEBAN-GFWRT
for a purchase requisition overall release.
If you have maintained a Tolerance for value changes during release
(V_161S-TLFAE), the release strategy is reset when the value of the
document is higher than the percentage you have specified and if the
document is still subject to the previous release strategy.Hi,
Thanks.
The release strategies are able to be determined correctly when the PO is created so I guess that means its all setup correctly?
The issue is only with PO change - how to cause the reset when the PO value increases by more than the tolerance %.
cheers. -
Tween Class - calling Function
What am I doing wrong? I have been using the Tween Class in AS2 for years. This is how I have been using it.
//Beginning of my Flash file
import mx.transitions.Tween;
import mx.transitions.easing.*;
function fadeon(mcname:String) {
new Tween(mcname, "_alpha", Strong.easeOut, 0, 100, 1.5, true);
//This is placed on Frames where I want to call this particular Tween
fadeon(mymovieclipsname);
Similiar setup for AS3 with no errors when I run it. The only problem is it doens't work.
import fl.transitions.Tween;
import fl.transitions.easing.*;
function fadeon(mcname:String):void {
new Tween(mcname, "alpha", Strong.easeOut, 0, 100, 1.5, true);
//on Frames where I want to call this particular Tween
mymovieclipsname.fadeon();
if I run this portion the same as AS2 I get this lovely Compiler Error message.
1067: Implicit coercion of a value of type flash.display:MovieClip to an unrelated type String.
Any thoughts or help wold be greatly appreciated.Note that a better solution for AS3 is to simply create a Class that does the tween (to itself), then apply that to each bullet and leave the parent out of it. I'd probably have done the same thing in AS2 as well, but I learned As1>As3>As2, so my experience is not representative.
Here's the Class that I use to do this (note I didn't use a Tween for this task as they have the danger to go out of memory before the tween is done unless you store a reference to them):
package view.effects {
import flash.display.Sprite;
import flash.events.Event;
//view.effects.SimpleFadeIn
public class SimpleFadeIn extends Sprite {
public function SimpleFadeIn() {
super();
addEventListener(Event.ADDED_TO_STAGE, startFade);
protected function startFade(e:Event):void {
alpha = 0;
addEventListener(Event.ENTER_FRAME, doFade);
addEventListener(Event.REMOVED_FROM_STAGE, cleanUp);
protected function doFade(e:Event):void {
if (alpha < 1) {
alpha += .04;
} else {
cleanUp(e);
protected function cleanUp(e:Event):void {
removeEventListener(Event.ENTER_FRAME, doFade);
removeEventListener(Event.REMOVED_FROM_STAGE, cleanUp);
Note that the reason the path to the Class is there in a comment is so team members can copy and paste it into the Base Class for a MC they want to apply this behavior to. -
Tween class animations - modifying elasticity
I am fairly new to Flash, and couldn't find the help I needed through a search.
I am using the Tween class to move objects when buttons are clicked. I am using elastic easing as the animation ends, and it looks ok. But am I able to modify the elasticity at all? I like the effect, but it is a little strong and I would like to reduce the bounce at the end.
Can I do this, or by using this method of animation am I losing the fine control that I would have by using the timeline and I just have to suck it up?Well the easing you provide for the tween is just a reference to a function. So you can search the web and find your own functions. Robert Penner is famous for a large number of really great easing methods. Or you can just muck a bit with the built in functions. I put two small clips on the stage, clip0 and clip1. Then this code:
import fl.transitions.*;
import fl.transitions.easing.*;
var myTween0:Tween=new Tween(clip0,"x",Elastic.easeOut,100,500,2,true);
myTween0.start();
var myTween1:Tween=new Tween(clip1,"x",myEase,100,500,2,true);
myTween1.start();
function myEase(t:Number, b:Number, c:Number, d:Number):Number {
return Elastic.easeOut(t, b, c, d, .5, .9);
The the top one is the default and the lower one is my "modified" version. If you check out the help files for the Elastic classes easeOut method it requires the first four arguments (time, start value, end value of the prop, and duration) as do all tween functions. But the last two a and p are specific to elastic easing. The first is the amplitude of the sine wave and p is the period of the sine wave. I don't know what the units are on either of those, but I'm guessing pixels (or twips) and either seconds or milliseconds. So you could just fiddle with those numbers.
I'm not sure if there is anyway to send those numbers directly through the Tween constructor -- regardless of whether I used the built in functions or made my own. -
Oracle.forms.webutil.ole.OleFunctions class not found
Hi all,
I am getting oracle.forms.webutil.ole.OleFunctions class not found at design time in Forms Builder 10gR2 as well as at run time when working with webutil. Webutil is properly configured. I am using file uploading and downloading and it is working fine. but when I m working with CLIENT_OLE2, it is giving class not found exception. Can someone please help me to identify the problem.
Thanks in advance
Bilalhi
Forms [32 Bit] Version 10.1.2.0.2 (Production in this version the webutil is already installed but u have to sign jars and there is also some modifications
in formsweb.cfg.
please check this.
How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
Solution
Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
here are steps to get a small test form running, using WebUtil 1.06.
Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
Feel free to copy this note to a text editor, and do a global find/replace on
[OraHome] with your actual value (no trailing slash). Then it is easy to
copy/paste actual commands to be executed from the note copy.
1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
2) Copy or move jacob.jar and jacob.dll
[JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
cd [JacobStage]
copy jacob.jar [OraHome]\forms\java\.
copy jacob.dll [OraHome]\forms\webutil\.
The Jacob staging area is no longer needed, and may be deleted.
3) Sign frmwebutil.jar and jacob.jar
Open a DOS command prompt.
Add [OraHome]\jdk\bin to the PATH:
set PATH=[OraHome]\jdk\bin;%PATH%
Sign the files, and check the output for success:
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
[OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
you may skip this step. Otherwise,
Create a schema to hold the WebUtil stored code, and privileges needed to
connect and create a stored package. Schema name "WEBUTIL" is recommended
for no reason other than consistency over the user base.
Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
out the EXIT statement, to be able to see whether the objects were created witout
errors.
Start SQL*Plus as SYSTEM, and issue:
CREATE USER webutil IDENTIFIED BY [password]
DEFAULT TABLESPACE users
TEMPORARY TABLESPACE temp;
GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
CONNECT webutil/[password]@[connectstring]
@[OraHome]\forms\create_webutil_db.sql
-- Inspect SQL*Plus output for errors, and then
CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
Reconnect as SYSTEM, and issue:
grant execute on webutil_db to public;
5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
to the CLASSPATH entry.
6) Start the OC4J instance
7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
It is important to generate the PLX, to avoid the FRM-40039 discussed in
Note 303682.1
If the PLX is not generated, the Webutil.pll library would have to be attached with
full path information to all forms wishing to use WebUtil. This is NOT recommended.
8) Create a new FMB.
Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
There is no need to Subclass the WebutilConfig object.
Attach the Webutil.pll Library, and remove the path.
Add an ON-LOGON trigger with the code
NULL;
to avoid having to connect to an RDBMS (optional).
Create a new button on a new canvas, with the code
show_webutil_information (TRUE);
in a WHEN-BUTTON-PRESSED trigger.
Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
the "Application Server URL" is empty.
Then append "?config=webutil" at the end, so you end up with a URL of the form
http://server:port/forms/frmservlet?config=webutil
10) Run your form.sarah -
Report With Multiple Radio Button ,How to reset the values of when selected
Reaching out to the experts here. I have a report which i created a radio group which saves the value rownum when the radio buton is selected to a hidden item based on an on click event. There are currently 3 radio button , i need to be able to "reset" the value of the other items when more than of the button are selected .I.E. There are 3 buttons, user clicks button one , but then decides they need to click button two , then realizes they really wanted to perform button 3 , I want to be able to "reset" the value of the 1st two hidden items so the only value populated is the 3rd hidden item. I am new to working with these features and scenarios so any and help would be appreciated.
Here is the report
SELECT APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN1'').value=' || ROWNUM|| '"') UPDATE_RECORD
,APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN2'').value=' || ROWNUM|| '"') DELETE_RECORD
,APEX_ITEM.RADIOGROUP(1, ROWNUM, NULL,NULL,'onclick="javascript:$x(''P5_HIDDEN3'').value=' || ROWNUM|| '"') SET_PRIMARY
,papf.first_name
,papf.last_name
,hl.meaning
,pp.phone_number
,case when phone_type is not null then (select meaning from hr_lookups where lookup_type ='PHONE_TYPE' and pp.phone_type=lookup_code)
end as phone_type
,emrg.primary_contact_flag
from hr.per_all_people_f papf
,apps.hr_lookups hl
,apps.per_contact_relationships pcr
,apps.per_phones pp
,(select contact_person_id,primary_contact_flag
from apps.per_contact_relationships pcr
where pcr.person_id = :P5_PERSON_ID
and contact_type = 'EMRG') emrg
where pcr.contact_person_id in emrg.contact_person_id
and pcr.personal_flag='Y'
and contact_type <> 'EMRG'
and trunc(sysdate) between date_start and NVL(date_end,'31-DEC-4712')
and pcr.contact_type = hl.lookup_code
and hl.lookup_type='CONTACT'
and pcr.contact_person_id = papf.person_id
and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
and pcr.contact_person_id = pp.parent_id
and pp.phone_type in (select lookup_code from hr_lookups where lookup_type ='PHONE_TYPE')Related thread here How to Pass values from SQL Report into TEXT ITEM ?
Regards, -
Why does this class not read and write at same time???
I had another thread where i was trying to combine two class files together
http://forum.java.sun.com/thread.jspa?threadID=5146796
I managed to do it myself but when i run the file it does not work right. If i write a file then try and open the file it says there are no records in the file, but if i close the gui down and open the file everything get read in as normal can anybody tell me why?
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import bank.BankUI;
import bank.*;
public class testing extends JFrame {
private ObjectOutputStream output;
private BankUI userInterface;
private JButton SaveToFile, SaveAs, Exit; //////////savetofile also saves to store need to split up and have 2 buttons
//private Store store; MIGHT BE SOMETHING TO DO WITH THIS AS I HAD TO COMMENT THIS STORE OUT TO GET IT WORKING AS STORE IS USED BELOW
private Employee record;
//////////////////////////////////////from read
private ObjectInputStream input;
private JButton nextButton, openButton, nextRecordButton ;
private Store store = new Store(100);
private Employee employeeList[] = new Employee[100];
private int count = 0, next = 0;
/////////////////////////////////////////////from read end
// set up GUI
public testing()
super( "Employee Data" ); // appears in top of gui
// create instance of reusable user interface
userInterface = new BankUI( 9 ); // nine textfields
getContentPane().add( userInterface, BorderLayout.CENTER );
// configure button doTask1 for use in this program
SaveAs = userInterface.getSaveAsButton();
SaveAs.setText( "Save as.." );
//////////////////from read
openButton = userInterface.getOpenFileButton();
openButton.setText( "Open File" );
openButton.addActionListener(
// anonymous inner class to handle openButton event
new ActionListener() {
// close file and terminate application
public void actionPerformed( ActionEvent event )
openFile();
} // end anonymous inner class
); // end call to addActionListener
// register window listener for window closing event
addWindowListener(
// anonymous inner class to handle windowClosing event
new WindowAdapter() {
// close file and terminate application
public void windowClosing( WindowEvent event )
if ( input != null )
closeFile();
System.exit( 0 );
} // end anonymous inner class
); // end call to addWindowListener
// get reference to generic task button doTask2 from BankUI
nextButton = userInterface.getDoTask2Button();
nextButton.setText( "Next Record" );
nextButton.setEnabled( false );
// register listener to call readRecord when button pressed
nextButton.addActionListener(
// anonymous inner class to handle nextRecord event
new ActionListener() {
// call readRecord when user clicks nextRecord
public void actionPerformed( ActionEvent event )
readRecord();
} // end anonymous inner class
); // end call to addActionListener
//get reference to generic task button do Task3 from BankUI
// get reference to generic task button doTask3 from BankUI
nextRecordButton = userInterface.getDoTask3Button();
nextRecordButton.setText( "Get Next Record" );
nextRecordButton.setEnabled( false );
// register listener to call readRecord when button pressed
nextRecordButton.addActionListener(
// anonymous inner class to handle nextRecord event
new ActionListener() {
// call readRecord when user clicks nextRecord
public void actionPerformed( ActionEvent event )
getNextRecord();
} // end anonymous inner class
); // end call to addActionListener
///////////from read end
// register listener to call openFile when button pressed
SaveAs.addActionListener(
// anonymous inner class to handle openButton event
new ActionListener() {
// call openFile when button pressed
public void actionPerformed( ActionEvent event )
SaveLocation();
} // end anonymous inner class
); // end call to addActionListener
// configure button doTask2 for use in this program
SaveToFile = userInterface.getSaveStoreToFileButton();
SaveToFile.setText( "Save to store and to file need to split this task up" );
SaveToFile.setEnabled( false ); // disable button
// register listener to call addRecord when button pressed
SaveToFile.addActionListener(
// anonymous inner class to handle enterButton event
new ActionListener() {
// call addRecord when button pressed
public void actionPerformed( ActionEvent event )
addRecord(); // NEED TO SPLIT UP SO DONT DO BOTH
} // end anonymous inner class
); // end call to addActionListener
Exit = userInterface.getExitAndSaveButton();
Exit.setText( "Exit " );
Exit.setEnabled( false ); // disable button
// register listener to call addRecord when button pressed
Exit.addActionListener(
// anonymous inner class to handle enterButton event
new ActionListener() {
// call addRecord when button pressed
public void actionPerformed( ActionEvent event )
addRecord(); // adds record to to file
closeFile(); // closes everything
} // end anonymous inner class
); // end call to addActionListener
// register window listener to handle window closing event
addWindowListener(
// anonymous inner class to handle windowClosing event
new WindowAdapter() {
// add current record in GUI to file, then close file
public void windowClosing( WindowEvent event )
if ( output != null )
addRecord();
closeFile();
} // end anonymous inner class
); // end call to addWindowListener
setSize( 600, 500 );
setVisible( true );
store = new Store(100);
} // end CreateSequentialFile constructor
// allow user to specify file name
////////////////from read
// enable user to select file to open
private void openFile()
// display file dialog so user can select file to open
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode( JFileChooser.FILES_ONLY );
int result = fileChooser.showOpenDialog( this );
// if user clicked Cancel button on dialog, return
if ( result == JFileChooser.CANCEL_OPTION )
return;
// obtain selected file
File fileName = fileChooser.getSelectedFile();
// display error if file name invalid
if ( fileName == null || fileName.getName().equals( "" ) )
JOptionPane.showMessageDialog( this, "Invalid File Name",
"Invalid File Name", JOptionPane.ERROR_MESSAGE );
else {
// open file
try {
input = new ObjectInputStream(
new FileInputStream( fileName ) );
openButton.setEnabled( false );
nextButton.setEnabled( true );
// process exceptions opening file
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error Opening File",
"Error", JOptionPane.ERROR_MESSAGE );
} // end else
} // end method openFile
public void readRecord() // need to merger with next record
Employee record;
// input the values from the file
try {
record = ( Employee ) input.readObject();
employeeList[count++]= record;
store.add(record);/////////ADDS record to Store
store.displayAll();
System.out.println("Count is " + store.getCount());
// create array of Strings to display in GUI
String values[] = {
String.valueOf(record.getName()),
String.valueOf(record.getGender()),
String.valueOf( record.getDateOfBirth()),
String.valueOf( record.getID()),
String.valueOf( record.getStartDate()),
String.valueOf( record.getSalary()),
String.valueOf( record.getAddress()),
String.valueOf( record.getNatInsNo()),
String.valueOf( record.getPhone())
// i added all those bits above split onto one line to look neater
// display record contents
userInterface.setFieldValues( values );
// display message when end-of-file reached
catch ( EOFException endOfFileException ) {
nextButton.setEnabled( false );
nextRecordButton.setEnabled( true );
JOptionPane.showMessageDialog( this, "No more records in file",
"End of File", JOptionPane.ERROR_MESSAGE );
// display error message if class is not found
catch ( ClassNotFoundException classNotFoundException ) {
JOptionPane.showMessageDialog( this, "Unable to create object",
"Class Not Found", JOptionPane.ERROR_MESSAGE );
// display error message if cannot read due to problem with file
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this,
"Error during read from file",
"Read Error", JOptionPane.ERROR_MESSAGE );
} // end method readRecord
private void getNextRecord()
Employee record = employeeList[next++%count];//cycles throught accounts
//create aray of string to display in GUI
String values[] = {String.valueOf(record.getName()),
String.valueOf(record.getGender()),
String.valueOf( record.getStartDate() ), String.valueOf( record.getAddress()),
String.valueOf( record.getNatInsNo()),
String.valueOf( record.getPhone()),
String.valueOf( record.getID() ),
String.valueOf( record.getDateOfBirth() ),
String.valueOf( record.getSalary() ) };
//display record contents
userInterface.setFieldValues(values);
//display record content
///////////////////////////////////from read end
private void SaveLocation()
// display file dialog, so user can choose file to open
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode( JFileChooser.FILES_ONLY );
int result = fileChooser.showSaveDialog( this );
// if user clicked Cancel button on dialog, return
if ( result == JFileChooser.CANCEL_OPTION )
return;
File fileName = fileChooser.getSelectedFile(); // get selected file
// display error if invalid
if ( fileName == null || fileName.getName().equals( "" ) )
JOptionPane.showMessageDialog( this, "Invalid File Name",
"Invalid File Name", JOptionPane.ERROR_MESSAGE );
else {
// open file
try {
output = new ObjectOutputStream(
new FileOutputStream( fileName ) );
SaveAs.setEnabled( false );
SaveToFile.setEnabled( true );
Exit.setEnabled( true );
// process exceptions from opening file
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error Opening File",
"Error", JOptionPane.ERROR_MESSAGE );
} // end else
} // end method openFile
// close file and terminate application
private void closeFile()
// close file
try {
//you want to cycle through each recordand add them to store here.
int storeSize = store.getCount();
for (int i = 0; i<storeSize;i++)
output.writeObject(store.elementAt(i));
output.close();
input.close();// from read!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
System.exit( 0 );
// process exceptions from closing file
catch( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error closing file",
"Error", JOptionPane.ERROR_MESSAGE );
System.exit( 1 );
} // end method closeFile
// add record to file
public void addRecord()
int employeeNumber = 0;
String fieldValues[] = userInterface.getFieldValues();
// if account field value is not empty
if ( ! fieldValues[ BankUI.IDNUMBER ].equals( "" ) ) {
// output values to file
try {
employeeNumber = Integer.parseInt(
fieldValues[ BankUI.IDNUMBER ] );
String dob = fieldValues[ BankUI.DOB ];
String[] dateofBirth = dob.split ("-"); // what used to put between number chnage to /
String sDate = fieldValues[ BankUI.START ];
String[] startDate = sDate.split ("-");
String sex = fieldValues[ BankUI.GENDER ];
char gender = (sex.charAt(0)); // check if m or f prob check in employee
if ( employeeNumber >= 0 ) {
/* create new record =String name, char gender, Date dob, String add, String nin, String phone, String id, Date start, float salary*/
record = new Employee(
fieldValues[ BankUI.NAME ],
gender,
new Date( Integer.parseInt(dateofBirth[0]),
Integer.parseInt(dateofBirth[1]),
Integer.parseInt(dateofBirth[2])),
fieldValues[ BankUI.ADDRESS ],
fieldValues[ BankUI.NATINTNO ],
fieldValues[ BankUI.PHONE ],
fieldValues[ BankUI.IDNUMBER ],
new Date( Integer.parseInt(startDate[0]),
Integer.parseInt(startDate[1]),
Integer.parseInt(startDate[2])),
Float.parseFloat( fieldValues[ BankUI.SALARY ] ));
if (!store.isFull())
store.add(record);
else
JOptionPane.showMessageDialog( this, "The Store is full you cannot add\n"+
"anymore employees. \nPlease Save Current File and Create a New File." );
System.out.println("Store full");
store.displayAll();
System.out.println("Count is " + store.getCount());
// output record and flush buffer
//output.writeObject( record );
output.flush();
else
JOptionPane.showMessageDialog( this,
"Account number must be greater than 0",
"Bad account number", JOptionPane.ERROR_MESSAGE );
// clear textfields
userInterface.clearFields();
} // end try
// process invalid account number or balance format
catch ( NumberFormatException formatException ) {
JOptionPane.showMessageDialog( this,
"Bad ID number, Date or Salary", "Invalid Number Format",
JOptionPane.ERROR_MESSAGE );
// process exceptions from file output
catch ( ArrayIndexOutOfBoundsException ArrayException ) {
JOptionPane.showMessageDialog( this, "Error with Start Date or Date of Birth\nPlease enter like: 01-01-2001",
"IO Exception", JOptionPane.ERROR_MESSAGE );
// process exceptions from file output
catch ( IOException ioException ) {
JOptionPane.showMessageDialog( this, "Error writing to file",
"IO Exception", JOptionPane.ERROR_MESSAGE );
closeFile();
} // end if
} // end method addRecord
public static void main( String args[] )
new testing();
} // end class CreateSequentialFileSure you can read and write at the same time. But normally you would be reading from one place and writing to another place.
I rather regret avoiding the OP's earlier post asking how to combine two classes. I looked at the two classes posted and realized the best thing to do was actually to break them into more classes. But I also realized it was going to be a big job explaining why and how, and I just don't have the patience for that sort of thing.
So now we have a Big Ball Of Tar™ and I feel partly responsible. -
Af:table and selectOneChoice, creating a new row resets selected value
Hello,
I have a table containing 4 columns, first two are read-only (outputtext) and next 2 contains selectOneChoice , table model is baed on java.util.List
adding a new row, works fine but it resets the selectOneChoice(dropbox) selected value to First Index For All Rows
so everytime you add a new row, it resets the value to the very First Value in the dropbox for all rows,
it seems after PPR it loses the selected value in SelectOneChoice for each row...
any ideas?
Thanks,Hi,
What is the EL expression given for value property of selectOneChoice list?
I guess it is the bean variable and it is same for each row, due to which selection in any selectOneChoice list in table modifies the same bean variable and sets the same value for lists in all other rows too(same happens in case of new insertion also, when you insert new record selectonechoice list points to the first value if no selection item is not added), in case of selectonechoice list you need to handle the selected values differently for each row. If you can share sample code, I can tell you what could be the problem.
Sireesha -
Valuation Class not appearing in Material Master (Finished Goods)
Hi Friends,
I am facing problem with Valuation Class not appearing while creation of Material Master especially in Finished Products
when i give the Valuation class it showing the message like below
*Valuation class IBM2 not allowed for material type Finished product*
*Message no. M3180*
*Diagnosis*
*The combination of values you have entered is not defined in the system.*
*Procedure*
*Check your entries, and choose a valid value or combination of values with F4.*
*If you want the value(s) to be defined in the system, contact your systems administrator.*
and When i press F4 in Valuation Class area it is not appearing
Can any one give me the solution
Regards,
RamHi Ram,
Go to Transaction Code OMSK. You will find three tabs there.
Go to the second tab i.e, valuation class, note the account category reference assigned to the valuation class "IBM2".
Come out of that screen and access the third tab ie., Material Type/Account Category reference.
Check whether Account category reference related to the valuation class "IBM2" is assigned to ther material type "Finished product" or not.
If not, assign the same. It should work.
Warm regards,
Murukan Arunachalam
Maybe you are looking for
-
Epson r800 prints, but does not appear in Printer List: can't use Utilities
My Epson r800 prints, but does not appear in Printer List. It is connected via USB to the iMac. A Brother LH-2070N is connected via AirPort Extreme. I need to use Utilities to clean the head of cartridge, check levels, etc.. Is there a way to fix thi
-
Sales, costs and Operating Earnings Report
Hi Experts, I have been asked to create a report on Sales, costs and Operating Earnings and i have no experience with the reporting side of BW yet. Can you please give me a step by step guide on how to go about completing this task? Thank you.
-
Why scribblenauts remix doesn't appear at app store in my IPad 2
I realy want this game please help me
-
Download a Document from a custom table
Hello, Currently I maintain HTML documents in a CLOB and I want to provide the user a means to download it as a file. I followed the instructions for this in the HOWTO but I am having problems executing my procedure via a URL along the lines of: #OWN
-
Why are my NEF files appearing faded and dull?
Just purchased ps cs4 and I'm totally new to it having used capture nx2 before now, but I don't understand why my nef files are coming out so faded and low in contrast? When I download from the camera and when I download via Nikon transfer. The files