Loop through all controls in view

Hi Everyone,
I need to cycle through all the controls on a view.
I have set each of the controls of type UISegmentedControl with a unique tag number.
I am using this tag number to perform a lookup in database for the value of the segmented control.
So, my question is this.... how do i cycle through all the controls on a view?
thank you
take care
tony

alt-088 wrote:
I think we are close - just one correction.
The segmented controls are all at design time, there will be no new controls added.
I'm not clear on what's been corrected. The sample code I gave you assumed all the controls were known at compile time. So I think the example code addressed the problem you're trying to solve. The last paragraph of that post was just an afterthought, to explain what to do in case you ever needed to add controls dynamically.
-> loop through all controls on view
-> if control is of type uisegmentdcontrol
then do database lookup on tag
Set segment value to value returned from database
Once again, if I correctly understand the above, the code I gave you does exactly what you want. You haven't indicated you want to take any action when a control is not a segmented control, so I don't see why you'd want to include them in the loop. However, if you actually do need to enumerate non-segmented controls (or other subviews), my last response advised you to set the tag properties of all those other controls, making sure the range of those tags is different from the range of the seg control tags.
The part that eludes me is the looping through all the controls on the view
I guess the part that eludes me is why you're so interested in enumerating all the controls, when you only seem to be interested in the segmented controls. But even if you really do need to look at every control, I don't see why you're rejecting the solution I gave you. [viewWithTag:|http://developer.apple.com/iphone/library/documentation/UIKit/Ref erence/UIViewClass/UIView/UIView.html#//appleref/doc/uid/TP40006816-CH3-SW26] is a powerful method which recursively walks the entire view hierarchy to find whatever tag it's looking for. If you use it correctly (e.g. by assigning unique tag numbers that tell you what type of control you've found), it will save you lots of trouble.
If, for some reason, you insist on doing this job without using viewWithTag, the next best might be something like this:
- (void)doSomethingWithEachSegCtrlInView:(UIView *theView) {
UIView *subView;
for (subView in theView.subviews) {
if ([subView respondsToSelector:@selector(selectedSegmentIndex)]) {
// subView is a segmented control ...
else {
// subView is not a segmented control ...
if ([subView.subviews count]) {
// this subview has its own subviews
[self doSomethingWithEachSegCtrlInView:subView];
Note that the above is a more difficult, more error prone method than the sample in my first response. Firstly, it needs to recurse in case any controls are placed on subviews of the main view (or on subviews of those subviews, etc.), a capability already built into viewWithTag. Secondly it needs to identify the type of each subview object. [respondsToSelector:|http://developer.apple.com/iphone/library/documentation/Co coa/Reference/Foundation/Protocols/NSObjectProtocol/Reference/NSObject.html#//appleref/occ/intfm/NSObject/respondsToSelector:] is the preferred way of identifying the class of an object, especially when the selector argument represents one of the methods you intend to use. However there's no reason to get into the business of identifying the class of an object, when you could have given that object a unique tag number in the xib, where there was no question about its class.
Hope the above communicates the solution better than my first response!
- Ray

Similar Messages

  • Looping through all the Nodes at any Particular Level Specified

    Dear Forum Members,
    I have an XML File in the database in a Column of type XMLTYPE.
    The Format is given below
    <XML-SSDFILELIST>
    <Training>
    <BRKCD_STMNSWTINVIN_C Key="6707">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </BRKCD_STMNSWTINVIN_C>
    <BRKCD_STREDSWTINVIN_C Key="6708">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </BRKCD_STREDSWTINVIN_C>
    <VSACD_TIPER_C Key="7285">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSACD_TIPER_C>
    <VSSCD_NTHRESPLA_C Key="6266">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSSCD_NTHRESPLA_C>
    <VSSCD_QTHRESPLA_C Key="6267">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSSCD_QTHRESPLA_C>
    <VSSCD_VDFL_C Key="6269">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSSCD_VDFL_C>
    <VSSCD_VMAX_C Key="6270">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSSCD_VMAX_C>
    <VSSCD_VMIN_C Key="6271">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSSCD_VMIN_C>
    <VSSCD_VTHRESPLA_C Key="6272">
    <FINISHED><![CDATA[This is a Finished data ]]></FINISHED>
    <CONTACT-NUMBER><![CDATA[This is a CONTACT-NUMBER data ]]></CONTACT-NUMBER>
    <DEFAULT></DEFAULT>
    <MIN></MIN>
    <MAX></MAX>
    <UNIT></UNIT>
    <FORMULA></FORMULA>
    <FORMULA-DESC></FORMULA-DESC>
    <ADVANCED-FORMULA></ADVANCED-FORMULA>
    <INTERNAL-ADAPT-DESC></INTERNAL-ADAPT-DESC>
    <DATA-DESC-REPORT></DATA-DESC-REPORT>
    <REV-DESC></REV-DESC>
    </VSSCD_VTHRESPLA_C>
    </Training>
    </XML-SSDFILELIST>
    Is there any way I can Loop through all the Child records at 3rd Level(Bolded Level in the File).
    Regards
    Madhu.

    check this blog,
    http://www.oracleappshub.com/11i/oracleapps-responsibility-vs-sap-functions/
    Re: How to change OM responsibility as read-only in oracle applications 11i
    read only responsibility-user

  • Loop through all layers and sublayers

    is there a way that I can loop through all layers and sublayers looking for a name of a layer? I have one that loops through only top level layers. I am thinking I have to somehow incorperate all pathItems, groupItems and the like to incorperate all types of "layers" there might be, since a group is technically not a layer but a groupItem.
    this is what I am doing so far:
    for (var i = 0; i < numberOfLayers; i++) {
        var customName = "div structure";
        var myLayer = app.activeDocument.layers[i];
        var myLayer = myLayer.name;
        alert(myLayer);
        //alert (myLayer);
        if (customName == myLayer) {
            alert("layer matches");
        else { break; }
    any ideas?

    Sorry I don't understand what it is you are trying to achieve… Most collections offer a getByName() method if you know what you are looking for eg…
    doc.layers.getByName( 'fluff' );
    This should return you the first found or error so you need to try & catch when using this…

  • I was wondering how I can loop through all records in a database?

    I'm using a do while loop to loop through all the records in a database is there a way I can simulate to EOF. I tried something to simulate it but I don't think it'll work. I assume there's a better way.
    Here's my code:
    boolean noRecords=false;
    do
    noRecords=false;
    if (queryResults.next())
    serverOutput.print(queryResults.getInt("itemID");
    serverOutput.println(queryResults.getString("itemName");
    else
    noRecords=true;
    }while(noRecords==false);

    i think i know what you mean...
    try this
    while (queryResults.next()) {
    serverOutput.print(queryResults.getInt("itemID");
    serverOutput.println(queryResults.getString("itemName");
    when .next() returns false, it will exit the while loop. you don't need the other code you have there, the above should do it all.
    is that what you're after?

  • Dbma_scheduler job executing procedure that loops through all client schemas in the database rolls back transaction incase of exception

    Hi,
    Needed your inputs on approach to implement a job using dbms_scheduler.
    We have around 2000 schemas. Each schema has a package with 2 procedures.
    The requirement is to create a single job in SYS that would loop through each schema and run the procedures at a specific time ( once a day) and send email notification on success or failure.
    Job script:
    BEGIN
        dbms_scheduler.create_job( job_name=> 'LOAD_EACH_SCHEMA_AUDIT_DATA',
                                   job_type=>'PLSQL_BLOCK',
                                   job_action=>'BEGIN  sys.p_loadaudit;     
                                    END;',
                                   start_date=>systimestamp,
                                   repeat_interval=>'FREQ=MINUTELY;INTERVAL=1',
                                   number_of_arguments=>0,
                                   enabled=> true,
                                   comments=>'Job repeat interval is every 5 mins' );
                                   END;
    Note: for testing purpose i have set repeat interval to minutely.
    Procedure job will be executing:
    Procedure sys.p_loadaudit:
    CREATE OR REPLACE
    PROCEDURE p_loadaudit
    AS
        v_count          NUMBER:= 0;
        lv_error_message VARCHAR2(4000);
        vstmt            VARCHAR2(4000);
    BEGIN
        FOR i IN
        ( SELECT username FROM dba_users WHERE username LIKE 'ABCFIRM%'
        LOOP
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_coa; end;';
            EXECUTE immediate vstmt;
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_am; end;';
            EXECUTE immediate vstmt;
        END LOOP;
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure p_loadaudit: ' || SQLCODE || ' -ERROR- ' || SUBSTR(
        sqlerrm,1,300) || '*' || dbms_utility.format_error_backtrace;
        raise_application_error(-20002,lv_error_message);
    END p_loadaudit;
    Example of one schema: SCHEMA_01
    create or replace
    PACKAGE pkg_audit_info
    AS
    type cursortype
    IS
        ref
        CURSOR;
            PROCEDURE p_load_COA;
            PROCEDURE p_load_AM;
       END pkg_audit_info;
    create or replace
    PACKAGE body pkg_audit_info
    AS
    PROCEDURE p_load_COA
    AS
    BEGIN
    INSERT INTO TABLE1();
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure pkg_audit_info.p_load_COA: ' || SQLCODE
        || ' -ERROR- ' || SUBSTR(SQLERRM,1,300) || '*' || dbms_utility.format_error_backtrace;
        RAISE_application_error(-20002,lv_error_message);
    END p_load_COA;
    PROCEDURE p_load_AM
    AS
    BEGIN
    INSERT INTO TABLE2();
    EXCEPTION
    WHEN OTHERS THEN
        lv_error_message := 'Error in procedure pkg_audit_info.p_load_AM: ' || SQLCODE ||
        ' -ERROR- ' || SUBSTR(SQLERRM,1,300) || '*' || dbms_utility.format_error_backtrace;
        RAISE_application_error(-20002,lv_error_message);
    END p_load_AM;
    END pkg_audit_info;
    Table1 and table1 exist in schema_01.
    All 2000 schemas have same package.procedures.
    Due to security reasons i have removed the actual code.
    I was able to execute the job successfully. However, when a schema procedure (SCHEMA_01.pkg_audit_info.p_load_COA) throws an exception, the job fails and all transaction is rolled back.
    Is there a way to loop through each schema and execute the related procedures. Even if exception happens, it should rollback only for that schema and continue the other schemas in the loop?
    Please let me know if there is a better way to achieve this. Is the way i am handling exceptions in the job/procedure correct?
    Thanks

    Hi,
    RAISE_APPLICATION_ERROR will cause the program to exit back to the caller, even if you place it in a block within the loop, so the RAISE or RAISE_APPLICATION_ERROR instruction should be placed in your "pkg_audit_info.p_load_AM" and "pkg_audit_info.p_load_coa" procedures. This way, you can use a block inside the loop and log the error.
    FOR i IN
        ( SELECT username FROM dba_users WHERE username LIKE 'ABCFIRM%'
        LOOP
           BEGIN
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_coa; end;';
            EXECUTE immediate vstmt;
            vstmt:= 'begin ' || i.username || '.pkg_audit_info.p_load_am; end;';
            EXECUTE immediate vstmt;
    EXCEPTION
    WHEN OTHERS THEN  
        --> Log the error in a custom log table otherwise you will not know what happened for that schema: don't forget the username
    END;
    END LOOP;

  • Loop through all fields in a (2 page) form?

    Is it possible to do it in one go?
    suppose you have fields in 2 pages.. (2 subforms)
    would you have to write a script that would check for all fields in page 1
    and another to check for all fields in subform 2?
    or can you just loop through the parent of the 2 subforms?.. (the aim would be to check that all required fields have been filled in or are not equal to their default value)
    thank you in advance

    You can certainly write a script that'll find all fields on all pages and perform some action on them.
    I've included a sample form which contains two pages with fields on them. At the top of the first page, there's a "Find Fields" button which, when pressed, populates the list box next to it with the names of each field found across all pages. Clicking on an item in the list box will then set focus to that field.
    The script uses a recursive function called GetFieldNames in a Script Object called "Utils". In the function, lines 21 - 25 are as follows:
    else if (oNode.className == "field")
    // oNode is a field
    sFieldNames += (sFieldNames.length > 0 ? "\n" : "") + oNode.name;
    If you wanted to verify that all mandatory fields were filled, you could change them to this:
    else if (oNode.className == "field")
    // oNode is a field
    if (oNode.mandatory == "error" && (oNode.rawValue == null || oNode.rawValue.length == 0))
      sFieldNames += (sFieldNames.length > 0 ? "\n" : "") + oNode.name;
    That would find only fields that are required and haven't been filled accross all pages.
    Stefan
    Adobe Systems

  • Loop through form controls

    Hi
    Anyone know how I can use Javascript to loop through each
    text box on a page
    when the page loads?
    Something along the lines of :
    For Each document.form.input.text In document.form
    Thanks
    Brendan
    Rate your experiences with your UK and Ireland builders at
    http://www.ratethebuilder.co.uk
    =========================================

    RateTheBuilder wrote:
    > Hi
    >
    > Anyone know how I can use Javascript to loop through
    each text box on a page
    > when the page loads?
    >
    > Something along the lines of :
    >
    > For Each document.form.input.text In document.form
    <script type="text/javascript">
    onload=function(){
    var inputs=document.getElementsByTagName("INPUT");
    var inputQty=inputs.length;
    while(inputQty--){
    if(inputs[inputQty].type=="text"){
    //do stuff with text field
    inputs[inputQty].value="This is text field No.
    "+(inputQty+1);
    </script>
    Note that this function retrieves *all* text fields, from
    *all* of your
    forms in the document.
    Mick.
    >
    > Thanks
    >
    > Brendan
    > ______________________________________________
    > Rate your experiences with your UK and Ireland builders
    at
    >
    http://www.ratethebuilder.co.uk
    > =========================================
    >
    >

  • For-looping Through All textFrames (cs4 jsx)

    var docRef = app.activeDocument;
    for (var num=0; num<docRef.textFrame.length; num++){
         alert( docRef.textFrames[num] );
    I would like to for through all of the text frames in a document to experiment with what properties return what information.  I have a simple test document with like three different text frames, and I want to collect info on each one.  This for loop doesn't seem to work though, and I can't quite wrap my head around how the textFrame and textFrames objects work.
    Thanks for the assistance!

    textFrames = a collection of textFrames
    textFrame = a single textFrame, for example textFrames[1] refers to the second textFrame
    try this
    var docRef = app.activeDocument;
    for (var num=0; num<docRef.textFrames.length; num++){ // you were missing an s
         alert( docRef.textFrames[num]); // returns the object itself
         alert( docRef.textFrames[num].contents ); // returns a property (contents) of the object

  • Loop through all items in all data blocks?

    Is there a way to loop through every item in every data block and set the property of a format mask?

    I do not know what error it is, only that an on-error trigger fires.
    I found out one thing I was definitely doing wrong, using nextblock, nextitem properties at the wrong level.
    DECLARE
         v_firstblock VARCHAR2(50);
         v_currentblock VARCHAR2(50);
         v_firstitem VARCHAR2(50);
         v_currentitem VARCHAR2(50);
         v_counter NUMBER :=0;
         v_counter2 NUMBER :=0;
    begin
       v_firstblock := get_form_property(:System.Current_Form,first_block);
       v_currentblock:= get_block_property(v_firstblock,nextblock);
       MESSAGE(v_firstblock||v_currentblock);
         LOOP
              v_counter := v_counter +1;
              IF (v_counter >10) THEN
                   exit;
              END IF;
              IF (v_currentblock = v_firstblock) THEN
                             exit;
           ELSE
                   v_firstitem :=  get_block_property(v_firstblock,first_item);
                        IF (lower(GET_ITEM_PROPERTY(v_firstitem,format_mask))=lower('mm-dd-yyyy')) THEN
                                       SET_ITEM_PROPERTY(v_firstitem,format_mask,'DD-MON-YYYY');
                        END IF;
                   v_currentitem :=  get_block_property(v_firstblock,first_item);
                   v_currentblock:= get_block_property(v_currentblock,nextblock);
                   GO_BLOCK(v_currentblock);
                        LOOP
                             v_counter2 := v_counter2 +1;
                             IF (v_counter2>15) THEN
                                  exit;
                             END IF;
                             v_currentitem:= get_item_property(v_currentitem,nextitem);
                             MESSAGE(v_counter||v_firstblock||v_currentblock||v_firstitem||v_currentitem||v_counter2);
                             IF (v_currentitem <> v_firstitem) THEN
                                  IF (lower(GET_ITEM_PROPERTY(v_currentitem,format_mask))=lower('mm-dd-yyyy')) THEN
                                       SET_ITEM_PROPERTY(v_currentitem,format_mask,'DD-MON-YYYY');
                                  END IF;
                             ELSE
                                  exit;
                             END IF;
                        END LOOP;
               END IF;
      END LOOP;
         end;Here is updated new code. I am currently trying to debug it, it has crashed my form on the server when tied to a button press.
    EDIT: So far I have found that it infinitely loops through the first 3 items and a null item in the first block. Still looking into why...
    EDIT: Some code changes to temporarily stop infinite loop and make v_currentblock actually change. Still loops through same 3 items in the first data block even though v_currentblock changes.
    Edited by: 878576 on Oct 21, 2011 12:46 PM

  • Loop through all open documents not performing some actions

    I have a loop that imports XML, then Exports each page individually, then has a SaveAs dialog for the indd, then closes the active document.
    The import XML works, the SaveAs works, and the close works but the loop skips over the PDF part. Is it because I need to define myCounter in the for loop within the ExportPDF function? I just included the part from Choose XML to the end of ExportPDF.
    //choose XML
    var FilterXML = "XML File: *.xml";
    var myXML = File.openDialog("Choose XML File", FilterXML);
    //loop for each action below
    for(myDocumentCounter = app.documents.length; myDocumentCounter > 0; myDocumentCounter--){
    //import XML
    app.activeDocument.importXML(myXML);
    //PDF by page to settings; preset must be "dailies_x1a"
    function myExportPages(myFolder){
    var myPageName, myFilePath, myFile;
    var myDocument = app.activeDocument;
    var myDocumentName = myDocument.name;
    var myBaseName = myBaseNameField.editContents;
    for(var myCounter = 0; myCounter < myDocument.pages.length; myCounter++){
    myPageName = myDocument.pages.item(myCounter).name;
    app.pdfExportPreferences.pageRange = myPageName;
    //The name of the exported files will be the base name + the page name + ".pdf".
    //If the page name contains a colon (as it will if the document contains sections), then remove the colon.
    var myRegExp = new RegExp(":","gi");
    myPageName = myPageName.replace(myRegExp, "_");
    myFilePath = myFolder + "/" + myBaseName + "_" + myPageName + ".pdf";
    myFile = new File(myFilePath);
    myDocument.exportFile(ExportFormat.pdfType, myFile, false, "dailies_x1a");

    Nevermind, I found my error. Code should read...
    for(myDocumentCounter = app.documents.length; myDocumentCounter > 0; myDocumentCounter--){
    if(app.documents.length != 0){
    var myFolder = Folder.selectDialog ("Choose a Folder to Save the PDFs");
    if(myFolder != null){
    myExportPages(myFolder);
    else{
    alert("Please open a document and try again.");
    function myExportPages(myFolder){
    var myPageName, myFilePath, myFile;
    var myDocument = app.activeDocument;
    var myDocumentName = myDocument.name;
    var myDialog = app.dialogs.add();
    with(myDialog.dialogColumns.add().dialogRows.add()){
    staticTexts.add({staticLabel:"Please Modify the Base Name if Necissary:"});
    var myBaseNameField = textEditboxes.add({editContents:myDocumentName,
    minWidth:160});
    var myResult = myDialog.show({name:"ExportPages"});
    if(myResult == true){
    var myBaseName = myBaseNameField.editContents;
    //Remove the dialog box from memory.
    myDialog.destroy();
    for(var myCounter = 0; myCounter < myDocument.pages.length;
    myCounter++){
    myPageName = myDocument.pages.item(myCounter).name;
    app.pdfExportPreferences.pageRange = myPageName;
    //The name of the exported files will be the base name + the
    //page name + ".pdf".
    //If the page name contains a colon (as it will if the
    //document contains sections),
    //then remove the colon.
    var myRegExp = new RegExp(":","gi");
    myPageName = myPageName.replace(myRegExp, "_");
    myFilePath = myFolder + "/" + myBaseName + "_" + myPageName + ".pdf";
    myFile = new File(myFilePath);
    myDocument.exportFile(ExportFormat.pdfType, myFile, false, "dailies_x1a");
    else{
    myDialog.destroy();

  • How to loop through all columns of row parameter in "Public override void Input0_ProcessInputRow(Input0Buffer Row)" method

    Hi,
    I have flat files whose data I am going to insert in table. I have primary contrain on my table. If any row voilet primary key contrain then I am redirecting that row to Error table. For this purpose I am using script component. With the help of below method
    I am getting error discription but I want error row also. Can anyone help me to get error row with the help of below method.
    Public override
    void Input0_ProcessInputRow(Input0Buffer
    Row)
    Thanks

    When you write the records to your destination using a Destination Data flow object, you can redirect the bad records from the destination task to another table (error log table in your case). The redirected row will have the error code and the row detail.
    example handling error rows ssis
    The Codeplex XMLIFY component will allow you to transform the bad record into an xml
    Regards, Dinesh

  • Cannot loop through values in Node

    Hi Everyone,
    I am using a TreeNestedInTable UI.  I have 2 columns: a Master Column with a TextView Cell Editor, and a field called "Check" whereby one of the values in the Master Column can be selected.  The "checked" attribute of the Check column is mapped to a isChecked attribute in my Node that contains all the data being displayed in the TreeNestedInTable (IncidentAgent Node).
    I would like to loop through all the Check boxes ticked in this TreeNestedInTable and get the corresponding Value to write to a Test Node (to make sure that I am in fact reading all cheked rows).
    I do not seem to, however, get all the values checked.  Please see my code below and comment.  I am testing and so I put a button on the screen that should loop through all the values and see which ones are checked.  It should then write these checked valus to a node that is also linked to a table control on the screen.  The Idea is that each time you check a few values they should be displayed in this table control when the button is pressed.  This is not happening - the table stays blank.
    public void onActionSeeIACollection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSeeIACollection(ServerEvent)
           IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
           //New Element added each time:
           ITEST_IA_NODEElement newElement;
           //Incident Agent element:
           IIncidentAgentElement agentElement;
           //Loop through ALL the IncidentAgent Elements and see which ones hace got the "Check" value
           //flagged:
           for(int i=0;i<wdContext.nodeIncidentAgent().size();i++)
                //Get the currently processed element:
                agentElement = wdContext.nodeIncidentAgent().getIncidentAgentElementAt(i);
                //If the Check value is flagged, add it to the TEST_IA_NODE node:
                if(agentElement.getCheck())
                     newElement = wdContext.createAndAddTEST_IA_NODEElement();
                     newElement.setVALUE(agentElement.getVALUE());
                     msgMgr.reportSuccess(agentElement.getVALUE());
                }//end if
           }//end for
        //@@end

    Sure.  Thank you for your help.
    "Data Containing" Node:
    h1  IncidentAgent(Top Level Node)
         h2 RecursiveNode(Pointing to IncidentAgent as recursiveNode)
           h4 Check (boolean attribute)
           h4 ChildrenLoaded (boolean attribute for TreeNestedInTable)
           h4 Expanded (boolean attribute for TreeNestedInTable)
           h4 IsLeaf (boolean attribute for TreeNestedInTable)
           h4 NODE_ID (attribute)
           h4 PARENT_ID (attribute)
           h4 VALUE (attribute)
    Collection Cardinality: 0...N
    Selection Cardinality: 0...N
    Singleton: TRUE
    Node that should contain VALUE attribute from node above if Check attribute above is checked
    h1 TEST_IA_NODE
           h4 VALUE
    Collection Cardinality: 0...N
    Selection Cardinality: 0...N
    Singleton: TRUE

  • Looping through business partners

    I need to run a query that shows which BPs have NOT had a recent delivery.  Therefore, I am searching for values not present.  I have decided to run a subquery pulling up all deliveries within the last month and then looping through all BPs to see if they are in that query.  If not, I want to display their name as part of the result.  I am not sure how to loop through BPs in SQL using Query Generator.  Any idea of syntax?
    Thank you in advance for you help!
    Jacquie

    I'm not sure about this, but I guess that you can't set parameters in that second SELECT at all.
    This works:
    SELECT T0.CardName FROM OCRD T0
    Where T0.CardCode Not in
    (SELECT T0.CardCode FROM OINV T1
    WHERE datediff(Day,T1.DocDate, getdate())<0)
    This doesn't: (I changed only: getdate())<'[%0]')
    SELECT T0.CardName FROM OCRD T0
    Where T0.CardCode Not in
    (SELECT T0.CardCode FROM OINV T1
    WHERE datediff(Day,T1.DocDate, getdate())<'[%0]')
    Regarding your SQL. From the syntax point of view:
    - include a space between "NOT_in"
    - maybe you should eliminate T0.DocDate from the second SELECT
    HTH
    Juha

  • SSIS - Loop through files from a file path based on the value in the variable

    Experts,
    I have a requirement where I'll be loading multiple files in to a SQL server table and archive the files when loaded. However, the challenge is , the file path should be dynamic based on the value of a variable (say, @ProductName).
    For example: If I am running the package for variable @ProductName="Product", the file path would be "\\....\Src\Product", in that case the ForEachLoop will loop through all the files in that folder, load them to the table and Archive
    the files to the "\\....\Src\Product\Archive" folder.
    Similarly, if the @ProductName="Product_NCP", the foreachloop container should loop through files in the "\\....\Src\Product_NCP" folder, load them to the table and archive them to the ""\\....\Src\Product_NCP\Archive"
    folder.
    Any suggestions? I should be able to run the package manually just by passing the "@Product" value, create Archive folder if it doesn't exist, load the data and archive the files.

    Yes
    1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
    like
    (@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
    similary archive
    (@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How Do I get SSIS To Stop Looping Through Excel Rows After Last Populated Record?

    I have a package that loops through many excel files. Each Excel File has about 5000 rows. My problem is that after the 5000th row SSIS keeps looping through all the rows after the last row. There are nothing in these rows. This is a complete bottleneck
    of my package because it takes forever when doing this. How do I stop this?
    Thanks

    Another way is to specify the range in select statement which can be done in two ways
    http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
    http://sqlserversolutions.blogspot.in/2009/02/selecting-excel-range-in-ssis.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • XFCE and KDE Menus on same machine

    I'm planning on installing both XFCE and KDE on a laptop and was wondering if there was any way to separate the KDE and XFCE programs in the menu.  For example on KDE when I go to Multimedia under the K Menu I would see K3B and under a subfolder call

  • Qosmio X505-Q870 Hard lock on startup

    Approximately 1 out of 10 startups, I get a hard lockup while windows is loading. My machine is only about two weeks old. I've seen others with lockup issues with these models but only after startup. Anyone else having these issues? I have no errors

  • How to adjust vendor amt in one co cd to customer amt in another co cd

    Hi experts, I have made intercompany inter company transaction config via OBYA and trying to adjust the vendor in one co cd to customer in anotehr company through T code F-02, Doc type SA. It was working fine in classic GL but when New GL is configur

  • PRC: Create Accounting Output shows "xml version="1.0" encoding="UTF-8"

    I m getting Error in the Output of Create Accounting like <?xml version="1.0" encoding="UTF-8" ?> Any one have some Clue ...

  • Oracle Materialized View replication

    I am perplexed by the fact that I have a slave sight full of MV's and a refresh group created to refresh with the Master site. When I refresh, however, the master site updates all of the tables (MV's) except one within my refresh group and all the ch