Need help fine tuning my code

This program im making is eventualy going to end up as an attack calculator; the thing is i need help finetuning my program so that a) when it is run it will start at the very top of the window ancestory. b) the 2 windows are locked onto the same ancestory (ancestory is the position of the window relitive to the others: ie the window that is on top of another is higher on the ancestory). this code runs and should easily cut and paste.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class AttackCalculator implements ActionListener{
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
     "Use the legend below for the correct government number. ",
      "Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, ",
      "Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, ",
      "Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 ",
       public static void createAndShowGUI(){
       String[] labels = {
      "Enter how many troops you have: ", "Enter how many tanks you have: ",
      "Enter how many jets you have: ", "Enter how many ships you have: ",
      "Enter your government type (1-12 refer above): ","Enter your health(%)",
      "Enter your stage number (1-4): ", "Enter how many troops your enemy has: ",
      "Enter how many tanks your enemy has: ", "Enter how many jets your enemy has: ",
      "Enter how many ships your enemy has: ", "Enter your enemy's government type (1-12 refer above): ",
      "Enter your enemy's stage number (1-4): ", "Enter your enemy health: "};
        int numPairs = labels.length;
       JTextField[] textField = {
       new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
       new JTextField( 1 ), new JTextField( 10 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ),
       new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 ), new JTextField( 1 )};
        //Create and populate the panel.
        JPanel p = new JPanel(new SpringLayout());
        for (int i = 0; i < numPairs; i++) {
            JLabel l = new JLabel(labels, JLabel.TRAILING);
p.add(l);
l.setLabelFor(textField[i]);
p.add(textField[i]);
JLabel l = new JLabel("Your union has 2+ members", JLabel.TRAILING);
p.add(l);
JCheckBox checkBox = new JCheckBox("", false);
l.setLabelFor( checkBox );
p.add(checkBox );
JLabel la = new JLabel("Enemy's union 2+ members", JLabel.TRAILING);
p.add(la);
JCheckBox jcheckBox = new JCheckBox("", false);
la.setLabelFor( jcheckBox );
p.add(jcheckBox);
JButton calculate = new JButton("Calculate");
p.add(calculate);
//Lay out the panel.
SpringUtilities.makeCompactGrid(p,
16, 2, //rows, cols
6, 6, //initX, initY
6, 6); //xPad, yPad
JFrame contentPane = new JFrame();
contentPane.setSize(420, 105);
JLabel title1 = new JLabel("Use the legend below for the correct government number. \n");
JLabel title2 = new JLabel("Legend: Democracy = 1, Communism = 2, Autocracy = 3, Fascism = 4, \n");
JLabel title3 = new JLabel("Monarchy = 5, Pacifism = 6, Technocracy = 7, Theocracy = 8, \n");
JLabel title4 = new JLabel("Anarchy = 9, Corpocracy = 10, Ochlocracy = 11, Physiocracy = 12 " );
contentPane.add( title1 );
contentPane.add( title2 );
contentPane.add( title3 );
contentPane.add( title4 );
SpringLayout layout = new SpringLayout();
contentPane.setLayout(layout);
//Adjust constraints for the label so it's at (5,5).
layout.putConstraint(SpringLayout.WEST, title1,
5,
SpringLayout.WEST, contentPane);
layout.putConstraint(SpringLayout.NORTH, title1,
5,
SpringLayout.NORTH, contentPane);
//Adjust constraints for the label so it's at (5,5).
layout.putConstraint(SpringLayout.WEST, title2,
5,
SpringLayout.WEST, contentPane);
layout.putConstraint(SpringLayout.NORTH, title2,
20,
SpringLayout.NORTH, contentPane);
//Adjust constraints for the label so it's at (5,5).
layout.putConstraint(SpringLayout.WEST, title3,
5,
SpringLayout.WEST, contentPane);
layout.putConstraint(SpringLayout.NORTH, title3,
35,
SpringLayout.NORTH, contentPane);
//Adjust constraints for the label so it's at (5,5).
layout.putConstraint(SpringLayout.WEST, title4,
5,
SpringLayout.WEST, contentPane);
layout.putConstraint(SpringLayout.NORTH, title4,
50,
SpringLayout.NORTH, contentPane);
//Create and set up the window.
JFrame frame1 = new JFrame("Endless Revolution Attack Calculator");
frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//Make sure we have nice window decorations.
JFrame.setDefaultLookAndFeelDecorated(true);
//Set up the content pane.
p.setOpaque(true); //content panes must be opaque
frame1.setContentPane(p);
//Display the window.
frame1.pack();
frame1.setLocationRelativeTo( null );
frame1.setVisible(true);
contentPane.setLocationRelativeTo( null );
contentPane.setVisible(true);
public void actionPerformed( ActionEvent evt){
public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
here is the second class needed to run
import javax.swing.*;
import javax.swing.SpringLayout;
import java.awt.*;
* A 1.4 file that provides utility methods for
* creating form- or grid-style layouts with SpringLayout.
* These utilities are used by several programs, such as
* SpringBox and SpringCompactGrid.
public class SpringUtilities {
     * A debugging utility that prints to stdout the component's
     * minimum, preferred, and maximum sizes.
    public static void printSizes(Component c) {
        System.out.println("minimumSize = " + c.getMinimumSize());
        System.out.println("preferredSize = " + c.getPreferredSize());
        System.out.println("maximumSize = " + c.getMaximumSize());
     * Aligns the first <code>rows</code> * <code>cols</code>
     * components of <code>parent</code> in
     * a grid. Each component is as big as the maximum
     * preferred width and height of the components.
     * The parent is made just big enough to fit them all.
     * @param rows number of rows
     * @param cols number of columns
     * @param initialX x location to start the grid at
     * @param initialY y location to start the grid at
     * @param xPad x padding between cells
     * @param yPad y padding between cells
    public static void makeGrid(Container parent,
                                int rows, int cols,
                                int initialX, int initialY,
                                int xPad, int yPad) {
        SpringLayout layout;
        try {
            layout = (SpringLayout)parent.getLayout();
        } catch (ClassCastException exc) {
            System.err.println("The first argument to makeGrid must use SpringLayout.");
            return;
        Spring xPadSpring = Spring.constant(xPad);
        Spring yPadSpring = Spring.constant(yPad);
        Spring initialXSpring = Spring.constant(initialX);
        Spring initialYSpring = Spring.constant(initialY);
        int max = rows * cols;
        //Calculate Springs that are the max of the width/height so that all
        //cells have the same size.
        Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)).
                                    getWidth();
        Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)).
                                    getWidth();
        for (int i = 1; i < max; i++) {
            SpringLayout.Constraints cons = layout.getConstraints(
                                            parent.getComponent(i));
            maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth());
            maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight());
        //Apply the new width/height Spring. This forces all the
        //components to have the same size.
        for (int i = 0; i < max; i++) {
            SpringLayout.Constraints cons = layout.getConstraints(
                                            parent.getComponent(i));
            cons.setWidth(maxWidthSpring);
            cons.setHeight(maxHeightSpring);
        //Then adjust the x/y constraints of all the cells so that they
        //are aligned in a grid.
        SpringLayout.Constraints lastCons = null;
        SpringLayout.Constraints lastRowCons = null;
        for (int i = 0; i < max; i++) {
            SpringLayout.Constraints cons = layout.getConstraints(
                                                 parent.getComponent(i));
            if (i % cols == 0) { //start of new row
                lastRowCons = lastCons;
                cons.setX(initialXSpring);
            } else { //x position depends on previous component
                cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST),
                                     xPadSpring));
            if (i / cols == 0) { //first row
                cons.setY(initialYSpring);
            } else { //y position depends on previous row
                cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH),
                                     yPadSpring));
            lastCons = cons;
        //Set the parent's size.
        SpringLayout.Constraints pCons = layout.getConstraints(parent);
        pCons.setConstraint(SpringLayout.SOUTH,
                            Spring.sum(
                                Spring.constant(yPad),
                                lastCons.getConstraint(SpringLayout.SOUTH)));
        pCons.setConstraint(SpringLayout.EAST,
                            Spring.sum(
                                Spring.constant(xPad),
                                lastCons.getConstraint(SpringLayout.EAST)));
    /* Used by makeCompactGrid. */
    private static SpringLayout.Constraints getConstraintsForCell(
                                                int row, int col,
                                                Container parent,
                                                int cols) {
        SpringLayout layout = (SpringLayout) parent.getLayout();
        Component c = parent.getComponent(row * cols + col);
        return layout.getConstraints(c);
     * Aligns the first <code>rows</code> * <code>cols</code>
     * components of <code>parent</code> in
     * a grid. Each component in a column is as wide as the maximum
     * preferred width of the components in that column;
     * height is similarly determined for each row.
     * The parent is made just big enough to fit them all.
     * @param rows number of rows
     * @param cols number of columns
     * @param initialX x location to start the grid at
     * @param initialY y location to start the grid at
     * @param xPad x padding between cells
     * @param yPad y padding between cells
    public static void makeCompactGrid(Container parent,
                                       int rows, int cols,
                                       int initialX, int initialY,
                                       int xPad, int yPad) {
        SpringLayout layout;
        try {
            layout = (SpringLayout)parent.getLayout();
        } catch (ClassCastException exc) {
            System.err.println("The first argument to makeCompactGrid must use SpringLayout.");
            return;
        //Align all cells in each column and make them the same width.
        Spring x = Spring.constant(initialX);
        for (int c = 0; c < cols; c++) {
            Spring width = Spring.constant(0);
            for (int r = 0; r < rows; r++) {
                width = Spring.max(width,
                                   getConstraintsForCell(r, c, parent, cols).
                                       getWidth());
            for (int r = 0; r < rows; r++) {
                SpringLayout.Constraints constraints =
                        getConstraintsForCell(r, c, parent, cols);
                constraints.setX(x);
                constraints.setWidth(width);
            x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad)));
        //Align all cells in each row and make them the same height.
        Spring y = Spring.constant(initialY);
        for (int r = 0; r < rows; r++) {
            Spring height = Spring.constant(0);
            for (int c = 0; c < cols; c++) {
                height = Spring.max(height,
                                    getConstraintsForCell(r, c, parent, cols).
                                        getHeight());
            for (int c = 0; c < cols; c++) {
                SpringLayout.Constraints constraints =
                        getConstraintsForCell(r, c, parent, cols);
                constraints.setY(y);
                constraints.setHeight(height);
            y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad)));
        //Set the parent's size.
        SpringLayout.Constraints pCons = layout.getConstraints(parent);
        pCons.setConstraint(SpringLayout.SOUTH, y);
        pCons.setConstraint(SpringLayout.EAST, x);
}I know this is a lot but when I have tried to put out the portion where I belived the problem to be, didnt work, people couldent help, so here it is all of it.

it wouldn't run for me, until I changed these lines
contentPane.add( title1 );
contentPane.add( title2 );
contentPane.add( title3 );
contentPane.add( title4 );
SpringLayout layout = new SpringLayout();
contentPane.setLayout(layout);
to these
contentPane.getContentPane().add( title1 );
contentPane.getContentPane().add( title2 );
contentPane.getContentPane().add( title3 );
contentPane.getContentPane().add( title4 );
SpringLayout layout = new SpringLayout();
contentPane.getContentPane().setLayout(layout);
then it worked OK, smaller frame on top (the one with the info), larger frame behind.
both above all other windows
made it into a .jar file (in case IDE influenced above) and ran the same way

Similar Messages

  • Need help fine tuning my gallery

    Hello everybody... first let me post the code and then I'll post the errors and what needs to be done...
    XML Code:
    <images>
    <image src="images/image1.jpg" title="Jelly 4" url="images/image1.jpg" />
    <image src="images/image2.jpg" title="Cat" url="images/image2.jpg" />
    <image src="images/image3.jpg" title="Statue" url="images/image3.jpg" />
    <image src="images/image4.jpg" title="Arch 3" url="images/image4.jpg" />
    <image src="images/image5.jpg" title="Penguin" url="images/image5.jpg" />
    <image src="images/image6.jpg" title="Jelly" url="images/image6.jpg" />
    <image src="images/image7.jpg" title="Statue 2" url="images/image7.jpg" />
    <image src="images/image8.jpg" title="Arch 1" url="images/image8.jpg" />
    <image src="images/image9.jpg" title="Arch 2" url="images/image9.jpg" />
    </images>
    AS 3.0 Code:
    import gs.*;
    import gs.easing.*;
    //load xml
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    var xmlPath:String = "image-scroller.xml";
    xmlLoader.load(new URLRequest(xmlPath));
    function LoadXML(e:Event):void {
         xmlData = new XML(e.target.data);
         buildScroller(xmlData.image);
    //declaring variables
    var scroller:MovieClip = new MovieClip();
    var speed:Number;
    var padding:Number = 5;
    var thumbFadeOut:Number = .2;
    var thumbFadeIn:Number = 1;
    var thumbSmall:Number = 1;
    var thumbLarge:Number = 1.1;
    this.addChild(scroller);
    scroller.y = scroller.x = padding;
    var thisOne:MovieClip
    //build scroller from xml
    function buildScroller(imageList:XMLList):void{
         for (var item:uint = 0; item < imageList.length(); item++ )  {
              thisOne = new MovieClip();
              //outline
              var blackBox:Sprite = new Sprite();
              blackBox.graphics.beginFill(0xFFFFFF);
              blackBox.graphics.drawRect( -1, -1, 82, 82);
              blackBox.alpha = thumbFadeOut;
              thisOne.addChild(blackBox);
              thisOne.blackBox = blackBox;
              thisOne.x = thisOne.myx = (80 + padding) * item;
              thisOne.itemNum = item;
              thisOne.title = imageList[item].attribute("title");
              thisOne.link = imageList[item].attribute("url");
              thisOne.src = imageList[item].attribute("src");
              //image container
              var thisThumb:Sprite = new Sprite();
              //add image
              var ldr:Loader = new Loader();
              var urlReq:URLRequest = new URLRequest(thisOne.src);
              ldr.load(urlReq);
              //assign event listeners for Loader
              ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
              ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
              thisThumb.addChild(ldr);
              thisOne.addChild(thisThumb);
              //create listeners for this thumb
              thisOne.buttonMode = true;
              thisOne.addEventListener(MouseEvent.MOUSE_OVER, overScrollerItem);
              thisOne.addEventListener(MouseEvent.MOUSE_OUT, outScrollerItem);
              thisOne.addEventListener(MouseEvent.CLICK, clickScrollerItem);
              //add item to the scroller mc
              scroller.addChild(thisOne);
         scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);
    function overScrollerItem(e:MouseEvent):void {
         //trace("over" + e.currentTarget.name);
         TweenMax.to(e.currentTarget, 0.5, { scaleX:thumbLarge, scaleY:thumbLarge, x:e.currentTarget.myx - e.currentTarget.width * Math.abs(thumbSmall - thumbLarge)/2, y: -e.currentTarget.width * Math.abs(thumbSmall - thumbLarge)/2} );
         TweenMax.to(e.currentTarget.blackBox, 1, { alpha:thumbFadeIn} );
    function outScrollerItem(e:MouseEvent):void {
         //trace("out" + e.currentTarget.name);
         TweenMax.to(e.currentTarget, 0.5, { scaleX:thumbSmall, scaleY:thumbSmall, x:e.currentTarget.myx, y:0} );
         TweenMax.to(e.currentTarget.blackBox, 0.5, { alpha:thumbFadeOut} );
    var mcFullImage:MovieClip;
    var fullLdr:Loader
    function clickScrollerItem(e:MouseEvent):void {
         mcFullImage = new MovieClip();
         fullLdr = new Loader()
         var urlReq:URLRequest = new URLRequest(e.currentTarget.link);
         fullLdr.load(urlReq);
         fullLdr.contentLoaderInfo.addEventListener(Event.INIT, initHandler)
         addChild(mcFullImage);
         mcFullImage.x = 100;
         mcFullImage.y = 90;
         mcFullImage.addChild(fullLdr);
         var image:Bitmap = Bitmap(e.target.content);
         image.smoothing = true;
    function initHandler(e:Event):void
         TweenMax.from(fullLdr, 1, {alpha: 0});
         mcFullImage.addEventListener(MouseEvent.CLICK, removeImg);
    function removeImg(e:MouseEvent):void
         TweenMax.to(mcFullImage, 0.2, {alpha: 0, onComplete: unloadImg});
    function unloadImg(e:Event):void
         removeChild(fullLdr);
         fullLdr.unload();
         removeChild(mcFullImage);
         mcFullImage = null;
    function completeHandler(e:Event):void {
         //size image into scroller
         resizeMe(e.target.loader.parent, 80, 80, true, true, false);
         var image:Bitmap = Bitmap(e.target.content);
         image.smoothing = true;
         TweenMax.to(e.target.loader.parent.parent, 0.5, { alpha:1} );
    function errorHandler(e:IOErrorEvent):void {
         trace("thumbnail error="+e);
    //The resizing function
    // parameters
    // required: mc = the movieClip to resize
    // required: maxW = either the size of the box to resize to, or just the maximum desired width
    // optional: maxH = if desired resize area is not a square, the maximum desired height. default is to match to maxW (so if you want to resize to 200x200, just send 200 once)
    // optional: constrainProportions = boolean to determine if you want to constrain proportions or skew image. default true.
    function resizeMe(mc:DisplayObject, maxW:Number, maxH:Number=0, constrainProportions:Boolean=true, centerHor:Boolean=true, centerVert:Boolean=true):void{
        maxH = maxH == 0 ? maxW : maxH;
        mc.width = maxW;
        mc.height = maxH;
        if (constrainProportions) {
            mc.scaleX < mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;
         if (centerHor) {
              mc.x = (maxW - mc.width) / 2;
         if (centerVert){
              mc.y = (maxH - mc.height) / 2;
    function moveScrollerThumbs(e:Event):void {
         if ( mouseY > scroller.y && mouseY < scroller.y + scroller.height) {//vertically over scroller
              if (mouseX < stage.stageWidth/2 - padding*2 && mouseX > 0) {//left of stage explicitly
                   speed = -(mouseX - (stage.stageWidth/2 - padding*2)) / 8;
              else if (mouseX > stage.stageWidth/2 + padding*2 && mouseX < stage.stageWidth) {//right of stage explicitly
                   speed = -(mouseX - (stage.stageWidth/2 + padding*2)) / 8;
              else {
                   speed = 0;
              scroller.x += speed;
              //scroller limits
              if (scroller.x < -scroller.width + stage.stageWidth - padding) { //if scrolled too far left
                   scroller.x = -scroller.width + stage.stageWidth - padding;
              else if (scroller.x > padding) { //if scrolled to far right
                   scroller.x = padding;
    The problem is that when I click on a thumb it shows up the image nicely, but when I click on the image to close it, I get this error:
    ArgumentError: Error #1063: Argument count mismatch on XMLScroller_fla::MainTimeline/unloadImg(). Expected 1, got 0.
         at Function/http://adobe.com/AS3/2006/builtin::apply()
         at gs::TweenLite/complete()
         at gs::TweenMax/complete()
         at gs::TweenMax/render()
         at gs::TweenLite$/updateAll()
    Also, when there's already an image which is loaded, and I click another thumb, a new image loads on top of the one that is already loaded. I tried removing "thisOne.addEventListener(MouseEvent.CLICK, clickScrollerItem);" in the clickScrollerItem function but it didn't work.... Any suggestions?

    Now I tried adding a boolean to check whether there's an image that is already loaded to the stage or not and still no luck I really need to fix this, so please someone tell me where did I go wrong...!! here's the code:
    import gs.*;
    import gs.easing.*;
    //load xml
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    var xmlPath:String = "image-scroller.xml";
    xmlLoader.load(new URLRequest(xmlPath));
    function LoadXML(e:Event):void {
         xmlData = new XML(e.target.data);
         buildScroller(xmlData.image);
    //declaring variables
    var scroller:MovieClip = new MovieClip();
    var speed:Number;
    var padding:Number = 5;
    var thumbFadeOut:Number = .2;
    var thumbFadeIn:Number = 1;
    var thumbSmall:Number = 1;
    var thumbLarge:Number = 1.1;
    this.addChild(scroller);
    scroller.y = scroller.x = padding;
    var thisOne:MovieClip
    var loaded:Boolean = false;
    //build scroller from xml
    function buildScroller(imageList:XMLList):void{
         for (var item:uint = 0; item < imageList.length(); item++ )  {
              thisOne = new MovieClip();
              //outline
              var blackBox:Sprite = new Sprite();
              blackBox.graphics.beginFill(0xFFFFFF);
              blackBox.graphics.drawRect( -1, -1, 82, 82);
              blackBox.alpha = thumbFadeOut;
              thisOne.addChild(blackBox);
              thisOne.blackBox = blackBox;
              thisOne.x = thisOne.myx = (80 + padding) * item;
              thisOne.itemNum = item;
              thisOne.title = imageList[item].attribute("title");
              thisOne.link = imageList[item].attribute("url");
              thisOne.src = imageList[item].attribute("src");
              //image container
              var thisThumb:Sprite = new Sprite();
              //add image
              var ldr:Loader = new Loader();
              var urlReq:URLRequest = new URLRequest(thisOne.src);
              ldr.load(urlReq);
              //assign event listeners for Loader
              ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
              ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
              thisThumb.addChild(ldr);
              thisOne.addChild(thisThumb);
              //create listeners for this thumb
              thisOne.buttonMode = true;
              thisOne.addEventListener(MouseEvent.MOUSE_OVER, overScrollerItem);
              thisOne.addEventListener(MouseEvent.MOUSE_OUT, outScrollerItem);
              if(loaded == false) {
              thisOne.addEventListener(MouseEvent.CLICK, clickScrollerItem);
              //add item to the scroller mc
              scroller.addChild(thisOne);
         scroller.addEventListener(Event.ENTER_FRAME, moveScrollerThumbs);
    function overScrollerItem(e:MouseEvent):void {
         //trace("over" + e.currentTarget.name);
         TweenMax.to(e.currentTarget, 0.5, { scaleX:thumbLarge, scaleY:thumbLarge, x:e.currentTarget.myx - e.currentTarget.width * Math.abs(thumbSmall - thumbLarge)/2, y: -e.currentTarget.width * Math.abs(thumbSmall - thumbLarge)/2} );
         TweenMax.to(e.currentTarget.blackBox, 1, { alpha:thumbFadeIn} );
    function outScrollerItem(e:MouseEvent):void {
         //trace("out" + e.currentTarget.name);
         TweenMax.to(e.currentTarget, 0.5, { scaleX:thumbSmall, scaleY:thumbSmall, x:e.currentTarget.myx, y:0} );
         TweenMax.to(e.currentTarget.blackBox, 0.5, { alpha:thumbFadeOut} );
    var mcFullImage:MovieClip;
    var fullLdr:Loader
    function clickScrollerItem(e:MouseEvent):void {
         mcFullImage = new MovieClip();
         fullLdr = new Loader()
         var urlReq:URLRequest = new URLRequest(e.currentTarget.link);
         fullLdr.load(urlReq);
         fullLdr.contentLoaderInfo.addEventListener(Event.INIT, initHandler)
         addChild(mcFullImage);
         mcFullImage.x = 100;
         mcFullImage.y = 90;
         mcFullImage.addChild(fullLdr);
         var image:Bitmap = Bitmap(e.target.content);
         image.smoothing = true;
         loaded = true;
    function initHandler(e:Event):void
         TweenMax.from(fullLdr, 1, {alpha: 0});
         mcFullImage.addEventListener(MouseEvent.CLICK, removeImg);
    function removeImg(e:MouseEvent):void
         TweenMax.to(mcFullImage, 0.2, {alpha: 0, onComplete: unloadImg});
    function unloadImg():void
         mcFullImage.removeChild(fullLdr);
         fullLdr.unload();
         removeChild(mcFullImage);
         mcFullImage = null;
         loaded = false;
    function completeHandler(e:Event):void {
         //size image into scroller
         resizeMe(e.target.loader.parent, 80, 80, true, true, false);
         var image:Bitmap = Bitmap(e.target.content);
         image.smoothing = true;
         TweenMax.to(e.target.loader.parent.parent, 0.5, { alpha:1} );
    function errorHandler(e:IOErrorEvent):void {
         trace("thumbnail error="+e);
    //The resizing function
    // parameters
    // required: mc = the movieClip to resize
    // required: maxW = either the size of the box to resize to, or just the maximum desired width
    // optional: maxH = if desired resize area is not a square, the maximum desired height. default is to match to maxW (so if you want to resize to 200x200, just send 200 once)
    // optional: constrainProportions = boolean to determine if you want to constrain proportions or skew image. default true.
    function resizeMe(mc:DisplayObject, maxW:Number, maxH:Number=0, constrainProportions:Boolean=true, centerHor:Boolean=true, centerVert:Boolean=true):void{
        maxH = maxH == 0 ? maxW : maxH;
        mc.width = maxW;
        mc.height = maxH;
        if (constrainProportions) {
            mc.scaleX < mc.scaleY ? mc.scaleY = mc.scaleX : mc.scaleX = mc.scaleY;
         if (centerHor) {
              mc.x = (maxW - mc.width) / 2;
         if (centerVert){
              mc.y = (maxH - mc.height) / 2;
    function moveScrollerThumbs(e:Event):void {
         if ( mouseY > scroller.y && mouseY < scroller.y + scroller.height) {//vertically over scroller
              if (mouseX < stage.stageWidth/2 - padding*2 && mouseX > 0) {//left of stage explicitly
                   speed = -(mouseX - (stage.stageWidth/2 - padding*2)) / 8;
              else if (mouseX > stage.stageWidth/2 + padding*2 && mouseX < stage.stageWidth) {//right of stage explicitly
                   speed = -(mouseX - (stage.stageWidth/2 + padding*2)) / 8;
              else {
                   speed = 0;
              scroller.x += speed;
              //scroller limits
              if (scroller.x < -scroller.width + stage.stageWidth - padding) { //if scrolled too far left
                   scroller.x = -scroller.width + stage.stageWidth - padding;
              else if (scroller.x > padding) { //if scrolled to far right
                   scroller.x = padding;

  • Need help fine tuning my pc

    can anyone give some help on the best setup for my system including over clocking
    here is the details of my system and thanx in advance
    processor intel pentium 4
    code name northwood
    voltage 1.536v
    specification intel cpu 3.06ghz
    core speed 3006mhz
    multiplier x15.0
    fsb 200.0mhz
    bus speed 800.0mhz
    L1 date 8 kbytes
    L1 trace 12kbytes
    Level 2 512kbytes
    L2 cacha
    location on chip
    size 512kbytes
    associativity 8-way
    line size 64bytes
    ratio full
    frequency 3006 mhz
    bus width 256 bits
    prefetch lodge yes
    motherboard
    micro-star inc.
    model ms-6728 100
    chip intel i865p/pe/g/i848p rev a2
    southbridge intel 82801eb [1ch5]
    AGP
    revision 3.0
    aperture size 256mb
    data transer rate 8x
    side band addressing
    memory
    1024 mbytes
    channels dual
    performance mode enabled
    modules info dane-elec DDR-SDRAM PC3200-X2
    frequency 133.3mhz
    fsb dram 3:4
    cas#latency 2.0 clocks
    ras#to cas# delay 3 clocks
    ras# percharge 2 clocks
    cycle time [tras] 5 clocks

    There is no one overclockring to rule them all. Try here instead: https://forum-en.msi.com/index.php?boardid=27&sid=

  • Need help with a activation code for Adobe Acrobat X Standard for my PC,, Don't have older version serial numbers,  threw programs away,  only have Adobe Acrobat X Standard,  need a code to unlock program?

    Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7. 

    You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.

  • I need help getting new authorization codes for digital copies

    I need help getting new authorization codes for digital copies of movies. Can someone help me out?

    There's a lot of results in Google when you search for this but unfortunately refreshing the page doesn't seem to generate a different code anymore. Mine also says already redeemed

  • Need help to redeem contact code for OS X 7

    Need help to redeem contact code for OS X 7

    Hello NOREDEEM,
    Thanks for using Apple Support Communities.
    If you have the purchase code for OS X 10.7 Lion, then you can follow the directions below to redeem it on your Mac.
    Mac App Store: Redeem gift cards and download codes
    Take care,
    Alex H.

  • I need help I scratched the code off my itunes card

    I need help I scratched the code off my itunes card

    Click here and ask the iTunes Store staff for assistance. Supply them with as much of the code as you can.
    (102006)

  • Need Help With Simple ABAP Code

    Hello,
    I'm loading data from a DSO (ZDTBMAJ) to an Infocube (ZCBRAD06). I need help with ABAP code to some of the logic in Start Routine. DSO has 2 fields: ZOCTDLINX & ZOCBRDMAJ.
    1. Need to populate ZOCPRODCD & ZOCREFNUM fields in Infocube:
        Logic:-
        Lookup /BI0/PMATERIAL, if /BIC/ZOCBRDMAJ = /BIC/OIZOCBRDMAJ
        then /BIC/ZOCPRODCD = ZOCPRODCD in Infocube
               /BIC/ZOCREFNUM = ZOCREFNUM in Infocube         
    2. Need to populate 0G_CWWTER field in Infocube:
        Logic:
        Lookup /BIC/PZOCTDLINX, if /BIC/ZOCTDLINX = BIC/OIZOCTDLINX
        then G_CWWTER = 0G_CWWTER in Infocube.
    I would need to read single row at a time.
    Thanks!

    I resolved it.

  • Need help with pie chart code

    I am new to Java and am having problems and I am in need of some help. I have written the code for my Mortgage Calculator but do not know how to get my chart to work. I found an example of the chart code in my text book but I am not sure if I wrote it wrong. When I run the MortCalc code it compiles but the Pie Chart code won't. I tried to run the chart code by itself but it prints out another calculator. My question is 1.) Is my chart code written wrong? and 2.) How do i enter it into my MortCalc code so that I get my chart?
    **Below I have included the assignment(so you know what I am doing exactly) and below that the pie chart code just in case you have questions. Thanks for any advice you can give.
    **If you need the rest of the code I can post it too. It was too long to post with the pie chart code.
    Assignment:
    Write the program in Java(w/ a GUI) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage adn the user's selection from a menu of availible mortgage loans:
    --7 yrs @ 5.35%
    --15 yrs @ 5.5%
    --30 yrs @ 5.75%
    Use an array for the mortgage data for the different loans. Read the interst rates to fill the array from a sequential file. Display the mortgage payment amount followed by the loan balance and interest paid for each payment over the term of the loan. Add graphics in the form of a chart.Allow the user to loop back and enter a new amount and make a new selection of quit. Please insert comments in the program to document the program.
    CODE:
    import java.awt.Color;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    //Class to hold a value for a slice
    public class PieValue {
    double value;
    Color color;
    public PieValue(double value, Color color) {
    this.value = value;
    this.color = color;
    // slices is an array of values that represent the size of each slice.
    public void drawPie(Graphics2D g, Rectangle area, PieValue[] slices) {
    // Get total value of all slices
    double total = 0.0D;
    for (int i=0; i<slices.length; i++) {
    total += slices.value;
    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i++) {
    // Compute the start and stop angles
    startAngle = (int)(curValue * 360 / total);
    int arcAngle = (int)(slices[i].value * 360 / total);
    // Ensure that rounding errors do not leave a gap between the first and last slice
    if (i == slices.length-1) {
    arcAngle = 360 - startAngle;
    // Set the color and draw a filled arc
    g.setColor(slices[i].color);
    g.fillArc(area.x, area.y, area.width, area.height, startAngle, arcAngle);
    curValue += slices[i].value;

    // Draw each pie slice
    double curValue = 0.0D;
    int startAngle = 0;
    for (int i=0; i<slices.length; i+) {
    // Compute the start and stop angles
    startAngle = (int)(curValue 360 / total);
    int arcAngle = (int)(slices.value * 360 / total);Look here and i think you will find some syntax errors.
    Count the brackets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need help th tuning query or re write the query--

    Hi,
    Need help to tune the below query or rewrite th query for reducing the execution time Please find the query and explain plan.
    QUERY
    explain plan FOR SELECT consumer_key,product_key,days_in_product,20100201 period_key FROM
    (SELECT consumer_key,
      product_key,
      days_in_product,
      row_number() over ( Partition BY consumer_key order by Days_in_product DESC) row_num
    FROM
      (SELECT consumer_key,
        product_key,
        SUM(no_ofdays) days_in_product
      FROM
        (SELECT pcv.consumer_key,
          pcv.product_key,
          pcv.product_consumer_valid_from,
          pcv.product_consumer_valid_to,
          DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from) period_start,
          DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959) period_end,
          CASE
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
            AND activation_date > to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
            THEN 0
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) BETWEEN 20100201000000 AND 20100228235959
            AND activation_date BETWEEN to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') AND to_Date(product_consumer_valid_to,'YYYYMMDDHH24MISS')
            THEN
              --to_char(activation_date,'MON-YYYY')='PERIOD_ACTIVE'  and activation_date >= to_Date(product_consumer_valid_from,'YYYYMMDDHH24MISS') then
              (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_date(TO_CHAR(activation_date,'YYYYMMDDHH24MISS'),'YYYYMMDDHH24MISS') )
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) < 20100201000000
            THEN (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
            WHEN to_number(TO_CHAR(cd.activation_date,'YYYYMMDDHH24MISS')) > 20100228235959
            THEN 0
            ELSE
              --unusual situation
              (to_date(DECODE (SIGN(20100228235959-product_consumer_valid_to),1,product_consumer_valid_to,20100228235959),'YYYYMMDDHH24MISS') - to_Date(DECODE (SIGN(20100201000000-product_consumer_valid_from),1,20100201000000,product_consumer_valid_from),'YYYYMMDDHH24MISS') )
          END No_ofDays
        FROM cimtran.product_consumer_validity pcv,
          consumer_dimension cd
        WHERE pcv.consumer_key           =cd.consumer_key
        AND product_consumer_valid_to   >= 20100201000000
        AND product_consumer_valid_from <= 20100228235959
          --and product_consumer_valid_from > '20090801000000'
        ORDER BY consumer_key,
          product_key,
          product_consumer_valid_from
        ) a
      GROUP BY consumer_key,
        product_key
      ORDER BY consumer_key,
        product_key
    ) WHERE row_num=1 ;EXPLAIN PLAN
    "PLAN_TABLE_OUTPUT"
    "Plan hash value: 3823907703"
    "| Id  | Operation                | Name                      | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |"
    "|   0 | SELECT STATEMENT         |                           |  4665K|   231M|       |   133K  (1)| 00:31:08 |"
    "|*  1 |  VIEW                    |                           |  4665K|   231M|       |   133K  (1)| 00:31:08 |"
    "|*  2 |   WINDOW SORT PUSHED RANK|                           |  4665K|   173M|   232M|   133K  (1)| 00:31:08 |"
    "|   3 |    VIEW                  |                           |  4665K|   173M|       |   104K  (1)| 00:24:18 |"
    "|   4 |     SORT GROUP BY        |                           |  4665K|   182M|   729M|   104K  (1)| 00:24:18 |"
    "|*  5 |      HASH JOIN           |                           |    13M|   533M|    65M| 44241   (1)| 00:10:20 |"
    "|   6 |       TABLE ACCESS FULL  | CONSUMER_DIMENSION        |  2657K|    35M|       |  4337   (1)| 00:01:01 |"
    "|*  7 |       TABLE ACCESS FULL  | PRODUCT_CONSUMER_VALIDITY |    13M|   351M|       | 15340   (2)| 00:03:35 |"
    "Predicate Information (identified by operation id):"
    "   1 - filter(""ROW_NUM""=1)"
    "   2 - filter(ROW_NUMBER() OVER ( PARTITION BY ""CONSUMER_KEY"" ORDER BY "
    "              INTERNAL_FUNCTION(""DAYS_IN_PRODUCT"") DESC )<=1)"
    "   5 - access(""PCV"".""CONSUMER_KEY""=""CD"".""CONSUMER_KEY"")"
    "   7 - filter(""PRODUCT_CONSUMER_VALID_FROM""<=20100228235959 AND "
    "              ""PRODUCT_CONSUMER_VALID_TO"">=20100201000000)"

    I doubt that this query can be tuned without using indexes. There is a lot of unnecessary work specified in your query, like unnecessary intermediate sorting and selecting unused columns. The cost based optimizer recognized it and skips some of that unnecessary work, it seems. For clarity's sake, I would rewrite your query like below. Note that the query is untested:
    select consumer_key
         , max(product_key) keep (dense_rank last order by days_in_product) product_key
         , max(days_in_product) days_in_product
         , 20100201 period_key
      from ( select pcv.consumer_key
                  , pcv.product_key
                  , sum
                    ( case
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) between 20100201000000 and 20100228235959
                      then
                        case
                        when cd.activation_date > to_date(pcv.product_consumer_valid_to,'yyyymmddhh24miss')
                        then
                          0
                        when cd.activation_date between to_date(pcv.product_consumer_valid_from,'yyyymmddhh24miss') and to_date(product_consumer_valid_to,'yyyymmddhh24miss')
                        then
                          to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
                          - to_date(to_char(activation_date,'yyyymmddhh24miss'),'yyyymmddhh24miss')
                        end
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) < 20100201000000
                      then
                        to_date(to_char(pcv.product_consumer_valid_to),'yyyymmddhh24miss'))
                        - to_date(to_char(pcv.product_consumer_valid_from),'yyyymmddhh24miss'))
                      when to_number(to_char(cd.activation_date,'yyyymmddhh24miss')) > 20100228235959
                      then
                        0
                      end
                    ) days_in_product
               from cimtran.product_consumer_validity pcv
                  , consumer_dimension cd
              where pcv.consumer_key             = cd.consumer_key
                and product_consumer_valid_to   >= 20100201000000
                and product_consumer_valid_from <= 20100228235959
              group by consumer_key
                  , product_key
    group by consumer_keyRegards,
    Rob.

  • I need help activating my redemption code.

    I need help activating my redemption code

    Hello Joe,
    as an addition: please have a look there Redemption Code Help and if necessary and for further questions click through (Still need help? Contact us.) >>>
    http://helpx.adobe.com/contact.html and if "open" please use chat, I had the best experiences. I quote from Adobe's employee Preran: The chat button is activated as soon as there is an agent available to help.
    Good luck!
    Hans-Günter

  • Need help embedding mailchimp subscription code into dreamweaver.

    so I created my page in edge animate, and then I brought it over to adobe dreamweaver, and I dont know where or how to place my embeded mailchimp code? 
    <!-- Begin MailChimp Signup Form -->
    <link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css">
    <style type="text/css">
              #mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif;  width:360px;}
              /* Add your own MailChimp form style overrides in your site stylesheet or in this style block.
                 We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
    </style>
    <div id="mc_embed_signup">
    <form action="http://kandied.us3.list-manage.com/subscribe/post?u=4525b320bd81872705a48ea05&id=4743a970b 1" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
              <input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
        <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
        <div style="position: absolute; left: -5000px;"><input type="text" name="b_4525b320bd81872705a48ea05_4743a970b1" value=""></div>
              <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
    </form>
    </div>
    <!--End mc_embed_signup-->
    I keep trying to add it to it, but I either get noting or just the subscription box. does this happen due to my edge animate project?

    Ben Thank you so much for your reply! It helped me read the code and made me understand it better. I decided to make my own subscription box by making a symbol "Subscription" and inside this i created two more symbols called "Textbox" and "Submittbutton". I tried putting in part of the code from above under the div id, but it kept creating the whole text box behind the symbols in dreamweaver. How would you suggest I embed the code from above into my created submission box below?
             <div id="Stage_Center2_Subscription">
                    <div id="Stage_Center2_Subscription_subscribe"></div>
                    <div id="Stage_Center2_Subscription_Submittbutton">
                        <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton">
                            <div id="Stage_Center2_Subscription_Submittbutton_Submitbutton_RoundRect2"></div>
                        </div>
                        <div id="Stage_Center2_Subscription_Submittbutton_text">
                            <div id="Stage_Center2_Subscription_Submittbutton_text_Text">Join</div>
                        </div>
                    </div>
                    <div id="Stage_Center2_Subscription_Textbox">
                        <div id="Stage_Center2_Subscription_Textbox_textbox">
                            <div id="Stage_Center2_Subscription_Textbox_textbox_RoundRect"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>
    </html>
    Thank you for taking the time to look at my question! I really appreciate it!
    Kyle

  • I need help with some simple code! Please read!

    hi everyone.
    I'm having problems with a piece of code, and i'd be extremely greatful if somebody could give me a hand with it. I'm totally new to java and have to make a program for my university degree, but i'm finding it extremely difficult, mainly due to my total lack of apptitude for this type of thing. I know this is easy stuff, but the books I have are no use so any help would be greatly appreciated.
    I have to write a program which uses two class files. I want one with the code to produce a simple button, and one to invoke it several times at different locations. I decided to write the program as one class file at first, and thought i'd be able to split it up at later. The program works fine when it is one class file. My book said that to split the two classes up, all i needed to do was change the second class to public, although this seems to not work at all. I'm at my wits end on this, and if anyone could correct my code I'd be eternally greatful.
    Here is the first class... (sorry about the lack of indentation)
    >>>>>>>>>>
    import java.awt.*;
    import java.applet.Applet;
    public class Phone extends Applet {
    private Image image;
    public void init() {
    setLayout(null);
    image = getImage(getDocumentBase(), "phone.jpg");}
    public void paint (Graphics g) {
    g.drawImage(image, 0, 0, 700, 530, this);
    PhoneButton myButton;
    myButton = new PhoneButton(20,20);
    >>>>>>>
    This is the second class....
    >>>>>>>
    public class PhoneButton {
    private Button butt;
    public PhoneButton(int a, int b, int c){
    setLayout(null);
    butt = new Button();
    butt.setBounds(a,b,20,20);
    add(butt);
    >>>>>>>>
    My compiler generates errors relating to Button, but i can't do anything to please it.
    Also, could anyone give me some pointers on how to add a different number or symbol to each button. That is what I added int c for, but i couldn't get it to work.
    Cheers in advance.
    Michael Morgan

    I found that there are 5 error in your code.
    1. You should import the "java.awt" package to the PhoneButton.java
    2. The PhoneButton is not a kind of Component. You cannot not add it to the Phone class
    3. the myButton = new PhoneButton(20, 20) does not provide enough parameters to create PhoneButton
    4. You cannot add a Button to a PhoneButton. Becaue the PhoneButton is not a kind of Container
    Fixed code:
    import java.awt.*;
    public class PhoneButton extends Button {
    public PhoneButton(int a, int b, int c){
         setBounds(a, b, 20, 20);
         setLabel(String.valueOf(c));
    ===========================================
    import java.awt.*;
    import java.applet.Applet;
    public class Phone extends Applet {
    private Image image;
    public void init() {
    setLayout(null);
    image = getImage(getDocumentBase(), "phone.jpg");}
    public void paint (Graphics g) {
    g.drawImage(image, 0, 0, 700, 530, this);
    PhoneButton myButton;
    myButton = new PhoneButton(20,20, 1);
    ======================
    Visual Paradigm for UML - Full Features UML CASE tool
    http://www.visual-paradigm.com/

  • Need help in tuning a procedure

    DECLARE
    CURSOR Cur_sub_rp IS
    SELECT A.SUB_ACCOUNT, B.PH_basic_srv,B.PH_Salesman,A.SUB_SSN
    FROM STG_SUB_MASTER_MONTH_HISTORY A, STG_PHN_MASTER_MONTH_HISTORY
    B
    WHERE A.SUB_ACCOUNT = B.PH_ACCOUNT (+)
    AND A.MONTH_ID = B.MONTH_ID ;
    TYPE t_values_tab IS TABLE OF cur_sub_rp%rowtype ;
    values_tab t_values_tab := t_values_tab() ;
    BEGIN
    OPEN Cur_sub_rp ;
    LOOP
    FETCH Cur_sub_rp BULK COLLECT INTO Values_tab
    LIMIT 1000;
    EXIT WHEN Cur_sub_rp%NOTFOUND ;
    END LOOP ;
    CLOSE Cur_sub_rp;
    FORALL i IN VALUES_TAB.first..values_tab.last
    INSERT INTO SUB_PHN_1 VALUES VALUES_TAB(i);
    commit;
    END;
    The tables used here has 9 million records each.
    The total process takes around 19 minutes.
    Need your help in optimizing the process.

    i have tried using
    Create table as SELECT A.SUB_ACCOUNT,  B.PH_basic_srv,B.PH_Salesman,A.SUB_SSN
                        FROM STG_SUB_MASTER_MONTH_HISTORY A, STG_PHN_MASTER_MONTH_HISTORY
    B
                        WHERE A.SUB_ACCOUNT = B.PH_ACCOUNT (+)
                        AND A.MONTH_ID = B.MONTH_ID (+);But still taking long time(apprx 15 min).
    so used this...
    help me in tuning the query in either of this.
    DECLARE
    CURSOR Cur_sub_rp IS
                    SELECT A.SUB_ACCOUNT,  B.PH_basic_srv,B.PH_Salesman,A.SUB_SSN
                        FROM STG_SUB_MASTER_MONTH_HISTORY A, STG_PHN_MASTER_MONTH_HISTORY
    B
                        WHERE A.SUB_ACCOUNT = B.PH_ACCOUNT (+)
                        AND A.MONTH_ID = B.MONTH_ID (+);
    TYPE t_values_tab IS TABLE OF cur_sub_rp%rowtype ;
    values_tab t_values_tab := t_values_tab()  ;
    BEGIN
        OPEN Cur_sub_rp ;
        LOOP
            FETCH Cur_sub_rp BULK COLLECT INTO Values_tab
                                                LIMIT 1000;
            EXIT WHEN Cur_sub_rp%NOTFOUND ;
        END LOOP ;
        CLOSE Cur_sub_rp;
    FORALL i IN VALUES_TAB.first..values_tab.last
    INSERT INTO SUB_PHN_1 VALUES VALUES_TAB(i);
    commit;
    END;Message was edited by:
    Vakeel
    Message was edited by:
    Vakeel

  • Need help on Modifying Jsp Code to establish relationships in iStore.

    I am currently working on iStore an internet enabled product
    from Oracle.
    In iStore one can establish relationships between products like
    cross sell , complimentary, substitute, conflict etc. However at
    the moment only one relationship works i.e: Related. This is
    because this is a bug in iStore. Only the relationship Related
    is defined in the jsp. We have been asked to modify the jsp
    ibeCCtdItemDetail.jsp
    Please find pasted below the jsp which only had the arrays for
    related i.e: relitems and service i.e service have added the
    array complimentary to establish such a relationship and pasted
    the relitems code once again and changed relitems to
    complimentary. I am stuck up on this since the past 2 weeks i
    would appreciate if anybody could help.
    <%@include file="jtfincl.jsp" %>
    <!-- $Header: ibeCCtdItemDetail.jsp 115.24 2001/06/16 15:21:05
    pkm ship $ -->
    <%--
    =================================================================
    ========
    | Copyright (c)2000 Oracle Corporation, Redwood Shores, CA
    | All rights reserved.
    +================================================================
    ===========
    |
    | FILE
    | ibeCCtdItemDetail.jsp - Item Detail display
    |
    | DESCRIPTION
    | Displays Item Detail page. Item's description, long
    description, large
    | image, flexfields, available services, and related items
    are displayed.
    | The list price and best price (selling price) for each of
    the Item's
    | available units of measure is displayed. Displays Add to
    Cart,
    | Express Checkout, Configure buttons (if appropriate).
    |
    | PARAMETERS (SOURCE)
    | party Id IN (RequestCtx) - user's party
    id
    | account Id IN (RequestCtx) - user's
    account id
    | currency code IN (RequestCtx) - currency code
    | item IN (URL) - Item ID
    | section IN (URL) - section ID of
    section we are
    | coming from
    (optional)
    | item IN (pageContext) - Item ID
    | section IN (pageContext) - Section ID
    | qty IN (pageContext) - Quantity
    entered by user
    | uom IN (pageContext) - UOM selected
    by user
    | errorMsg IN (pageContext) - error message
    from buy
    | routing page
    | * pageContext attributes for "item" and "section" are used
    when the URL
    | does not contain valid values for "item" and "section"
    (such as when an
    | error occurred in the buy routing page and the request is
    forwarded
    | back to this page)
    |
    | oneclick_obj OUT (pageContext) - OneClick
    object containing
    | user's
    Express Checkout
    | preferences
    | postingID OUT (pageContext) - Integer
    posting Id, for
    | iMarketing
    integration
    | itemIDs OUT (pageContext) - int[] itemIDs
    on the page
    | (for use by
    postings)
    | numRequested OUT (pageContext) - Integer
    number of postings,
    | for
    iMarketing integration
    | random OUT (pageContext) - Boolean
    whether to randomize
    | posting
    retrieved, for
    | iMarketing
    integration
    | type OUT (HTML form) - "single" (1
    item)
    | item OUT (HTML form) - Item ID
    | refpage OUT (HTML form) -
    "ibeCCtdItemDetail.jsp" plus any
    | parameters
    needed to return
    | to this page
    in case of error.
    | uom OUT (HTML form) - UOM code
    selected by user
    | qty OUT (HTML form) - quantity
    entered by user
    | Add to Cart.x OUT (HTML form) - user clicks
    Add to Cart
    | 1-Click.x OUT (HTML form) - user clicks
    Express Checkout
    | Configure.x OUT (HTML form) - user clicks
    Configure
    |
    | OBJECTS REFERENCED
    | oracle.apps.ibe.catalog.Item
    | oracle.apps.ibe.order.OneClick
    |
    | APIs REFERENCED
    | Item.getItemID() - get Item ID
    | Item.getDescription() - get item description
    | Item.getLongDescription() - get item long description
    | Item.isConfigurable() - whether item has
    configuration UI set up
    | Item.getFlexfields() - get Item flexfield
    prompts and values
    | Item.getRelatedItems() - get related items and
    service items
    | Item.getMediaFileName() - get media based on
    display context
    | OneClick.loadSettingFrDB() - load Express Checkout
    settings for
    | current user
    |
    | JSPs REFERENCED
    | ibeCCtpPostingI.jsp - set iMarketing
    parameters (include)
    | ibeCCtpSetItem.jsp - retreive and set item
    information (include)
    | ibeCCtpItmDspRte.jsp - Item display routing
    page (link)
    | ibeCCtpBuyRoute.jsp - Buy routing
    page (form POST)
    | ibeCCtdSctPath.jsp - Path Traversed
    Display (include)
    | ibeCXpdShowTag.jsp - Express Checkout Tag
    Area (include)
    | ibapstng.jsp - iMarketing integration
    page (include)
    |
    | ADDITIONAL NOTES
    | iMarketing posting ID can be changed by editing file
    ibeCCtpPostingI.jsp
    |
    | HISTORY
    | 08/01/2000 auyu Created.
    | 04/09/2001 auyu Added compile-time include for retrieving
    item
    | information
    |
    +================================================================
    =======--%>
    <%@page import="oracle.apps.ibe.order.*" %>
    <%@page import="oracle.apps.ibe.catalog.*" %>
    <%@page import="oracle.apps.ibe.store.*" %>
    <%@page import="oracle.apps.jtf.displaymanager.*" %>
    <%@page import="oracle.apps.jtf.base.Logger" %>
    <%@page import="oracle.apps.jtf.minisites.*" %>
    <%@include file="ibeCZzpHeader.jsp" %>
    <%@page import="oracle.jdbc.driver.*" %>
    <%@page import="java.sql.*" %>
    <%-- declaration --%>
    <%!
    /* Retrieve parent section ids for a given item.
    * int itemId - Item whose parent section ids will be retrieved
    int getParentSectionId(int itemId)
    int parentSectionId = -1;
    Connection conn = null;
    OraclePreparedStatement stmt = null;
    ResultSet rs = null;
    try {
    BigDecimal minisiteId = RequestCtx.getMinisiteId();
    conn = TransactionScope.getConnection();
    StringBuffer sql = new StringBuffer(400);
    sql.append("select jdsi.section_id ");
    sql.append("from jtf_dsp_section_items jdsi, ");
    sql.append("jtf_dsp_msite_sct_items jdmsi ");
    sql.append("where jdsi.inventory_item_id = ? ");
    sql.append("and jdsi.section_item_id =
    jdmsi.section_item_id ");
    sql.append("and jdmsi.mini_site_id = ? ");
    sql.append("and nvl(jdsi.start_date_active, sysdate) <=
    sysdate ");
    sql.append("and nvl(jdsi.end_date_active, sysdate) >=
    sysdate ");
    sql.append("and nvl(jdmsi.start_date_active, sysdate) <=
    sysdate ");
    sql.append("and nvl(jdmsi.end_date_active, sysdate) >=
    sysdate");
    stmt = (OraclePreparedStatement)conn.prepareStatement
    (sql.toString());
    stmt.setInt(1, itemId);
    stmt.setInt(2, minisiteId.intValue());
    stmt.defineColumnType(1, Types.INTEGER);
    rs = stmt.executeQuery();
    if (rs.next())
    parentSectionId = rs.getInt(1);
    } catch (Exception e1) {
    parentSectionId = -1;
    IBEUtil.log("ibeCCtdItemDetail.jsp",
    "Caught exception while retrieving parent
    section id");
    IBEUtil.log("ibeCCtdItemDetail.jsp", e1.getMessage());
    } finally
    try { if (rs != null) rs.close(); } catch (Exception e2) {}
    try { if (stmt != null) stmt.close(); } catch (Exception
    e2) {}
    try {
    if (conn != null) TransactionScope.releaseConnection
    (conn);
    } catch (Exception e2) {}
    return parentSectionId;
    %>
    <%-- end declaration --%>
    <%@include file="ibeCCtpSetItem.jsp"%>
    <%
    The compile-time inclusion of ibeCCtpSetItem.jsp will declare
    and set
    the following variables:
    boolean bItemLoaded - whether section was
    loaded
    Item lItem - Item
    boolean bItemCanBeOrdered - whether item can be
    ordered
    String[] uomCodes - Item's UOM Codes
    Vector itemSellPriceDisplayVec - vector containing
    item's selling
    prices in formatted
    strings
    Vector itemListPriceDisplayVec - vector containing
    item's list
    prices in formatted
    strings
    int nPriceDefined - number of prices
    defined for the item
    Perform the following actions:
    Set "itemIds" in the PageContext.REQUEST_SCOPE
    Set "item" in PageContext.REQUEST_SCOPE
    Set "section" in PageContext.REQUEST_SCOPE
    MessageManagerInter lMsgMgr =
    Architecture.getMessageManagerInstance();
    pageContext.setAttribute("_pageTitle",
    lMsgMgr.getMessage
    ("IBE_PRMT_CT_PRODUCT_DETAILS"),
    PageContext.REQUEST_SCOPE);
    %>
    <%@ include file="ibeCCtpPostingI.jsp" %>
    <%@ include file="ibeCZzdTop.jsp" %>
    <%@ include file="ibeCZzdMenu.jsp" %>
    <%
    if (bItemLoaded)
    OneClick lOneClickObj;
    String xprTagArea = "", confirmXpr = "";
    String lBuyRoutePage;
    String lSectionPathPage = "";
    int sectid = 0;
    Item[] services = new Item[0];
    Item[] relItems = new Item[0];
    Item[] complimentary = new Item[0];
    ItemFlexfield[] itemFlexfields = new ItemFlexfield[0];
    String lItemImage = "", lItemAddtlInfoFile = "";
    StringBuffer lRef = new StringBuffer("ibeCCtdItemDetail.jsp?
    item=");
    String qty = "", userSelUOM = "";
    String errorMsg = "";
    //--------------- load express checkout preferences ---------
    if (IBEUtil.useFeature("IBE_USE_ONE_CLICK"))
    xprTagArea = DisplayManager.getTemplate
    ("STORE_XPR_TAG_AREA").getFileName();
    if (xprTagArea == null)
    xprTagArea = "";
    confirmXpr = lMsgMgr.getMessage("IBE_PRMT_EXPR_CONFIRM");
    if (RequestCtx.userIsLoggedIn()) {
    //initialize OneClick if user is logged in
    BigDecimal partyId = RequestCtx.getPartyId();
    BigDecimal accountId = RequestCtx.getAccountId();
    lOneClickObj = new OneClick();
    lOneClickObj.loadSettingsFrDB(partyId, accountId);
    } // end user express checkout
    //------------ set "section", lSectionPathPage --------------
    String lSectionId = IBEUtil.nonNull(request.getParameter
    ("section"));
    if (lSectionId.equals(""))
    lSectionId =
    IBEUtil.nonNull((String)pageContext.getAttribute
    ("section", PageContext.REQUEST_SCOPE));
    if(IBEUtil.useFeature("IBE_USE_SECTION_PATH"))
    lSectionPathPage = DisplayManager.getTemplate
    ("STORE_CTLG_SCT_PATH").getFileName();
    try {
    sectid = Integer.parseInt(lSectionId);
    pageContext.setAttribute("section", String.valueOf
    (sectid), PageContext.REQUEST_SCOPE);
    } catch (NumberFormatException e) { }
    if(lSectionPathPage == null)
    lSectionPathPage = "";
    lBuyRoutePage = DisplayManager.getTemplate
    ("STORE_CTLG_BUY_PROCESS_ROUTE").getFileName();
    /* if error and forwarded back to this page, get values
    selected by user */
    qty = IBEUtil.nonNull((String)pageContext.getAttribute
    ("qty", PageContext.REQUEST_SCOPE));
    if (qty.equals(""))
    qty = "1";
    userSelUOM = IBEUtil.nonNull((String)pageContext.getAttribute
    ("uom", PageContext.REQUEST_SCOPE));
    errorMsg = IBEUtil.nonNull((String) pageContext.getAttribute
    ("errorMsg", PageContext.REQUEST_SCOPE));
    //set ref for returning to this page in case of error
    lRef.append(lItem.getItemID());
    if (sectid > 0)
    lRef.append("&section=");
    lRef.append(sectid);
    /* Get Bin Open and Bin Close Images */
    String binOpenImg = "", binCloseImg = "";
    try {
    Media binOpenMedia = DisplayManager.getMedia
    ("STORE_BIN_OPEN_IMAGE", true);
    if (binOpenMedia != null)
    binOpenImg = binOpenMedia.getFileName();
    } catch (MediaNotFoundException mnfe) {}
    if (binOpenImg == null)
    binOpenImg = "";
    try {
    Media binCloseMedia = DisplayManager.getMedia
    ("STORE_BIN_CLOSE_IMAGE", true);
    if (binCloseMedia != null)
    binCloseImg = binCloseMedia.getFileName();
    } catch (MediaNotFoundException mnfe) {}
    if (binCloseImg == null)
    binCloseImg = "";
    /* Get images, additional info, flexfields, related items,
    service items */
    lItemImage = lItem.getMediaFileName
    ("STORE_PRODUCT_LARGE_IMAGE");
    lItemAddtlInfoFile = lItem.getMediaFileName
    ("STORE_PRODUCT_ADDTL_INFO");
    // check for defaulting
    String defaultFromSection = "Y";
    if ("Y".equals(defaultFromSection))
    if (lItemImage == null || lItemAddtlInfoFile == null)
    try {
    int parentSectionId = getParentSectionId
    (lItem.getItemID());
    Section parentSection = Section.load(parentSectionId);
    if (lItemImage == null)
    lItemImage = parentSection.getMediaFileName
    ("STORE_SECTION_SMALL_IMAGE");
    if (lItemAddtlInfoFile == null)
    lItemAddtlInfoFile = parentSection.getMediaFileName
    ("STORE_SECTION_ADDTL_INFO");
    } catch (Exception e) {}
    itemFlexfields = lItem.getFlexfields();
    try {
    services = lItem.getRelatedItems("SERVICE");
    } catch (ItemNotFoundException e) {}
    try {
    relItems = lItem.getRelatedItems("RELATED");
    } catch (ItemNotFoundException e) {}
    try {
    complimentary = lItem.getRelatedItems("COMPLIMENTARY");
    } catch (ItemNotFoundException e) {}
    %>
    <!-- body section -----------------------------------------------
    ------------->
    <table border="0" width="100%">
    <%
    if (IBEUtil.showPosting()) {
    %>
    <!--------- iMarketing integration ----------------->
    <tr><td colspan="4" align="center">
    <% try {
    %>
    <jsp:include page="ibapstng.jsp" flush="true" />
    <% } catch (Throwable e) {
    IBEUtil.log("ibeCCtdItemDetail.jsp", "iMarketing error",
    Logger.ERROR);
    %>
    </td></tr>
    <% } //end iMarketing installed
    %>
    <tr><td> </td>
    <%
    if(!lSectionPathPage.equals(""))
    %>
    <td colspan="4" class="smallLink">
    <jsp:include page="<%=lSectionPathPage%>" flush="true" />
    </td>
    <% }
    %>
    </tr>
    <tr><td valign="top">   </td>
    <!-- center column ------------------------------------------
    ------------->
    <td valign="top" width="70%">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td colspan="3">
    <span class="pageTitle"><%=lItem.getDescription()%
    </span></td></tr>
    <tr>
    <% if (lItemImage != null) {
    %>
    <td valign="TOP"><img src="<%=lItemImage%>"></td>
    <td valign="TOP" colspan="2"><%
    =lItem.getLongDescription()%></td>
    <% } else {
    %>
    <td valign="TOP" colspan="3"><%
    =lItem.getLongDescription()%></td>
    <% }
    %>
    </tr>
    <% if (lItemAddtlInfoFile != null) {
    %>
    <tr><td colspan="3"><br>
    <jsp:include page="<%=lItemAddtlInfoFile%>"
    flush="true" />
    </td></tr>
    <% }
    %>
    <tr><td colspan="3"><br></td></tr>
    <%
    for (int i=0; i < itemFlexfields.length; i++)
    String prompt = itemFlexfields.getPrompt();
    String value = itemFlexfields[i].getValue();
    if (value != null && !value.equals(""))
    %>
    <tr>
    <td align="LEFT" width="20%">
    <span class="sectionHeader2"><%=prompt%
       </span></td>
    <td align="LEFT" colspan="2" width="80%"><%=value%
    </td></tr>
    <% }
    if (services.length > 0)
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr><td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_WARRANTIES")%>
    </td>
    <td colspan="2" align="left" class="sectionHeaderBlack"
    width="80%"><hr>
    </td></tr>
    <%
    for(int i=0; i < services.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td align="left" colspan="2" valign="TOP" width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    (STORE_CTLG_ITM_ROUTE", "item=" + services[i.getItemID()) %>">
    <%=services.getDescription()%></A>
    </span>
    <%=services[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" class="sectionHeaderBlack"> </td>
    </tr>
    <% } //end loop through services
    } // end if services.length > 0
    if (relItems.length > 0) {
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr>
    <td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
    </td>
    <td align="left" colspan="2" class="sectionHeaderBlack"
    width="80%"><hr></td>
    </tr>
    <%
    for(int i=0; i < relItems.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td colspan="2" align="left" valign="TOP"
    width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    ("STORE_CTLG_ITM_ROUTE", "item=" + relItems[i].getItemID()) %>">
    <%=relItems[i].getDescription()%></A>
    </span>
    <%=relItems[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" align="RIGHT"
    class="sectionHeaderBlack"> </td>
    </tr>
    <% } // end loop through related items
    } // end if relItems.length > 0
    %>
    </table>
    </td>
    <%if (complimentary.length > 0) {
    %>
    <tr><td colspan="3"><br></td></tr>
    <tr>
    <td align="RIGHT" class="sectionHeader1" width="20%">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_REL_PRODUCTS")%>
    </td>
    <td align="left" colspan="2" class="sectionHeaderBlack"
    width="80%"><hr></td>
    </tr>
    <%
    for(int i=0; i < complimentary.length; i++)
    %>
    <tr>
    <td valign="TOP" class="sectionHeaderBlack"
    width="20%"> </td>
    <td colspan="2" align="left" valign="TOP"
    width="80%">
    <span class="sectionHeaderBlack">
    <A HREF="<%= DisplayManager.getURL
    ("STORE_CTLG_ITM_ROUTE", "item=" + complimentary[i].getItemID())
    %>">
    <%=complimentary[i].getDescription()%></A>
    </span>
    <%=complimentary[i].getLongDescription()%>
    </td>
    </tr>
    <tr>
    <td colspan="3" align="RIGHT"
    class="sectionHeaderBlack"> </td>
    </tr>
    <% } // end loop through related items
    } // end if complimentary.length > 0
    %>
    </table>
    </td>
    <!-- right column -------------------------------------------
    ------------->
    <td valign="top" width="20%">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr><td>
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <% if (! binOpenImg.equals("")) {
    %>
    <td><img src="<%=binOpenImg%>"></td>
    <% }
    %>
    <td nowrap class="binHeaderCell" width="100%">
    <%
    if (!lItem.isConfigurable()) {
    %>
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_2_WAYS_TO_SHOP")%>
    <% } else {
    %>
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIG_PRODUCT")%>
    <% }
    %>
    </td>
    <% if (! binCloseImg.equals("")) {
    %>
    <td><img src="<%=binCloseImg%>"></td>
    <% }
    %>
    </tr>
    </table>
    </td></tr>
    <tr><td class="binColumnHeaderCell">
    <table border="0" cellspacing="1" width="100%">
    <tr><td class="binContentCell" align="CENTER">
    <% /////////////////////////////// error
    messages //////////////////////////////
    if (!errorMsg.equals("")) {
    %>
    <table><tr><td align="center" class="errorMessage">
    <%=errorMsg%>
    </td></tr></table>
    <% }
    /////////////////////////////// display
    form //////////////////////////////////%>
    <!--Javascript for express checkout confirmation-->
    <script language="JavaScript">
    function get_confirmation(form)
    if (confirm("<%=confirmXpr%>" ) ) {
    form.tmpx.name = '1-Click.x';
    form.tmpy.name = '1-Click.y';
    form.submit();
    return true;
    else
    return false;
    </script>
    <form method=POST action="<%=lBuyRoutePage%>">
    <input type=hidden name="type" value="single">
    <input type=hidden name="item" value="<%=lItem.getItemID()%
    "><input type=hidden name="refpage" value="<%=lRef.toString
    ()%>">
    <INPUT TYPE="HIDDEN" NAME="tmpx" VALUE="100">
    <INPUT TYPE="HIDDEN" NAME="tmpy" VALUE="100">
    <%= RequestCtx.getSessionInfoAsHiddenParam() %>
    <%
    if ( ! lItem.isConfigurable())
    { // display prices
    %>
    <table>
    <tr><td align ="left" nowrap>
    <span class="sectionHeaderBlack">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_LIST_PRICE_COLON")%>
    </span>
    </td>
    <%
    for (int i=0; i < uomCodes.length && i <
    itemListPriceDisplayVec.size(); i++)
    if (uomCodes[i] != null && uomCodes[i].equals
    (lItem.getPrimaryUOMCode()))
    if (itemListPriceDisplayVec.elementAt(i) != null &&
    !itemListPriceDisplayVec.elementAt(i).equals(""))
    %>
    <td align="right">
    <%=itemListPriceDisplayVec.elementAt(i)%
       <%=lItem.getPrimaryUOM()%></td>
    <% } else {
    %>
    <td>   </td>
    <% }
    break;
    } // end primary uomcode
    } // end loop through uoms and list price
    %>
    </tr>
    <tr><td align="left" nowrap>
    <span class="sectionHeaderBlack">
    <%=lMsgMgr.getMessage("IBE_PRMT_CT_YOUR_PRICE_COLON")%>
    </span>
    </td>
    <td>
    <% // display selling price for each uom
    if (nPriceDefined > 1) {
    //prices defined for multiple UOMs for the item
    %>
    <select name = "uom">
    <%
    //--------- loop through uoms and prices ------------------
    for (int i=0; i < itemSellPriceDisplayVec.size() && i <
    uomCodes.length; i++)
    if (itemSellPriceDisplayVec.elementAt(i) != null &&
    !itemSellPriceDisplayVec.elementAt(i).equals(""))
    boolean bSelectUom = false;
    if (uomCodes[i] != null && uomCodes[i].equals
    (lItem.getPrimaryUOMCode()))
    bSelectUom = true;
    if (bSelectUom)
    %>
    <option value="<%=uomCodes[i]%>" SELECTED>
    <% } else {
    %>
    <option value="<%=uomCodes[i]%>">
    <% }
    %>
    <%=itemSellPriceDisplayVec.elementAt(i)%
       <%=IBEUtil.nonNull(lItem.getUOM(uomCodes))%
    <%
    } // end current uom has price
    } //end loop i through uoms and prices
    %>
    </select>
    <% //end more than 1 UOM with price defined for the item
    } else {
    if (nPriceDefined == 0) { //multiple UOMs, none with
    price defined
    %>
    <input type=hidden name="uom" value="<%
    =lItem.getPrimaryUOMCode()%>">
    <% } else { // 1 UOM with price defined
    String formatSellPrice = "";
    String uomWithPrice = "";
    for (int i=0; i < uomCodes.length && i <
    itemSellPriceDisplayVec.size(); i++)
    if (itemSellPriceDisplayVec.elementAt(i) != null &&
    !itemSellPriceDisplayVec.elementAt(i).equals(""))
    formatSellPrice = (String)
    itemSellPriceDisplayVec.elementAt(i);
    uomWithPrice = uomCodes;
    break;
    %>
    <input type=hidden name="uom" value="<%=uomWithPrice%>">
    <%=formatSellPrice%>   <%=IBEUtil.nonNull
    (lItem.getUOM(uomWithPrice))%>
    <% } //end 1 UOM with price defined
    } // end display selling prices
    %>
    </td></tr></table> <%-- end table for the price --%>
    <% } // end non-configurable item
    if (bItemCanBeOrdered)
    // show quantity and buttons only if item can be ordered
    %>
    <p><%=lMsgMgr.getMessage("IBE_PRMT_CT_QUANTITY")%>
    <input type="TEXT" name="qty" size="3" maxlength="20"
    value="<%=qty%>">
    </p>
    <% if (lItem.isConfigurable()) {
    %>
    <p>
    <input type=hidden name="uom" value="<%
    =lItem.getPrimaryUOMCode()%>">
    <input type=submit name="Configure.x"
    value="<%=lMsgMgr.getMessage("IBE_PRMT_CT_CONFIGURE")%
    "></p>
    <% } else {
    %>
    <p>
    <input type=submit name="Add to Cart.x"
    value="<%=lMsgMgr.getMessage
    ("IBE_PRMT_ADD_TO_CART_PRMT_G")%>">
    </p>
    <%
    if (!xprTagArea.equals(""))
    %>
    <p><%=lMsgMgr.getMessage("IBE_PRMT_CT_OR")%></p>
    <p><jsp:include page="<%=xprTagArea%>"
    flush="true" /></p>
    <% }
    } // end item can be ordered
    %>
    <br>
    </form>
    </td></tr></table> <%-- end table for bin content and
    header --%>
    </td></tr></table>
    <p> </p>
    <p> </p>
    </td></tr></table> <%-- end page table --%>
    <% } // end item loaded
    %>
    <%@ include file="ibeCZzdBottom.jsp" %>
    <!-- ibeCCtdItemDetail.jsp end -->

    my bad...didnt think anyone was gonna come in ...lol......nothing populates in the second drop down...I was thinking of making a separate page and just pass the parameter in, bu i never used jsp include.....any suggestions on how to get this thing working??

Maybe you are looking for

  • ABAP calling Webservice

    Hello, Please guide me how i can call webservice i.e EJB develped in Java Stack from ABAP program. Please let me know if some blog is avalabilbe for same. Thanks a lot in advance. regards, Vikrant

  • Unload swf file using SWFLoader

    Hi, I have a main application where I am using a SWFLoader to load a second application. In the second application I want to put a button (Close) and when I click it I want to unload this application. Is it possible to achieve this? I know that I can

  • GotoAndplay from the instance on stage to MovieClip in Library

    Hi I am trying to learn ActionScript 3. I have a MovieClip called Ship in the library and have made class of it called ship. The Ship movieClip glows from Frame 6 to indicate when it crashes into an asteroid. The myShipMovieClip child is controlled b

  • Unable to see page icons in panel

    I am having trouble viewing my pages within the pages panel. I am using InDesign CS4. When I open the file and click on the pages panel, it isn't expanding fully, and it takes me about 5 or 6 tries to get it to resize. Once I resize it, the page icon

  • Edge Animate, Working with multiple audio tracks

    I'm having trouble with one of my animations. I have set up 8 animated symbols that will play when the user hovers over the symbol. When the user clicks on a symbol it will play an audio mp3 files. // insert code for mouse click here // Sets a toggle