This discussion is archived
7 Replies Latest reply: Jun 19, 2008 7:50 AM by 420747 RSS

Why not Pre-Element feature?

VANJ Journeyer
Currently Being Moderated
There is the Post-Element feature on the Item Properties page.

Why isnt there a Pre Element feature?

This way I can enclose an element in a DIV tag and do all sorts of DOM/CSS stuff with it.

Thanks
  • 1. Re: Why not Pre-Element feature?
    VANJ Journeyer
    Currently Being Moderated
    Bump. Thanks.
  • 2. Re: Why not Pre-Element feature?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,

    It just hasn't been done yet, I could use it as well and will try and get it in a future version.

    Actually we should probably have some sort of item template that can be applied to items and item types as well or extend the label template to wrap items instead of just sit in front of them. All sorts of ways to get the same effect just a matter of choosing the right one.

    Carl
  • 3. Re: Why not Pre-Element feature?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,

    Also in most cases (not all) grabbing a page items parentNode should get you a table cell object.

    Carl
  • 4. Re: Why not Pre-Element feature?
    VANJ Journeyer
    Currently Being Moderated
    Yes, an item template makes a lot of sense. For quick page layout, what would be even more useful is to to be able to refer to items using say their sequence number in substitution string #ITEM_NN#. If a page/region template could refer to items in this way, that would make page layout almost WYSIWYG and very fast.

    Thanks
  • 5. Re: Why not Pre-Element feature?
    VANJ Journeyer
    Currently Being Moderated
    See
    http://htmldb.oracle.com/pls/otn/f?p=24317:102

    In order to hide the label of the item along with the item itself, I had to edit the label template to add a id="#CURRENT_ITEM_NAME#_label"

    Is there a way to achieve the same thing using the parentNode technique you mention below? Or would that hide the TD and mess up the layout?

    Comments? Thanks
  • 6. Re: Why not Pre-Element feature?
    357241 Oracle ACE
    Currently Being Moderated
    Hello,

    We have some built in javascript functions

    html_HideItemRow(pNd)
    html_ShowItemRow(pNd)
    html_ToggleItemRow(pNd)

    Where pNd is a node id or a node object. It cascades up the DOM from the given item to the containing table row then hides/shows toggles it. Very useful in 'most' cases.'

    or

    Just create a generic javascript function .... vk_HideElementAndLabel(SomeId) ... something like that hides both the item and the label, which is what you have done.

    For your example your way seems the best to me.

    This week on my blog site I will start going through function by function of javascripts HTML DB provides and give a description and usage examples of each.

    Carl

    Message was edited by:
    cbackstr
  • 7. Re: Why not Pre-Element feature?
    420747 Newbie
    Currently Being Moderated
    Actually we should probably have some sort of item
    template that can be applied to items and item types
    as well or extend the label template to wrap items
    instead of just sit in front of them.
    I am looking for this very feature right now. This post is from 2005 so I'm hoping there are now ways to accomplish this. I will continue to hunt around the forum as well.

    My specific issue is that we are interested in putting a help icon after the input item. There are label templates which have help built into them, but label templates don't wrap around the item (not that I know of) and there are POST TEXT ELEMENT attributes attached to items, but it would be a maintenance nightmare to change the POST TEXT ELEMENT attribute of every item if or when we make a change to the help model.

    I imagine one method would be to create a Shortcut Shared Component of the generic code and then simply refer to that Shortcut in the POST TEXT ELEMENT of the items that need the help icon.

    Any other suggestions? Is there a new feature that I am not aware of? We are on ApEx 3.1. By the way, item templates would rock.

    Shane.