This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Jan 22, 2013 5:58 AM by Gus C RSS

Button Template

Gus C Journeyer
Currently Being Moderated
At the moment, in some of our reports we html buttons.
In the sql we have for example
<input type="button" name="disable" value="Disable" onclick="code(''disable'','''||jobsequence||''')">',
       '<input type="button" name="enable" value="Enable" onclick="code(''enable'','''||jobsequence||''')">') active
Can we refer to standard apex buttons instead

Gus

Edited by: Gus C on Jan 18, 2013 6:32 AM
  • 1. Re: Button Template
    MarkoGoricki Journeyer
    Currently Being Moderated
    Hi Gus,

    you can't use button templates in reports directly. But you can create procedure that will generate your button HTML code so you'll have this code only in one place.

    Br,
    Marko Goricki
    ------------------
    http://apexbyg.blogspot.ca/
  • 2. Re: Button Template
    975525 Newbie
    Currently Being Moderated
    Hi,
    I've got an application item in my application with the HTML code for the button (I use APEX "uButton" class to reproduce the look of standards buttons):
    <button class="uButton" type="button" onclick="apex.navigation.redirect('#EDIT_LINK#');">
    <span>Edit</span>
    </button>
    In the column attributes, in "Column Formating" I just refer to my item : &EDIT_BUTTON_HTML.

    (APEX 4.2, Blue Responsive Theme 25)

    Regards,
    Lucien

    Edited by: Alucien on Jan 18, 2013 8:22 AM
  • 3. Re: Button Template
    Gus C Journeyer
    Currently Being Moderated
    Where do I put the button html code ?
    I can't see a place to put the code in an application item

    Gus
  • 4. Re: Button Template
    975525 Newbie
    Currently Being Moderated
    Hi Gus,
    You can use an "Application Computation" in the shared components. Computation point : "On New Instance".
    Regards,
    Lucien
  • 5. Re: Button Template
    Gus C Journeyer
    Currently Being Moderated
    OK.
    I created an application item called EDIT_BUTTON_HTML
    I created an application computation with the computation item set to EDIT_BUTTON_HTML
    Computation Type = Static Assignment
    Computation - I put your html code.

    In my report col formatting HTML Expression I put &EDIT_BUTTON_HTML.

    Nothing happened

    Gus
  • 6. Re: Button Template
    975525 Newbie
    Currently Being Moderated
    OK, did you logout and login again?
    Do you see your html code in your application item session state?
    Regards,
    Lucien
  • 7. Re: Button Template
    Gus C Journeyer
    Currently Being Moderated
    Yes I see it in session state.
    What is the next step ?

    Gus
  • 8. Re: Button Template
    MarkoGoricki Journeyer
    Currently Being Moderated
    Hi Gus,

    I've also tried this and it doesn't work with application item, but it works with hidden item on page 0 (global page). Just set button HTML code as default value of item.

    Br,
    Marko Goricki
    ---------------------
    http://apexbyg.blogspot.com/
  • 9. Re: Button Template
    Gus C Journeyer
    Currently Being Moderated
    What type of item do I use and how do I refer to it in my sql report

    Gus
  • 10. Re: Button Template
    MarkoGoricki Journeyer
    Currently Being Moderated
    I've wrote it above. Hidden item.
    You reference it the same way as app. item. In column formatting - &P0_ITEM_NAME.

    Br,
    Marko Goricki
    ---------------------------------
    http://apexbyg.blogspot.com/
  • 11. Re: Button Template
    Gus C Journeyer
    Currently Being Moderated
    I tried applying the formatting, but the item just disappears and is not displayed in the report

    Gus
  • 12. Re: Button Template
    MarkoGoricki Journeyer
    Currently Being Moderated
    What HTML do you use as default value? Did you check out HTML source?

    Br,
    Marko Goricki
    ---------------------------------------
    http://apexbyg.blogspot.com/
  • 13. Re: Button Template
    975525 Newbie
    Currently Being Moderated
    Hi Gus,
    What's your APEX version?
    Mine is APEX 4.2.1 (use to work in 4.2.0), I don't have access to an other version to test it.

    Application Item :

    Name : EDIT_BUTTON_HTML
    Scope : Application
    SSP : Restricted

    Application Computation :

    Computation Point : On New Instance
    Type : Static Assignment
    Computation :
     <button class="uButton" type="button" onclick="apex.navigation.redirect('#EDIT_LINK#');">
    <span>Edit</span>
    </button>
    Column Attributes/Colmumn Formating/HTML Expression: &EDIT_BUTTON_HTML.

    Works for me in both Interactive and classics reports.

    Regards,
    Lucien

    Edited by: Alucien on Jan 22, 2013 5:11 AM
  • 14. Re: Button Template
    MarkoGoricki Journeyer
    Currently Being Moderated
    Yes, it works. I don't know what I've done wrong last time. Maybe blank space at the end of item name or something.

    Sorry for inconvenience!

    The way I've post about it is also ok. Only that we have unnecessary item on page 0 (global page). So, your way is better.

    Br,
    Marko Goricki
    ----------------------
    http://apexbyg.blogspot.com/
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points