Page Item Labels

How do I refer to a page item label? I want to hide it (along with its associated page item) by using html_HideElement.
Thanks,
Chris

Chris,
You know, it's never too early to start using jQuery. If you put an example what you're trying to do on apex.oracle.com, provide the workspace name, and valid credentials, I'll jump into the application and show you how to do this.
Regards,
Dan
http://danielmcghan.us
http://sourceforge.net/projects/tapigen

Similar Messages

  • Apex Page Input Item Label Conditional Style at run time

    Hi,
    Apex version 4.2.1.00.08
    We have an issue after migrating to apex 4.2.1. We have a select list and use another couple of dummy items to be used as its label instead of giving the text value to the LABEL control. Only one of the dummy items is shown as a label for the select list conditionally based on another value. It was working fine with the earlier versions upto 4.1, but with the introduction of grid in 4.2, its now displaying the select list on a new row (ie the lable in one row and the select list on the next row).
    However, we really would like to solve this by having a way to display the label of the select list either in "required format style" or as an "optional style". The display style should be determined only at runtime.
    Example. Say P100_MY_SELECT_LIST is the select list
    The label for this item is "My Select List Label"
    I have another dummy item P100_DUMMY
    if P100_dummy = 1 then the label "My Select List Label" should be displayed in red and with an * *My Select List LabelOtherwise it should be in black and without * My Select List LabelPlease help how to do this.
    Thanks in advance.
    Regards,
    Natarajan

    Well, I deviated with the various other things, and finally needed to get it fixed now. I find my own solution by having a Label Template which creates an ID for every label of the input item and calling a couple of javascript functions thro dynamic action.
    1) Create a label template "FormFieldDynamic" as follows
    In the template definition "Before Label"
    <img src="#IMAGE_PREFIX#requiredicon_status2.gif" alt="Required Field Icon" /><label for="#CURRENT_ITEM_NAME#" id="#CURRENT_ITEM_NAME#_LABEL" tabindex="999" class="itemLabel">in the "after label"
    </label>Note, I am having the image for the * always with the laebl and creating an ID for the label with id="#CURRENT_ITEM_NAME#_LABEL" .
    I have created a couple of javascript function to show the label dynamically as required or optional.
    function setLabelRqd(item) {
         var v = item+'_LABEL';
         var pid = document.getElementById(v);
         if (!((pid===null)||(pid===undefined))){
              pid.style.color = "red";
              $('#'+v).prev().show();
    function setLabelOpt(item) {
         var v = item+'_LABEL';
         var pid = document.getElementById(v);
         if (!((pid===null)||(pid===undefined))){
              pid.style.color = "black";
              $('#'+v).prev().hide();
    }Use the template if the input item (label) is dynamically set as Required or Optional at runtime based on a value of another item.
    How to:
    1.     Select the template FormFieldDynamic for the input item.
    2.    Create a dynamic action triggering on the change event of the page item which holds the conditional value to set the input item label as required or as optional.
    Under the When Section
    a.     Event => Change
    b.    Selection Type => Item(s)
    c.     Item(s) => PXXX_ITEM_NAME (The item that holds the conditional value to set the label for the input item
    d.    Condition => equal to
    e.     Value => Enter the value  for which the label needs to be displayed in Required format.
    f.     Set True Action
                                                              i.    Action => Execute Javascript Code  (Identification)
                                                             ii.    Fire on Page Load => checked (Execution Option)
                                                           iii.    Code => setLabelRqd(‘PXXX_ITEM_NAME’);  (Settings)  /*Call the javascript function to set the label as required*/
                                                            iv.    Selection Type => Item(s) (Affected Elements)
                                                             v.    Item(s) => PXXX_INPUT_ITEM1[,PXXX_INPUT_ITEM2]…
    g.     Set False Action
                                                              i.    Action => Execute Javascript Code  (Identification)
                                                             ii.    Fire on Page Load => checked (Execution Option)
                                                           iii.    Code => setLabelOpt(‘PXXX_ITEM_NAME’);  (Settings) /*Call the javascript function to set the label as optional*/
                                                            iv.    Selection Type => Item(s) (Affected Elements)
                                                             v.    Item(s) => PXXX_INPUT_ITEM1[,PXXX_INPUT_ITEM2]…It finally works for me :) and hope this will be helpful to others too. I will greatly appreciate anyone to mention it here if this helps for him.
    Thanks,
    Natarajan

  • [CS3 JS] Getting a page item by its script label

    I have a text frame on a master page with its script label set. In my script, I am trying to get a reference to the text frame with this:
    var doc = app.activeDocument;
    var spread = doc.masterSpreads[0];
    var tabFrame = spread.allPageItems.item("TabLeft");
    I get the error "spread.allPageItems.item is not a function"
    Any help will be appreciated. Thanks.
    Rick

    Hi Rick,
    spread.allPageItems returns a flattened array of all of the page items in the spread, at any level of the hierarchy (i.e., inside groups and other page items). Is that what you want? Sadly, allPageItems does not benefit from the special case where we use the label as a name, so you'll have to iterate if that's what you want.
    As Peter says (thanks, Peter!), spread.pageItems.item("label") gives you all of the page items whose label matches the string, but it does so in sort of a weird way--you'll always get a page item object. If no page items match, you get an invalid page item; if one matched, you get a single page item, and if multiple page items matched, you get a page item object that actually contains multiple page items. It can take a little testing to figure out exactly what it is that was returned.
    Thanks,
    Ole

  • How to extract custom label from page item

    I´m trying to extract custom labels from a page item -a rectangle in this case-, inside a document observer:
         UIDRef pageItemRef=iCommand->GetItemList()->GetRef(0);
         InterfacePtr<IScript> script(pageItemRef,IID_ISCRIPT);
         IScriptLabel::ScriptLabelKeyValueList tags = script->GetTags();
    as sugested here -> http://forums.adobe.com/thread/747080?tstart=0  but I always get script=nil
    Regards

    I solved.
    Problem was that I was trying to get IScript interface once observer command was in kDone state -it was a delete command-.
    Thus, page items did not exist anymore when I was trying to get their custom labels.
    I changed it, making test during kNotDone state.
    Regards

  • Listing (for further action) all page items that have a certain script label

    hello from France,
    Well the question is essentially in the subject line: how to find and work on all page items of a document (or a page/spread) that have the same script label (or better: whose script label contain the same word)?
    I tried some variations around something like that, with no results:
    set list_pageitems to every page item of page i whose label is "product"
    Any clues?
    Thanks for your help
    Vincent

    I found the answer (for those who might be interested), but still have a question (for those who know).
    The solution:
    set list_pageitems to page item "product" of page i
    If you want to do it for a whose document (in may case, deleting some page items):
    delete page item "product" of document 1
    Strange syntax but it works :-)
    The remaining question:
    How to find page items whose label contains a certain string: it would be like selecting page items by tags (every word of the script label would be considered as a tag)?
    Thanks

  • [AS CS3] Bug? All Page Items - grouped items w labels

    Can anyone confirm this behaviour for me. I would classify it as a bug, but maybe the logic for it not being a bug escapes me.
    The command "all page items" is supposed to return a (flat) list of every page object, right? I would suspect that I should be able to address any object in the list. But I can only seem to address an object when it's inside of a group.
    I am trying to get the text of a text frame that has a label. It may or may not be inside a group. I can certainly do a try/error block to try a script statement for objects in a group or not in a group. But I think that "all page items" should be able to handle it directly.
    Here's a test script: ------
    tell application "Adobe InDesign CS3"
    tell document 1
    get label of all page items
    set myUngrouped to contents of text frame "some label" --only works when objects ungrouped, this is expected
    set myText to (get contents of text frame "some label" of all page items)
    --both statements work ONLY when objects grouped
    set myText to (get contents of every page item of all page items whose label is "some label")
    end tell
    end tell
    Steps:
    Make a new document.
    Draw a text frame. Type some text into it.
    Label the frame "some label".
    Draw another empty graphic or text frame.
    Run script
    -->result is, myText statements error out. Why is this?
    Now group all items on page.
    Run script.
    -->result is, myUngrouped can't continue. This is expected.
    Comment out myUngrouped statement
    Run script.
    -->result is, myText statements work OK.

    On 19/8/08 1:14 AM, "SuperMacGuy" <[email protected]> wrote:<br /><br />> set myText to (get contents of every page item of all page items whose label<br />> is "some label") <br /><br />The syntax is a bit tricky. The key is that all page items returns a list,<br />so what you want is certain items -- not page items -- from that list. So:<br /><br />set myText to (every item of all page items whose label is "some label")<br /><br /><br />-- <br />Shane Stanley <[email protected]>

  • Listing (for further action) all page items that have a certain custom label

    Hi again,
    Same question as before (see my previous post today), but now with custom labels.
    Who has already use the custom labels and how?
    I found it easy to write and read custom labels on a item basis (via a loop inside a list) but what if i want to get a list based on a custom label?
    Thanks for any help

    I found the answer (for those who might be interested), but still have a question (for those who know).
    The solution:
    set list_pageitems to page item "product" of page i
    If you want to do it for a whose document (in may case, deleting some page items):
    delete page item "product" of document 1
    Strange syntax but it works :-)
    The remaining question:
    How to find page items whose label contains a certain string: it would be like selecting page items by tags (every word of the script label would be considered as a tag)?
    Thanks

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • Dynamic creation of page items

    How can I create page items dynamic, if I have their number and their titles in a page item?

    More often than not you'll run into difficulties when trying to do something like this with APEX. However, you have two options:
    1 - The htmldb_item API, embedding items into a report based on the values of your previous page items.
    2 - Some combination of hidden fields and conditionals that makes use of your page item values for their label text.
    The former is well documented on the forum.
    Rgds
    Ben

  • Trouble with using javascript $s function to populate a page item

    Hello Oracle APEX Community,
    I'm working on a drilldown dashboard page and have been encountering a problem when i try to populate a Text Page Item (hidden or not) using the javascript built in $s function.
    The function works great when the data is a number such as dept_id (even if the field type is varchar). However, trying to pass anything which is a text the process fails, except when a value is hard-coded as a parameter for the function. So for example, I have a chart with counts of constituents by state. I would like to populate (filter) a table based on when you click on a bar for a state without having to submit the page. I'm using dynamic actions and a built in javascript function in the SQL for the chart to accomplish this; but again, it works great when I use a varchar field like the FIPS code (i.e. the FIPS for Texas is '48'), but when I try to populate the page item using the state abbreviation 'TX' (again varchar) it fails.
    Here's an example of code that works:
    SELECT 'javascript:$s("P1_DEPTNO",'||d.deptno||')' LINK,
    d.dname LABEL,
    sum(e.SAL) sal
    FROM emp e, dept d
    where e.deptno = d.deptno
    group by 'javascript:$s("P1_DEPTNO",'||d.deptno||')', d.dname And here's an example of code that does not work:
    SELECT 'javascript:$s("P1_DEPTNO",'||d.loc||')' LINK,
    d.dname LABEL,
    sum(e.SAL) sal
    FROM emp e, dept d
    where e.deptno = d.deptno
    group by 'javascript:$s("P1_DEPTNO",'||d.loc||')', d.dname However, when I hard code a text value the script works:
    SELECT 'javascript:$s("P1_DEPTNO","BOSTON")' LINK,
    d.dname LABEL,
    sum(e.SAL) sal
    FROM emp e, dept d
    where e.deptno = d.deptno
    group by 'javascript:$s("P1_DEPTNO","BOSTON")', d.dname
    ORDER BY d.dname I'm encountering this problem on several versions of APEX: (4.0.2.00.07-local installation) and (4.1.0.00.28-apex.oracle.com)
    Does anybody know of this problem and how to solve it? I've looked for settings on the page item itself, and can't figure it out.
    I've re-written my sql to utilize the value fields of my tables instead but I have some objects on the page which are really going to depend on the character based data instead.
    Thanks,
    Wayne

    In your javascript you are generating, surround your value with double-quotes and it'll should then always work with both numbers and strings (your strings are probably being interpreted as variable names and they don't exist at runtime, hence erroring out).
    Example:
    SELECT 'javascript:$s("P1_DEPTNO","'||d.loc||'")' LINK,Edited by: gti_matt on Aug 16, 2011 9:50 AM

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Display as Text page items - How to change color based on Value

    Hi,
    I have a bunch of page items that I would like to display in red if they contain a minus "-" sign. My guess is that this can be done with a template. Right now they are using the Optional Label with Help template. How might I elegantly specify to display a red font if the text contains a minus sign?
    I have done this before with report regions which include conditions and I just tagged a condition to a column template and I am looking to do something similar.
    Thanks!

    You haven't had a response... I was wondering if you could answer the question I posed of where are the "Display As" templates?
    It seems that there is nothing on the forum or WEB about them. They must be in a CSS sheet somewhere, but I don't even have access to those folders at work.
    I exported a "theme" and started to look through the sql code that created the CSS file (at least that is what I think it does) but it is about 170k and it is slow reading... I have tried searching on several key words but no luck yet.
    I appreciate any insights you have. It seems to me that the display as templates would provide some real cool features...
    turn negative numbers red
    gray out non-updateable fields
    The look and feel that would meet a design standard for a specific company...
    Best of luck,
    Sam

  • Change item Label based on Another item's value

    Hi guys,
    I need to set an item label (A) based on the value of another item (B). I did the following:
    I Created a dynamic action.
    When B changes:
    1- submit the value of B
    2- Refresh item A
    The label of the item A is : myitem &B.
    Any ideas ????
    Best Regards,
    Fateh

    Fateh wrote:
    Ok... Thanks a lot... but before closing the thread and for better understanding.
    I put this code on Execute when Page Loads:
    $("#P1_A").change(function(){
    if($v(this)=="Rent"){
    $('#mylabel > label > span').text('Is it for Sale also');
    }else{
    $('#mylabel > label > span').text('Is it for Rent also');
    }However, the label does not change. Any ideas why this is not working????
    Regards,
    Fateh
    $v(this)
    you are mixing jquery and apex API, it won't work
    and missing *});* at the end, and when adding to the page load you should wrap them in $(document).ready( code here.... });
    $(document).ready(function () {
         $("#P1_A").change(function () {
              if ($(this).val() == "Rent") {
                   $('#mylabel > label > span').text('Is it for Sale also');
              } else {
                   $('#mylabel > label > span').text('Is it for Rent also');
    });

  • Select previous page items or next page items (IDCS3)

    Hello all,
    How can I refer to previous page or its item? I am trying to do something below. if a textFrame with label "myFrame" is missing on current page go to next page (or may try to next page)
    for (var i=0; i<=myTotalPage-1; i++)
    app.activeWindow.activePage =myDoc.pages[i];
    //$.writeln ("Page is :"+myDoc.pages[i].name);
    if(!(myDoc.pages[i].textFrames.itemByName("sections")!=null))
    var myText="sometext";
    myDoc.pages[i].previousItem ().textFrames.itemByName("myFrame").insertionPoints.item(-1).properties = { appliedCharacterStyle : "myCharacterStyle", contents:myText};
    else{
    var myText="anotherText";
    myDoc.pages[i].textFrames.itemByName("myFrame").insertionPoints.item(0).properties = { appliedCharacterStyle : "myCharacterStyle", contents:myText};
    I know that previousItem () is not supported here, just added it to make the things clear.
    Any suggestions greatly appreciated.
    TIA,
    --PC

    Hello again,
    Kasyan's suggestion
    var myPreviousPage=mydoc.pages[i].previousItem(myPage);
    do not prompt for any error if selected first page.
    Harbs suggestion though prompts error if selected first page (obviously there is no  previous page)
    var myPreviousPage = doc.pages.item(page.documentOffset+1);
    but both of them fails if I try
    myPreviousPage.textFrames.itemByName("myFrame").insertionPoints.item(-1).properties
    = { appliedCharacterStyle : "myCharacterStyle", contents:myText}; //Object is invalid
    but works for the next page (at least Kasyan's suggestion: not tested Harbs idea).
    myNextPage.textFrames.itemByName("myFrame").insertionPoints.item(0).properties
    = { appliedCharacterStyle : "myCharacterStyle", contents:myText};
    I beleive this has nothing to do with insertionPoints(-1) I am trying for myPreviousPage case and ID do look for back pages???????? Simply getting nuts.
    Any ideas???
    --PC

  • Item Label

    How to change the font of Item label ?
    Sanjay

    Hi,
    If you need to set different font for item label then->
    Click the item ->attribute->Label->
    <div style=font-family:calibri;>Label Name</div>Inside " double quote use this *font-family:calibri;*
    You can also try inside template for all the label in the page.
    Thanks,
    Loga

Maybe you are looking for

  • How to cross a window in smartforms

    How to cross a window in smartforms.

  • Exchange setup error: "There was a problem accessing the registry on this computer"

     Hi, i am trying to install Exchange 2007 SP1 in a Windows 2003 Server standard 32 bits version. During the "Readiness checks" i received the next error in "Hub transport role prerequisites": Error: There was a problem accessing the registry on this

  • Remembering username and password in an unsigned applet...

    Does anyone have any ideas how my unsigned applet could remember the username and password entered by a user? Previously, I was using a signed applet so could store the username and password in a persistent text file, but now I need to provide an uns

  • Headache with button

    Hi, here is a link to FLA files www.fulek.com/bug/BUG_report.rar (This is another X-file's example, FLA's are actually empty but they have 2MB each when extracted). Short description of problem: StartFile.swf has one big button which is instance of B

  • How to pass Dynamic Table(s) to FM

    Hello All i hv an requirement in which i need to process a block of code recursively. right now i am trying to do the same with Subroutine but its hard i know. I have an option to use FM instead but i am not sure if we can pass dynamic tables to FM,