[JS][CS4] Remove all hidden page items?

Hello,
I'm trying to remove all hidden page items regardless of how many sublayers they are burried in. Is this possible? I wrote a snippet here that seems to only partly work. It removes all hidden page items unless two hidden items exist right after each other in the stacking order. Why would this be happening? Any suggestions?
for (i=0; i<doc.pageItems.length; i++){
          if (doc.pageItems[i].hidden == true){
               doc.pageItems[i].remove();
I'm new to scripting so any help is greatly appreciated.
Thanks!
Lindsay

What happens if you go from back to front? I think something like this
#target illustrator
var idoc = app.activeDocument;
for (i = idoc.pageItems.length-1; i>=0; i--){
          if (idoc.pageItems[i].hidden == true){
               idoc.pageItems[i].remove();
Worked on a trial

Similar Messages

  • Remove All from Page Item

    Hi!
    I 've a report that does't make sense to use a date with All in the Page Item.
    Can anybody tell me how can I remove <All> from the page item.
    Thanks a lot,
    Leila

    Hi Gianluca
    You are right because I did not understand. Now I do and thanks for explaining otherwise I would have continued down that path for years. :-)
    Ok, what you need to do is to create a new data type within your workbook, then more than likely in conjunction with one or more analytic functions, Discoverer will create the sub-totals and totals that you want.
    Here is an example that may show the principle:
    You can use calculations to create new data types within your worksheet. These new types only exist within the worksheet. You can apply sorts, totals and even base other calculations on these data types.
    Example Data Type:
    Let’s say we want to generate a new data type called Category, and this category has three values
         High
         Middle
         Low
    We want to analyze our sales and work out our top ranking customers, such that customers with:
         Sales > 9,000,000 are High
         Sales > 4,000,000 but < 9,000,000 are Middle
         Sales < 4,000,000 are Low
    Basic Requirement - Syntax:
    IF Sales > 9,000,000
    THEN HIGH
    ELSE IF Sales > 4,000,000
    THEN MIDDLE
    ELSE LOW
    Using a CASE statement, this translates into:
    CASE WHEN Sales > 9,000,000 THEN ‘High’
    WHEN Sales > 4,000,000 THEN ‘Middle’
    ELSE ‘Low’
    END
    Here's an example using DECODE:
    You have been asked to create a report that combines the sizes Small and Mini into a new category called Tiny so that we report
         Large
         Medium
         Tiny – combined Small and Mini
    Basic Syntax:
    IF Product Size = SMALL
    THEN Type = TINY
    ELSE IF Product Size = MINI
    THEN Type = TINY
    ELSE Type = Product Size
    Using a DECODE statement this translates into:
    DECODE (Size, ‘SMALL’, ‘TINY’, ‘MINI’, ‘TINY’, Size)
    Best wishes
    Michael

  • How To Use a Hidden Page Item within an SQL Report Query without Submitting

    Hi,
    Using: Oracle ApEx 3.0.1
    I have an sql report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value enetered to my hidden item, so that it can be used within the where condition of my sql but this would need to be done without actually submitting the form.
    At the moment, I can set the value via an on-demand process but my SQL is still not returing any values as the hidden page item within the query is not set (as page has not been submitted).
    Can anybody please assist as I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
    Thanks.
    Tony.
    Edited by: Tony F. on Nov 12, 2011 1:39 AM

    You can set a session value using a dummy ajax call e.g:
    Add the following to the 'Function and Global Variable Declaration' region
    function f_set_item(pThis){
      var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',1);
      get.add('P1_ID',pThis.value)
      gReturn = get.get();
      get = null;
    }Where P1_ID is the session value to be set. Then call the function in the usual way e.g.
    javascript:f_set_item(this);
    I hope that helps
    Shunt

  • All in page items

    Hi,
    I created a report which contain a few page item. All the drop downs (page items) have more than one value. In one page item I can select <All> for all the values but in second page item drop down list, <All> is not present :( .
    Can somebody tell me how can I add <All> in the values present in the page item drop down if i want to select all the values???
    Regards,
    Usman

    Usman,
    I don't know if your situation is exactly like mine. I had a case where as a result of my worksheet conditions, I had a page item with only one value returned for it. When you only get one value returned, Discoverer does not make that "<All>" value available. I reported this to support and they dupllicated the issue and are working with development on a possible fix. In the meantime, there is a work around, if you can manage it. If you can somehow get more than one value to show up for the page item, you can then pick that <All> value. For example, I removed my conditions so that I could get multiple values for the page item. Once you pick that <All> value for the page item and save it, it will then stay available, even after reapplying your conditions to take you back to one value. Yep - surprised me to - if you can get it in there and pick it, it will stick around. So the trick is to be able to get at least one time multiple values for the page item, pick the <All>, save that selection, and you are good to go.
    So you really have the issue only if there is only 1 possible page item value today. That would be a pretty rare situation to have happen, but I guess it could.
    Hope this makes some sense.
    John Dickey

  • Got a message saying Apple web security detected trojans, when I click on remove all get page not found help

    Received message Apple Web Security has detected trojans. When I click on Remove All, I then get the message page not found.

    The only two items in my Account --> Log in Items are iTunes helper and Logitec Control Center Daemon (my mouse is a Logitec).
    Here's the My Processess list:
               System Preferences
               TextEdit
               Finder
               rapportd
               iTunesHelper
               Logitech Control Center Daemon
               AppleSpell.service
               fontd
               launchd
               mdworker
               iCal
               pboard
               loginwindow
               Dock
               UserEventAgent
               Quick Look Helper
               WebKitPluginAgent
               SystemUIServer
               Safari
               AirPort Base Station Agent
               Activity Monitor
    Thanks.

  • Report Refresh on selecting All from Page Item

    Hi,
    I have a report that has the academic years as one of the page items. If we select the first entry '2004 - 2005' and then select 'All' from the page item, the data doesn't refresh.
    However if we go ahead and choose any other value, for example '2006-2007' or any other entry and then select 'All' the report does refresh normally.
    I've tried to search if this is a known bug, but I was unable to find any information. If any of you can help in this regard, reference to a known bug or if there's a workaround, please do let me know.
    Thanks a lot in advance

    Hi
    Do you get any errors messages?
    Best wishes
    Michael

  • CASE vs DECODE - CASE with SUM and All in Page Item is non aggregable

    Hi,
    I'm using Discoverer 9.0.4.
    After switching calculations from DECODE to CASE
    I found out that case gives a non aggregable result when using a Page Item and selecting <All>.
    The calculations
    (SUM x) / (SUM y)
    or
    (x SUM) / (y SUM)
    where x and y are variables, work fine with page item <All>.
    But for example:
    CASE WHEN 1=2 THEN 1 ELSE (SUM x) / (SUM y) END
    gives non-aggregable.
    The same code works with DECODE:
    DECODE(1,2,1,(SUM x) / (SUM y))
    and is aggregable.
    Does anyone know a reason or a way to make it work with CASE?
    Thanks,
    Joao Noronha
    P.S.: I wanted <= comparisons and CASE is the best in simplicity,
    but now I know I can do it with DECODE, still looking ok using LEAST instead of ABS of the difference.

    Hi there
    I think therefore you have answered your own question and determined that using CASE in aggregations is not a good idea. I only threw out the two CASE options as ideas not as solutions, just in case (pardon the pun) one of these worked in your situation.
    Your comment I must say that if it worked it would give a wrong result (the sum of the divisions is not the same as the division of the sums) may give the wrong answer in your case but may be correct in others. It just depends how the items in the folder have been set up. I agree though that SUM(x) / SUM(y) will more often than not give the right answer.
    This discussion about DECODE vs CASE has been going on ever since Oracle introduced CASE as a means of placating a younger breed of user who needed an IF..THEN...ELSE construct and could not get their minds around the intricacies of DECODE. The DECODE is a much more reliable function than CASE because it has been around for a long time allowing Oracle plenty of opportunity to iron the bugs out of it. If I get a chance I will always use a DECODE whenever aggregations are required. However, when no aggregations are in use then I'll use CASE, simply because it's easier for users to work with.
    Unfortunately, users need to work with aggregations and so I don't see any alternative to Plus users having to learn DECODE. Whenever I teach Plus I always teach the users both CASE and DECODE but point out that DECODE has fewer issues that CASE. Oh, and talking of issues, try getting the THEN and ELSE components to return a different datatype. CASE has a fit and will not compile.
    Best wishes and glad you got your issue solved - you did right?
    Regards
    Michael

  • ALL in page item

    Hi,
    I am trying to make ALL to appear as the default on page items (i.e., after rearranging crosstab layout, I want the users to see ALL appearing in page items before they select from LOV). Thanks for your help.

    As you most likely know, Disco puts the <All> option in a LOV when you have a crosstab.
    Also, when you are using a simple table, it does not put the <All> option in LOVs.
    What I have done in the table version, is to create a LOV manually (via Disco Admin)
    ie:
    select 'North' dir from dual
    union
    select 'South' dir from dual
    union
    select 'West' dir from dual
    union
    select 'East' dir from dual
    You can also create an <All> option using this method.
    However, my users also wanted the <All> to be right at the top of the LOV, so I simply made sure it was called .<All> (ie: not the period first). This sorts to the top and they were happy.

  • Javascript reading a protected / hidden page item / application item

    Hi
    I'm trying to use javascript to validate / calculate the value of a page item.
    For this I need to access an item that is it protected (not simply a text field which is editable) - or one which is currently hidden.
    Is it possible for javascript to read the value of an application item or a page item that is hidden or a page item that is protected (not editable)?
    Thanks in advance.
    Mike

    Mike, when you change the item type you are changing the html element type
    from
    <input type="text" id="P1_ONE" value="This is P1_ONE item type value" />
    to something like
    <td>This is P1_ONE item type value</td>
    for the text type you would use .value so $('P1_ONE').value or document.getElementById('P1_ONE'). value but for the "display as text" would be $('P1_ONE').innerHTML or document.getElementById('P1_ONE').innerHTML.
    been a while since i use APEX js systax as I've been using jquery but the second example of each type will work.

  • How to remove all pages from layout? (except Master Page)

    Geetings Experts:
    I'm implementing additional security measures into my 'initialze' event, where I'll check some global variables and render the file unreadable if needed.
    Which object and properties do I access to remove all my pages from the form?
    I would like to createa a function that removes all the sub pages, leavning only the Matster Page, enable a label in the MasterPage and save itself.
    I searched for xfa.layout and Page[n].remove() methods but cannot find any reference to these.
    .presence = "hidden", fulfills my purpose but the pages remian visible and I need for a clean solution no pages are visible.
    I'm advanced in C# but a novice in LC JavaScript, so any comment, reference or code snipet will be greatly appreciated
    Thank you for your time,
    Ivan A. Loreto – Computer Education Technician
    LOMA LINDA UNIVERSITY | School of Allied Health Professions - Department of Physical Therapy
    [PDF Development Platform]
    Windows XP SP3
    Acrobat Pro 9
    LifeCycle Designer ES 8.2

    Hi Ivan,
    The particular syntax of Javascript in LC Designer is different from that used in Acrobat and different (as I understand it) from core javascript and other applications. There are several free guides on the Adobe web site which cover Acrobat and LC:
    http://www.adobe.com/go/learn_lc_scriptingBasics
    http://www.adobe.com/go/learn_lc_scriptingReference
    http://www.adobe.com/go/learn_lc_formCalc
    http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Refer ence.pdf
    http://www.adobe.com/devnet/acrobat/pdfs/lc_migrating_acrobat_xmlform.pdf
    And a very handy resource (it goes back to version 6, but is still applicable):http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf
    JP Terry's book on LC Forms is very good and we use www.pdfscripting (which is a subscription service). If you are going to be doing a lot of LC Designer work, these may be of help.
    I am not a coder, so I going to try and work through your script. Bear with me if you already have this sorted...
    The script looks ok and you are using the resolveNode method correctly. Seeing topmostSubform in the resolveNode indicates that you imported an existing document into LC. This is fine, but sometimes it restricts some of the functionality.
    For starters I think that mPg is returning null. You can use the following in your script to see what is happening (debugging) and then comment it out:
    console.println("mpg: " + mPg);
    Then when previewing hit control+J to bring up the javascript console, then will show the value of mPg when that script executes.
    Try deleting the SOM up to #pageSet:
    var mPg = xfa.resolveNode("#pageSet.MasterPage1");
    The javascript console will show you when the script is working.
    In relation to the loop, I would advise a few changes:
    for (var i=1; i <= xfa.layout.pageCount(); i++)
         var vPage = ("xfa.form.topmostSubform.Page" + i).toString();
         //console.println("vPage: " + vPage);
         var curPage = xfa.resolveNode(vPage);
         curPage.presence = "hidden"; 
    }//next page
    There are a few things here:
    I would declare i as a variable, not an integer (not sure if it makes a difference);
    I would use pageCount rather than numPages and then <=;
    There was an extra ; at the end of the loop declaration;
    I would break the script into steps and get the full SOM of the page as a variable first and then resolveNode that variable;
    You don't need to go to the current page;
    I tend to name master pages with a capital "P" and pages with a small "p". Personal preference, but it can make tracking script easier.
    Have a crack off that and hopefully you can get it to work,
    Niall
    ps another tip, if you want to reference an object in script. First click on the object you want to script for and then scroll (or click on the master page) for the object you want to reference. Click inside the script editor and then when you move the mouse back into the form, press and hold Control, this will turn the mouse into a "V". When you click on the object you want to reference it will insert the SOM into the script. If it needs the resolveNode it will automatically put that in for you. Holding Shift and Control will insert a fully resolved node.

  • Disable all page items except one

    Hi All,
    Can any one please help me with the code. I have created a page with report from a table which has 5 values. If any user want to edit a row, he can do that by clicking the edit icon next to the row then the page redirected to another page with has a tabular form i created where there are 5 page items with values. I want to disable all the page items and enable only one item.the user can modify only one item which enabled, rest of the page items must be disabled. How can i do that. I have to use java script or is there any provision in apex itself?please help me....
    Thanks In Advance
    Meena
    Edited by: 793914 on Oct 19, 2010 2:05 PM

    Meena,
    My apologies. 3.2 also allows you to set the Page Item to Display Only. I don't know why I was thinking that was new to 4.0!
    By disabled, I assume you just want the current value to display, which would be null for a new record? It's not that you want to hide the disabled values, right?

  • Discoverer Report: Select all values for a Page Item

    Hi Guys
    I have created a Disco Report which has one Page Item.
    It populates all columns based on values I select for Page Item that is perfectly fine.
    How do I Display column values for all possible values of Page Item?
    Is thera ny way I can have Option to select All possible values for Page Item?
    Cheers
    Vijay

    Hi Vijay
    Just to confirm what Rod has said, this capability to manage ALL in Page Items was introduced as part of 10.1.2 and has been maintained into 10.1.2.3 and 11g. It will not be back ported to previous releases.
    Best wishes
    Michael

  • Javascript help - Hide/Show a page item

    Environment:
    APEX 3.1.00.09 running on AIX 5.3
    Sample application on apex.oracle.com:
    Workspace: GALWAY
    UserID: gwicke
    Password: gwicke
    To see where my issues are:
    1- Start on page 3
    2- In the Agency drop down select 'J & B Marketing'
    3- In the Contract drop down select the only contract that appears
    4- Click on 'Edit Existing Contract'
    5- Note the page item 'LY Closings' has the value 261
    6- Click on the link (really a tab in my theme) at the top labeled 'Cost Detail'
    7- The 'Estimate Justification' is the page item to be displayed/hidden as noted below.
    8- The 'Homes Per Year' under the 'YEAR1' column is the user input page item
    9- The P2_BUILDER_CLOSINGS (value 261 noted above) is the page item to be used in the comparison
    I need to do a couple of things with a potentially hidden page item:
    1- Every time the page loads I need to check to see if the page item (P8_ESTIMATE_JUSTIFICATION) is not null and if it is indeed not null, make it displayed.
    2- When the user enters a value in another page item (P8_HOMES_PER_YEAR1), call a function to see if that value is more than 120% of another page item (P2_BUILDER_CLOSINGS) and if so make the above page item displayed (P8_ESTIMATE_JUSTIFICATION).
    I have the javascript function created (showHideEstimateJustification) and in the HTML Header of the page. The function is being called currently with an onChange check on the page item entered by the user as noted above (P8_HOMES_PER_YEAR1).
    Issues:
    1- I need to force a SUBMIT after the user enters the value for P8_HOMES_PER_YEAR1 so it is available in session state and hence to the javascript function (other ideas welcome!)
    2- I am currently using the x.style.display = 'inline' versus 'none' to hide/show the page item, where x is derived from var x = document.getElementById(P8_ESTIMATE_JUSTIFICATION) Is there a better way????
    Any help is greatly appreciated.
    -gary (a.k.a. Javascript newbie)

    Hi,
    Only your messages use the session state. The code would use the entered value, but you would need to change:
    var homes = parseInt(document.getElementById('P8_HOMES_PER_YEAR1'));to
    var homes = parseInt(document.getElementById('P8_HOMES_PER_YEAR1').value);so that "homes" becomes the numeric version of the value of the item
    Normally, for the label, you would just enter an ID="xxx" into the HTML Table Cell Attributes for the label which you can then use in your javascript. For some reason this doesn't seem to want to work in this page.
    What you could do is find all the labels and then check which is the right one before showing/hiding it. Something along the lines of:
    var xx = document.getElementsByTagName("LABEL");
    var zz;
    var label;
    for (zz = 0; zz < xx.length; zz++)
    if (xx[zz].htmlFor == 'P8_ESTIMATE_JUSTIFICTION")
      label = xx[zz];
    xx[zz].style.display = 'none';
    {code}
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Page items do not go into Excel when exporting

    We are using 10.1.2 viewer and plus (and I have the desktop version available). I have tried exporting a worksheet with page items using all 3 of the above and the page items will not go into excel. Is there any trick to get this to work? I thought that it used to work in older versions?
    thanks
    Angie

    Did you try the Export to Excel as Pivot Table option? That would create a base sheet with all the page items flattened out, a static sheet that looks like the worksheet at the time of the export, and an Excel Pivot Table where you can page through the page items.
    thanks
    Abhinav
    Oracle Business Intelligence Product Management
    BI - http://www.oracle.com/bi
    BI - http://www.oracle.com/technology/bi
    Blog - http://blogs.oracle.com/
    BI Blog - http://oraclebi.blogspot.com/

  • What is the best way to get the UID of any selected page item (frames, rectangle etc)?

    I need UID of any selected item on page and also array of UID's in case multiple selection happens. How can I achieve it?
    One way I know is to write an observer and attach it on every new page Item created, but that way the system might become slow and also
    the behavior will be unpredictable in case of multiple selections.
    Can some one suggest a better way to do it?

    The selection subsystem hides most ideas of direct adressing (e.g. UID of page item(s) or story) into the concrete selection, while from the outside you only work on the suite interfaces of the abstract selection. So you don't ask whether the selection is some kind of page item and you don't peek at the actual items. Instead you ask about their capabilities and applied values.
    Attaching observers to page items has nothing to do with the selection, because they only notify about changes on those page items - which could also be caused by scripts or anything else. Even then, the most relevant changes go thru the kDocBoss as single point to attach an observer, rather than thru all those page items.
    Regarding speed - the selection has many optimizations, for example "lazy" notifications can be deferred until they become appropriate for an UI update, they might even become aggregated / optimized away.
    One starting point into the selection when you come from nowhere would be ISelectionUtils. Your selection observer might also pass interesting parameters.
    Dirk

Maybe you are looking for

  • NFS-e Município de Salvador-BA (Certificado IMBUI)

    Pessoal, Temos atualmente uma customização da solução de NF-e para NFS-e Município de Salvador-BA. Recentemente eles fizeram um ajuste no sistema deles, pois pelo que eles falaram antigamente não havia validação alguma, mensagem, assinatura, etc. A a

  • ITunes started to crash after upgrating to 10.6.7/10.2.1 (Memory leak?)

    All the time since 10.6.2 iTunes worked fine for me, but after the latest upgrade to 10.6.7/10.2.1 yesterday it started to crashing. First of all, the "The iTunes Library file cannot be saved. An unknown error occured (-50)" error occured which I've

  • SAP integration kit - MDX parser does not exist

    Hi, While running a query via Web Intelligence, during the process where data should be retrieved, the error pops up that RFC destination MDX PARSER does not exist. The universe is built on an infoCube without intermediate BEx query. I know about the

  • How to find the configuration use the Z message class.

    Usually when I do some configuration, it may need to create some message. such as the Validation. It raise a message when I run some standard t-code. So when I check some Z message class to find what program use this message, i can not find anything.

  • Is it possible to install Mac OS X Snow leopard on a PC ?

    Hi buddies I was wondering if it is possible to run a mac os X on a PC I mean on a dell , hp and etc, ?