Hello, could you help me with the function "createpopupmenu" in api_popupmenu, please. What should I put to the second parameter in_menuitem_xml in xmldom.domdocument ? Can you show me some examples, please?

Best regards, Yermek

asked 22 Apr '13, 08:01

%D0%95%D1%80%D0%BC%D0%B5%D0%BA%20%D0%9A%D1%83%D1%88%D1%83%D0%BA%D0%BE%D0%B2's gravatar image

Ермек Кушуков
111
accept rate: 0%

edited 24 Apr '13, 02:49

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5


Hi Yermek,

As the in_menuitem_xml parameter, you should use the definition of the popupmenu to be created in XML notation, which is exactly same with the XML notation used in design time, while defining a popupmenu through Formspider IDE.

An example can be as follows:

procedure createPopupMenu is
  v_popupMenu_cl  clob;
  v_popupMenu_xml xmldom.domdocument;
begin
   v_popupMenu_cl := 
                    '<popupMenu>
                      <menu label="1">
                        <menu label="1.1">
                          <menuItem label="1.1.1">
                            <!--<events>
                             <menuItemClick action="yourEvent"/>
                            </events>-->
                          </menuItem>
                        </menu>
                        <menu label="1.2">
                          <menuItem label="1.2.1"/>
                        </menu>
                      </menu>
                    </popupMenu>';

  v_popupMenu_xml := xmldom.newdomdocument(v_popupMenu_cl);
  api_popupmenu.createpopupmenu('popupMenu1',v_popupMenu_xml);
  xmldom.freedocument(v_popupMenu_xml);
end;

Hope this helps,
Ibrahim

link

answered 24 Apr '13, 06:45

formspider's gravatar image

formspider ♦♦
138210
accept rate: 22%

Thank you very much for your response. But I'd like to ask one more question. When I use this event for the second time, it shows a mistake like "the popupmenu's already been used". How can I verify if this popupmenu created or not?

(24 Apr '13, 08:03) Ермек Кушуков

Hi Yermek,

When this error occurs, Formspider raises the api_exception.e_popupMenuExists exception. You can catch and handle this exception to verify if this popupmenu is created or not:

procedure createPopupMenu is
  v_popupMenu_cl  clob;
  v_popupMenu_xml xmldom.domdocument;
begin
...
exception
  when api_exception.e_popupMenuExists then
    ...
end;

Alternatively, you can create your own custom function which verifies the popupmenu's existence using the api_popupMenu.getClickedMenuItem API and api_exception.e_invalidPopupMenuName exception:

function popupMenuExists(in_popupMenuName_tx varchar2) return varchar2 is
  v_name_tx varchar2(255);
begin
  v_name_tx := api_popupmenu.getClickedMenuItem(in_popupMenuName_tx);
  return 'Y';
exception
  when api_exception.e_invalidPopupMenuName then
    return 'N';
end;

Hope this helps,
Ibrahim

(24 Apr '13, 09:24) Ibrahim Sand... ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3

Asked: 22 Apr '13, 08:01

Seen: 963 times

Last updated: 24 Apr '13, 09:24


© Copyright Gerger 2017