LOV problem : here is my code

Hello all,
I've been trawling through the forums trying to find a solution to this problem but with no success.
I am trying to create an LOV for my application, the Activity_Plan_ObjectView1_Update page accesses the LOV (via LocationLOV.uix) which is meant to then update this page.
Here is my code, the first page has the BC4J tag which opens the LocationLOV.uix page, I think the problem lies with how I'm trying to pass the parameter back to the Activity_Plan_ObjectView1_Update page :
Activity_Plan_ObjectView1_Update :
<?xml version="1.0" encoding="windows-1252" ?>
<page xmlns="http://xmlns.oracle.com/uix/controller"
xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
xmlns:ui="http://xmlns.oracle.com/uix/ui"
xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j" >
<bc4j:registryDef>
<bc4j:rootAppModuleDef name="Activity_Plan_ObjectView1AppModule"
definition="uiXML.BC4J_PackageModule"
releaseMode="stateful" >
<bc4j:viewObjectDef name="Activity_Plan_ObjectView1" >
<bc4j:rowDef name="UpdateActivity_Plan_ObjectView1" autoCreate="false" >
<bc4j:propertyKey name="key" />
</bc4j:rowDef>
</bc4j:viewObjectDef>
</bc4j:rootAppModuleDef>
</bc4j:registryDef>
<content>
<try xmlns="http://xmlns.oracle.com/uix/ui"
xmlns:data="http://xmlns.oracle.com/uix/ui" >
<catch>
<displayException />
</catch>
<contents>
<switcher childName="default">
<boundAttribute name="childName">
<if>
<comparison type="equals">
<dataObject select="key" source="ctrl:page"/>
<dataObject source="ui:null"/>
</comparison>
<fixed text="error"/>
</if>
</boundAttribute>
<case name="error">
<header text="Required page property 'key' missing. Cannot display page."/>
</case>
<case name="default">
<pageLayout title="Activity Plan - Update" >
<!-- Start of common pageLayout section. If you plan to expand this
example application, consider using a UIT template to specify the common
portions of your pageLayout -->
<productBranding>
<image source="tools_collage.gif" shortDesc="JDeveloper Product Logo"/>
</productBranding>
<corporateBranding>
<image source="oraclelogo.gif" shortDesc="Oracle Logo"/>
</corporateBranding>
<globalButtons>
<globalButtonBar>
<contents>
<globalButton source="www_home.gif"
text="Home"
destination="Main.uix" />
<globalButton source="www_contact.gif"
text="Contact Us"
destination="http://www.oracle.com" />
<globalButton source="www_help.gif"
text="Help"
destination="http://otn.oracle.com/products/jdev/content.html" />
</contents>
</globalButtonBar>
</globalButtons>
<copyright>Copyright 2002 Oracle Corporation. All Rights Reserved.</copyright>
<privacy>
<link text="Privacy Statement" destination="http://www.oracle.com"/>
</privacy>
<!-- End of common pageLayout section -->
<contents>
<!-- this will contain any validation errors after form
submission -->
<messageBox automatic="true" />
<form name="updateForm" method="POST" >
<contents>
<!-- we cannot implicitly determine that events
will be triggered because submit buttons are
outside the form scope, so add the placeholder
explicitly -->
<formParameter name="event" />
<!-- layout the fields in two columns -->
<tableLayout>
<contents>
<bc4j:rootAppModuleScope name="Activity_Plan_ObjectView1AppModule" >
<contents>
<bc4j:viewObjectScope name="Activity_Plan_ObjectView1" >
<contents>
<bc4j:rowScope name="UpdateActivity_Plan_ObjectView1" >
<contents>
<bc4j:messageInput attrName="PlanId" prompt="Plan ID" />
<bc4j:messageInput attrName="PlanType" prompt="Plan Type"/>
<bc4j:messageInput attrName="PlanTypeCode" />
<bc4j:messageInput attrName="PlanDesc" />
<bc4j:messageInput attrName="PlanStart" />
<bc4j:messageInput attrName="PlanFinish" />
<bc4j:messageInput attrName="ActivityApproved" />
<bc4j:messageInput attrName="CreatedBy" />
<bc4j:messageLovField attrName="DeployToLocation"
onClick="openWindow(top,
'LocationLOV.uix',
'lovWindow',
{width:400, height:450},
true,
'dialog')" />
</contents>
</bc4j:rowScope>
</contents>
</bc4j:viewObjectScope>
</contents>
</bc4j:rootAppModuleScope>
</contents>
</tableLayout>
</contents>
</form>
</contents>
<contentFooter>
<!-- place a row of buttons below the content -->
<pageButtonBar>
<contents>
<!-- the cancel button performs a transaction rollback -->
<button text="Cancel" ctrl:event="cancel" />
<!-- the update button submits the user-entered
form data -->
<submitButton text="Update" formName="updateForm"
ctrl:event="apply" />
</contents>
</pageButtonBar>
</contentFooter>
</pageLayout>
</case>
</switcher>
</contents>
</try>
</content>
<handlers>
<event name="cancel" >
<!-- using the ApplicationModule causes it to be checked out from the
ApplicationPool. It is released using stateful mode. -->
<bc4j:findRootAppModule name="Activity_Plan_ObjectView1AppModule" >
<!-- rollback the current transaction -->
<bc4j:rollback/>
<!-- forward to the summary page -->
<ctrl:go name="Activity_Plan_ObjectView1_View" redirect="true" />
</bc4j:findRootAppModule>
</event>
<event name="apply" >
<!-- using the ApplicationModule causes it to be checked out from the
ApplicationPool. It is released using stateful mode. -->
<bc4j:findRootAppModule name="Activity_Plan_ObjectView1AppModule" >
<!-- establish the ViewObject scope -->
<bc4j:findViewObject name="Activity_Plan_ObjectView1" >
<!-- find the row by key, falling back on a new default
row if the key is not found -->
<bc4j:findRow name="UpdateActivity_Plan_ObjectView1" >
<!-- set each attribute explicitly -->
<bc4j:setAttribute name="PlanId" />
<bc4j:setAttribute name="PlanType" />
<bc4j:setAttribute name="PlanTypeCode" />
<bc4j:setAttribute name="PlanDesc" />
<bc4j:setAttribute name="PlanStart" />
<bc4j:setAttribute name="PlanFinish" />
<bc4j:setAttribute name="ActivityApproved" />
<bc4j:setAttribute name="CreatedBy" />
<bc4j:setAttribute name="DeployToLocation" />
<!-- commit the transaction -->
<bc4j:commit/>
<bc4j:executeQuery/>
<!-- forward to the summary page -->
<ctrl:go name="Activity_Plan_ObjectView1_View" redirect="true" />
</bc4j:findRow>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
</event>
</handlers>
</page>
LocationLOV.uix :
<?xml version="1.0" encoding="windows-1252" ?>
<page xmlns="http://xmlns.oracle.com/uix/controller"
xmlns:ctrl="http://xmlns.oracle.com/uix/controller"
xmlns:ui="http://xmlns.oracle.com/uix/ui"
xmlns:bc4j="http://xmlns.oracle.com/uix/bc4j" >
<bc4j:registryDef>
<bc4j:rootAppModuleDef name="LocationView1AppModule"
definition="uiXML.BC4J_PackageModule"
releaseMode="stateful" >
<bc4j:viewObjectDef name="LocationView1"
rangeSize="5" />
</bc4j:rootAppModuleDef>
</bc4j:registryDef>
<content>
<try xmlns="http://xmlns.oracle.com/uix/ui"
xmlns:data="http://xmlns.oracle.com/uix/ui" >
<catch>
<displayException />
</catch>
<contents>
<pageLayout xmlns="http://xmlns.oracle.com/uix/ui"
xmlns:data="http://xmlns.oracle.com/uix/ui"
title="Location LOV" >
<!-- Start of common pageLayout section. If you plan to expand this
example application, consider using a UIT template to specify the common
portions of your pageLayout -->
<!-- End of common pageLayout section -->
<contents>
<!-- this will contain any validation errors after form
submission -->
<messageBox automatic="true" />
<bc4j:rootAppModuleScope name="LocationView1AppModule" >
<contents>
<header text="Search" >
<contents>
<form name="search" method="POST" >
<contents>
<inlineMessage prompt="Search" vAlign="middle" >
<contents>
<flowLayout>
<contents>
<choice name="attrName"
data:selectedValue="attrName@ctrl:page"
shortDesc="Search Column">
<contents>
<option text="LoCode" value="LoCode" />
</contents>
</choice>
<textInput name="attrValue" columns="20"
data:text="attrValue@ctrl:page"
shortDesc="Search"/>
</contents>
</flowLayout>
</contents>
<end>
<submitButton text="Go" ctrl:event="search" />
</end>
</inlineMessage>
</contents>
</form>
</contents>
</header>
<header text="Results" >
<contents>
<form name="viewForm" method="POST" >
<contents>
<tableLayout>
<contents>
<bc4j:viewObjectScope name="LocationView1" >
<contents>
<bc4j:table name="viewTable" width="20%"
alternateText="No rows found">
<tableSelection>
<!-- single selection for each row in the table -->
<singleSelection selectedIndex="0" shortDesc="Select Row">
<contents>
<!-- the update button causes the currently selected
row to be sent to the update page -->
<!-- the delete button causes the currently selected
row to be removed -->
</contents>
</singleSelection>
</tableSelection>
<!-- the key identifying the current row in the table -->
<bc4j:keyStamp>
<bc4j:rowKey name="key" />
</bc4j:keyStamp>
<contents>
<!-- A bc4j:column element is added for each attribute
in the ViewObject. -->
<bc4j:column attrName="LoCode">
<columnHeader>
<bc4j:sortableHeader sortable="no" text="Location Code" />
</columnHeader>
<contents>
<bc4j:input readOnly="true"/>
</contents>
</bc4j:column>
</contents>
</bc4j:table>
</contents>
</bc4j:viewObjectScope>
</contents>
</tableLayout>
</contents>
</form>
</contents>
</header>
</contents>
</bc4j:rootAppModuleScope>
</contents>
<contentFooter>
<!-- the create button redirects to the create page -->
<button text="Select" ctrl:event="select" />
</contentFooter>
</pageLayout>
</contents>
</try>
</content>
<handlers>
<event name="search" >
<!-- using the ApplicationModule causes it to be checked out from the
ApplicationPool. It is released using stateful mode. -->
<bc4j:findRootAppModule name="LocationView1AppModule" >
<!-- establish the ViewObject scope -->
<bc4j:findViewObject name="LocationView1" >
<!-- search for the view criteria -->
<bc4j:findByExample>
<bc4j:exampleRow ignoreCase="true" >
<bc4j:exampleAttribute>
<bc4j:nameBinding><bc4j:parameter name="attrName" /></bc4j:nameBinding>
<bc4j:valueBinding><bc4j:parameter name="attrValue" /></bc4j:valueBinding>
</bc4j:exampleAttribute>
</bc4j:exampleRow>
</bc4j:findByExample>
<bc4j:executeQuery/>
<!-- store the current search criteria as page properties -->
<bc4j:setPageProperty name="attrName" >
<bc4j:parameter name="attrName" />
</bc4j:setPageProperty>
<bc4j:setPageProperty name="attrValue" >
<bc4j:parameter name="attrValue" />
</bc4j:setPageProperty>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
</event>
<event name="sort" source="viewTable" >
<!-- using the ApplicationModule causes it to be checked out from the
ApplicationPool. It is released using stateful mode. -->
<bc4j:findRootAppModule name="LocationView1AppModule" >
<!-- establish the ViewObject scope -->
<bc4j:findViewObject name="LocationView1" >
<!-- sort by the submitted attribute name -->
<bc4j:sort/>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
</event>
<event name="goto" source="viewTable" >
<!-- using the ApplicationModule causes it to be checked out from the
ApplicationPool. It is released using stateful mode. -->
<bc4j:findRootAppModule name="LocationView1AppModule" >
<!-- establish the ViewObject scope -->
<bc4j:findViewObject name="LocationView1" >
<!-- navigate to the submitted range -->
<bc4j:goto/>
</bc4j:findViewObject>
</bc4j:findRootAppModule>
</event>
<event name="select" >
<ctrl:go name="Activity_Plan_ObjectView1_Update" redirect="false" >
<ctrl:property name="key">
<ctrl:selection name="viewTable" key="key" />
</ctrl:property>
</ctrl:go>
</event>
</handlers>
</page>
My apologies for such a huge post, hopefully any solutions will serve as some sort of tutorial for others stuck with this problem.
I thank the kind souls in advance for any solutions they offer.
Greg

That's a bit too much code to look into, I'm afraid.
Perhaps you could enable UIX debug mode (see the UIX
Configuration chapter) and see the servlet log to
find out what parameters are being sent back to
the server.

Similar Messages

  • Problem in modifying the code using work area concept

    Hi,
    I am working on a code in which i am on the code in which i am using the modify statement but it is not giving the right output.
    here's d code:-
    LOOP AT T_ITPO5 INTO W_ITPO5.
            LOOP AT T_ITPO4 INTO W_ITPO4 WHERE AUFNR = W_ITPO5-AUFNR.
           LOOP AT T_ITPO4 INTO W_ITPO4 FROM WV_INDEX.
             IF W_ITPO4-AUFNR EQ W_ITPO5-AUFNR.
             IF ITPO4-NTGEW <> 0 .
                CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                  EXPORTING
                    P_BUID   = W_ITPO4-WERKS
                    P_ITEMID = W_ITPO4-MATNR
                    P_QTY    = 1
                    P_UOM    = W_ITPO4-MEINS
                    P_UOM1   = 'KG'
                  IMPORTING
                    P_RETVAL = W_ITPO4-WTKG.
                TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
             IF W_ITPO4-BWART = '261'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
             ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
             ENDIF.
           ENDLOOP.
             MODIFY T_ITPO5 INDEX SY-TABIX FROM W_ITPO5.
           MODIFY T_ITPO5 FROM W_ITPO5 TRANSPORTING AUFNR.
       ENDLOOP.
         WRITE: / 'PRD.NO       ITEM DESCRIPTION                               WIP(KGS)'.
        ULINE.
        LOOP AT T_ITPO5 INTO W_ITPO5.
          READ TABLE T_ITPO1 INTO W_ITPO1 WITH KEY AUFNR = W_ITPO5-AUFNR.
          SELECT SINGLE MAKTG FROM MAKT INTO W_ITPO5-ITEMDESC WHERE MATNR = W_ITPO1-MATNR.
          if sy-subrc = 0 .
          WRITE: / W_ITPO5-AUFNR,W_ITPO5-ITEMDESC,W_ITPO5-I_QTY.
          TOT_QTY = TOT_QTY + W_ITPO5-I_QTY.
          else.
          write 'Unsuccessful'.
          endif.
        ENDLOOP.
        ULINE.
        FORMAT COLOR 3.
        WRITE: / 'GTOTAL',55 TOT_QTY.
        FORMAT COLOR OFF.
    plzz provide me guidelines to solve this problem.

    here's d code;-
    TYPES: BEGIN OF ITPO1,
           AUFNR TYPE AFPO-AUFNR,      "Order Number
           PSMNG TYPE AFPO-PSMNG,      "Order item quantity
           WEMNG TYPE AFPO-WEMNG,      "Quantity of goods received for the order item
           DWERK TYPE AFPO-DWERK,      "Plant
           MATNR LIKE AFPO-MATNR,      "Item Id
           END OF ITPO1.
    DECLARATION FOR AUFM TABLE
    TYPES: BEGIN OF ITPO4,
           AUFNR TYPE AUFM-AUFNR,      "Order Number
           BWART TYPE AUFM-BWART,      "Movement Type (Inventory Management)
           MENGE TYPE AUFM-MENGE,      "Quantity
           MEINS TYPE AUFM-MEINS,      "Base Unit of Measure
           BLDAT TYPE AUFM-BLDAT,      "Document Date in Document
           WERKS TYPE AUFM-WERKS,      "Plant
           MATNR TYPE AUFM-MATNR,      "Material Number
           NTGEW TYPE MARA-NTGEW,      "Net Weight
           WTKG  TYPE MARA-NTGEW,
           END OF ITPO4,
           BEGIN OF ITPO5 ,
           AUFNR TYPE AUFM-AUFNR,
           MENGE TYPE AUFM-MENGE,
           I_QTY TYPE AUFM-MENGE,
           ITEMDESC LIKE MAKT-MAKTG,
           END OF ITPO5.
        WORK AREA AND INTERNAL TABLE DECLARATION
    DATA : W_ITPO1 TYPE ITPO1,
           W_ITPO4 TYPE ITPO4,
           W_ITPO5 TYPE ITPO5,
           T_ITPO1 TYPE ITPO1 OCCURS 0,
           T_ITPO4 TYPE ITPO4 OCCURS 0,
           T_ITPO5 TYPE ITPO5 OCCURS 0.
    VARIABLES
    DATA: TOTWT1 LIKE AUFM-MENGE,
          TOT_QTY LIKE AUFM-MENGE.
    PARAMETERS N SELECT-OPTIONS
    PARAMETERS: PLANT LIKE AFPO-DWERK.
    SELECT-OPTIONS: PO_DATE FOR AFKO-GSTRP.
        LOOP AT T_ITPO5 INTO W_ITPO5.
            LOOP AT T_ITPO4 INTO W_ITPO4 WHERE AUFNR = W_ITPO5-AUFNR.
                CALL FUNCTION 'ZGET_ITEM_WEIGHT'
                  EXPORTING
                    P_BUID   = W_ITPO4-WERKS
                    P_ITEMID = W_ITPO4-MATNR
                    P_QTY    = 1
                    P_UOM    = W_ITPO4-MEINS
                    P_UOM1   = 'KG'
                  IMPORTING
                    P_RETVAL = W_ITPO4-WTKG.
                TOTWT1 = W_ITPO4-WTKG * W_ITPO4-MENGE.
             IF W_ITPO4-BWART = '261'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY + TOTWT1.
             ELSEIF W_ITPO4-BWART = '101' OR W_ITPO4-BWART = '531'.
              W_ITPO5-I_QTY = W_ITPO5-I_QTY - TOTWT1.
             ENDIF.
           ENDLOOP.
             MODIFY T_ITPO5 INDEX SY-TABIX FROM W_ITPO5.
           MODIFY T_ITPO5 FROM W_ITPO5 TRANSPORTING AUFNR.
       ENDLOOP.
         WRITE: / 'PRD.NO       ITEM DESCRIPTION                               WIP(KGS)'.
        ULINE.
        LOOP AT T_ITPO5 INTO W_ITPO5.
          READ TABLE T_ITPO1 INTO W_ITPO1 WITH KEY AUFNR = W_ITPO5-AUFNR.
          SELECT SINGLE MAKTG FROM MAKT INTO W_ITPO5-ITEMDESC WHERE MATNR = W_ITPO1-MATNR.
          if sy-subrc = 0 .
          WRITE: / W_ITPO5-AUFNR,W_ITPO5-ITEMDESC,W_ITPO5-I_QTY.
          TOT_QTY = TOT_QTY + W_ITPO5-I_QTY.
          else.
          write 'Unsuccessful'.
          endif.
        ENDLOOP.
        ULINE.
        FORMAT COLOR 3.
        WRITE: / 'GTOTAL',55 TOT_QTY.
        FORMAT COLOR OFF.
    I want to have output that the production order is displayed along with the deficit quantity. but using this concept it shows only production order no. and qty 0.

  • Jdev11g/adf/LOV problem

    Hi Frank and all,
    A LOV problem is here,
    i ve attached scrren shots and some code at following link,
    http://sites.google.com/site/mucuslu/index/adflovproblem-1
    thanks.
    Mucahid

    Anybody know why I get sometime this exception?
    Thanks

  • I am making code to try to make a game and my problem is that my code......

    I am making code to try to make a game and my problem is that my code
    will not let it change the hit everytime so im getting the first guy to hit 1 then next hits 8 and so on and always repeats.
    Another problem is that I would like it to attack with out me telling it how much times to attack. I am using Object oriented programming.
    Here is the code for my objects:
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class rockCrab {
         //Wounding formula
         double sL = 70;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 50;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         rockCrab() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              double done = rint(fH - fA);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("Rockcrab hit" +done);
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class self {
         //Wounding formula
         double sL = 1;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 1;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         self() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("You hit" +done);
    }Here is the main code that writes what the objects do:
    class fight {
         public static void main(String[] args) {
              self instance1 = new self();
              rockCrab instance2 = new rockCrab();
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
    }when the code is run it says something like this:
    you hit 1
    RockCrabs health is 9
    RockCrab hit 7
    your health is 38
    you hit 1
    RockCrabs health is 8
    RockCrab hit 7
    your health is 31
    you hit 1
    RockCrabs health is 7
    RockCrab hit 7
    your health is 24
    you hit 1
    RockCrabs health is 6
    RockCrab hit 7
    your health is 17
    my point is whatever some one hits it always repeats that
    my expected output would have to be something like
    you hit 1
    RockCrabs health is 9
    RockCrab hit 9
    your health is 37
    you hit 3
    RockCrabs health is 6
    RockCrab hit 4
    your health is 33
    you hit 2
    RockCrabs health is 4
    RockCrab hit 7
    your health is 26
    you hit 3
    RockCrabs health is 1
    RockCrab hit 6
    your health is 20
    Edited by: rade134 on Jun 4, 2009 10:58 AM

    [_Crosspost_|http://forums.sun.com/thread.jspa?threadID=5390217] I'm locking.

  • The problem here is i am not able to get the data from the list

    hi all,
    i have the following code
    EnrichedProductCatalogue enrichedProductCatalogue1 = new EnrichedProductCatalogue();
    enrichedProductCatalogue1.setAssetCount(2);
    enrichedProductCatalogue1.setBlockingProduct("Weekend Freebee");
    enrichedProductCatalogue1.setBlockingReason("Compatability");
    ArrayList<String> availableActionsList = new ArrayList<String>();
    availableActionsList.add(EnrichedProductConstants.ADD.toString());
    availableActionsList.add(EnrichedProductConstants.REMOVE.toString());
    enrichedProductCatalogue1.setAvailaibleActions((ArrayList<String>)availableActionsList);
    BundleProduct bundleProduct = null;
    Product product = new Product();
    product = new Product();
    product.setProductName("International");
    product.setProductClassName("International");
    ArrayList<UiCategory> uiCategory = new ArrayList<UiCategory>();
    UiCategory uiCategory1 = new UiCategory();
    uiCategory1.setCategoryName("Simply");
    UiCategory uiCategory2 = new UiCategory();
    uiCategory2.setCategoryName("Freebees");
    uiCategory.add(uiCategory1);
    uiCategory.add(uiCategory2);
    product.setUiCategory(uiCategory);
    bundleProduct = new BundleProduct();
    bundleProduct.setCommercialProduct(product);
    enrichedProductCatalogue1.setBundleProduct(bundleProduct);
    listOfEnrichProducts.add(enrichedProductCatalogue1);
    listOfEnrichProducts.add(enrichedProductCatalogue1);
    here i have an list called listOfEnrichProducts.
    here i am adding two objects of enrichedProductCatalogue.
    which contains a object called BundleProduct.
    which has a reference for Product class.
    here this product class has a list which contains objects of another class called UiCategory.
    the problem here is i am not able to get the data from the list which contains UiCategory objects .
    the following is the UI
    <af:table var="row" rowBandingInterval="0" id="t1"
    value="#{pageFlowScope.sample1}"
    binding="#{pageFlowScope.sampleManagedBean.dataTable}"
    partialTriggers="apimethods ::apimethods">
    <af:column sortable="false" headerText="ProductName" id="c2">
    <af:outputText value="#{row.bundleProduct.commercialProduct.productName}" id="ot15"/>
    </af:column>
    <af:column sortable="false" headerText="ProductClass" id="c12">
    <af:outputText value="#{row.bundleProduct.commercialProduct.productClassName}" id="ot19"/>
    </af:column>
    <!--
    <af:column sortable="false" headerText="UICategoryName" id="c32">
    <af:forEach var="item" items="#{row.bundleProduct.commercialProduct.uiCategory}" >
    <af:outputText value="#{item.categoryName}" id="ot119"/>
    </af:forEach>
    </af:column>
    -->
    <af:column sortable="false" headerText="AssetCount" id="c22">
    <af:outputText value="#{row.assetCount}" id="ot1"/>
    </af:column>
    <af:column sortable="false" headerText="blockingReason" id="c3">
    <af:outputText value="#{row.blockingReason}" id="ot2"/>
    </af:column>
    <af:column sortable="false" headerText="blockingProduct" id="c4">
    <af:outputText value="#{row.blockingProduct}" id="ot3"/>
    </af:column>
    <!--<af:column sortable="false" headerText="availaibleActions" id="c1">
    <af:commandButton text="#{row.availaibleActions}" id="cb1"
    actionListener="#{pageFlowScope.sampleManagedBean.callAction}"
    partialSubmit="true">
    <af:setPropertyListener from="#{row.availaibleActions}"
    to="#{pageFlowScope.avalibleaction}" type="action"/>
    </af:commandButton>
    </af:column>-->
    </af:table>
    Can anyone pls give some solution ...

    Hi Frank,
    value="#{pageFlowScope.sample1}"
    here sample is
    Map<String, Object> flowScope1 =
    ADFContext.getCurrent().getPageFlowScope();
    flowScope.put("sample1", listOfEnrichProducts);
    this is not the problem . i am able to get all the values except the following .
    ArrayList<UiCategory> uiCategory = new ArrayList<UiCategory>();
    UiCategory uiCategory1 = new UiCategory();
    uiCategory1.setCategoryName("Simply");
    UiCategory uiCategory2 = new UiCategory();
    uiCategory2.setCategoryName("Freebees");
    uiCategory.add(uiCategory1);
    uiCategory.add(uiCategory2);
    product.setUiCategory(uiCategory);

  • Problem in fetching the code for the line item

    Hi,
    I am working on a report in which to display the values corresponding to the line item of a PO.
    For, ex, if there are 3 line items 10,140,150 and their condition values such zing,zgrd,zbrd are the condition types consist of different values depending on the line item i.e. 10,140,150.
    My problem is when i execute the code the data of 1st line item is correctly fetched but the rest 2 line item data is pasted as it is. only the main pricre changes and the code for zing,zbrd,zgrd remains same as it is in the first line item 10.
    plzz proivde me guide lines how to solve this problem.
    Here's d code:-
    DATA : vspl LIKE konv-kbetr.
    DATA : vspl1 LIKE konv-kbetr.
    DATA : vkwert LIKE konv-kwert.
    DATA: VSPL2 LIKE KONV-kbetr.    "ZING COST
    DATA: VSPL3 LIKE KONV-kbetr.    "ZGRD COST
    DATA: VSPL4 LIKE KONV-kbetr.    "ZBDL COST
    LOOP AT item.
        SELECT kbetr FROM konv INTO item-rate  WHERE knumv = header-knumv AND kposn = item-ebelp
         AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
          MODIFY item.
       ENDSELECT.
      ENDLOOP.
      LOOP AT item.
        SELECT kwert FROM konv INTO vkwert  WHERE knumv = header-knumv AND kposn = item-ebelp
        AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
        ENDSELECT.
      ENDLOOP.
    CLEAR : vspl , vspl1 , vspl2 , vspl3 , vspl4.
      LOOP AT item.
        SELECT kbetr FROM konv INTO vspl  WHERE knumv = header-knumv AND kposn = item-ebelp  
       AND  kschl = 'ZCOM'.
        ENDSELECT.
        SELECT kbetr FROM konv INTO vspl1 WHERE knumv = header-knumv AND kposn = item-ebelp
        AND  kschl = 'ZBR1'.
        ENDSELECT.
    *******************Begin - new code added on 14.01.2009******************
        SELECT kbetr FROM konv INTO vspl2 WHERE knumv = header-knumv AND kposn = item-ebelp
        AND  kschl = 'ZING'.
        ENDSELECT.
       SELECT kbetr FROM konv INTO vspl3 WHERE knumv = header-knumv AND kposn = item-ebelp
       AND  kschl = 'ZGRD'.
        ENDSELECT.
       SELECT kbetr FROM konv INTO vspl4 WHERE knumv = header-knumv AND kposn = item-ebelp
       AND  kschl = 'ZBRL'.
       ENDSELECT.
    *******************End - new code added on 14.01.2009******************
      ENDLOOP.
      LOOP AT item.
        item-rate  = item-rate + vspl + vspl1.
    *******************Begin - new code added on 14.01.2009******************
        item-rate1 = item-rate1 + vspl2.
        item-rate2 = item-rate2 + vspl3.
        item-rate3 = item-rate3 + vspl4.
    ********************End - new code added on 14.01.2009*******************
        MODIFY item INDEX sy-tabix TRANSPORTING rate.
    *******************Begin -11`` new code added on 14.01.2009******************
        MODIFY item INDEX sy-tabix TRANSPORTING rate1.
        MODIFY item INDEX sy-tabix TRANSPORTING rate2.
        MODIFY item INDEX sy-tabix TRANSPORTING rate3.
    *********************End - new code added on 14.01.2009******************
      ENDLOOP.
    PLZ PROIVDE ME GUIDLINES HOW TO SOLVE THIS PROBLEM .
    Edited by: ricx .s on Jan 19, 2009 10:16 AM
    Edited by: Vijay Babu Dudla on Jan 19, 2009 5:22 AM

    Hello,
    Why are you looping at the same internal table so many times, you could probably perform everything within one loop instead.
    DATA : vspl LIKE konv-kbetr.
    DATA : vspl1 LIKE konv-kbetr.
    DATA : vkwert LIKE konv-kwert.
    DATA: VSPL2 LIKE KONV-kbetr. "ZING COST
    DATA: VSPL3 LIKE KONV-kbetr. "ZGRD COST
    DATA: VSPL4 LIKE KONV-kbetr. "ZBDL COST
    field-symbols <fs>.
    LOOP AT item assigning <fs>.
    SELECT kbetr FROM konv INTO <fs>-rate WHERE knumv = header-knumv AND kposn = item-ebelp
    AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
    MODIFY item.
    ENDSELECT.
    SELECT kwert FROM konv INTO vkwert WHERE knumv = header-knumv AND kposn = item-ebelp
    AND ( kschl = 'ZP00' OR kschl = 'P001' OR kschl = 'PBXX' OR kschl = 'P000' OR kschl = 'PB00' OR kschl = 'ZING' OR kschl = 'ZBRD' OR kschl = 'ZGRD').
    ENDSELECT.
    ENDLOOP.
    CLEAR : vspl , vspl1 , vspl2 , vspl3 , vspl4.
    SELECT kbetr FROM konv INTO vspl WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZCOM'.
    ENDSELECT.
    SELECT kbetr FROM konv INTO vspl1 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZBR1'.
    ENDSELECT.
    *******************Begin - new code added on 14.01.2009******************
    SELECT kbetr FROM konv INTO vspl2 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZING'.
    ENDSELECT.
    SELECT kbetr FROM konv INTO vspl3 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZGRD'.
    ENDSELECT.
    SELECT kbetr FROM konv INTO vspl4 WHERE knumv = header-knumv AND kposn = item-ebelp
    AND kschl = 'ZBRL'.
    ENDSELECT.
    *******************End - new code added on 14.01.2009******************
    <fs>-rate = <fs>-rate + vspl + vspl1.
    *******************Begin - new code added on 14.01.2009******************
    <fs>-rate1 = item-rate1 + vspl2.
    <fs>-rate2 = item-rate2 + vspl3.
    <fs>-rate3 = item-rate3 + vspl4.
    ENDLOOP.
    Also, use field-symbols and use loop at itab assigning addition so that you can directly change the contents of the table without using modify statment.
    regards,
    Advait

  • I have tried another exercise, but again I will need help, here's the code

    hi,
    I have another problem. here's the question pluss the code.
    public interface Patient{
    public void doVisit(float hour);
    public boolean hospitalize();
    1. I will need to write a class name OrdinaryPatient which extends Patient.
    the class will include value int that his name age and another value that will be boolean
    of disease.
    I have to do two constructors. one that don't get values and give them default and the other one
    that does get values.
    another method name docVisit which get a visit to the doctor time visit and will print a message.
    the method hospitalize will hospitalize the patient (and if he will have disease he will get true).
    and for age I have to write methods of get and set.
    2. I will need to write a class of Hipochondriac that extends from OrdinaryPatient.
    I have to do two constructors. one that don't get values and make default and the other one that do get values.
    I will need to ade int by the name of numberOfHospitalize.
    I will need to move the method hospitalize that it will be possible to hospitalize the hypochondriac
    on with the value numberOfHospitalize that his small from 5 and if he will hospitalize he will return
    the value true.
    3. write class PatientClass which will be the method main.
    do 10 objects from OrdinaryPatient, 5 that don't get values and 5 will get randomaly age and
    chronic disease with true.
    do 10 objects from Hipochonidraic, 9 that don't get values and one get all of them.
    save all objects in value from Patinet.
    print for each of them their age.
    print for the OrdinaryPatient alone the method of Hospitalize.
    ok, here's what I did.
    1. OrdinaryPatient
    pbulic class OrdinaryPatient implements Patient{
    private int age;
    private boolean disease;
    public OrdinaryPatient(){
    this.disease=false;
    this.age=0;
    public OrdinaryPatient(int age,boolean ddisase){
    this.disease=disease;
    this.age=age;
    public int getAge(){
    return age;
    public void setDisease(boolean disease){
    this.disease=disease;
    public void setAge(int age){
    this.age=age;
    public void docVisit(){
    System.out.println("Patient's visit is one hour");
    public boolean hospitalize(){
    return false;
    2. public class Hipochondriac extends OrdinaryPatient{
    private = numberOfHospitalize;
    public Hipochondriac();
    super();
    numberOfHospitalize=0;
    public Hipochondriac(int age, boolean diseased, int numberOfHospitalize){
    super(age.diseased);
    setnumberOfHospitalize(numberofHospitalize);
    from here I don't know how to continue.
    3. public class PatientClass{
    public static void main(String args[]){
    patient patinets= new patient[20];
    for (int i=0; i<5; i++){
    patients= new OrdinaryPatient();
    from i'm stuck!!!
    if you can help me to improve it I will appriciate it...
    Einat

    here my result.
    1. public interface Patient{
         public void docVisit(float hour_;
         public boolean hospitalize();
    public class OrdinaryPatient extends Patient
         private int age;
         private boolean disease;
    //constructors
         public OrdinaryPatient(){
              age=20;
              disease=true;
         public OrdinaryPatient(int age, boolean disease) {
              setAge(age);
              this.disease=disease;
    //methods
         public int getAge() {
              return age;
         public void setAge(boolean disease) {
              if(age>0 && age<120)
                   this.age=age;
         //overriding methods.
         public void docVisit(float hour) {
              System.out.println("your visit turn is at "+hour");
         public boolean hospitalize(){
              System.out.println("go to hospital");
              if(disease)
                   return true;
              else
                   return false;
    2. public class Hipochondriac extends OrdinaryPatient{
         private int numberOfHospitalize;
    //constructors
         public Hipochondriac(){
         public Hipochondriac(int age, boolean disease, int numberOfHospipitalize){
              setAge(age);
              this.disease=disease;
              this.numberOfHospitalize=numberOfHospitalize
         //methods
         public int getNumberOfHospitalize(){
              return numberOfHospitalize;
         public void setNumberOfHospitalize(int numberOfHostpitalize){
              if(numberOfHospitalize>0)
                   this.numberOfHospitalize=numberOfHospitalize;
         public boolean hospitalize(){
              if(numberOfHospitalize<5)
                   System.out.println("go to hospital");
                   numberOfHospitalize++;
                   return true;
              else
                   return false;
    3. public class PatientClass
         //constructors
         private PatientClass(String[] args){
              //private methods helps to build the object.
              intialArr(args);
              printAge();
              gotHospital();
    //methods.
    private void intialArr(String[] args){
         int i;//array index
         for(i=0;i<arr.lents/2;i+=2)
              arr=new OrdinaryPatient();
              arr[i+1]=new OridnaryPatient((int)(Math.random()*121),true);
         for(;i<=arr.length-2;i++)
              arr[i]=new Hipochondriac();
         arr[i]=new Hipochondriac(Interget.parseINt(args[0]),
         private void printAge(){
              for(int i=0;i<arr.length;i++)
                   System.out.println(((OrdinaryPatient)arr[i]).getAge());
         private void gotoHospital(){
              for(int i=0;i<arr.length;i++)
    //checking for ordinarypatient objects only
                   if(!(arr[i] instanceof Hipochondriac))
                        //dont need casting
                        arr[i].hospitalize()[
         //main method
         public static void main(String[] args)
              //setting the commandLine array from the main to PatientClass object
              PatientClass pc=new PatientClass(args);
    let me know if it's seems logic to you.
    thank you, Einat     

  • What is the problem here?

    Hello,
    First of all I am a beginner. But I thought it would be better to write this topic here rather than Beginner.
    I have written a simple calculator program. But I have a problem with the interface. I created a Text Field (JTextField actually). And below this text field, buttons are placed.
    The buttons consist of 4 rows and 4 colums (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, C, OK, *, +, -, /).
    The problem is: the buttons (0, 4, 8, *) are in the width of the textField. Whatever length you enter for the textField, the length of the buttons changes.
    I have used the GridBagLayout. Which one is more suitable for a job like this?
    GridBagLayout or GridLayout?
    I tried GridLayout also, which didn't work either.
    In the code below, for the JLabel I used: fill constraint. as HORIZONTAL.
    Does it make any sense? I also tried to use the fill constraint also for the textField. I used:
    cons.fill = GridBagConstraints.FIRST_LINE_START
    But it also didn't work. I am confused, I almost tried everything and couldn't get a satisfying result.
    When I use GridLayout this time all the buttons take the length of textField area.
    I used GridLayout(0,4,1,1).
    Also while using the GridLayout if the windows is maximized then the shape of buttons and the textField also changes. Is there a way to stop this?
    Here is the code:
      public void addComponentsToPane(Container pane) {
        if(LEFT_TO_RIGHT) {
          pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
        pane.setLayout(new GridBagLayout());
        GridBagConstraints cons = new GridBagConstraints();
        subtotal = 0;
        operator = new String("");
        stringvalue = new String("");
        label = new JLabel("Simple Calculator");
        cons.fill = GridBagConstraints.HORIZONTAL;
        cons.gridx = 0;
        cons.gridy = 0;
        pane.add(label, cons);
        textField = new JTextField(15);
        cons.gridx = 0;
        cons.gridy = 1;
        pane.add(textField, cons);
        zero = new JButton("0");
        zero.addActionListener(this);
        cons.gridx = 0;
        cons.gridy = 2;
        pane.add(zero, cons);
        one = new JButton("1");
        one.addActionListener(this);
        cons.gridx = 1;
        cons.gridy = 2;
        pane.add(one, cons);
        two = new JButton("2");
        two.addActionListener(this);
        cons.gridx = 2;
        cons.gridy = 2;
        pane.add(two, cons);
        three = new JButton("3");
        three.addActionListener(this);
        cons.gridx = 3;
        cons.gridy = 2;
        pane.add(three, cons);
        four = new JButton("4");
        four.addActionListener(this);
        cons.gridx = 0;
        cons.gridy = 3;
        pane.add(four, cons);
        five = new JButton("5");
        five.addActionListener(this);
        cons.gridx = 1;
        cons.gridy = 3;
      }Thanks in advance for your helps.

    Although the GridBagLayout is extremely flexible it is also more complicated to use.
    I prefer to use multiple LayoutManagers to get the effect I want. Maybe something like this:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=609795

  • TS1398 Turn the wifi on and off? I think I have a serious problem here. I cannot even press the on and off because its not available (the color is grey not black). I think this is why Apple is constantly losing a buyer and user. Slow action.

    What is the problem here Apple? Please hear us. I turned on my Wifi and then turned it off after use. After that I noticed something strange because I cannot turn on the wifi button anymore. I have restarted the phone several times, and turn it on after 10 mins, sometimes 30 min - 1 Hr. but then again its not working. I encountered this problem after updating my iOS to 6.1.2! Please hear us. If you wanted to penetrate to the market please love your consumers. Your products are great but your actions to their(US, CONSUMERS)  problems in terms of bugs fixes and battery life is so slow. Why is that?

    Try the suggestions here to see if they resolve your problem:
    http://support.apple.com/kb/ts1559
    If these don't work you may have a hardware problem. Visit an Apple store for an evaluation or contact Apple Support.

  • Hi there i am having a problem here i had an old id when i created my account but my credit card expired and i had put a new info but after that i have changed my apple id as well but now whenever i open anything the same old email id popped up how can i

    Hi there i am having a great problem here i had an old id when i first made my apple id but at that time my credit card info was different and now i have chaged my credit card info because it got expired.my problem is that even though i have changed my apple id the same old one always pops up and ask for a password and i ont hat id anymore how can i change my id on the main icloud setting page please slove my problem it is bothering me alot and my icloud is not backing up anymore how can i replace my new apple id to an old one please help me.
    Thanks
    Ayesha

    OK ..... Did you sign into your new ID in Settings>iTunes and App Stores>Apple ID. Tap your old ID and sign out and then sign in with the new ID.

  • I have a new laptop so I download again iTunes...the problem here is that I just got a cd and I tried to put it on my iPod and it won't let me, how can I fix this?

    I have a new laptop so I download again iTunes...the problem here is that I just got a cd and I tried to put it on my iPod and it won't let me, how can I fix this?

    The iPod sees the new computer as a new iTunes library. You can only sync with one iTunes library.  However, you can manage music among disfferent computers.  See:
    Using iPhone, iPad, or iPod with multiple computers

  • Problem while executing the code( that covert jpeg images to movie)

    http://java.sun.com/products/java-media/jmf/2.1.1/solutions/JpegImagesToMovie.html
    here is the code:
    * @(#)JpegImagesToMovie.java     1.3 01/03/13
    * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
    * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
    * modify and redistribute this software in source and binary code form,
    * provided that i) this copyright notice and license appear on all copies of
    * the software; and ii) Licensee does not utilize the software in a manner
    * which is disparaging to Sun.
    * This software is provided "AS IS," without a warranty of any kind. ALL
    * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
    * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
    * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
    * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
    * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
    * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
    * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
    * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
    * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
    * POSSIBILITY OF SUCH DAMAGES.
    * This software is not designed or intended for use in on-line control of
    * aircraft, air traffic, aircraft navigation or aircraft communications; or in
    * the design, construction, operation or maintenance of any nuclear
    * facility. Licensee represents and warrants that it will not use or
    * redistribute the Software for such purposes.
    import java.io.*;
    import java.util.*;
    import java.awt.Dimension;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.media.datasink.*;
    import javax.media.format.VideoFormat;
    * This program takes a list of JPEG image files and convert them into
    * a QuickTime movie.
    public class JpegImagesToMovie3 implements ControllerListener, DataSinkListener {
    public boolean doIt(int width, int height, int frameRate, Vector inFiles, MediaLocator outML) {
         ImageDataSource ids = new ImageDataSource(width, height, frameRate, inFiles);
         Processor p;
         try {
         System.err.println("- create processor for the image datasource ...");
         p = Manager.createProcessor(ids);
         } catch (Exception e) {
         System.err.println("Yikes! Cannot create a processor from the data source.");
         return false;
         p.addControllerListener(this);
         // Put the Processor into configured state so we can set
         // some processing options on the processor.
         p.configure();
         if (!waitForState(p, p.Configured)) {
         System.err.println("Failed to configure the processor.");
         return false;
         // Set the output content descriptor to QuickTime.
         p.setContentDescriptor(new ContentDescriptor(FileTypeDescriptor.QUICKTIME));
         // Query for the processor for supported formats.
         // Then set it on the processor.
         TrackControl tcs[] = p.getTrackControls();
         Format f[] = tcs[0].getSupportedFormats();
         if (f == null || f.length <= 0) {
         System.err.println("The mux does not support the input format: " + tcs[0].getFormat());
         return false;
         tcs[0].setFormat(f[0]);
         System.err.println("Setting the track format to: " + f[0]);
         // We are done with programming the processor. Let's just
         // realize it.
         p.realize();
         if (!waitForState(p, p.Realized)) {
         System.err.println("Failed to realize the processor.");
         return false;
         // Now, we'll need to create a DataSink.
         DataSink dsink;
         if ((dsink = createDataSink(p, outML)) == null) {
         System.err.println("Failed to create a DataSink for the given output MediaLocator: " + outML);
         return false;
         dsink.addDataSinkListener(this);
         fileDone = false;
         System.err.println("start processing...");
         // OK, we can now start the actual transcoding.
         try {
         p.start();
         dsink.start();
         } catch (IOException e) {
         System.err.println("IO error during processing");
         return false;
         // Wait for EndOfStream event.
         waitForFileDone();
         // Cleanup.
         try {
         dsink.close();
         } catch (Exception e) {}
         p.removeControllerListener(this);
         System.err.println("...done processing.");
         return true;
    * Create the DataSink.
    DataSink createDataSink(Processor p, MediaLocator outML) {
         DataSource ds;
         if ((ds = p.getDataOutput()) == null) {
         System.err.println("Something is really wrong: the processor does not have an output DataSource");
         return null;
         DataSink dsink;
         try {
         System.err.println("- create DataSink for: " + outML);
         dsink = Manager.createDataSink(ds, outML);
         dsink.open();
         } catch (Exception e) {
         System.err.println("Cannot create the DataSink: " + e);
         return null;
         return dsink;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    * Block until the processor has transitioned to the given state.
    * Return false if the transition failed.
    boolean waitForState(Processor p, int state) {
         synchronized (waitSync) {
         try {
              while (p.getState() < state && stateTransitionOK)
              waitSync.wait();
         } catch (Exception e) {}
         return stateTransitionOK;
    * Controller Listener.
    public void controllerUpdate(ControllerEvent evt) {
         if (evt instanceof ConfigureCompleteEvent ||
         evt instanceof RealizeCompleteEvent ||
         evt instanceof PrefetchCompleteEvent) {
         synchronized (waitSync) {
              stateTransitionOK = true;
              waitSync.notifyAll();
         } else if (evt instanceof ResourceUnavailableEvent) {
         synchronized (waitSync) {
              stateTransitionOK = false;
              waitSync.notifyAll();
         } else if (evt instanceof EndOfMediaEvent) {
         evt.getSourceController().stop();
         evt.getSourceController().close();
    Object waitFileSync = new Object();
    boolean fileDone = false;
    boolean fileSuccess = true;
    * Block until file writing is done.
    boolean waitForFileDone() {
         synchronized (waitFileSync) {
         try {
              while (!fileDone)
              waitFileSync.wait();
         } catch (Exception e) {}
         return fileSuccess;
    * Event handler for the file writer.
    public void dataSinkUpdate(DataSinkEvent evt) {
         if (evt instanceof EndOfStreamEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              waitFileSync.notifyAll();
         } else if (evt instanceof DataSinkErrorEvent) {
         synchronized (waitFileSync) {
              fileDone = true;
              fileSuccess = false;
              waitFileSync.notifyAll();
    public static void main(String args[]) {
         if (args.length == 0)
         prUsage();
         // Parse the arguments.
         int i = 0;
         int width = -1, height = -1, frameRate = 1;
         Vector inputFiles = new Vector();
         String outputURL = null;
         while (i < args.length) {
         if (args.equals("-w")) {
              i++;
              if (i >= args.length)
              prUsage();
              width = new Integer(args[i]).intValue();
         } else if (args[i].equals("-h")) {
              i++;
              if (i >= args.length)
              prUsage();
              height = new Integer(args[i]).intValue();
         } else if (args[i].equals("-f")) {
              i++;
              if (i >= args.length)
              prUsage();
              frameRate = new Integer(args[i]).intValue();
         } else if (args[i].equals("-o")) {
              i++;
              if (i >= args.length)
              prUsage();
              outputURL = args[i];
         } else {
              inputFiles.addElement(args[i]);
         i++;
         if (outputURL == null || inputFiles.size() == 0)
         prUsage();
         // Check for output file extension.
         if (!outputURL.endsWith(".mov") && !outputURL.endsWith(".MOV")) {
         System.err.println("The output file extension should end with a .mov extension");
         prUsage();
         if (width < 0 || height < 0) {
         System.err.println("Please specify the correct image size.");
         prUsage();
         // Check the frame rate.
         if (frameRate < 1)
         frameRate = 1;
         // Generate the output media locators.
         MediaLocator oml;
         if ((oml = createMediaLocator(outputURL)) == null) {
         System.err.println("Cannot build media locator from: " + outputURL);
         System.exit(0);
         JpegImagesToMovie3 imageToMovie3 = new JpegImagesToMovie3();
         imageToMovie3.doIt(width, height, frameRate, inputFiles, oml);
         System.exit(0);
    static void prUsage() {
         System.err.println("Usage: java JpegImagesToMovie -w <width> -h <height> -f <frame rate> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...");
         System.exit(-1);
    * Create a media locator from the given string.
    static MediaLocator createMediaLocator(String url) {
         MediaLocator ml;
         if (url.indexOf(":") > 0 && (ml = new MediaLocator(url)) != null)
         return ml;
         if (url.startsWith(File.separator)) {
         if ((ml = new MediaLocator("file:" + url)) != null)
              return ml;
         } else {
         String file = "file:" + System.getProperty("user.dir") + File.separator + url;
         if ((ml = new MediaLocator(file)) != null)
              return ml;
         return null;
    // Inner classes.
    * A DataSource to read from a list of JPEG image files and
    * turn that into a stream of JMF buffers.
    * The DataSource is not seekable or positionable.
    class ImageDataSource extends PullBufferDataSource {
         ImageSourceStream streams[];
         ImageDataSource(int width, int height, int frameRate, Vector images) {
         streams = new ImageSourceStream[1];
         streams[0] = new ImageSourceStream(width, height, frameRate, images);
         public void setLocator(MediaLocator source) {
         public MediaLocator getLocator() {
         return null;
         * Content type is of RAW since we are sending buffers of video
         * frames without a container format.
         public String getContentType() {
         return ContentDescriptor.RAW;
         public void connect() {
         public void disconnect() {
         public void start() {
         public void stop() {
         * Return the ImageSourceStreams.
         public PullBufferStream[] getStreams() {
         return streams;
         * We could have derived the duration from the number of
         * frames and frame rate. But for the purpose of this program,
         * it's not necessary.
         public Time getDuration() {
         return DURATION_UNKNOWN;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    * The source stream to go along with ImageDataSource.
    class ImageSourceStream implements PullBufferStream {
         Vector images;
         int width, height;
         VideoFormat format;
         int nextImage = 0;     // index of the next image to be read.
         boolean ended = false;
         public ImageSourceStream(int width, int height, int frameRate, Vector images) {
         this.width = width;
         this.height = height;
         this.images = images;
         format = new VideoFormat(VideoFormat.JPEG,
                        new Dimension(width, height),
                        Format.NOT_SPECIFIED,
                        Format.byteArray,
                        (float)frameRate);
         * We should never need to block assuming data are read from files.
         public boolean willReadBlock() {
         return false;
         * This is called from the Processor to read a frame worth
         * of video data.
         public void read(Buffer buf) throws IOException {
         // Check if we've finished all the frames.
         if (nextImage >= images.size()) {
              // We are done. Set EndOfMedia.
              System.err.println("Done reading all images.");
              buf.setEOM(true);
              buf.setOffset(0);
              buf.setLength(0);
              ended = true;
              return;
         String imageFile = (String)images.elementAt(nextImage);
         nextImage++;
         System.err.println(" - reading image file: " + imageFile);
         // Open a random access file for the next image.
         RandomAccessFile raFile;
         raFile = new RandomAccessFile(imageFile, "r");
         byte data[] = null;
         // Check the input buffer type & size.
         if (buf.getData() instanceof byte[])
              data = (byte[])buf.getData();
         // Check to see the given buffer is big enough for the frame.
         if (data == null || data.length < raFile.length()) {
              data = new byte[(int)raFile.length()];
              buf.setData(data);
         // Read the entire JPEG image from the file.
         raFile.readFully(data, 0, (int)raFile.length());
         System.err.println(" read " + raFile.length() + " bytes.");
         buf.setOffset(0);
         buf.setLength((int)raFile.length());
         buf.setFormat(format);
         buf.setFlags(buf.getFlags() | buf.FLAG_KEY_FRAME);
         // Close the random access file.
         raFile.close();
         * Return the format of each video frame. That will be JPEG.
         public Format getFormat() {
         return format;
         public ContentDescriptor getContentDescriptor() {
         return new ContentDescriptor(ContentDescriptor.RAW);
         public long getContentLength() {
         return 0;
         public boolean endOfStream() {
         return ended;
         public Object[] getControls() {
         return new Object[0];
         public Object getControl(String type) {
         return null;
    on executing with the command:
    java JpegImagesToMovie -w <width> -h <height> -f <frame rate per sec.> -o <output URL> <input JPEG file 1> <input JPEG file 2> ...
    comes this......
    Exception in thread"JMF thread:SendEventQueue:com.sun.media.processor.unknown Handler" java.lang.NullPointerException"
    plz help

    Don't forget to use the "Code Formatting Tags",
    see http://forum.java.sun.com/help.jspa?sec=formatting,
    so the posted code retains its original formatting.

  • Problem with AS 2 code...

    Hi,
    I bought this template because I wanna use certain stuff from
    it for my page.
    Unfortunately I'm not that experienced with Action Script, so
    here we go... (btw, it's AS 2.0)
    I ripped out a portion of the template which is like a photo
    gallery, but only the small preview thumbnails.
    Now, I have a lot of preview thumbnails, but because of
    limitations to the size of the page I can only show a few at once -
    let' say 8 - and then have arrow keys on the top and the bottom to
    go show the next / previous 8 thumbnails.
    In the template that I bought the code, of course, works, but
    when I ripped it out it doesn't really work anymore, probably
    something is missing or has to be adjusted...
    Here's the code that is applied to the preview thumbnails:
    onClipEvent (load) {
    accel =0;
    rate = 0.05;
    trace(_y)
    _root.ykoord=20.5;
    onClipEvent(enterFrame) {
    y=y*accel+(_root.ykoord-_y) * rate;
    _y+=y;
    if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }
    Here's the code that is applied to one of the arrow buttons:
    on (rollOver) {
    gotoAndPlay("S1");
    on (releaseOutside, rollOut) {
    gotoAndPlay("S2");
    on (release) {
    if (_root.ykoord>-200) {
    _root.ykoord -= 308;
    The rollover effect for the button is working, just when u
    click on them nothing is moving / transitioning.
    Like I said, in the original template the code is working.
    Because of my very limited action script skills ;) I just
    understand half of the code that's why I can't seem to adjust it...
    I managed to write my own very simple code to make the
    buttons move the preview thumbnails, something like:
    on (release) {
    _root.small_pics_all.small_pics._y =
    _root.small_pics_all.small_pics._y - 308;
    but it just does not have the nice transition scrolling that
    the other one has...
    Any help is very, very appreciated ! ;)
    Mike

    Hi Kiran,
    The log files i mentioned can be found in /usr/sap/<SID>/<instanceID>/work/
    As for the java heap settings, if you see in the log files the error "cannot reserve enough space for object heap" then you need to lower the values of -Xmx and -Xms JVM options, via configtool.
    See
    http://help.sap.com/saphelp_nw2004s/helpdata/en/00/3ca3e81b5a4c749b860ab1ed1fb206/content.htm
    Greetings, Myriana

  • Since upgrading to iphoto 11 I,m having difficulty viewing my photos in edit mode. On the quick scan of info mode the photos appear sharp, however in edit mode the edges blur up making it very difficult to edit properly, What is the problem here?  I never

    Since upgrading to iphoto 11 I,m having difficulty viewing my photos in edit mode. On the quick scan of info mode the photos appear sharp, however in edit mode the edges blur up making it very difficult to edit properly, What is the problem here?  I never

    Marisa, you stand a better chance of getting an answer concerning iPhoto by posting this question in the iPhoto forum
    https://discussions.apple.com/community/ilife/iphoto

  • I have downloaded the Creative Cloud and when it finished, it opened up and was completely blank. Nowhere for me to sign in and no apps for me to click to download. I need this to be fixed ASAP. What is the problem here?

    I have downloaded the Creative Cloud and when it finished, it opened up and was completely blank. Nowhere for me to sign in and no apps for me to click to download. I need this to be fixed ASAP. What is the problem here?

    BLANK Cloud Screen http://forums.adobe.com/message/5484303 may help
    -and step by step http://forums.adobe.com/thread/1440508?tstart=0
    -and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html

Maybe you are looking for

  • Photoshop CS5 still chooses wrong monitor profile in dual monitor case?

    The folk lore has it that if you go to EDIT/COLOR SETTINGS and open the Working Spaces RGB drop down, then what it says near the top on the "Monitor RGB" line is the monitor profile that photoshop is actually using. If that is true, then I would expe

  • Inbox messages won't appear on Mail

    My ymail account won't sync to my Mail. I'm on OS X. I'm not too sure what happened. All my other accounts like hotmail and another yahoo mail are synced and I can access my messages. I tried deleting the account but it's still the same.

  • Can anyone explain this code!

    DECLARE TYPE t_NumberTableType IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; v_NumberTable t_NumberTableType; v_TempVar NUMBER; BEGIN v_TempVar := v_NumberTable(1); END; /

  • Windows 8 Key doesn't work in bootcamp

    I currently have windows boot camped on my early 2013 Macbook pro retina however i am not allowed to download anything. When i go into pc settings to input my product key to activate windows it denies my product key. Does anyone have a solution to th

  • Can I install CS3 without disk? Have key registered.

    My old laptop crashed and of course after my move, I can't find my cs3 disks. I have my serial key registered through Adobe (shows up in my "sign-in" info when I log into the website) and all. I tried finding the download files through the website bu