Help in Ajax Urgent!!!!!!!
Hi,
i am using Ajax in my j2ee project for realtime form validation.
the problem is i want to sent a collection of values to my XMLHttpRequest from my Action Class.Actually now i am sending those values as plain text using response.getWriter().write(); method and fetching that in the client side using responseText.here is sample code wat i am using
while(rs.next()){
StringBuffer list=new StringBuffer();
list.append(rs.getString(1));
list.append(rs.getString(2));
System.out.println(list.toString());
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write(list.toString());
All i wanted is to send that values in xml format
is that enough, setting that content as xml will sent my response in xml
Hi Santhosh,
In Global definition,
declare in global data
Z_TY_ACCOUNTDATA type Z_TY_ACCOUNTDATA
ITAB_ACCOUNTDATA type standard table of Z_TY_ACCOUNTDATA
wa_ACCOUNTDATA type Z_TY_ACCOUNTDATA
Then in program lines , you should declare input and output parameters.
Example.
Input : Z_TY_ACCOUNTDATA
Output : ITAB_ACCOUNTDATA
code
select * from Z_TY_ACCOUNTDATA into table ITAB_ACCOUNTDATA .
then in loop,give as follows.
loop ITAB_ACCOUNTDATA into wa_ACCOUNTDATA .
then design your text element like this.
Hope this helps.
Regards,
J.Jayanthi
Similar Messages
-
Help me! URGENT cannot find my printer model on hp website - how do i know which cartridge to order.
Depend on which country you are in btw, for the US this should be 61 black and 61 tricolor. For most of europe this will be 301 black and 301 tri color. So to be sure tell me from which country you are.
Say "Thanks" by clicking the Kudos Star in the post that helped you.
Although I work for HP my posts and replies are my own
Please mark the post that solves your problem as "Accepted Solution" -
How can i set dynamice for week on Selection screen..pls help me..Urgent
Hi..All
please Help me .. i am very confused..
i need to set a varient for week which is dynamic on selection screen.
b) Week from current week to current week + 2. (<b>Dynamic selection)</b>how can i set dynamice for week on Selection screen,,
how can i do this..i am alrady set dynamice variant for Date.. there is option for D.. but in case of week there is a no option.
pls help me..urgent
thamks in advance.
mayukhHi,
I think the way out is use the dynamic select option while setting up the varinat and use sy-datum to sy-datum+9 which should essentially serve the purpose.
While saving the variant, for that particular date field check the Selection variable checkbox, then Choose D
option and then choose current days + or - option from there.
Rgds,
HR -
hi experts'
i have to generate asset utilization report in webdynpro
inputs for report are some rfcs
i get result from rfcs
i need to float report i used bussinessgraphic object
its not interactive
if i go for tables
how to create tables with drill down inside table
how to set color for each cell of table depending on condition
please help me
its urgent
and send me code n linkHi Vani,
Your requirement has many things
1. How to call RFCs
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#15 [original link is broken]
2. Once you have data, how to work with BusinessGraphics ?
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ba2db0e5-0601-0010-9790-e271902f2c38
(This docs contatins all the required info on webDynpro UIElements)
3.Tables
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#46 [original link is broken]
Regards,Anilkumar -
problem with connecting ipad 2 with crestron cp2e...help plss its urgent...
I hv a ipad 2 with mobile pro g connected with cp2e. when i pressed any button in ipad its connet with cp2e but after 4-5 sec one error comes (warning wifi was powered off while the device was in auto -lock(sleep)press connect to reconnect) when i pressed again its connected with cp2e. i am using netgear wireless access point . i also has been changed access point as well as updated ipad firmware bt problem is as it is .. pls help.Hi have you solved the issue ?
Cause I have the same problem.
Tnx -
i want to delete my data from iphone while i doesnot have the access but i know my apple id so plz help me its urgent, i want to delete my data from iphone while i doesnot have the access but i know my apple id so plz help me its urgent
Welcome to the Apple Community.
You can only wipe your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely. -
Plz help me its urgent i have iphone i dnt want my deleted texts my phone was jailbroken if i do restore widout backup should i jailbreak again ,should i unlock again,will the data of texts premantly erased plz answr me
Jailbroken phones cannot be discussed in an Apple forum. If you synced your phone with your computer the texts will be in the backup, so if you restore the backup you may get them back, but with a jailbroken phone it's anybody's guess what will happen.
-
i can't download the apple ios 5 for the ipad. after downloading around 10 % an error no. 3259 occurs. it's a network error. please help . it's urgent. i am having apple ipad 2 3G wifi.
i switched off all the security settings and all the firewalls.
i m unable to install any of the app on the ipad
so i saw the apple support and it said to update the older version of my ipad.
and niether am i able to download the update nor am i able to download any app and install it in my ipad2
i also tried to download an .ipsw file (ios5 update) from torrentz bt i am also unable to install from that as itunes rjects that file and gives an error. and also tries to delete that file. plz anyone help urgently. -
hi all,
i have a problem in my bsp page.
in my bsp page, there is a button which is clicked, a new pop up window will appear. after the pop up window closed the caller window will be submitted.
after submitted, the server side script ( ABAP Code in event OnInputProcessing & OnInitiallization will be run ).
in order to be able to do this, i used java script. and it's already works well.
the problem is : there is 1 record that the ABAP code in event OnInputProcessing is not run. I have set break points on one of code in event OnInputProcessing, but it seems event OnInputProcessing is not triggered. if i also put the break point in event OnInitialization, it will stop in the break point in event OnInitialization.
is there any clue why this happened ?
please help, it's urgent because it's happened in my production system
many thanks in advance
regards
eddhiehi Raja,
thanks for the respond.
the code is already works for 2 years and just 1 record of ... perhaps thousands record that used the same code.
for other record, it go to event OnInputProcessing
but just this 1 record it won't go to event OnInputProcessing.
any clue ?
please help
regards -
My iPad refuses to turn on... HELP THIS IS URGENT!
Just thismorning i had my iPad 2 working fine... until it ran out of charge. Yes, I put it on the charger. Once it had been charging for about 30 minutes, i attempted to switch it on, but the apple logo sign never moved. At some times, the iPad returned to the normal unlock screen, but when i did, it froze and the frozen apple sign appeared again.
I thought that maybe plugging it into my computer backup source would help... Well, it kinda helped but the iPad is reacting as if it is brand new and its name is now ''iPad'' when clearly, before i had this problem, it was named ''Nicole's iPad''.
Please help, this is urgent! I have school on Tuesday and if it is not repaired by then, my assignments and homework will be lost. ThankyouTry to hard boot it by pressing home key and power key at same time and keep them pressed to the count of one to fifteen.
And wait for few minutes it will work
If its not working yet then connect it iTunes and update it to iOS 6,
Before updating do not forget to back up your iPad -
Need some urgent help please.
I have a court summons for some information that has been taken from my Icloud account.
I believe my ex employer has hired someone to hack into my account. They have had my laptop inspected by a forensic company. Orginally they did not know what the five emails I sent myself were about. Now they do. I believe they have hacked my Icloud account. I have asked Apple to help but they are refusing is there any way I can find out please feel free to email me [email protected] Thanks have to go to court tomorrow morning.It sounds like you really might want to consider seeking legal advice for this matter.
-
Error while opening a module. plz help me, very urgent.
when i try to open a module, the following error message appears on my screen.
" no j2ee component found in d:\krisp\programs\servlets".
i've installed bea in c: drive and my servlet program is in d: drive.
plz help me, it's very urgent.Can you provide some more information? What were you doing when this happened?
Can you post the entire error message?
-- Rob
WLS Blog http://dev2dev.bea.com/blog/rwoollen/ -
How to write code for this logic, plz help me very urgent
Hi All,
i am new to sap-abap, i got this work and i m working on this can any body help me in writing code, plz help me, this is very very urgent.
here i m giving my logic, can anybody send me the code related to this logic.
this is very urgent .
this program o/p should be in ALV format and need to create one commond 'SAVE" on this o/t list if user clicks save processedon and processedby fields in ZFIBUE should be updated automatically.
i am creating one custom table zfibue having fields: (serialno, bukrs, matnr,prdha,hkont,gsber,wrbtr,budat, credate, cretime,processed, processedon, processedby,mapped)
fields of zfibue:
serailno = numc
bukrs = char
matnr = char
prdha = char
hkont = char
gsber = char
wrbtr = char
budat = date
credate = date
cretime = time
processed= char
processedon = date
processedby = char
mapped = char are belongs to above type data types
and seelct-optionfields: s_bukrs for bseg-bukrs
s_hkont for bseg-hkont,
s_budat for bkpf-budat,
s_processed for zfibue-processed,
s_processedon for zfibue-processedon,
s_mapped. for zfibue-mapped
parameters: p_chk1 as checkbox,
p_chk2 as checkbox.
p_filepath type rlgrap-filename.
1.1 Validate the user inputs (S_BUKRS and S_HKONT) against respective check tables (T001 and SKB1). If the validation fails, provide respective error message. Eg: Invalid input for Company Code.
1.2 Fetch SERIALNO, BUKRS, MATNR, PRDHA, HKONT, GSBER, WRBTR, BUDAT, CREDATE, CRETIME, PROCESSED, PROCESSEDON, PROCESSEDBY, MAPPED from table ZFIBUE into internal table GT_ZFIBUE where BUKRS IN S_BUKRS, HKONT IN S_HKONT, BUDAT IN S_BUDAT, PROCESSED IN S_PROCESSED, PROCESSEDON IN S_PROCESSEDON, and MAPPED IN S_MAPPED.
1.3 If P_CHK2 = X, go to step 1.11. Else continue.
1.4 If P_CHK1 = X, continue. Else go to step 1.9
1.5 Fetch MATNR, PRDHA from MARA into GT_MARA for all entries in GT_ZFIBUE where MATNR = GT_ZFIBUE-MATNR.
1.6 Sort and delete adjacent duplicates from GT_MARA based on MATNR.
1.7 Loop through GT_ZFIBUE where PRDHA = blank.
Read Table GT_MARA based on MATNR = GT_ZFIBUE-MATNR.
IF sy-subrc = 0.
Move GT_MARA-PRDHA to GT_ZFIBUE-PRDHA.
Modify Table GT_ZFIBUE. Update Product Hierarchy
Endif.
Fetch PRDHA, GSBER from ZFIBU into GT_ZFIBU for all entries in GT_ZFIBUE where PRDHA = GT_ZFIBUE-PRDHA.
Read Table GT_ZFIBU based on PRDHA = GT_ZFIBUE-PRDHA.
IF sy-subrc = 0.
Move GT_ZFIBU-GSBER to GT_ZFIBUE-GSBER.
Move X to GT_ZFIBUE-MAPPED.
Modify Table GT_ZFIBUE.
Endif.
Endloop.
1.8 Modify database table ZFIBUE from GT_ZFIBUE.
1.9 Fill the field catalog table GT_FIELDCAT using the details of output fields listed in section Inputs/Outputs (above).
Eg: LWA_ FIELDCAT -SELTEXT_L = 'Serial Number.
LWA_ FIELDCAT -DATATYPE = NUMC.
LWA_ FIELDCAT -OUTPUTLEN = 9.
LWA_ FIELDCAT -TABNAME = 'GT_ZFIBUE'.
LWA_ FIELDCAT-FIELDNAME = 'SERIALNO'.
Append LWA_FIELDCAT to GT_FIELDCAT
Note: a) The output field GT_ZFIBUE-PROCESSED will be editable marking INPUT = X in field catalog (GT_FIELDCAT).
b) The standard ALV functionality will be used to give the user option for selecting all or blocks of entries at a time.
c) The PF-STATUS STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN will be copied to the program and modified to include a SAVE button.
1.10 Call the function module REUSE_ALV_GRID_DISPLAY passing output table GT_ZFIBUE and field catalog GT_FIELDCAT. Additional parameters like I_CALLBACK_PF_STATUS_SET (= ZFIBUESTAT) and I_CALLBACK_USER_COMMAND (=HANDLE_USER_ACTION) will also be passed to handle user events. Go to 2.14.
1.11 Download the file to P_FILEPATH using function module GUI_DOWNLOAD passing GT_ZFIBUE.
1.12 Exit Program.
Logic to be implemented in routine Handle_User_Action
This routine will have the following interface:
FORM Handle_User_Action USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
ENDFORM.
Following logic will be implemented in this routine:
1. If r_ucomm = SAVE, continue. Else exit.
2. Loop through GT_ZFIBUE where SEL_ROW = X. Row is selected
a. IF GT_ZFIBUE-PROCESSED = X.
i. GT_ZFIBUE-PROCESSEDON = SY-DATUM.
ii. GT_ZFIBUE-PROCESSEDBY = SY-UNAME.
iii. MODIFY ZFIBUE FROM work area GT_ZFIBUE.
Endif.
Endloop.Hi Swathi,
If it's very very urgent then you better get on with it, don't waste time on the web. Chop chop. -
guys, i need help.... is anyone there have an idea about opengl...? ill attach 4 files that needs to be enhanced or debug for possible errors. to see the canvas... you should have atleast all the needed lib and jar of opengl in your pc.
its urgent, its for our thesis actually....ill be dividing the codes with the use of (" **** ")sign...
* Main.java
* Created on 29 January 2007, 08:12
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong;
* @author welcome
public class Main {
/** Creates a new instance of Main */
public Main() {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
frmMain f = new frmMain();
* frmMain.java
* Created on November 10, 2006, 10:52 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong; // create a floder named longgong and add the class inside
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
* @author all user
public class frmMain extends JFrame implements ActionListener, ChangeListener, ItemListener{
JPanel pnlWest, pnlEast, pnlCenter, pnlSouth, pnlTitle, pnlSlider, pnlPlayers;
JSlider slrSpeed;
JList lstResults;
String varResults [] = new String[31];
JLabel lblPlayers, lblTitle;
JCheckBox lblPlayer1, lblPlayer2, lblPlayer3, lblPlayer4, lblPlayer5, lblPlayer6;
ImageIcon imgDice1;
MyCanvas canvas;
JButton btnStart, btnStop;
JMenuBar menuBar;
JMenu menuFile, menuView, menuHelp;
JMenuItem menuNew, menuExit, menuIn, menuOut, menuHigh, menuPlay, menuAbout;
boolean isNew = false;
/** Creates a new instance of frmMain */
public frmMain() {
setLayout(new BorderLayout());
setTitle("Longgong");
setSize(780,600);
canvas = new MyCanvas(getSize().width, getSize().height);
imgDice1 = new ImageIcon("c:\\java\\images\\one.png");
menuBar = new JMenuBar();
menuFile = new JMenu("File");
menuView = new JMenu("View");
menuHelp = new JMenu("Help");
menuNew = new JMenuItem ("New Game");
menuNew.addActionListener(this);
menuExit = new JMenuItem ("Exit");
menuExit.addActionListener(this);
menuIn = new JMenuItem ("Zoom In");
menuIn.addActionListener(this);
menuOut = new JMenuItem ("Zoom Out");
menuOut.addActionListener(this);
menuHigh = new JMenuItem ("High Score");
menuPlay = new JMenuItem ("How To Play");
menuPlay.addActionListener(this);
menuAbout = new JMenuItem ("About");
menuAbout.addActionListener(this);
menuFile.add(menuNew);
menuFile.add(menuExit);
menuView.add(menuIn);
menuView.add(menuOut);
menuView.add(menuHigh);
menuHelp.add(menuPlay);
menuHelp.add(menuAbout);
menuBar.add(menuFile);
menuBar.add(menuView);
menuBar.add(menuHelp);
setJMenuBar(menuBar);
varResults[0] = "Dice Results";
varResults[1] = "1. 3-4-2";
varResults[2] = "2. 3-1-4";
varResults[3] = "3. 3-6-5";
slrSpeed = new JSlider(0, 100, 0);
slrSpeed.setPaintTicks(true);
slrSpeed.setMinorTickSpacing(1);
slrSpeed.setPaintLabels(true);
slrSpeed.setSnapToTicks(true);
slrSpeed.addChangeListener(this);
slrSpeed.setEnabled(false);
btnStart = new JButton("Start");
btnStart.addActionListener(this);
btnStop = new JButton("Stop");
btnStop.addActionListener(this);
pnlWest = new JPanel();
pnlEast = new JPanel();
pnlCenter = new JPanel();
pnlSouth = new JPanel();
pnlTitle = new JPanel();
pnlSlider = new JPanel();
pnlPlayers = new JPanel();
pnlWest.setLayout(new BorderLayout());
pnlEast.setLayout(new BorderLayout());
pnlEast.setPreferredSize(new Dimension(100,400));
pnlCenter.setLayout(new BorderLayout());
pnlSouth.setLayout(new FlowLayout());
pnlTitle.setLayout(new FlowLayout());
pnlSlider.setLayout(new FlowLayout());
pnlPlayers.setLayout(new BoxLayout(pnlPlayers,BoxLayout.Y_AXIS));
pnlPlayers.setPreferredSize(new Dimension(150,400));
lblPlayers = new JLabel(" Players: Choice (s)");
lblPlayer1 = new JCheckBox("None");
lblPlayer1.addItemListener(this);
lblPlayer2 = new JCheckBox("None");
lblPlayer2.addItemListener(this);
lblPlayer3 = new JCheckBox("None");
lblPlayer3.addItemListener(this);
lblPlayer4 = new JCheckBox("None");
lblPlayer4.addItemListener(this);
lblPlayer5 = new JCheckBox("None");
lblPlayer5.addItemListener(this);
lblPlayer6 = new JCheckBox("None");
lblPlayer6.addItemListener(this);
lstResults = new JList(varResults);
pnlPlayers.add(lblPlayers);
pnlPlayers.add(lblPlayer1);
pnlPlayers.add(lblPlayer2);
pnlPlayers.add(lblPlayer3);
pnlPlayers.add(lblPlayer4);
pnlPlayers.add(lblPlayer5);
pnlPlayers.add(lblPlayer6);
pnlSlider.add(slrSpeed);
pnlSlider.add(btnStart);
pnlSlider.add(btnStop);
pnlEast.add(BorderLayout.CENTER, lstResults);
pnlCenter.add(BorderLayout.SOUTH, pnlSlider);
pnlCenter.add(BorderLayout.CENTER, canvas);
lblTitle = new JLabel("LONGGONG DICE GAME SIMULATION");
pnlTitle.add(lblTitle);
getContentPane().add(BorderLayout.NORTH,pnlTitle);
getContentPane().add(BorderLayout.WEST,pnlPlayers);
getContentPane().add(BorderLayout.EAST,pnlEast);
getContentPane().add(BorderLayout.CENTER, pnlCenter);
getContentPane().add(BorderLayout.SOUTH,pnlSouth);
setResizable(false);
canvas.start();
show();
//name change when player is selected
public void itemStateChanged(ItemEvent e) {
Object source = e.getItemSelectable();
int choice;
if (source == lblPlayer1) {
if (lblPlayer1.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer1);
if (source == lblPlayer2) {
if (lblPlayer2.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer2);
if (source == lblPlayer3) {
if (lblPlayer3.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer3);
if (source == lblPlayer4) {
if (lblPlayer4.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer4);
if (source == lblPlayer5) {
if (lblPlayer5.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer5);
if (source == lblPlayer6) {
if (lblPlayer6.isSelected()) {
frmChoices fchoices = new frmChoices(lblPlayer6);
// if (e.getStateChange() == ItemEvent.DESELECTED)
//...make a note of it...
//slider speed change
public void stateChanged(ChangeEvent e){
canvas.speed(slrSpeed.getValue());
public void actionPerformed (ActionEvent e){
if (e.getActionCommand().equals ("Exit")){
System.exit (0);
//connects to frmNew
if (e.getActionCommand().equals ("New Game")){
frmNew n = new frmNew(this);
lblPlayer1.setText("None");
lblPlayer2.setText("None");
lblPlayer3.setText("None");
lblPlayer4.setText("None");
lblPlayer5.setText("None");
lblPlayer6.setText("None");
isNew = true;
lblPlayer1.setSelected(false);
lblPlayer2.setSelected(false);
lblPlayer3.setSelected(false);
lblPlayer4.setSelected(false);
lblPlayer5.setSelected(false);
lblPlayer6.setSelected(false);
if (e.getActionCommand().equals ("Start")){
slrSpeed.setEnabled(true);
canvas.setRandomDicePosition();
if (e.getActionCommand().equals ("Stop")){
slrSpeed.setValue(0);
slrSpeed.setEnabled(false);
//ADDED
if (e.getActionCommand().equals ("New Game")){
frmNew n = new frmNew(this);
if (e.getActionCommand().equals ("Zoom In")){
canvas.zoomIn();
if (e.getActionCommand().equals ("Zoom Out")){
canvas.zoomOut();
if (e.getActionCommand().equals ("How To Play")){
frmPlay p = new frmPlay();
if (e.getActionCommand().equals ("About")){
frmAbout a = new frmAbout();
package longgong;
// Java classes
import java.awt.*;
import java.awt.event.*;
import java.net.URL;
// GL4Java classes
import gl4java.GLContext;
import gl4java.awt.GLAnimCanvas;
import gl4java.utils.textures.*;
class MyCanvas extends GLAnimCanvas implements KeyListener, MouseListener
// holds information on which keys are held down.
boolean[] keys=new boolean[256];
float xrot; // X Rotation ( NEW )
float yrot; // Y Rotation ( NEW )
float zrot; // Z Rotation ( NEW )
float[] diceRotX = new float[3];
float[] diceRotY = new float[3];
float[] diceRotZ = new float[3];
float[] diceTranX = new float[3];
float[] diceTranY = new float[3];
float[] diceTranZ = new float[3];
float speedValue;
Dice[] D;
float zoom = -15.0f;
public MyCanvas(int w, int h)
super(w, h);
//Registers this canvas to process keyboard events, and Mouse events
addKeyListener(this);
addMouseListener(this);
setAnimateFps(60); // seemed to be essential in getting any performance
speedValue=0.0f;
diceTranX[0] = -2.0f;
diceTranY[0] = 2.0f;
diceTranZ[0] = zoom;
diceTranX[1] = 2.0f;
diceTranY[1] = 1.0f;
diceTranZ[1] = zoom;
diceTranX[2] = 0.0f;
diceTranY[2] = -2.0f;
diceTranZ[2] = zoom;
public void zoomIn(){
zoom=zoom+1.0f;
public void zoomOut(){
zoom=zoom-1.0f;
public void speed(float s){
speedValue=s/100;
/** void reshape(int width, int height) Called after the first paint command. */
public void reshape(int width, int height)
if(height==0)height=1;
gl.glViewport(0, 0, width, height); // Reset The Current Viewport And Perspective Transformation
gl.glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
gl.glLoadIdentity(); // Reset The Projection Matrix
glu.gluPerspective(45.0f, width / height, 0.1f, 100.0f); // Calculate The Aspect Ratio Of The Window
gl.glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
gl.glLoadIdentity(); // Reset The ModalView Matrix
/** void preInit() Called just BEFORE the GL-Context is created. */
public void preInit()
{ doubleBuffer = true; stereoView = false; // buffering but not stereoview
public void setRandomDicePosition(){
for (int i=0; i<3; i++){
D.setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
D[i].getRandomDice();
/** void init() Called just AFTER the GL-Context is created. */
public void init()
//float width = (float)getSize().width;
//float height = (float)getSize().height;
D = new Dice[5];
D[0] = new Dice(this);
D[1] = new Dice(this);
D[2] = new Dice(this);
//initialize dice location
for (int i=0; i<3; i++){
D[i].setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
D[i].getRandomDice();
gl.glEnable(GL_TEXTURE_2D); //Enable Texture Mapping ( NEW )
gl.glShadeModel(GL_SMOOTH); //Enables Smooth Color Shading
gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //This Will Clear The Background Color To Black
gl.glClearDepth(1.0); //Enables Clearing Of The Depth Buffer
gl.glEnable(GL_DEPTH_TEST); //Enables Depth Testing
gl.glDepthFunc(GL_LEQUAL); //The Type Of Depth Test To Do
gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Really Nice Perspective Calculations
public void DrawBoundaries(){
double x,y;
double radius = 5.0f;
gl.glLoadIdentity(); // Reset The View
gl.glTranslatef(0.0f,0.0f,zoom-1.0f);
gl.glRotatef(90.0f,0.0f,0.0f,1.0f);
gl.glColor3f(0.6f,0.3f,0.3f);
gl.glBegin(gl.GL_POLYGON);
// angle is
// x = radius * (cosine of angle)
// y = radius * (sine of angle)
for (double a=0; a<360; a++) {
x = radius * (Math.cos(a));
y = radius * (Math.sin(a));
gl.glVertex3d(x, y, 0.0f);
gl.glEnd();
gl.glColor3f(1.0f,1.0f,1.0f);
public void DrawGLScene()
gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer
DrawBoundaries();
for (int i=0; i<3; i++){
D[i].startDiceMovement();
D[i].setTz(zoom);
D[i].setSpeed(speedValue);
D[i].drawDice();
for (int i=0; i<3; i++){
//start of loop
if(i!=0){
if (D[0].getMoveLeft()==true){
if ( (D[0].getTx()>=D[i].getTx()-1.0f) && (D[0].getTx()<=D[i].getTx()) ){
if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
else D[0].setMoveLeft(true);
}else{
if ( (D[0].getTx()-1<=D[i].getTx()) && (D[0].getTx()-1>=D[i].getTx()-1) ){
if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
else D[0].setMoveLeft(true);
if (D[0].getMoveUp()==true){
if ( (D[0].getTy()>=D[i].getTy()-1.0f) && (D[0].getTy()<=D[i].getTy()) ){
if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
else D[0].setMoveUp(true);
}else{
if ( (D[0].getTy()-1<=D[i].getTy()) && (D[0].getTy()-1>=D[i].getTy()-1) ){
if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
else D[0].setMoveUp(true);
}//end of if i!=0
if(i!=1){
if (D[1].getMoveLeft()==true){
if ( (D[1].getTx()>=D[i].getTx()-1.0f) && (D[1].getTx()<=D[i].getTx()) ){
if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
else D[1].setMoveLeft(true);
}else{
if ( (D[1].getTx()-1<=D[i].getTx()) && (D[1].getTx()-1>=D[i].getTx()-1) ){
if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
else D[1].setMoveLeft(true);
if (D[1].getMoveUp()==true){
if ( (D[1].getTy()>=D[i].getTy()-1.0f) && (D[1].getTy()<=D[i].getTy()) ){
if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
else D[1].setMoveUp(true);
}else{
if ( (D[1].getTy()-1<=D[i].getTy()) && (D[1].getTy()-1>=D[i].getTy()-1) ){
if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
else D[1].setMoveUp(true);
}//end of if i!=1
if(i!=2){
if (D[2].getMoveLeft()==true){
if ( (D[2].getTx()>=D[i].getTx()-1.0f) && (D[2].getTx()<=D[i].getTx()) ){
if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
else D[2].setMoveLeft(true);
}else{
if ( (D[2].getTx()-1<=D[i].getTx()) && (D[2].getTx()-1>=D[i].getTx()-1) ){
if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
else D[2].setMoveLeft(true);
if (D[2].getMoveUp()==true){
if ( (D[2].getTy()>=D[i].getTy()-1.0f) && (D[2].getTy()<=D[i].getTy()) ){
if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
else D[2].setMoveUp(true);
}else{
if ( (D[2].getTy()-1<=D[i].getTy()) && (D[2].getTy()-1>=D[i].getTy()-1) ){
if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
else D[2].setMoveUp(true);
}//end of if i!=2
//end of loop for i
/** void display() Draw to the canvas. */
// Purely a Java thing. Simple calls DrawGLScene once GL is Initialized
public void display()
for(int i=0;i<3;i++){
glj.gljMakeCurrent(); //Ensure GL is initialised correctly
DrawGLScene();
glj.gljSwap(); //Swap buffers
glj.gljFree(); // release GL
// Key Listener events
public void keyTyped(KeyEvent e){
public void keyPressed(KeyEvent e){
switch(e.getKeyCode())
//Kill app
case KeyEvent.VK_ESCAPE:
System.exit(0);
break;
default :
if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
keys[e.getKeyCode()]=true;
break;
public void keyReleased(KeyEvent e){
if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
keys[e.getKeyCode()]=false;
// mouse listener events
public void mouseEntered( MouseEvent evt )
Component comp = evt.getComponent();
if( comp.equals(this ) )
//requestFocus();
public void mouseExited( MouseEvent evt ){
public void mousePressed( MouseEvent evt ){
public void mouseReleased( MouseEvent evt ){
public void mouseClicked( MouseEvent evt )
Component comp = evt.getComponent();
if( comp.equals(this ) )
requestFocus();
* Dice.java
* Created on 08 February 2007, 22:26
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package longgong;
import java.net.URL;
import gl4java.GLContext;
import gl4java.awt.GLAnimCanvas;
import gl4java.utils.textures.*;
* @author welcome
public class Dice {
GLAnimCanvas glCanvas ;
URL codeBase;
int[]texture1 = new int[1]; //Storage for one texture ( NEW )
int[]texture2 = new int[1]; //Storage for one texture ( NEW )
int[]texture3 = new int[1]; //Storage for one texture ( NEW )
int[]texture4 = new int[1]; //Storage for one texture ( NEW )
int[]texture5 = new int[1]; //Storage for one texture ( NEW )
int[]texture6 = new int[1]; //Storage for one texture ( NEW )
float rx;
float ry;
float rz;
float tx;
float ty;
float tz;
float speed;
boolean txMoveLeft;
boolean tyMoveUp;
boolean tzMoveFront;
/** Creates a new instance of Dice */
public Dice(GLAnimCanvas g) {
glCanvas = g;
if(!LoadGLTexture("c:\\java\\images\\one.png",texture1)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\two.png",texture2)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\three.png",texture3)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\four.png",texture4)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\five.png",texture5)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
if(!LoadGLTexture("c:\\java\\images\\six.png",texture6)){
System.out.println("Failed to load Textures,Bailing!");
System.exit(0);
txMoveLeft = true;
tyMoveUp = true;
public boolean inCircleBoundaries(float x, float y, float radius)
float r;
r = (float)Math.sqrt((x*x) + (y*y));
if (r <= radius)
return true;
else
return false;
public void setCoordinates(float corRx,float corRy,float corRz,float corTx,float corTy,float corTz){
rx = corRx;
ry = corRy;
rz = corRz;
tx = corTx;
ty = corTy;
tz = corTz;
public void getRandomDice(){
int num = (int)(Math.random() * 6);
if (num==1){
rx=0.0f;
ry=0.0f;
rz=0.0f;
else if (num==2){
rx=90.0f;
ry=0.0f;
rz=0.0f;
else if (num==3){
rx=0.0f;
ry=-90.0f;
rz=0.0f;
else if (num==4){
rx=0.0f;
ry=90.0f;
rz=0.0f;
else if (num==5){
rx=-90.0f;
ry=0.0f;
rz=0.0f;
else{
rx=180.0f;
ry=0.0f;
rz=0.0f;
public float getTx(){
return tx+0.5f;
public float getTy(){
return ty+0.5f;
public float getTz(){
return tz+0.5f;
public void setTz(float z){
tz=z;
public boolean getMoveLeft(){
return txMoveLeft;
public boolean getMoveUp(){
return tyMoveUp;
public void setMoveLeft(boolean m){
txMoveLeft = m;
public void setMoveUp(boolean m){
tyMoveUp = m;
public void startDiceMovement(){
if (txMoveLeft==true) {
tx+=speed;
else {
tx-=speed;
if (tyMoveUp==true) {
ty+=speed;
else {
ty-=speed;
ry+=(speed*4);
rx+=(speed*4);
//rz+=(speed*2);
//tx+=speed;
//ty+=speed;
//tz+=speed;
if (inCircleBoundaries(tx,ty,3.5f)==false) {
if (tx>=3.0f) txMoveLeft = false;
if (tx<=-3.0f) txMoveLeft = true;
if (ty>=3.0f) tyMoveUp = false;
if (ty<=-3.0f) tyMoveUp = true;
public void setSpeed(float s){
speed = s;
public void drawDice(){
glCanvas.gl.glLoadIdentity(); // Reset The View
glCanvas.gl.glTranslatef(tx,ty,tz);
glCanvas.gl.glRotatef(rx,1.0f,0.0f,0.0f);
glCanvas.gl.glRotatef(ry,0.0f,1.0f,0.0f);
glCanvas.gl.glRotatef(rz,0.0f,0.0f,1.0f);
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture1[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Front Face
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, 1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture6[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Back Face
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture2[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Top Face
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, -1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture5[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Bottom Face
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, 1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture3[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Right face
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, 1.0f);
glCanvas.gl.glEnd();
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture4[0]);
glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);
// Left Face
glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, 1.0f);
glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, 1.0f, -1.0f);
glCanvas.gl.glEnd();
public boolean LoadGLTexture(String fileName, int textureNumber[])
PngTextureLoader texLoader = new PngTextureLoader(glCanvas.gl, glCanvas.glu);
if(codeBase!=null)
texLoader.readTexture(codeBase, fileName);
else
texLoader.readTexture(fileName);
if(texLoader.isOk())
//Create Texture
glCanvas.gl.glGenTextures(1, textureNumber);
glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, textureNumber[0]);
glCanvas.gl.glTexParameteri(glCanvas.gl.ill attach 4 files that needs to be
enhanced or debug for possible errors. i hate to break it to you, but even if you post this for the seventh time, finding and fixing errors in your code remains your task. -
NetBeans VWP: help w/ AJAX, is it possible to refresh more than one field?
I have a form with lots of fields. Some of them the value is retrieved from the database, for example the service field, where the user types the service id and at the onChange event the form is submitted, executing the processValueChange handler. In this handler the service data is retrieved from the database and a static text with the service name and a static text with the service price are updated.
I'm trying to do this with AJAX, so at the onChange event of the service id text field I have the following:
document.getElementById('form1:stServiceName').refresh('form1:tfServiceId');
document.getElementById('form1:stServicePrice').refresh('form1:tfServiceId');It works, but the processValueChange handler is executed 2 times, and that's a problem...
Isn't there any way to refresh more than one field? With something like this for example:
document.getElementById('form1:tfServiceId').submit();
document.getElementById('form1:stServiceName').refresh();
document.getElementById('form1:stServicePrice').refresh();Thanks for any help,
FelipeYou may want to try creating your own custom popup lov
http://www.oracle.com/technology/products/database/application_express/howtos/how_to_create_custom_popups.html
you can then create your own lov report listing all people and then when you click the name required you can passback as many values as required to the calling form.
Maybe you are looking for
-
What does pin 1 do on the docking connector? (iPod won't sync with AVIC-D3)
My wife's 5th Gen iPod stopped working with her AVIC-D3 header in her vehicle. I can connect other iPods of various generations and they work just fine. This has gone back to Best Buy (its still under extended warranty) five (yes, 5) times and they n
-
After uninstall, Bridge CC will not reinstall
I have a new computer (PC). I downloaded Bridge CC soon after I first got the computer and admittedly did not use if for several weeks. When I went in to first use it there were several drivers missing. I thought the easiest thing to do would be t
-
Hi this is Saroj.My question is wheather smartforms are language dependent or independent.I am not asking about client ,i am asking about language.Please answer the question. regards saroj
-
File Not Found Error When Rendering Motion Menu
Hi there. I'm attempting to render a motion menu and keep getting the error "file not found". All of the necessary files are available and no specific missing file is mentioned. The background video is a .m2v, and there is a .wav audio file too. They
-
Adobe Digital edition does not respond and is EXTREMELY SLOW
The PDFs take forever to load or scroll or navigate through the pages. Highlighting certain sections hangs up the processor. How is this even a thing? Totally unacceptable & clearly the WORST