Javascript get item label

Hi there,
I am using some client side javascript, does anybody know what function I can use to get a label for an item, can I use the $x function? thanks, Anil

Hi,
You can query APEX_APPLICATION_PAGE_ITEMS view
Regards,
Jari

Similar Messages

  • Dynamic item labels

    What is the best way to get item labels to be dynamic? I would like to store item labels in a table in the database and retrieve them when the page is rendered.
    This way I only have to change the label in one place and both the application and other reports based on this data will see the changes.
    The only way I could think of is to have item labels like &P1_LABEL1., &P1_LABEL2. and so on and then have a OnLoad process populate all these hidden items.
    But this way I am "using up" a bunch of items that count toward the 100-item-per-page limit. If I have 10 real items on the page, using this technique, I would have 20.
    Any other ideas?
    Thanks

    Not sure I understand you, Scott.
    If I understand you correctly,
    For each item I want to render, I would have
    a. Display as Text
    b. Actual item
    For (a), I would choose to have a blank label and source the item with my dynamic label
    For (b), I would again choose a blank label.
    I would put items (a) and (b) on the same line (and/or) field.
    So, I am really displaying 2 items but making them appear to be 1 "regular" item.
    But then the "label" and the item are not really connected to each other, if I move one, the other wont move automatically, etc.
    Is that what you are suggesting?
    Thanks

  • How to get the label on selectOneMenu selected item??

    Hi,
    I'm not able to get the label of the selected item in a selectOneMenu. The code I use to fill it is:
    <h:form id="formNacion" name="formNacion">
    <h:selectOneMenu value="#{modelRtbBean.nacion}" id="selectNacion" onchange="this.form.submit();">
    <f:selectItems value="#{dataRecoveryBean.naciones}" id="idItemsNacion"/>
    </h:selectOneMenu>
    </h:form>
    The dataRecoveryBean has this method to fill the content of the component (basically it creates an arrayList of selectItems by recovering data from a database):
    public ArrayList<SelectItem> getNaciones() {
    if ((naciones == null ) || (naciones.isEmpty()) ){
    naciones = new ArrayList<SelectItem>();
    HDBGeografico hdbGeo = new HDBGeografico();
    SqlMadd sqlmadd = new SqlMadd();
    try {
    AccessBD sscm = new AccessBD( );
    sscm.table(hdbGeo.getSqlNaci());
    // The AccessBD object has a reference to the resultset:
    ResultSet rs = sscm.getRS();
    while (rs.next()) {
    naciones.add(new SelectItem((String) rs.getString(1), (String) rs.getString(2)));
    sscm.Close();
    } catch (Exception e) {
    System.out.println(e.toString());
    return naciones;
    the modelRtbBean setNacion recovers the value, but I need its label too, because it's a kind of description that I use later.
    In the modelRtbBean setNacion method I'm able to access the UISelectItems object, but I cannot get the selected item itself
    public void setNacion(String nacion) {
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc != null) {
    UIViewRoot viewRoot= fc.getViewRoot();
    System.out.println(viewRoot.getViewId());
    HtmlSelectOneMenu selNac = (HtmlSelectOneMenu)viewRoot.findComponent("bodySTB:formNacion:selectNacion");
    if (selNac != null) {
    System.out.println("Nacion value-htmlSelectOneMenu :" + selNac.getValue() );
    System.out.println(selNac.getAccesskey() + selNac.getTitle() + selNac.toString());
    UISelectItems uis = (UISelectItems)selNac.findComponent("idItemsNacion");
    if (uis != null) {
    System.out.println("I have the element...");
    this.nacion = nacion;
    How could it be accessed this selected item label ??

    I finally did it as you suggest, but I found another way to access the label (I don't know if it could be useful for anybody but here it is) :
    In the setter method linked to the SelectOneMenu, you can put in this code:
    FacesContext fc = FacesContext.getCurrentInstance();
    if (fc != null) {
    UIViewRoot viewRoot= fc.getViewRoot();
    System.out.println(viewRoot.getViewId());
    HtmlSelectOneMenu sel = (HtmlSelectOneMenu)viewRoot.findComponent("viewName:formName:selectOneName");
    if (sel != null) {
    UISelectItems uis = (UISelectItems)sel.findComponent("idItemsName");
    if (uis != null) {
    ArrayList<SelectItem> listElem = (ArrayList<SelectItem>) uis.getValue();
    You could put in in the value item of each SelectItem it's index position in the list, so in the setter method
    of the bean linked to the selectOneMenu you would get the index of the selected item as the parameter of the method
    int index = 1; // For easyness in this example
    System.out.println("Label: " + listElem.get(index).getLabel() + " Value: "+ listElem.get(index).getValue());
    Thanks !!!

  • What is the code to get the  Label of  radio button item at runtime?

    Hi All
    I am working on forms 10g(version 10.1.2.0.2 ) with Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 on windows 2000 platform.
    My requirement is to dynamically get the label of the radio button item in a radio group.I am able to get the label of the radio group as shown below
    Item :Radio group
    Label : Gender
    IF m_type = 'RADIO GROUP' THEN
         m_label:=Get_Item_Property(m_Item ,label);
    END IF;
    There two Radio buttons inside this radio group which are
    item     : Radio button
    Label : Male
    item :Radio button
    Label :female
    What is the code to get the label of radio button(i.e) male and female ?
    How will I get the count of radio buttons in a radio group at runtime?
    Regards
    Mohan

    But you have to provide the button name which cannot be get at runtime.
    This is a lack of information that the Dev team would correct !
    Francois

  • 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

  • Dynamic action to change item label

    Hi All,
    How can I use dynamic action to change item label?
    thanks.

    Hi,
    fac586 wrote:
    Why and when do you want to dynamically change a label? This would have a detrimental effect on usability and accessibility.
    Consider a visually impaired user of your app using a screen reader. The screen reader identifies a checkbox labelled "Free Cake". They like the sound of that, so navigate to the checkbox to tick it. Your dynamic action fires when it gets focus and changes the label to "Give all my money to Fadi".I think this would confuse even a sighted user! I don't know the OP full requirements or constraints but I can bet the OP does not want to change the item label when the user navigates to it.
    I have to say that I don't like forms that change as the user enters data. I think that enabling and disabling fields is OK, but not hiding or showing or changing labels or field types.
    In any case, if you have to do it, an alternative to changing an item label is to have 2 separate items: one hidden and one shown. Then, using some triggering event, you can hide one and show the other.
    Because there are built-in dynamic actions to hide and show items but not to change item labels, one might thing that one approach is more acceptable than the other. However, if those 2 separate items occupy the same spot in the page, from a user point of view (or screen reader for that matter) I don't see any difference between those two approaches (in my view, both bad practices.)
    And because of its lots of nested tables, lack of headings etc, apex pages are not screen-reader friendly anyway... This is an interesting plugin for firefox that shows how your page would be read by a screen reader:
    http://www.standards-schmandards.com/projects/fangs/
    fac586 wrote:
    You can use an "execute javascript" dynamic action type to do it.Yes, you can. But should you?I don't know. As I mentioned above, I don't like the idea. However, as I also mentioned above, I don't know anything about the OP constraints or requirements.

  • Wraping text on an item label

    Would someone explain how to get the text to wrap on an Item Label. Thanx, Charlie

    Hello,
    A better way is to edit your label template to have this style attribute
    style="text-align:right;"
    At the end of the day all APEX outputs is HTML so youcan do pretty much anything you can do in any other HTML page with css javascript etc.
    Carl

  • Setting colors for item labels in JFreeChart (WaferMapRenderer)

    Hi,
    first of all, sorry for posting a JFreeChart related posting on this forum, but I didn't get a solution right now (I even didn't find anything useful on the JFreeChart website/forum). Here's my question...
    I'm trying to set the color for item labels in the legend but with no success.
    Here's a code example:
    final JFreeChart chart = ChartFactory.createWaferMapChart(
        "Wafer Map Demo",         // title
        dataset,                  // wafermapdataset
        PlotOrientation.VERTICAL, // vertical = notchdown
        true,                     // legend          
        true,                    // tooltips
        false
    WaferMapPlot plot = (WaferMapPlot) chart.getPlot();
    WaferMapRenderer renderer = new WaferMapRenderer();
    renderer.setSeriesItemLabelPaint(0, Color.red);
    renderer.setSeriesItemLabelPaint(1, Color.blue);
    plot.setRenderer(renderer);The default behavior of the WaferMapRenderer is also strange because the item label as well as the item marker is painted black so you cannot distinguish different fields of the wafer map. Is this a bug or am I doing something wrong (or missing somehting)?
    Any help would be greatly appreciated.
    Thanks and best regards,
    - Stephan

    Your folder action script doesn't work because of one simple error:
    set label index of every item of entire contents of processFolder to 7
    Nowhere in your script is 'processFolder' defined, so AppleScript has no idea what you're trying to do.
    Given that you (correctly) iterate through added_items, the correct format would be:
    on adding folder items to this_folder after receiving added_items
      repeat with item_ in added_items
        tell application "Finder"
          set label index of item_ to 7
        end tell
      end repeat
    end adding folder items to
    In other words, this changes the label index of each item just added.
    That should work provided you're dropping files into this folder. If you're dropping folders then this would set the label index of the folder itself, but not necessarily the items within that folder. For that you'd need to add a check to see if item_ was a folder and add code to handle folders.
    Also note that this kind of folder action will only work on the folder itself - that is, if you have folder A that contains subfolder B, then dropping a file into subfolder B won't trigger the script and won't change that item's label. To do that you'd have to attach your folder action to subfolder B.

  • Missing Javascript menu items on Acrobat 9 Standard

    I've been trying to get into some more advanced JS coding within Acrobat for forms, and I'm running into a bit of a roadblock in accessing the javascript tools.  Specifically, I keep seeing references to Javascript menu items under the Advanced menu, but my Acrobat doesn't seem to have these at all.  I also can't open the JS Debugger/console with Ctrl-J, but it will open if i put in a syntactically incorrect javascript statement and try to execute it (from a form field, etc).
    Anyone have any ideas how to correct this?  I found references online to this being an issue if Acrobat Reader is also installed on the same machine (it was), so i removed that, but the problem persists.  I can enter javascript into an individual field, but i can't add a document-level script at all.
    thanks

    Sweet! I got it working.   My function reads in the contents of a range (30+) of combo boxes and text boxes, does a little editing and then sorts, and then puts them back in the same range of boxes but with the blanks filtered out and in alpha order.  I  used a nested array and it worked pretty well. 
    The only thing i'm still stymied on is that it works perfectly for everything except if the textbox field is a number with a '+' in front of it (like +1 or +2200).  It strips the + sign out, I'm assuming that's because of javascript special characters, but the escape/unescape function did not fix it.  Doesn't matter if there are plus signs in the rest of the field, only at the beginning (and minus signs don't cause the same issue).  I'm going to try manually escaping with quotes before reading into the array I think, but if you have seen this sort of thing before please let me know.

  • App. Express -- Change font size in the item label.

    I would like to size the item label so I did this and it did not work
    in the label I put <span style="font-size:12px;">ITEM 1</span> and
    <span style="font-weight:bold;">ITEM 1</span>
    What wrong?

    Hello,
    The basic “trick” here is to duplicate the proper label template (you can of course change the original label template, but that’s less advisable) in order to add an ID to the text/link part.
    In my example, the template is base on the “Optional Label with Help” template, and the “Before Label” field contains the following:
    <label for="#CURRENT_ITEM_NAME#" tabindex="999"><a class="t2OptionalwithHelp" id="L_#CURRENT_ITEM_NAME#" href="javascript:popupFieldHelp('#CURRENT_ITEM_ID#','&SESSION.')" tabindex="999">In order to maintain ID uniqueness, the new ID just adds “L_” to the item name.
    Now I have direct access to the text/link, and I can manipulate it using JavaScript. In the example, I added the following to the region footer:
    <script type="text/javascript">
    $x('L_P160_ITEM2').style.fontSize = '20px';
    $x('L_P160_ITEM3').style.fontSize = '30px';
    $x('L_P160_ITEM3').style.color = 'green';
    </script>Regards,
    Arie.
    Hi Carl,
    As usual I was busy typing and didn’t see your reply. I agree that a specific example would be the best and easiest way to help.
    Message was edited by:
    ageller1

  • How to get Layer label

    I want get "Layer label"(not "Item label")with AEGP,b ut no API exist in LayerSuite.
    Is there a method of obtaining it?

    There is not getLayerLabel. You get the layer as an Item :
    GetItemFromLayer
    and then you get the label of the item, which should be the layer label with
    GetItemLabel

  • How do I get the Label for a Front Panel Control to appear in the Block Diagram but not on the Front Panel?

    How do I get the Label for a Front Panel Control to appear in the Block Diagram but not on the Front Panel? On the Front Panel I am making a complex control that consists of a Slider and a Numerical Input box. Both Controls display the same information and either can be used for Input. When one changs, the other is made to display the same value.
     But I only want the Slider to display the Label on the Front Panel, to avoid confusion. On the Block Diagram however, I want both controls to display their Labels so that I know what they are. How do I display the Label for a Control on the Block diagram, but not display its Label on the Front Panel?

    No.  The Label Visible property is separate for the front panel control label and the block diagram terminal label.
    How did you start out with the block diagram's label not being visible?  Whenever I drop a control or indicator, the label is always visible on both the FP and BD by default.  Maybe there is a LabVIEW option that causes new controls/indicators not to have their labels visible by default, but I have yet to find it.  I don't think an item should ever be dropped without the label visible, good LabVIEW coding practice demands that the labels for control terminals on the block diagram be visible so that you know what control or indicator a wire is going to.
    That being said, I have seen a lot of VI's posted where the label for the terminal on the BD is not shown (against good programming practice.)  I've gone to the BD and right clicked to show the label.  Sometimes, the people have an empty label (which will turn off the visibility for both the FP and BD) and I'm forced to add some text of my own into the label so I can figure out what their code is doing.  When I add some text to the label, at that time, I find both the BD and FP labels become visible.
    Are you dealing with controls that have empty labels to start?
    Good programming practices:
    1.  Always have a name for all of your controls, never use and empty label by deleting the text in the label.
    2.  Make the labels unique.  For example, don't have two controls both called Stop.  How do you know quickly know which terminal relates to which control?
    3.  Always show the labels on the block diagram, so you know the function of a control's terminal.  If you want to hide the label on the FP, that's okay.
    4.  If you want a different label to appear on the FP than whatever you actually called the control, then use the caption.  You can hide the label and show the caption.  This is useful if you need to programmatically change what the "label" is on the front panel such if you are making an application that needs to change its user interface such as for a foreign language.

  • Item Label with special Character

    Hi All,
    I trying to Conditionly  name the ladel of an item with two different special character accoding to the condition
    Two characters are
    asterisk    *            
    Diamond  -  equivalent HTML code is & #9830;
    {Code}
       IF (codition is true )
       THEN
          :P1_X := '*';
       ELSE
          :P1_X := '<sup>&#9830;</sup>';
       END IF;
    {Code}
    When i try to sustitute this value to my Item label using &P1_X , it is displaying the whole value (<sup> &#9830;</sup>) instead diamond symbol.
    Can any one help me out in this ?
    Thanks in advance for your help.
    Regards,
    Aru

    The label can be change on page load using some jQuery, for example:
    $('[for="P1_X"] SPAN').html('♦');and
    $('[for="P1_X"] SPAN').html('');You may need to adjust it based on your item template.
    Depends of your condition, the label can be set using Dynamic Action or a javascript function called on page load (you may need to set the condition True/False in an hidden item on your page so the JS will be able to check it).

  • Get menu label on a form

    I wanna get the label of the menu and populate it on the form that will open.
    I saw there is the function, but what is the menuitem_id MenuItem I have to inform?
    FUNCTION GET_MENU_ITEM_PROPERTY(menuitem_id MenuItem, property NUMBER);

    Hi,
    this is a sample code from Forms help:
    ** Built-in: GET_MENU_ITEM_PROPERTY
    ** Example: Toggle the enabled/disable status of the menu
    ** item whose name is passed in. Pass in a string
    ** of the form 'MENUNAME.MENUITEM'.
    PROCEDURE Toggle_Enabled( menuitem_name VARCHAR2) IS
    mi_id MenuItem;
    BEGIN
    mi_id := Find_Menu_Item( menuitem_name );
    IF Get_Menu_Item_Property(mi_id,ENABLED) = 'TRUE' THEN
    Set_Menu_Item_Property(mi_id,ENABLED,PROPERTY_FALSE);
    ELSE
    Set_Menu_Item_Property(mi_id,ENABLED,PROPERTY_TRUE);
    END IF;
    END;
    To find the Label you need something like this:
    ** Built-in: GET_MENU_ITEM_PROPERTY
    ** Example: Find the LABEL property
    ** Pass in a string
    ** of the form 'MENUNAME.MENUITEM'.
    FUNCTION get_menu_item_label( menuitem_name VARCHAR2) IS
    Return varchar2
    mi_id MenuItem;
    menu_label varchar2(50);
    BEGIN
    mi_id := Find_Menu_Item( menuitem_name );
    menu_label := Get_Menu_Item_Property(mi_id,LABEL);
    return(menu_label);
    END;
    Hope this helps,
    Hugo

  • Item Labels using Advanced Layout Designer

    Hello,
    I would like to print item labels using the ADL. What I would like to do is print labels using the std avery templates. I want to be able to select which items to print and also select the quantity of labels. The template I want to use will have more than one column going across.
    I am happy to base this on a query or any other method possible!
    Ideally, when running the report I would select:
    - one or more item codes
    - quantity of labels
    which would then print all the labels for all the codes in one report using the avery template.
    If anyone could give me some assistance in this regard i would be most grateful.
    Many Thanks!
    Russell Chesler

    Hi Russell
    I've the same problem as you, but by SAP that's Impossible,
    I use a external Software, to do this. The beter is Nice Label because it will connect to SAP Database, and you will make yours queries to get the information as it..
    Regards

Maybe you are looking for

  • How can I add three binary numbers and then convert to string (Hex format)?

    Hi All, I have my problem "half" resolved, but need some assistance on the final piece.  Overall, I need to take three string values (hex format), convert them to binary, add them and then convert back to a string (hex format).  If that doesn't make

  • Notification mails are not sent using RSWUWFMLEC

    Hi Experts, We are using SRM 4.0 and we have an issue with Notification mails, The report RSWUWFML2 for sending notification mail to outlook for work item,which we have been using . We have recently started using the report RSWUWFMLEC for sending the

  • Safe mode exit?

    Im in safe mode i tried restarting n i still didnt exit the safe mode. later i tried pressing alt while booting and chose mac osx still in safe mode. i need some assistance plz. thnx

  • Verizon Edge not offered to longstanding Verizon customers.

    Why are current Verizon customers who are under contract and not eligible for an upgrade not eligible for Verizon Edge? It would seem to me that long standing Verizon customers should be rewarded with new plans instead of being held to current/out da

  • Quick pick tips on i phone

    i have copied some several times, can i delete from i phone??????????