How to : add commandMenuItem dynamically to af:menu
I have af:menu and I need to add af:commandMenuItem dynamically,
how would I do that ?
any help is appreciated
thank you all,
Thanks for your response Simon,
I was able to figure out
RichCommandMenuItem newMenuItem1 = new RichCommandMenuItem();
RichCommandMenuItem newMenuItem2 = new RichCommandMenuItem();
menu1.getChilderen.add(newMenuItem1);
menu2.getChilderen.add(newMenuItem2);
if you want to add it to the af:group as a group items
//create the group
UIXGroup group1 = new UIXGroup();
//set the parent
group1.setParent(menu1);
//add the group to menu
menu1.getChilderen.add(group1);
//set the attributes for new menu items
newMenuItem.setText("group item 1");
newMenuItem.setType("check");
newMenuItem.setText("group item 2");
newMenuItem.setType("check");
group1.getChilderen.add(0,newMenuItem1);
group1.getChilderen.add(1,newMenuItem2);
Thank you
//add the group to menu
menu1.getChilderen.add(group1);
Message was edited by:
user626222
Similar Messages
-
How to add column dynamically based on user input in oracle?
**how to add column dynamically based on user input in oracle?**
I am generating monthly report based on from_date to to_date below is my requirement sample table
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE | 01-OCT-12 | 02-OCT-12 | 03-OCT-12
100001.............John...........02-OCT-12...............6
100002.............chris...........01-OCT-12...............4
Based on user input, that is, if user need the report from 01-OCT-12 TO 03-OCT-12, i need to add that dates as column in my table, like 01-OCT-12 | 02-OCT-12 | 03-OCT-12....
below is my code
create or replace
procedure MONTHLY_LVE_NEW_REPORT_demo
L_BUSINESS_UNIT IN SSHRMS_LEAVE_REQUEST_TRN.BUSINESS_UNIT%TYPE,
--L_LEAVE_TYPE_CODE IN SSHRMS_LEAVE_REQUEST_TRN.LEAVE_TYPE_CODE%TYPE,
L_DEPARTMENT_CODE IN VARCHAR2,
--L_MONTH IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_FROM_DATE IN SSHRMS_LEAVE_REQUEST_TRN.LVE_FROM_DATE%TYPE,
L_TO_DATE in SSHRMS_LEAVE_REQUEST_TRN.LVE_TO_DATE%type,
MONTHRPT_CURSOR OUT SYS_REFCURSOR
AS
O_MONTHRPT_CURSOR_RPT clob;
v_return_msg clob;
BEGIN
IF (L_BUSINESS_UNIT IS NOT NULL
AND L_FROM_DATE IS NOT NULL
and L_TO_DATE is not null
-- AND L_DEPARTMENT_CODE IS NOT NULL
THEN
OPEN MONTHRPT_CURSOR FOR
select EMPLOYEE_CODE, EMPLOYEE_NAME AS NAME, DEPARTMENT_CODE AS DEPARTMENT,DEPARTMENT_DESC, CREATED_DATE,
NVL(WM_CONCAT(CL_RANGE),'') as CL_TAKEN_DATE,
case when NVL(SUM(CL2),0)<0 then 0 else (NVL(SUM(CL2),0)) end as CL_BALANCE,
from
SELECT DISTINCT a.employee_code,
a.EMPLOYEE_FIRST_NAME || ' ' || a.EMPLOYEE_LAST_NAME as EMPLOYEE_NAME,
a.DEPARTMENT_CODE,
a.DEPARTMENT_DESC,
B.LEAVE_TYPE_CODE,
B.LVE_UNITS_APPLIED,
B.CREATED_DATE as CREATED_DATE,
DECODE(b.leave_type_code,'CL',SSHRMS_LVE_BUSINESSDAY(L_BUSINESS_UNIT,to_char(b.lve_from_date,'mm/dd/yyyy'), to_char(b.lve_to_date,'mm/dd/yyyy'))) CL_RANGE,
DECODE(B.LEAVE_TYPE_CODE,'CL',B.LVE_UNITS_APPLIED)CL1,
b.status
from SSHRMS_EMPLOYEE_DATA a
join
SSHRMS_LEAVE_BALANCE C
on a.EMPLOYEE_CODE = C.EMPLOYEE_CODE
and C.STATUS = 'Y'
left join
SSHRMS_LEAVE_REQUEST_TRN B
on
B.EMPLOYEE_CODE=C.EMPLOYEE_CODE
and c.EMPLOYEE_CODE = b.EMPLOYEE_CODE
and B.LEAVE_TYPE_CODE = C.LEAVE_TYPE_CODE
and B.STATUS in ('A','P','C')
and (B.LVE_FROM_DATE >= TO_DATE(L_FROM_DATE, 'DD/MON/RRRR')
and B.LVE_TO_DATE <= TO_DATE(L_TO_DATE, 'DD/MON/RRRR'))
join
SSHRMS_LEAVE_REQUEST_TRN D
on a.EMPLOYEE_CODE = D.EMPLOYEE_CODE
and D.LEAVE_TYPE_CODE in ('CL')
AND D.LEAVE_TYPE_CODE IS NOT NULL
group by EMPLOYEE_CODE, EMPLOYEE_NAME, DEPARTMENT_CODE, DEPARTMENT_DESC, CREATED_DATE
else
v_return_msg:='Field should not be empty';
end if;
END;
my code actual output
EMPLOYEE_CODE| Name | CL_TAKEN_DATE | CL_BALANCE
100001....................John............02-OCT-12.................6
100001....................chris...........01-OCT-12.................4
how to add column dynamically based on from_date to to_date?
Thanks and Regards,
Chris Jerome.You cannot add columns dynamically. But you can define a maximum number of numbers and then hide unused columns in your form useing SET_ITEM_PROPERTY(..,VISIBLE, PROPERTY_FALSE);
-
How to add Image dynamically in Webdynpro ABAP
Hi Experts,
How to add Image dynamically in Webdynpro ABAP.
My requirement is i maintain all the images in a table.
image source has to pick the table URl dynamically and display.
is that possible in webdynpro?
and also please give the suggesion,
without using MIME objects is that anyway to get images?
Thanks in advance.
Regrads,
JeyanthiHi,
are those icons wou want to display then. he following code will be useful.
data : lo_IMG type ref to CL_WD_IMAGE.
LO_IMG = cl_wd_IMAGE=>new_IMAGE( id = img_id SOURCE = 'ICON_BW_APD_TARGET' tooltip = sts_tltp ).
lo_cont->add_child( the_child = lo_img ).
here lo_cont is the container where you want to add the image dynamically and source is the attribiute through which you can change the ICON image. this thing you can getit from data base table and change accordingly.
Regards,
Anil kumar G -
How to add keyboard control key to menu bar as shown
how to add keyboard control key to menu bar as shown bellow
Please helpwhy, nobody can give me any suggestion?!
I want to know how to get the specific Control from the Line which does not has this kind of Control. Currently, I met this problem -- the line does not support EnumControl.Type.REVERB, however, I want to exert the reverb control to the line.
please. thank you very much! -
How to add event handling for a menu?
hi,
I have created a menu and few mneu items.
for eachmenu itme , i did event handling and it is workign fine.
it was like this
menuItem = new JMenuItem("Exit",KeyEvent.VK_X);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
menuItem.addActionListener(this);
menu.add(menuItem);
public void actionPerformed(ActionEvent e)
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Action event detected. Event source: " + source.getText();
System.out.println(s);
public void itemStateChanged(ItemEvent e)
JMenuItem source = (JMenuItem)(e.getSource());
String s = "Item event detected. Event source: " + source.getText();
System.out.println(s);
now int he second menu i don't have any menu item and i want to do the event handling for the menu itself. any ideas how to do it. following is the code for the menu
//Build the second menu.
menu2 = new JMenu("Options");
menu2.setMnemonic(KeyEvent.VK_O);
menuBar.add(menu2);
menu2.addActionListener(this); //this does nto workYou were on the right track. However, selecting a menu is different from selecting a menu item. MenuItem chucks an ActionEvent and Menu will send an ItemEvent.
If you pile all action output to one actionPerformed method then be careful of your assumptions on what the source type will be. If by any chance the Menu has sent an ActinoEvent then your code will have caused a ClassCastException.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class MenuTest implements ActionListener, ItemListener {
JMenuItem menuItem;
JMenu menu1, menu2;
JMenuBar menubar;
JFrame frame;
public MenuTest() {
frame = new JFrame("MenuTest");
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
menubar = new JMenuBar();
frame.setJMenuBar(menubar);
menu1 = new JMenu("File");
menu1.setMnemonic(KeyEvent.VK_F);
menuItem = new JMenuItem("Exit",KeyEvent.VK_X);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK));
menuItem.addActionListener(this);
menu1.addItemListener(this);
menu1.add(menuItem);
menubar.add(menu1);
//Build the second menu.
menu2 = new JMenu("Options");
menu2.setMnemonic(KeyEvent.VK_O);
menu2.addActionListener(this); //this does not work
menu2.addItemListener(this); // use this instead
menubar.add(menu2);
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(100,100));
frame.getContentPane().add(panel);
frame.pack();
frame.show();
public void actionPerformed(ActionEvent e)
String s = "Action event detected. Event source: " + e.getSource();
System.out.println(s);
public void itemStateChanged(ItemEvent e)
String s = "Item event detected. Event source: " + e.getSource();
System.out.println(s);
public static void main(String[] args) {
new MenuTest();
} -
How to add new folder in sap menu visible to all users
I want to add a new folder in sap menu. i can do it for my user id as it is user specific. I wanna know that how to add a folder so that every user able to see the same i.e irrespective of user-ids.
Hi Ramya,
This can be done in SAP menu instead of User Menu, provided all your users are using SAP menu. If a folder is created in User menu it would be visible only to the user. If it is created in SAP menu and if all the users are using the SAP menu then the folder would be visible to all...
Hope this clarifies your query...
Reward me points...
Regards
Prasanna -
How to Add the Dynamic List Wizard Form to a Spry Accordion Panel?
Is it possible to add ADDT Dynamic Forms to the Spry Widgets?
- I have been trying to add the Dynamic List Wizard to my existing Accordion but everytime I do, the Accordion turns into plain text?
-Also, If it is possible then how do I target the Panels and have the detail record open up in Panel number 2?
I plan on having the ADDT Dynamic Form in Panel 1, and want the Add, Edit, New, Delete form to open up in Panel 2.
Thanks for your help,
jligI figured this out.
1) First add all the Fields to the Form using the ADDT Insert Record Form Wizard.
2) View the ADDT form in the browser to make sure the fields all display.
3) In DW design view, move the cursor just to the left of the ADDT Form and hit Enter to Add a line just above the ADDT Table.
4) With the cursor below the Red Form line and just above the ADDT table add the SPRY widget. (ex..Tabs)
5) Now highlight the rows you want to move & hit Cut, then open up Tab1, highlight Content1 and hit Paste.
I decide to leave my date_added, modified_By & date_modified fields below the SPRY tab widget so that these fields are visible all the time. When I click on the Insert button, the record was added correctly to my Table after Validation passed.
Thanks,
jlig -
How to add a dynamic filter in query panel
I want to display the data in recent week, is it possible to add a dynamic filter in query panel?
eg. filter--> actionDate >= CurrentDate - 7
BO version: BOX I 3.1We are still trying to get this filter to work. Can anybody give us an example of how it should look on the sensor?
The sensor filter that we would like to create should exclude any source IP, any source port to specific destination hosts on all destination ports (icmp has none) from capturing events and storing them in the event store on the sensor.
This is the filter that we have so far on the sensor. Whats the problem with it?
service event-action-rules rules0
filters edit icmp-w-echo-filter-sensor-sensor-0-D
signature-id-range 2100
subsignature-id-range 0-255
attacker-address-range 0.0.0.0-255.255.255.255
victim-address-range a.b.c.x,a.b.c.y
attacker-port-range 0-65535
victim-port-range 0-65535
risk-rating-range 0-100
no actions-to-remove
deny-attacker-percentage 100
filter-item-status Enabled
stop-on-match False
no user-comment
exit
filters move icmp-w-echo-filter-sensor-sensor-0-D begin
exit -
How to add inputfield dynamically
Hi,
How to add Textfield and inputfield dynamically when i select Radio button in webdynpro-abap.
Can any one give example code of this requirement.
Thanks
NeelimaHi Neelima,
You can write code in wddomodify to create input field dynamically. you can use the class cl_wd_input_field for that. Using methods in the class u can create new input field.
you have to write the code to create input field inside a condition that check your radio button select.
i didnt tried with inputfield yet, but i tried creating radio button like this.i think it will work.
Regards
Sarath -
How to add music to idvd opening menu? How To's don't work
how to add music to opening theme of idvd slide show. How To's haven't worked???
Hi
In what format was the Audio You used ?
I only use
• .aiff 48kHz 16-bit (as from miniDV tape Camera - or -
• .aiff 44.1kHz from Audio-CD (as You play on the Stereo)
I never use (directly without converting to .aiff)
• .mp3
• .wma
• - from iTunes
all of them I convert to .aiff 48kHz or 44.1kHz
then iDVD (and iMovie and FinalCut Express AND Pro) takes them without any problems
Yours Bengt W -
How to add a dynamic menu to the Portal?
Dear all,
I am restructuring the company's Intranet on which I plan to put a left-side vertical menu. On the menu, most links are accessible to all Intranet users except some KPI (key performance indicators) links which are only accessible to managers.
I am evaluating a third-party dynamic menu builder so called "Sothink DHTML Menu" which is javascript based and provides features for connecting to database via JDBC in jsp.
For static menu scenario, "Sothink DHTML Menu" is perfect for Oracle Portal in the sense of easy development and deployment.
For dynamic menu scenario, if I really want to use "Sothink DHTML Menu", I need to put the codes in jsp file and then place the jsp file on the Portal page. Here is the tutorial http://www.sothink.com/product/dhtmlmenu/store/jspdb/jspdb.htm
I still can't figure out how to do that. Can any experts here tell me how or suggest other alternatives for generating a dynamic menu on Portal?
Thanks
George (HK)Hi
I also use SoThink menus in Oracle Portal, but for static menus (I upload them in the HtDocs of Apache and then refer to them with an URL Item).
In my previous version of Portal I also had to display some kind of dynamic menus, some parts should only be visible to some users/groups. But I didn't use Sothink at this moment but "DHTML Menus" from an other company.
Starting from an example and using their libraries I wrote my own menu in javascript. In this .js I wrote some functions
- 1 that document.write(s) the start of the menu and the public part of the menu
- 1 that document.write(s) the reserved part of the menu
- 1 that document.write(s) the last part of the menu.
Then in a navigation page I defined 3 regions, each region contains some jscript code that launchs the function/menu part of the same range. And I used the item level security to set right access to the second region/menu part.
It worked fine, I just had to add some /* at the end of region 1 ent */ at the beginning of region 2 to remove the HTML code Portal writes between the regions.
But it was very time consuming if your menu changes often. -
How to add a new right-click menu entry in Nautilus file browser?
I want to add a couple of new context menu entries to Nautilus File Browser.
So when I e.g. right-click in View Pane on a file "foobar.conf" an menu entry "edit with gedit" should appear (among the other default entries).
When clicked the file "foobar.conf" should be passed to gedit (and gedit editor opened).
How can I achieve this?
Under Ubuntu there are nautilus-actions but when I try to install them in Solaris with
pkg install nautilus-actions
then this package is not found.
How else can I create my own context menues?
I would appreciate to have one script with all my context menus, which when run add them all in one step.To manage selected files or directories, you can use specific Nautilus variables like NAUTILUS_SCRIPT_SELECTED_FILE_PATHS.
For more details and which variables exist, please read the content of the following URL :
Nautilus File Manager Scripts: Questions and Answers -
How to add a dynamic parameter with VB 6?
I'm building a simply application that will open crystal 11 reports and add a single parameter. I've been able to get this working however I don't know how to set the parameter as dynamic and add to the list of values?
Hi Jason,
Please search Forums before posting a question. There are others doing the same whcih include samples on how to. Here's one of them: Loading a prompt list dynamically on an ASP.NET page in Crystal 11
I assume you are using the RDC ( craxdrt.dll ). The RDC has been deprecated since version 9 meaning there have been no updated or new fucntionality added to it. Since Cascading Parameters were introduced in CR 11 the RDC has no API available and nor does the .NET components. Check the posting above for more info.
Also the RDC is not supported in .NET so you should upgrade CR and move to .NET Suite.
Thank you
Don -
How to add custom option in context menu
Hi,
When viewing a document of a repository, can we add our own option (for example, "View In new Browser") in the context menu? And how can we configure the function when a user clicked on the option of context menu?
Thanks,
RayHi Ray,
Yes, you are right. This is the assignation chain:
Command->group commands->resource/collection/details->layout set->folder/KM navigation iview.
Remember, layout set is a service that you need to active on your repository.
Layout set allows you define (between other things) commands groups availables for resource, links or folders.
The context menu will have differents commands group depending reource type.
Patricio. -
How to add user defined functions in Menu bar of a Selection Screen?
Hi,
Can anybody please suggest me that how can I add user defined functions in the menu bar of a Selection Screen?
Regards
s@kDear Amit,
I am referring to the standard SAP program: RIEQUI20.
On the initial screen, there are 3 tabs.
Code:
SELECTION-SCREEN BEGIN OF TABBED BLOCK tab FOR 25 LINES.
SELECTION-SCREEN TAB (20) tab1 USER-COMMAND ucomm1
DEFAULT SCREEN 001.
SELECTION-SCREEN TAB (20) tab2 USER-COMMAND ucomm2
DEFAULT SCREEN 002.
SELECTION-SCREEN TAB (20) tab3 USER-COMMAND ucomm2
DEFAULT SCREEN 003.
SELECTION-SCREEN END OF BLOCK tab.
AT SELECTION-SCREEN.
CLEAR gv_okcode.
gv_okcode = sy-ucomm.
CLEAR sy-ucomm.
CASE gv_okcode.
WHEN 'IH08'.
CALL TRANSACTION 'IH08'. "Equipment Selection
WHEN 'IW29'.
CALL TRANSACTION 'IW29'. "Notification Selection
WHEN 'IW39'.
CALL TRANSACTION 'IW39'. "Order List Selection
WHEN OTHERS.
ENDCASE.
* Check date:
IF NOT datuv IS INITIAL
AND NOT datub IS INITIAL.
IF datub >= datuv.
ELSE.
MESSAGE e884(ih) WITH datuv datub.
ENDIF.
ENDIF.
IF variant IS INITIAL AND
dy_vari IS INITIAL.
PERFORM get_default_variant_f14 USING variant.
ENDIF.
PERFORM variant_existence_f14 USING variant.
IF datuv IS INITIAL.
datuv = sy-datum.
ENDIF.
IF datub IS INITIAL.
datub = sy-datum.
ENDIF.
IF sy-ucomm = 'ADDR'.
PERFORM adress_sel_f01 USING 'EQUIR'.
ENDIF.
PERFORM check_parnr_f76.
* AT SELECTION SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
STATICS: l_slset TYPE sy-slset.
*--- Set initial variant
PERFORM variant_init_f14 USING 'INST' 'INST' 'INST' 'RIEQUI20'.
IF variant IS INITIAL AND
dy_vari IS INITIAL AND
gv_variant_flag IS INITIAL.
PERFORM get_default_variant_f14 USING variant.
gv_variant_flag = 'X'.
ENDIF.
*--- Set Icon for adress-button
PERFORM set_icon_f01 USING dy_adrfl ad_icon text-ad0 text-ad1.
*--- get classification data from select option
*--- (if new variant or if called via submit or F3)
IF ( l_slset NE sy-slset ) OR
( s_comw[] IS NOT INITIAL AND gt_clsd_comw[] IS INITIAL ).
l_slset = sy-slset.
gv_class_old = dy_class.
gv_klart_old = dy_klart.
PERFORM copy_selopt_comw_f79 TABLES gt_clsd_comw s_comw.
PERFORM class_search_init_f77 USING 'EQUI'.
ENDIF.
*--- set Icon for classification
LOOP AT gt_clsd_comw TRANSPORTING NO FIELDS
WHERE atcod > '0'.
EXIT.
ENDLOOP.
IF sy-subrc IS INITIAL.
gv_comw_flag = 'X'.
ELSE.
CLEAR gv_comw_flag.
ENDIF.
PERFORM set_icon_f01 USING gv_comw_flag cl_icon text-cl0 text-cl1.
CALL METHOD cl_uid_cust=>selection_screen_output.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR variant.
PERFORM variant_inputhelp_f14 USING variant 'RIEQUI20'.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR dy_parnr.
PERFORM f4_for_parnr_f76.
AT SELECTION-SCREEN ON BLOCK clse.
IF dy_class NE gv_class_old
OR dy_klart NE gv_klart_old.
gv_class_old = dy_class.
gv_klart_old = dy_klart.
CLEAR gv_comw_flag.
REFRESH gt_clsd_comw.
REFRESH s_comw.
ENDIF.
PERFORM class_exist_f77 USING dy_klart dy_class 'DY_CLASS'.
IF sy-ucomm = 'COMW'.
CALL FUNCTION 'IHCLSD_VALUATION_POPUP'
EXPORTING
i_klart = dy_klart
i_class = dy_class
i_language = sy-langu
i_key_date = sy-datum
i_also_subclasses = dy_subcl
TABLES
ct_comw = gt_clsd_comw
EXCEPTIONS
exc_no_class = 1
exc_klart_not_allowed = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*--- fill classification data in select option
PERFORM copy_comw_selopt_f79 TABLES gt_clsd_comw s_comw.
ENDIF.
IF sy-ucomm = 'ONLI'.
sscrfields-ucomm = sy-ucomm.
ENDIF.
Regards
s@k
Edited by: siemens.a.k on Jan 15, 2010 10:10 AM
Maybe you are looking for
-
My husband just bought an i-phone 4...how do we hook up an apple id account??? Do we need to be hooked up to his computer first?
-
Java 6, JAXB 2 and X3D (version 3.0)
Hi everyone, I'm trying to unmarshall a X3D file using JAXB2 included in Java 6. I successfully generated the classes from the schema (http://www.web3d.org/specifications/x3d-3.0.xsd). I then created a simple X3D file using Blender and the Duke model
-
Need a patten for this problem
interface iContainer { void add(iContainee containee); interface iContainee { class DBContainer implements iContainer { private final long id; public void add(iContainee containee){ //problem is here. I do not think its appropriate
-
Listening for an event in main from a component
Hi Ok so i have a Flash Builder project 4.5 that i created in Flash Catalyst thats draws all its data from MySql and four months into the build, as this is my first web project im noticing that when the page loads up in the browser it loads everythin
-
What are the benefits of upgrading into a wireless n router
Hi. I was thinking of upgrading our router into a wireless n router from linksys as well. I also need to upgrade our adapters so it could make use of the wireless n network