• Leistungsspektrum
    Die passenden Lösungen für Ihre Anforderungen.
    Mehr Details unter der Rubrik: Leistungen
  • Professionelle Anwendungen
    Holen Sie mehr aus Ihren APEX Applikationen heraus.
  • Neueste Designs
    Nutzung von erweiterten Web 2.0 Möglichkeiten und Entwicklung von Corporate Designs
  • Individuelle Lösungen
    Entwicklung von Business-Anwendungen genau nach Ihren Wünschen.
  • Upgrade Lösungen
    Weiterentwicklung bestehender Anwendungen.
  • Schulungen und Vorträge
    Die passenden Schulungen genau für Sie zugeschnitten. Beispiel: Navigationsbeispiele
  • Plugins und Third Party Erweiterungen
    Erweitern Sie die Funktionalität ihrer Anwendungen mit einem modularen Entwicklungsansatz.

29 May, 2009

Building your own button in an APEX region

Have you ever experienced some issues when you wanted to create a button inside an APEX region behind an item and that button should call a javascript function.
With normal APEX features "Create a button displayed among this region's items" it's not possible as I know because APEX creates automatically a doSubmit button.

Anyway one way to fix that is to create an own button:

First create your own button, for example on:
http://www.buttongenerator.com/
or on:
http://www.buttonboost.com

Next upload the new button image into the application workspace.
Home>Application Builder>Application 100>Shared Components>Images>Create>
Application: #Your application name#
Upload New Image: #Image path#
Notes: #Additional information to the picture#

Last step is to create an "Display as Text" page item with the following settings:
Label: empty
Template: No Label
Width: 0
Post Element Text:

 
<img
id="P1_btnID1"
src="#APP_IMAGES#start.png"
// if image was set to
// "No Application Associated"
// then use #WORKSPACE_IMAGES#
alt="Set user settings"
onclick="fnc_setUser('P1_USER')"
style="cursor: pointer"
title="Set user settings"
>

Info: If the button should be right behind an item then edit the option "Begin On
New Line" to "No".
And of course you can put the img-tag also into the "Post Element Text" of an already used APEX item.

At the end it should look similar to that:

5 comments:

Patrick Wolf said...

I think that it's getting time that we support javascript actions for item based buttons.

Regards
Patrick

Anonymous said...

How can I create a button in APEX, which automatically submits 2 functions at once?

Tobias Arnhold said...

Try this:
onclick="fnc_setUser('P1_USER');fnc_setGroup('P1_GROUP');"

Or look here:
http://javascript.internet.com/navigation/dual-function-button.html
or here:
http://forums.devshed.com/javascript-development-115/2-javascript-functions-on-1-click-29421.html
or here:
http://www.webdeveloper.com/forum/archive/index.php/t-51625.html

Anonymous said...

Thanks a lot!

My Problem:

I created items to put in an address and by clicking on the "Go" button I get the address shown in a report. This button is created with "Create a button displayed among this region's items" and is automatically a submit button. Now, clicking on this "Go" button should invoke displaying the address in a report AND showing this address on a map produced by mapviewer.

Have you any solution for that?

Anonymous said...

This solution is EXACTLY what I needed to give my client the visual placement of a page item button, but with the action of a region button. THANKS!!!