How to use setFireActionForSubmit with parameters and capture the parameter

Hi,
Can anyone explain how to use setFireActionForSubmit.
I am extending the Controller of ShoppingCartPG. In the extended controller processRequest method I am adding a button to the table and setting up the setFireActionForSubmit, so when the button is pressed it raises the event associated with the setFireActionForSubmit.
I need to pass the RequisitionLineId as a parameter which is present in the VO associated with the ShoppingCartPG.
I have used the following code in processRequest
=================================
public void processRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
super.processRequest(paramOAPageContext, paramOAWebBean);
OATableBean otbRN=(OATableBean)paramOAWebBean.findIndexedChildRecursive("ItemTableRN");
OASubmitButtonBean oasb= (OASubmitButtonBean)paramOAPageContext.getWebBeanFactory().createWebBean(paramOAPageContext,"BUTTON_SUBMIT");
oasb.setID("addnInfo");
oasb.setUINodeName("addnInfo");
oasb.setText("Additional Info");
String pageName = paramOAPageContext.getRootRegionCode();
Hashtable params = new Hashtable (1);
params.put ("param1", pageName);
Hashtable paramsWithBinds = new Hashtable(1);
paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL(oasb, "${oa.encrypt.current.RequisitionLineId}"));
oasb.setFireActionForSubmit("addnInfoEvent",params,paramsWithBinds,false,false);
otbRN.addIndexedChild(oasb);
=================================
And in processFormRequest method I am capturing the event "addnInfoEvent" and trying to capture the RequisitionLineId which I have passed it as a parameter.
This is the code I have used in processFormRequest.
=================================
public void processFormRequest(OAPageContext paramOAPageContext, OAWebBean paramOAWebBean)
super.processFormRequest(paramOAPageContext, paramOAWebBean);
OAApplicationModule localOAApplicationModule = paramOAPageContext.getApplicationModule(paramOAWebBean);
String strEvent= paramOAPageContext.getParameter(EVENT_PARAM) ;
if ("addnInfoEvent".equals(strEvent))
Number localNumber = 0;
try {
localNumber = new Integer(ClientUtil.getDecryptedParameter(paramOAPageContext, "param2"));
catch (Exception e) {e.printStackTrace();}
String outmsg="Line ID : " + localNumber + ":" + strEvent;
throw new OAException(outmsg,OAException.INFORMATION);
=================================
But I am not able to capture the RequisitionLineId which I have sent as a parameter.
Can anyone let me know what I am doing wrong.

Hi,
This is the requested HTML Code
===============================
<button id="N3:addnInfo:0" class="x7g" style="background-image:url(/OA_HTML/cabo/images/swan/btn-bg1.gif)" onclick="return _chain('submitForm(\'DefaultFormName\',1,{\'param1\':\'${oa.encrypt.current.RequisitionLineId}\',\'serverValidate\':\'1\',\'param2\':\'${oa.encrypt.current.RequisitionLineId}\',event:\'addnInfoEvent\',source:\'N3:addnInfo:0\'});return false;',*'submitForm*(\'DefaultFormName\',1,{\'_FORM_SUBMIT_BUTTON\':\'N34\'});return false',this,event,true)" type="submit">Additional Info</button>
===============================
Hi I am not able to paste the HTML Code..some parts of HTML gets removed automatically when I paste it in the forum.
Regards,
Rohit

Similar Messages

  • Execute a Query from a report sending it parameters and capture the result

    Hello everybody,
    Greetings from Peru, I want your help, Do you know how to execute a query from a report sending parameteres and capture the result in a internal table?
    The attached imaged has in red square the parameteres I want to send from a report.
    The idea is to have a JOB that executes everyday and parameters like DATE PERIOD will change automatically.
    Thanks for your time.

    Hi Enrique,
    You can call a query from a report by using submit statement.
    Every query has a corresponding program associated with it.
    Execute the query from SQ01. On te selection screen of query, goto SYSTEM  from menu and then click on STATUS, you will get program name (In this case aqzzzent_struct=zmm_ent_struc1). Use this program to call the query from your custom program.
    Also populate the rspar int table as per the selection criteria you want to pass to query.
       DATA: rspar     TYPE TABLE OF rsparams,
        wa_rspar  LIKE LINE OF rspar.
          wa_rspar-selname = 'SP$00001'.
          wa_rspar-kind = 'S'.
          wa_rspar-sign = 'I'.
          wa_rspar-option = 'BT'.
          wa_rspar-low  = s_cmp_cd-low.
          wa_rspar-high = s_cmp_cd-high.
          APPEND wa_rspar TO rspar.
       SUBMIT aqzzzent_struct=zmm_ent_struc1 WITH SELECTION-TABLE rspar AND RETURN.
    Thanks,
    Sachin

  • How to query Database with Parameters  and configure null value response?

    Hi,
    1.When capture attributes from forms & after applying several logics, passing to a DB table using an API, how to get relevant values for a given parameter in another DB table ?
    2.When a DB table is queried, if the value does not exist, how to configure the response message ?
    Thanks.

    Okay, you've provided exactly what John S. asked for - and no more. This is helpful, but not enough. I think we're going to need a use case to understand exactly what you are asking. What should the user see? What does the user do next? What should happen in the database and in the application when the user does this?
    However, I'll try to read between the lines a bit, and get you part of the way there. To query the database with parameters in ADF BC, you need a View Object (VO). The simplest thing to do is create the SELECT command behind the VO with some bind variables and add the bind variables to your VO. At that point, you will get an ExecuteWithParameters operation in the Data Control. You can drag that operation onto a JSF page and it will give you an option to create a parameter form to let the user fill in the parameters to set the bind variables, and a button to execute the query with these values. Any table or form based on that same VO will show the selected data.
    A Trinidad or ADF Rich Faces table will have an attribute to let you define some text to show the user if no data was retrieved by the query. But there are other ways to determine if data was retrieved which you can use to control other ways to display this information. For instance, I have a page that has an outputText component that has a "rendered" attribute to show the text only when there was no data retrieved by a query.

  • How to use JMS with tomcat and Axis

    Hello
    I'm new in ii, so i'm still a little bit lost. I have been implementing web services with tomcat and Axis. However, these services are synchronous and I would like that some services were asynchronous.
    I've been reading about the topic and I've found that JMS is a good solution for it. I have already downloaded JMS in my computer but now I don't know what else to do. I've been trying to run the SimpleQueueSender.java example but I get the error:
    JNDI API lookup failed: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    But I have attached all .jar from F:\Sun\MessageQueue\lib
    In addition to this, for my first webservices I used the Java2WSDL, WSDL2Java and AdminClient (axis tool) to create my web services bindings, stubs and skeletons and to deploy the web service on the server. Do I have to use them now with JMS? or now the deployment must be performed in a different way?
    Thank you in advanced,

    The error means that you have to specify the type and location of your jndi store. You could create a jndi.properties file and put two properties in it:
    java.naming.provider.url=file\\\:////var/jndi
    java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
    for a file based jndi store. Then you have to make sure your jndi.properties file is in your CLASSPATH. Then you have to use something like imqadmin to create your jndi store and store in it your administrative objects like Queues and QueueConnectionFactories.

  • How to use RLS with complex numbers as the input?

    I import a file which have complex numbers, and I want to filter it using complex RLS adaptive filter, but it always freeze at the filtering and update then it returns one value in the matrix and all the other numbers are NaN, so how can I fix this.
    The second thing is when I use FBLMS, it always return error 42020 unless I specify the filter length= number of the input which is huge number, so how do I specify normal filter length.

    Hi engomar,
    There is a detailed description of how to choose filter length in the Adaptive Filter Tollkit Help file. 
    http://zone.ni.com/reference/en-XX/help/372357B-01/lvaftconcepts/aft_choose_filterlength/
    This page has several links to other important factors of what filter to choose. Under Computational Resource Requirements, it lists the memory usage for different filter types. RLS is the most memory intensive, which could be causing the freeze. Maybe try a LMS to see if this helps.
    Robert R. | Applications Engineer | National Instruments

  • How to use Airplay with AE and ATV with no internet connection?

    I am currently at a resort that only has the AT&T Wi-fi.  Unelss someone knows how to hook an AppleTV into an AT&T network and get past their acceptance of terms screen I need to figure out how to get this to to work.
    I have an airport Express set up as it's own network.  I had the Apple TV join that netowork as well as my iPad.  When I start to play a movie the Airplay icon comes up and I tell it to use the AppleTV.  On the TV a notification comes up in the corner that has the movie name but then that's it.  It never plays. The AE was unhappy about not having an internet connection but I told it to ignore not having one and it turned green.
    As far as I can tell I should in theory be able to have the AE be it's own network without internet and use Airplay between my iPad and the ATV.  It's just a no go and I can't tell why.
    Thoughts?  Settings I may not be aware of? I can't figure it out.

    AirPlay is only compatible with AirPort base stations.
    The dongle is not compatible with AirPlay.

  • How to Parse XML with SAX and Retrieving the Information?

    Hiya!
    I have written this code in one of my classes:
    /**Parse XML File**/
              SAXParserFactory factory = SAXParserFactory.newInstance();
              GameContentHandler gameCH = new GameContentHandler();
              try
                   SAXParser saxParser = factory.newSAXParser();
                   saxParser.parse(recentFiles[0], gameCH);
              catch(javax.xml.parsers.ParserConfigurationException e)
                   e.printStackTrace();
              catch(java.io.IOException e)
                   e.printStackTrace();
              catch(org.xml.sax.SAXException e)
                   e.printStackTrace();
              /**Parse XML File**/
              games = gameCH.getGames();And here is the content handler:
    import java.util.ArrayList;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    class GameContentHandler extends DefaultHandler
         private ArrayList<Game> games = new ArrayList<Game>();
         public void startDocument()
              System.out.println("Start document.");
         public void endDocument()
              System.out.println("End document.");
         public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes atts) throws SAXException
         public void endElement(String namespaceURI, String localName, String qualifiedName) throws SAXException
         public void characters(char[] ch, int start, int length) throws SAXException
              /**for (int i = start; i < start+length; i++)
                   System.out.print(ch);
         public ArrayList<Game> getGames()
              return games;
    }And here is the xml i am trying to parse:<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <Database>
         <Name></Name>
         <Description></Description>
         <CurrentGameID></CurrentGameID>
         <Game>
              <gameID></gameID>
              <name></name>
              <publisher></publisher>
              <platform></platform>
              <type></type>
              <subtype></subtype>
              <genre></genre>
              <serial></serial>
              <prodReg></prodReg>
              <expantionFor></expantionFor>
              <relYear></relYear>
              <expantion></expantion>
              <picPath></picPath>
              <notes></notes>
              <discType></discType>
              <owner></owner>
              <location></location>
              <borrower></borrower>
              <numDiscs></numDiscs>
              <discSize></discSize>
              <locFrom></locFrom>
              <locTo></locTo>
              <onLoan></onLoan>
              <borrowed></borrowed>
              <manual></manual>
              <update></update>
              <mods></mods>
              <guide></guide>
              <walkthrough></walkthrough>
              <cheats></cheats>
              <savegame></savegame>
              <completed></completed>
         </Game>
    </Database>I have been trying for ages and just can't get the content handler class to extract a gameID and instantiate a Game to add to my ArrayList! How do I extract the information from my file?
    I have tried so many things in the startElement() method that I can't actually remember what I've tried and what I haven't! If you need to know, the Game class instantiates with asnew Game(int gameID)and the rest of the variables are public.
    Please help someone...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    OK, how's this?
    public void startElement(String namespaceURI, String localName, String qualifiedName, Attributes atts) throws SAXException
              current = "";
         public void endElement(String namespaceURI, String localName, String qualifiedName) throws SAXException
              try
                   if(qualifiedName.equals("Game") || qualifiedName.equals("Database"))
                        {return;}
                   else if(qualifiedName.equals("gameID"))
                        {games.add(new Game(Integer.parseInt(current)));}
                   else if(qualifiedName.equals("name"))
                        {games.get(games.size()-1).name = current;}
                   else if(qualifiedName.equals("publisher"))
                        {games.get(games.size()-1).publisher = current;}
                   etc...
                   else
                        {System.out.println("ERROR - Qualified Name found in xml that does not exist as databse field: " + qualifiedName);}
              catch (Exception e) {} //Ignore
         public void characters(char[] ch, int start, int length) throws SAXException
              current += new String(ch, start, length);
         }

  • How to Add a correspondence type and tick the parameter(FI Down Payment)

    Hi All,
    To use the Down-Payments functionality of SAP for customer payments. Part of the process will be to print off a request for the customer to pay based on data that is entered into transaction F-37 (Down-Payment Request).
    I have created a new sapscripts for the Down-Payment Request. We will need a new correspondence type creating for this print. For ZFI006 to show anything the u201CNoted Itemsu201D must be ticked when printed in ZFI006 using correspondence ZAP11.
    Kindly advice me how to add a new correspondence type and the u201CNoted Itemsu201D must be ticked?
    Thanks.

    Hi,
    You cannot define a payment type as that is based on a lookup defined under the navigation Setup>lookup>Payables.
    This look up access level is System whihc implies it does not allow user level values to be defined.
    So you have to use the available payment types,
    Thanks
    Manish Jain.

  • How to use SET & GET Parameters in Module Pool

    Hi Friends,
    Can anyone please tell how to use SET / GET parameters and PARAMETER ID for a text box (Input / Output field ) in module pool? What is the purpose and where do we need to do coding for it?
    Note : I will definitely give the marks for good responses.
    Thanks in advance,
    Pradeep

    Hi Pradeep,
    You can save values in the SAP memory using a parameter ID. These
    are user and terminal-session specific, but available to all internal and
    external sessions.
    SET Parameter copies the corresponding field contents into the SAP
    System memory in the PAI processing block.
    GET Parameter copies the corresponding field contents from the SAP
    memory at the end of the PBO processing block, after data has been
    transferred from the program, if the screen field still has its initial value
    You can link an input/output field to an area of the SAP memory in the
    ABAP Dictionary.
    When you use an input/output field that is defined in the ABAP
    Dictionary, its parameter ID is displayed in the Dictionary attribute
    Parameter ID in the Screen Painter.
    Usage
    SET PARAMETER ID: ’CAR’ FIELD space,
    ’CON’ FIELD space,
    ’DAY’ FIELD space.
    Here is the link that explains the usage of GET/SET in detail
    <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm">http://help.sap.com/saphelp_erp2005vp/helpdata/en/9f/db9e0435c111d1829f0000e829fbfe/content.htm</a>
    Regards,
    Sharadha

  • How to use Count with Date Parameters

    Hello,
    I am having issues using the Count() function in conjunction with date parameters.
    This is a Siebel report and in my report I have 2 date parameters(From Date, To Date). In a nutshell I am basically trying to count Opportunities that has a start date within the given date period. However I don't see a reasonable way to put my date parameters within the Count() function. The reason being is that I need to have a huge chunk of code to convert the dates into a common format that can be compared, and it won't even fit within the code block in my rtf template. I am not even sure how to put multiple conditional statements inside a Count() function since all the examples I have seen are very simple.
    Anyone have a suggestion on how to use Count() with date parameters?
    Thanks.

    Any chance you can get the date formats in the correct format from siebel?
    I don't know Siebel - so I can't help you with that. If you get the correct format it is just
    <?count(row[(FromDate>=date) and  (date<=ToDate))?>
    Otherwise the approach would probably need to use string function to get year/monthd/day from the date
    and store it into a varialbe and compare later the same way
    <?variable@incontext:from; ....?>
    <?variable@incontext:to; ...?>
    <?count(row[($from>=date) and  (date<=$to))?>
    Potentially you can use the date functions such as xdofx:to_date to do the conversion
    [http://download.oracle.com/docs/cd/E12844_01/doc/bip.1013/e12187/T421739T481158.htm]
    But I am not sure if they are available in your siebel implementation.
    Hope that helps

  • How to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and a novice in interfacing skill ..so plzzzzz explain me in a litle detail

    how to use labview with gpib to connect with Agilent PNA E8362B ?i am newbie ..just started to work on labview about a fortnite bck and +i am a novice in interfacing(networking... jst know tidbits) skill ..so plzzzzz explain me in a litle detail

    Sir
    We were able to solve that problem...but now could you advice as to which DC power supply we should use (preferably avalable in India) so that it can be controlled by Labview (through a gpib/rs232/any other port) to give a square wave of desired frequency/other parameters.
    Regards
    Shivam

  • HT1695 I know nothing about how to use my new ipod and when reading the little bit of information in the folder that came with it, all I can do is turn it on, but it just powers down after a few seconds.  How do I work this thing?

    I know nothing about how to use my new ipod and when reading the little information that came with it, all I can do is turn it on.  Then in a few seconds it goes black, never having brought up a screen to do anything!  Help!  What do I do to get this thing going?

    You might consider connecting it to the charger and charging up the battery overnight.
    Please Get the iPod Touch User Manual for iOS 5

  • How to use multiple selection parameters in the data model

    Hi, after have looked all the previous threads about how to use multiple selection parameters , I still have a problem;
    I'm using Oracle BI Publisher 10.1.3.3.2 and I'm tried to define more than one multiple selection parameters inside the data template;
    Inside a simple SQL queries they work perfectly....but inside the data template I have errors.
    My data template is the following (it's very simple...I am just testing how the parameters work):
    <dataTemplate name="Test" defaultPackage="bip_departments_2_parameters">
    <parameters>
    <parameter name="p_dep_2_param" include_in_output="false" datatype="character"/>
    <parameter name="p_loc_1_param" include_in_output="false" datatype="character"/>
    </parameters>
    <dataTrigger name="beforeReport" source="bip_departments_2_parameters.beforeReportTrigger"/>
    <dataQuery>
    <sqlStatement name="Q2">
    <![CDATA[
    select deptno, dname,loc
    from dept
    &p_where_clause
    ]]>
    </sqlStatement>
    </dataQuery>
    <dataStructure>
    <group name="G_DEPT" source="Q2">
    <element name="deptno" value="deptno"/>
    <element name="dname" value="dname"/>
    <element name="loc" value="loc"/>
    </group>
    </dataStructure>
    </dataTemplate>
    The 2 parameters are based on these LOV:
    1) select distinct dname from dept (p_dep_2_param)
    2) select distinct loc from dept (p_loc_1_param)
    and both of them have checked the "Multiple selection" and "Can select all" boxes
    The package I created, in order to use the lexical refence is:
    CREATE OR REPLACE package SCOTT.bip_departments_2_parameters
    as
    p_dep_2_param varchar2(14);
    p_loc_1_param varchar2(20);
    p_where_clause varchar2(100);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    CREATE OR REPLACE package body SCOTT.bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    if (p_dep_2_param is not null) --and (p_loc_1_param is not null)
    then
    p_where_clause := 'where (dname in (' || replace (p_dep_1_param, '''') || ') and loc in (' || replace (p_loc_1_param, '''') || '))';
    else
    p_where_clause := 'where 1=1';
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    As you see, I tried to have only one p_where_clause (with more than one parameter inside)....but it doesn't work...
    Using only the first parameter (based on deptno (which is number), the p_where_clause is: p_where_clause := 'where (deptno in (' || replace (p_dep_2_param, '''') || '))';
    it works perfectly....
    Now I don't know if the problem is the datatype, but I noticed that with a single parameter (deptno is number), the lexical refence (inside the data template) works.....with a varchar parameter it doesn't work....
    So my questions are these:
    1) how can I define the p_where_clause (inside the package) with a single varchar parameter (for example, the department location name)
    2) how can I define the p_where_clause using more than one parameter (for example, the department location name and the department name) not number.
    Thanks in advance for any suggestion
    Alex

    Alex,
    the missing thing in your example is the fact, that if only one value is selected, the parameter has exact this value like BOSTON. If you choose more than one value, the parameter includes the *'*, so that it looks like *'BOSTON','NEW YORK'*. So you need to check in the package, if there's a *,* in the parameter or not. If yes there's more than one value, if not it's only one value or it's null.
    So change your package to (you need to expand your variables)
    create or replace package bip_departments_2_parameters
    as
    p_dep_2_param varchar2(1000);
    p_loc_1_param varchar2(1000);
    p_where_clause varchar2(1000);
    function beforereporttrigger
    return boolean;
    end bip_departments_2_parameters;
    create or replace package body bip_departments_2_parameters
    as
    function beforereporttrigger
    return boolean
    is
    l_return boolean := true;
    begin
    p_where_clause := ' ';
    if p_dep_2_param is not null then
    if instr(p_dep_2_param,',')>0 then
    p_where_clause := 'WHERE DNAME in ('||p_dep_2_param||')';
    else
    p_where_clause := 'WHERE DNAME = '''||p_dep_2_param||'''';
    end if;
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || ' AND LOC IN ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || ' AND LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    else
    if p_loc_1_param is not null then
    if instr(p_loc_1_param,',')>0 then
    p_where_clause := p_where_clause || 'WHERE LOC in ('||p_loc_1_param||')';
    else
    p_where_clause := p_where_clause || 'WHERE LOC = '''||p_loc_1_param||'''';
    end if;
    end if;
    end if;
    return (l_return);
    end beforereporttrigger;
    end bip_departments_2_parameters;
    I've written a similar example at http://www.oracle.com/global/de/community/bip/tipps/Dynamische_Queries/index.html ... but it's in german.
    Regards
    Rainer

  • How to use onChange with edittext?

    Hi,
    This is how I'd like my script to work:
    In the first window, the user fills a few edittext-boxes with numbers. Clicking OK, a second window appears, where the previously entered values and results of calculations based on said numbers are displayed.
    Dismissing the second dialog with OK, another script from the same folder is started which receives the variables from the second window. The second menu has a back button which directs the user back to the first window.
    Would this be possible? I'm just beginning to script, so any help would be very appreciated.
    var value1;
    var value2;
    var value3;
    var value4;
    Win1();
    function Win1() {
        var win1 = new Window("palette", "Window 1",[200,100,700,340]);
        win1.editPanel = win1.add("panel", [25,15,476,140], "Edit");
        win1.editPanel.add("statictext", [15,20,255,35], "Width:");
        win1.editPanel.editA = win1.editPanel.add("edittext", [225,20,270,40], "120",);
        win1.editPanel.editA.onChange = function () {this.value = this.text};
        value1 = win1.editPanel.editA.value;
        win1.editPanel.add("statictext", [15,40,255,55], "Height:");
        win1.editPanel.editB = win1.editPanel.add("edittext", [225,40,270,60], "120",);
        win1.editPanel.editB.onChange = function () {this.value = this.text};
        value2 = win1.editPanel.editB.value;
        win1.editPanel.add("statictext", [15,60,255,80], "Multiplier Width:");
        win1.editPanel.editC = win1.editPanel.add("edittext", [225,60,270,80], "2",);
        win1.editPanel.editC.onChange = function () {this.value = this.text};
        value3 = win1.editPanel.editC.value;
        win1.editPanel.add("statictext", [15,80,255,100], "Multiplier Height:");
        win1.editPanel.editD = win1.editPanel.add("edittext", [225,80,270,100], "2",);
        win1.editPanel.editD.onChange = function () {this.text = this.value};
        value4 = win1.editPanel.editD.value;
        win1.okBtn = win1.add("button", [155,187,245,5],"OK");
        win1.cancelBtn = win1.add("button", [260, 187, 350, 5],"Cancel");
        win1.okBtn.onClick = function() {
                win2.show();
                win1.close();
        win1.cancelBtn.onClick = function() {
            win1.close();
        win1.show();
        return value1;
        return value2;
        return value3;
        return value4;
    var value5 = value1*value3;
    var value6 = value2*value4;
    //function Win2() {
        var win2 = new Window("palette", "Window 2",[200,100,700,340]);
        win2.controlPanel = win2.add("panel", [25,15,470,170], "Control");
        win2.controlPanel.add("statictext", [15,20,255,40], "Width:"+value1+"");
        win2.controlPanel.add("statictext", [15,40,255,60], "Height:"+value2+"");
        win2.controlPanel.add("statictext", [15,60,255,80], "Multiplier Width:"+value3+"");
        win2.controlPanel.add("statictext", [15,80,255,100], "Multiplier Height:"+value4+"");
        win2.controlPanel.add("statictext", [15,100,255,120], "Total Width:"+value5+"");
        win2.controlPanel.add("statictext", [15,120,255,140], "Total Height:"+value6+"");
        win2.okBtn = win2.add("button", [155,187,245,5],"OK");
        win2.backBtn = win2.add("button", [260, 187, 350, 5],"Back");
        win2.cancelBtn = win2.add("button", [365, 187, 455, 5],"Cancel");
        win2.okBtn.onClick = function() {
                win2.close();
        win2.cancelBtn.onClick = function() {
            win2.close();
            win1.show();
        win2.backBtn.onClick = function() {
            win2.close();
    //    win2.show();

    Hi Andrea,
    First you made some confusing and mistake
    Keep in mind , that dialogbox are unsynchronisious.. i explain (i try , i'm not expert)
    1) you prepare your first dialogbox
    - here a panel
    - add 'edittext' box with value
    2) you prepare your second dialogbox
    - here a panel
    - add 'edittext' box with your variable from first dialogbox, but at this time, dialogbox isn't running so value=undefined
    3) you call first dialbox
    Finally, you need consider your second dialogbox as embed in onClick function, because when onClick will be invoqued, value(s) will be really present.
    I hope i was clarly or not..
    Now your code:
    for statictext and editext use .text (and NOT value) to assign or capture the "value", value is for status of for exemple checkbox => checkbox.value is true or false
    win1.editPanel.editA = win1.editPanel.add("edittext", [225,20,270,40],"120",);
    win1.editPanel.editA.onChange = function () {this.value = this.text};
    value1 = win1.editPanel.editA.value;
    your onChange is useless, because if there are changes, of course the "value" will be changed, useless to re-assign a changed value
    but you could have used onChange to calculate and show the result , without create a second dialogbox (see the second script , lastest)
    Now check this your revised script:
    function Win1() {
        var win1 = new Window("palette", "Window 1",[200,100,700,340]);
        win1.editPanel = win1.add("panel", [25,15,476,140], "Edit");
        win1.editPanel.add("statictext", [15,20,255,35], "Width:");
        win1.editPanel.editA = win1.editPanel.add("edittext", [225,20,270,40]);
         win1.editPanel.editA.text=120;
        win1.editPanel.add("statictext", [15,40,255,55], "Height:");
        win1.editPanel.editB = win1.editPanel.add("edittext", [225,40,270,60]);
         win1.editPanel.editB.text=120;   
        win1.editPanel.add("statictext", [15,60,255,80], "Multiplier Width:");
        win1.editPanel.editC = win1.editPanel.add("edittext", [225,60,270,80]);
        win1.editPanel.editC.text=2;   
        win1.editPanel.add("statictext", [15,80,255,100], "Multiplier Height:");
        win1.editPanel.editD = win1.editPanel.add("edittext", [225,80,270,100]);
        win1.editPanel.editD.text=2;
        win1.okBtn = win1.add("button", [155,187,245,5],"OK");
        win1.cancelBtn = win1.add("button", [260, 187, 350, 5],"Cancel");
        win1.okBtn.onClick = function() {
              var value5 = win1.editPanel.editA.text*win1.editPanel.editC.text;
              var value6 = win1.editPanel.editB.text*win1.editPanel.editD.text;
         ///////////////// create win2 /////////////
        var win2 = new Window("palette", "Window 2",[200,100,700,340]);
        win2.controlPanel = win2.add("panel", [25,15,470,170], "Control");
        win2.controlPanel.add("statictext", [15,20,255,40], "Width:"+win1.editPanel.editA.text+"");  
        win2.controlPanel.add("statictext", [15,40,255,60], "Height:"+win1.editPanel.editB.text+"");  
        win2.controlPanel.add("statictext", [15,60,255,80], "Multiplier Width:"+win1.editPanel.editC.text+"");  
        win2.controlPanel.add("statictext", [15,80,255,100], "Multiplier Height:"+win1.editPanel.editD.text+"");
        win2.controlPanel.add("statictext", [15,100,255,120], "Total Width:"+value5+"");
        win2.controlPanel.add("statictext", [15,120,255,140], "Total Height:"+value6+"");
        win2.okBtn = win2.add("button", [155,187,245,5],"OK");
        win2.backBtn = win2.add("button", [260, 187, 350, 5],"Back");
        win2.cancelBtn = win2.add("button", [365, 187, 455, 5],"Cancel");
        win2.okBtn.onClick = function() {win2.close();    };
        win2.cancelBtn.onClick = function() {win2.close();win1.show();    };
        win2.backBtn.onClick = function() {win2.close(); win1.show()   };
        //////////////////// end of win2 ////////////////////      
                win2.show();
                win1.close();
        win1.cancelBtn.onClick = function() {      win1.close();    };
        win1.show();
        return win1;
    Win1();
    The same, but shorter with onChange and only one dialogbox
    function Win1() {
        var win1 = new Window("palette", "Window 1");
        win1.editPanel = win1.add("panel", undefined, "Edit");
        win1.editPanel.add("statictext", undefined, "Width:");
        win1.editPanel.editA = win1.editPanel.add("edittext", undefined);
         win1.editPanel.editA.text=1200;
        win1.editPanel.add("statictext", undefined, "Height:");
        win1.editPanel.editB = win1.editPanel.add("edittext", undefined);
         win1.editPanel.editB.text=1200;   
        win1.editPanel.add("statictext", undefined, "Multiplier Width:");
        win1.editPanel.editC = win1.editPanel.add("edittext", undefined);
        win1.editPanel.editC.text=20;   
        win1.editPanel.add("statictext", undefined, "Multiplier Height:");
        win1.editPanel.editD = win1.editPanel.add("edittext", undefined);
        win1.editPanel.editD.text=20;
         win1.editPanel.add("statictext", undefined, "Result Width:");
        win1.editPanel.editE = win1.editPanel.add("edittext", undefined);
        win1.editPanel.editE.text=24000;   
        win1.editPanel.add("statictext", undefined, "Result Height:");
        win1.editPanel.editF = win1.editPanel.add("edittext", undefined);
        win1.editPanel.editF.text=24000;
        win1.cancelBtn = win1.add("button", undefined,"Cancel");
        function calcul(){         
              win1.editPanel.editE.text = win1.editPanel.editA.text*win1.editPanel.editC.text;
              win1.editPanel.editF.text = win1.editPanel.editB.text*win1.editPanel.editD.text;
         win1.editPanel.editA.onChange=
         win1.editPanel.editB.onChange=
         win1.editPanel.editC.onChange=
         win1.editPanel.editD.onChange= function() {  calcul() };
        win1.cancelBtn.onClick = function() {      win1.close();    };
        win1.show();
        return win1;
    Win1();
    Regards, art.chrome
    Message was edited by: artchrome (added a shorter script)

  • How can I start anew with Photos and clear the (minimal) stuff it has uploaded

    I've about had it up to here with this new Photos scheme. I reorganised my Aperture libraries on both my iMac and MBA in preparation for this, delayed turning Photos on for a couple of days until I thought everything was ready based upon the limited advice that was out there, and then got stuck in an endless loop of "uploading" and "preparing" every time I opened Photos. There are 19,975 images in my Aperture library on the iMac. I was stuck at Uploading at anywhere between that number and 19,000 with no progress after hours of waiting. I tried all the tricks mentioned here including re booting, restarting the app, repairing/rebuilding the database, killing the "cloudd" process, etc.today Today when I restarted Photos, it now said I had 23,775 images to upload- 4000
    more than I have-and of course it got stuck there, like it has for the last week.
    I copied the previous Aperture library (pre Photos migration)back to my iMac and opened it in Aperture. Thankfully, all the photos I had taken on my iPhone this week during this Photos clusterphuck transition were in the Aperture Stream so I didn't lose any of those. I'm willing to give this whole thing one more shot. So  i need some advice. How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    <Re-Titled By Host>

    How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    It is hard to say from your post, why the migration did not succeed in your case.
    by "stuck on upload" do you mean, you opened the Aperture library in Photos, and Photos converted it to a Photo Library, and then the upload to iCloud Photo Library did hang?  Or did already the upgrade to the Photo Library fail?
    If you want the Aperture library to upload to iCloud Photo Library, it needs to be on a disk formatted MacOS Extended (Journaled) and the original image files must not be referenced. Referenced originals will not upload.
    Also, the upload may hang, if you do not have enough free iCloud storage, orr if one of the videos or photos in your library is in an unsupported format or corrupted.
    To start over, try to repair and rebuild the Aperture library before opening it in Photos. Try all Aperture Library First Aid options - starting with repairing the permissions.  (Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual)
    If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    You will have to delete the photos that are already in icloud too; otherwise you are risking duplicates.
    Can you launch Photos at all?  If yes, delete all photos in Photos and empty the Recently Deleted album. Wait for the deletion to sync to iCloud. Then delete the Photos.photolibrary.

Maybe you are looking for