Modifying Call Context Menu
Can anyone let me know if there's a possibility to modify the Call context menu shown in the example below ?
We just need to add:
"Gizmo5 call" that may goes through WiFi or 3G
"Skype" that goes through WiFi or 3G
"SIP1" that goes through WiFi to SIP provider just like "Internet call"
"Calling card" that goes through prepaid calling card provider, the call scheme can be <access number>p<PIN>p<destination number> (p is for pause)
Hope's it's possible.
Hi Frank,
thanks for the kind response..
Yeah, i had tried that out too. But in this case the context menu that i'm defining doesn't seem to be picked up by af:tree since i'm only able to see the default context menu of the browser.
This is strange since even the default context menu provided by af:tree doen't appear.
Do we need to do something else also for that...
By the way i assume that you were talking about contexMenu facet of af:tree only.
I am inlinning the jspx code snippet for convinient.
Can you please suggest something....
<af:panelFormLayout customizationId="panelFormLayout1">
<f:facet name="footer">
<af:group>
<af:commandButton text="commandButton 1"
customizationId="commandButton1"/>
<af:image source="http://www.google.com/intl/en_ALL/images/logo.gif"
shortDesc="THE logo" customizationId="image1"/>
<af:tree value="#{myBean.model}" var="model"
rowSelection="single" initiallyExpanded="true"
id="structureNavigatorTree" inlineStyle="padding:2px"
contentDelivery="immediate"
customizationId="amitKumarGupta">
<f:facet name="nodeStamp">
<af:panelGroupLayout>
<af:outputText value="#{model.name}"/>
</af:panelGroupLayout>
</f:facet>
<f:facet name="contextMenu">
<af:popup id="yesItsgeneral">
<af:menu id="fdssd" text="menu 1">
<af:commandMenuItem id="micrsfdg" text="Expand All2"/>
</af:menu>
</af:popup>
</f:facet>
</af:tree>
</af:group>
</f:facet>
</af:panelFormLayout>
</cust:panelCustomizable>
<f:facet name="editor">
<pe:pageEditorPanel/>
</f:facet>
</pe:pageCustomizable>
</af:form>
</af:document>
Hi,
turns out the solution is easy. Just use the context
menu facet, similar to below
<f:facet name="contextMenu">
<af:popup>
<af:menu text="menu 1">
<af:commandMenuItem text="Expand
All2"/>
</af:menu>
/af:popup>
</f:facet>
custom menu to the existing set of menus
Frank
Similar Messages
-
Modifying default context menu of af:tree
Hi all,
this one is urgent..
I am having a af:tree component on a jspx web page.
I know that we can change the context menu (the box that pops out when right click happens on any of its node) by setting contextMenuId of the af:tree which points to a af:popup having af:menu. When we dont set contextMenuId; we get a default context menu displaying options to expand/collapse other nodes. When we set it to some af:popup component we get a different context menu.
My requirment is that instead of getting a new context menu, i must be adding up my new options to the already existing default options in the context menu. So its a kind of extension of default context menu available.
So can anybody help me.... i am a newbie so pls forgive me if i'm wrong somewhere..
Thanks a lot..Hi Frank,
thanks for the kind response..
Yeah, i had tried that out too. But in this case the context menu that i'm defining doesn't seem to be picked up by af:tree since i'm only able to see the default context menu of the browser.
This is strange since even the default context menu provided by af:tree doen't appear.
Do we need to do something else also for that...
By the way i assume that you were talking about contexMenu facet of af:tree only.
I am inlinning the jspx code snippet for convinient.
Can you please suggest something....
<af:panelFormLayout customizationId="panelFormLayout1">
<f:facet name="footer">
<af:group>
<af:commandButton text="commandButton 1"
customizationId="commandButton1"/>
<af:image source="http://www.google.com/intl/en_ALL/images/logo.gif"
shortDesc="THE logo" customizationId="image1"/>
<af:tree value="#{myBean.model}" var="model"
rowSelection="single" initiallyExpanded="true"
id="structureNavigatorTree" inlineStyle="padding:2px"
contentDelivery="immediate"
customizationId="amitKumarGupta">
<f:facet name="nodeStamp">
<af:panelGroupLayout>
<af:outputText value="#{model.name}"/>
</af:panelGroupLayout>
</f:facet>
<f:facet name="contextMenu">
<af:popup id="yesItsgeneral">
<af:menu id="fdssd" text="menu 1">
<af:commandMenuItem id="micrsfdg" text="Expand All2"/>
</af:menu>
</af:popup>
</f:facet>
</af:tree>
</af:group>
</f:facet>
</af:panelFormLayout>
</cust:panelCustomizable>
<f:facet name="editor">
<pe:pageEditorPanel/>
</f:facet>
</pe:pageCustomizable>
</af:form>
</af:document>
Hi,
turns out the solution is easy. Just use the context
menu facet, similar to below
<f:facet name="contextMenu">
<af:popup>
<af:menu text="menu 1">
<af:commandMenuItem text="Expand
All2"/>
</af:menu>
/af:popup>
</f:facet>
custom menu to the existing set of menus
Frank -
Modify Context Menu BI7.0
Hi,
I want to modify the context menu in the WAD, so that it includes SAVE rather than having this attached to a button.
I know I can modify the context menu in BW3.5 by using SAPBWAddToMenu and a combination of javascript and html.
I know in BI7.01 (EHP1) the option for SAVE, REFRESH etc is already in the context menu and it can be modified by using SAPbi_AddToMenu.
But in BI7.0, there is no help for modifying the context menu using javascript, this section doesn't exist.
We are currently on BI7.0 SP23, I have tried both SAPBWAddToMenu and SAPbi_AddToMenu, but both give errors in the webtemplate and the context menu does not work at all. It seems as though from BW3.5 to BI7.01 the option has been disabled.
Has anybody managed to modify the context menu of the WAD in BI7.0?
Thanks
DJLDid you have a look at this help-sap-com entry?
[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/e073a356e32972e10000000a42189b/frameset.htm]
Reading your answer again, I see that you refer to BI 7.00 without any EHP.
So you might want to try using your own context menu as per [http://help.sap.com/saphelp_nw70/helpdata/en/43/152fa54b315a38e10000000a422035/frameset.htm] .
Edited by: Frank Besler on Aug 10, 2011 11:08 AM -
Is it possible to configure the context menu in BEx 3.5?
What I want is to give the user the possibility to access Go-To reports but not e.g use the drill-down option.There isn't option to modify the context menu.
You can give only quey without free-characteristics and give only possibility of Report-to-report interface (query jump):
Regards,
Sergio -
Can I call flex to show a context menu from Javascript in a Flex mobile app?
I have started with actionscript and flex just 4 days ago. I need to create a mobile app that displays an external swf (do not have the source code) in an html page. When a user clicks on a point on the swf, a javascript function can be called. I want to use the Javascript function to call actionscript code to display a context menu showing - send SMS, send email etc.. Is this possible at all?
Please suggest any alternatives also.Thanks. I using StageWebView to display a local HTML file(file://). But while I tried adding ExternalInterface addCallBack code and tested in the emulator - got the following error
Main Thread (Suspended: Error: Error #2067: The ExternalInterface is not available in this container. ExternalInterface requires Internet Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other browsers that support NPRuntime.)
Does it mean ExternalInterface cannot be used in a Mobile project using StageWebView? -
How do I modify the file right-click context menu to add "creat shortcut"?
I have just chosen Mozilla as my browser and want to add shortcuts to files by using the right-click context menu, but there is no "create shortcut" choice displayed.
Could you describe where you're clicking, exactly? Are you clicking on a web page, or clicking a link on a web page? If you are using Firefox to browse files on your hard drive, you're probably better off using Windows Explorer to do that since Firefox doesn't have all the functions of Windows.
-
Hi!
The problem is:
When I'm in Windows Explorer in shared folder on network drive (SMB), trying to open context menu for any file in this folder, it will show and then disappear in ~1 second, so I can't have time to select item in context menu, especially in any sub-menu!
It only happens if:
1) some (another) file is downloading in that moment to THIS shared foolder
2) some (another) file is editing by another user in that moment, or some log is writing by some software in that folder,
or archive is unpacking in that folder
and so on..Hi,
I haven't heard others have this kind of issue.
Please remove that network drive completely, and then follow below guide to re-map it for test:
Connecting to a Samba Directory: Windows 8
https://oit-nb.rutgers.edu/documentation/remote-drive-mapping-samba/connecting-samba-directory-windows-8
Make sure the folder permission is the same as Windows XP.
Karen Hu
TechNet Community Support -
How to modify the list item drop down context menu in SharePoint 2010
Hi All,
I have a requirement to add my name in the list item drop down context menu, already "Assigned ticket" option is available in the context menu and some names are available in the assigned ticket option. but i can't able to add my name in this options.
Attached screenshot for reference. Thanks in advance for your assistance!
Thanks
Arun PrakashDo you know how the currently listed values got there in the first place? Some sort of custom code or action? Some background information would help. There is obviously a source feeding it from somewhere, but it's impossible for us to tell you exactly
what just by looking at your scribbled-over screenshot
Check WSPs that are deployed to the farm. Check for any non-OOTB site features that are turned on... -
Open iviews in new window from detailed navigation context menu function
hello,
when we click in the detail navigation menu and in the context menu (because many of ours users are used to right click to open a link in a new window on the internet) on the functionnality "open in new window", the start page is always display instead of the corresponding iview ...
could you tell me if there is a configuration into the portal to :
1- suppress the function "open in new window" from the context menu in the detailed navigation !
2- make the iview displayed into the new window really the iview desired !
best regards,
Olivier.Hi Olivier,
The frist part is very precise. Not possible. Period. The reason is that the links are calling JS and not directly calling a http target.
About the second part: Within the Light Framework, you create a Light Detailed Navigation. And in this case, the links are direct http links. So with that, you have what you want.
For the Light Framework see http://help.sap.com/saphelp_nwce10/helpdata/en/43/0174a642406db7e10000000a422035/frameset.htm and around.
Hope it helps
Detlev -
Why did Word on Office 2013 REMOVE Auto Correct from Right-Click Context Menu??
Hi Microsoft -
I normally don't rant, but this is a killer feature removal, and the reason given is for aesthetics - 'Removal of clutter" is how it's worded here:
[Changes in Office 2013]
http://technet.microsoft.com/en-us/library/cc178954(en-us).aspx
I copy n pasted below the operative row from the linked TechNet page as to the reason WHY this critical (and very popular feature) has been removed from Microsoft Office 2013 Word's context-menu: LESS CLUTTER
And your answer is ambiguous and doesn't solve the issue that you created to make things prettier: "Click the AutoCorrect Options button" Then what? ADD EACH WORD MANUALLY?
Please advise ALL OF US that want this feature back how to have our commonly misspelled words fixed and added automatically to the dictionary. If I am missing this in a major way somehow, I apologize completely and will issue a public apology via any
social media platform of your choice. If it really is gone, and I have to manually add the entries into a buried table 6-clicks deep, then I will issue a public excoriation of this feature on as many social platforms of my choice.
Sincerely,
Maximus Mednick
COPY N PASTE AS FOLLOWS:
=-=-=-=-=-=-=-=
Contents of spelling error context menu
Word and WordMail within Outlook
Modifying the feature
Auto-Correct and certain formatting tools are no longer available from the spelling error context menu.
To make Word 2013 cleaner and less cluttered, we removed AutoCorrect and certain formatting tools from the spelling error context menu. The features are still available in Word 2013 through other entry points within the Word user interface.
Less clutter in the spelling error context menu. This enables users to find popular commands more quickly. In addition, the spelling error context menu now fits better on the screen.
To change AutoCorrect options, do the following:
Choose File -> Options -> Proofing
Choose the AutoCorrect Options button.
=-=-=-=-=-=-=-=
Thanks, MAXIMUSMicrosoft used to be about allowing users to customize the OS and apps however they want. This was one reason I have always preferred Windows over Mac. There are 5 ways to do any one thing, and you can customize it to do it however you want. It's all about
user choice. Please don't go the way of Apple and force users into the way that you *think* we should do things.
<rant>
While I whole heartedly agree with this suggestion, if you look through this blog about the design decisions that went into the 2007 ribbon:
Jensen Harris: An Office User Interface Blog -
http://blogs.msdn.com/b/jensenh/archive/2008/03/12/table-of-contents.aspx
You'll see that one of the considerations of the ribbon was to ELIMINATE/REDUCE customization because it was costing large corporate customers too much time/money to support their users with 2003 customized menu/toolbars. In other words, the ribbon
was intentionally built as a fixed design so that average user cannot change it. The QAT was an afterthought, a sop, to allow users minimal customization.
They found that the 2007 lock down was too much of a "good thing", too much like the good old "IBM 360 green screen" (even if most people don't recognize the reference), so in 2010 they
re-introduced limited Ribbon customization within the UI.
But you still can't customize the default tabs. And to add injury to insult, if you do want to customize a default tab and go to the effort of trying to recreate the default tabs and groups
within the Ribbon UI, you'll eventually find that YOU CAN'T'! There is no way inside the UI to force the buttons to layout the same way! AHHH!
Even in 2007,
EXPERTS have had the option of creating custom Ribbons/tabs by editing XML, but that is pretty serious programming, out of scope for 99% of users.
The "solution" to the problem was too simple. Just add an option to allow users to turn on the old menu UI. Even if it had been buried as a registry hack, the people who really wanted it would have learned about it. Then MS could have collected statistics
on usage that would have "proved" that the menu was preferred over the ribbon. The thing is, if the ribbon was defaulted "out of the box", over time people would eventually all switch over to it. Simply because it was the default, because MS only produced
new training material referring for the ribbon
Now, I'll concede that the ribbon really may be more "intuitive", but only for new users. For long time users the change is very jarring.
They made the same choice with Windows 8. In the last Windows 8 consumer Preview there was a registry hack to bypass the Start Screen. I learned about it in July or August. But MS was so sure the Start screen/metro was the only way to go they
rushed out a Windows Update to eliminate that registry entry. And it was eliminated from the RTM version.
WHY?
Why did they remove the user's right to chose the UI that worked best for them? I don't know.
</end rant> sorry, this is a hot button for me. -
How do I create a context menu in the new CL_SALV
I like a function xx in context menu. How do I create a context menu in the CL_SALV ?
thank you!
CLASS lcl_event_handler DEFINITION.
PUBLIC SECTION.
TYPES: t_proc TYPE zmp_c00_pr_d,
tt_proc TYPE STANDARD TABLE OF t_proc,
tt_proces_subpr TYPE TABLE OF ltyp_proces_subpr.
CLASS-DATA: lr_context TYPE REF TO cl_gui_alv_grid,
r_selections TYPE REF TO cl_salv_selections,
lr_menu type ref to cl_ctmenu.
CLASS-METHODS: main CHANGING ct_zmp_c00_pr_d TYPE tt_proc
ct_proces_subpr TYPE tt_proces_subpr
cv_screen TYPE i.
PRIVATE SECTION.
CLASS-DATA lt_zmp_c00_pr_d TYPE TABLE OF zmp_c00_pr_d.
CLASS-DATA ls_process TYPE zmp_c00_pr_d.
CLASS-METHODS: handle_double_click
FOR EVENT double_click OF cl_salv_events_table
IMPORTING row column,
detail
IMPORTING l_objkey TYPE zmp_c00_pr_d-objkey.
ENDCLASS. "lcl_events DEFINITION
* CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
METHOD main.
DATA: lr_alv TYPE REF TO cl_salv_table,
lr_events TYPE REF TO cl_salv_events_table,
lr_columns TYPE REF TO cl_salv_columns,
lt_col_tab TYPE salv_t_column_ref.
FIELD-SYMBOLS <column> LIKE LINE OF lt_col_tab.
IF r_container IS INITIAL.
CREATE OBJECT r_container
EXPORTING
container_name = 'CONTAINER'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE i004(z_pm_tool).
ENDIF.
*Für Dynpro 1400
IF cv_screen = '1400'.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = IF_SALV_C_BOOL_SAP=>FALSE
r_container = r_container
IMPORTING
r_salv_table = r_alv
CHANGING
t_table = ct_proces_subpr.
CATCH cx_salv_msg .
ENDTRY.
TRY.
* zeige die Daten
r_alv->display( ).
IF sy-subrc NE 0.
MESSAGE i001(z_pm_tool).
ENDIF.
CATCH cx_salv_msg.
ENDTRY.
ENDIF.
* Für Dynpro 1100
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
* list_display = IF_SALV_C_BOOL_SAP=>FALSE
r_container = r_container
IMPORTING
r_salv_table = r_alv
CHANGING
t_table = ct_zmp_c00_pr_d .
CATCH cx_salv_msg .
ENDTRY.
TRY.
* zeige die Daten
r_alv->display( ).
IF sy-subrc NE 0.
MESSAGE i001(z_pm_tool).
ENDIF.
CATCH cx_salv_msg.
ENDTRY.
*Ereignisobjekt holen
lr_events = r_alv->get_event( ).
** get the SELECTIONS object
*r_selections = r_alv->get_selections( ).
* Interne-Tabelle füllen und an die Methode handle_double_click übergeben
LOOP AT ct_zmp_c00_pr_d INTO ls_process.
APPEND ls_process TO lt_zmp_c00_pr_d.
ENDLOOP.
* Zeiger auf Container für Kontexmenu
CREATE OBJECT lr_context
EXPORTING
i_parent = r_container.
DATA: lt_events TYPE cntl_simple_events.
CALL METHOD lr_context->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Interne-Tabelle füllen und an die Methode handle_double_click übergeben
LOOP AT ct_zmp_c00_pr_d INTO ls_process.
APPEND ls_process TO lt_zmp_c00_pr_d.
ENDLOOP.
* Event: Add Function
SET HANDLER: on_added_function FOR lr_events.
* Event: Kontexmenu
* SET HANDLER: on_context_menu_request FOR lr_context.
* Event: Doppelklick
SET HANDLER handle_double_click FOR lr_events.
* get the SELECTIONS object
r_selections = r_alv->get_selections( ).
* Einzelne Spalte holen
lr_columns = r_alv->get_columns( ).
* Doppelklick funktioniert nur auf das Feld OBJKEY
LOOP AT lt_col_tab ASSIGNING <column>.
<column>-r_column->set_output_length( 20 ).
IF <column>-columnname = 'OBJKEY'.
<column>-r_column->set_visible( 'X' ).
ELSE.
<column>-r_column->set_visible( ' ' ).
ENDIF.
ENDLOOP.
IF lt_col_tab IS NOT INITIAL AND sy-subrc <> 0.
MESSAGE i002(z_pm_tool).
ENDIF.
ENDIF.
ENDMETHOD. "main
METHOD handle_double_click.
FIELD-SYMBOLS <fs_zmp_c00_pr_d> TYPE zmp_c00_pr_d.
READ TABLE lt_zmp_c00_pr_d INDEX row ASSIGNING <fs_zmp_c00_pr_d>. " vor dem Changing Parameter der Klasse
* READ TABLE ct_zmp_c00_pr_d INDEX row ASSIGNING <fs_zmp_c00_pr_d>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF column = 'OBJKEY'.
lcl_event_handler=>detail( <fs_zmp_c00_pr_d>-zz_slotid_a ).
ENDIF.
ENDMETHOD. "handle_double_click
METHOD detail.
DATA: lr_alv TYPE REF TO cl_salv_table,
lt_alv_tab TYPE TABLE OF zmp_p00_sp_d.
* Subprozess holen
SELECT * FROM zmp_p00_sp_d INTO TABLE lt_alv_tab
WHERE objkey = l_objkey.
IF sy-subrc <> 0.
MESSAGE i003(z_pm_tool).
ENDIF.
TRY.
* Neu erzeugte Instanz für ALV-Tabellenobjekt holen
cl_salv_table=>factory( IMPORTING r_salv_table = lr_alv
CHANGING t_table = lt_alv_tab ).
* Ausgabe Fenster für SubScreens
lr_alv->set_screen_popup( start_column = 1
end_column = 130
start_line = 1
end_line = 10 ).
* Anzeige der Daten
lr_alv->display( ).
IF sy-subrc <> 0.
MESSAGE i001(z_pm_tool).
ENDIF.
CATCH cx_salv_msg.
ENDTRY.
ENDMETHOD. "detail
ENDCLASS."lcl_event_handler IMPLEMENTATION
Edited by: polaris1 on Dec 15, 2010 12:18 PMCan't read that jumble, but suggest you look at the excellent SALV tutorials by Rich Heilman by searching for SALV tutorial on SCN. You'll find working code and how-to for adding your own functions to SALV.
-
"Save link as" in Right-click Context menu is not working properly.
Firefox 17: In a Google search, when I right click on a .pdf link, the popup window automatically gives a "url" filename and "Firefox Document" as filetype. Previously, the filename would be whatever it was on the website (ie. "filename.pdf") and the filetype would be "Adobe Acrobat Document".
I know this problem has less to do with Firefox and more to do with JavaScript, because the problem disappears if you disable JavaScript (Tools -- Options -- Content -- uncheck "Enable JavaScript"). What's happening is that JavaScript is somehow altering the link from a purely .pdf link to something else -- perhaps encasing the link inside a set of commands, and the computer is trying to save the command string instead of recognizing the link for what it is. When JavaScript is disabled in Google searches, the highlighted "[PDF]" link no longer appears in front of the link itself, and the "Save link as" function on the right-click works properly.
Any JavaScript junkies want to try their hand at creating a workaround? One that ensures that the reference created by the right-click context menu matches exactly what the filename is for the website?The problem is that Google has an onmousedown attribute added to the links that modify a link if you click or right-click a result link to make the link point to a safe browsing check on the Google server.<br />
You can see that if you hover a link and you will notice that after you have (right) click a link the the URL changes to www.google.com/url?xxxxx.
You can use this bookmarklet to remove the onmousedown attributes.
<pre><nowiki>javascript:(function(){var e=document.querySelectorAll('*[id="search"] a[onmousedown]'),E,i;for(i=0;E=e[i];i++){E.removeAttribute('onmousedown')}})()</nowiki></pre> -
Creation of Custom context menu in CL_GUI_TEXTEDIT
Hello all,
I need to develop a custom context menu in the Text Editor.
I am using the <b>CONTEXT_MENU</b> event of the class
<b>CL_GUI_TEXTEDIT </b>for the same.
It is giving a short dump with an exception 'empty_obj' in the method
<b>CL_CTXMNU_MGR=>CREATE_PROXY</b>.
Please help.Hello Tejas
The following sample report ZUS_SDN_TEXTEDIT_CTXMENU shows how to trigger context menus in text editor. Please note that the editor must be set <b>enabled</b>.
If you inactivate subroutine <b>SET_REGISTERED_EVENTS</b> the new context menu function will no be displayed. Thus you need to <b>register</b> the event for context menu handling.
*& Report ZUS_SDN_TEXTEDIT_CTXMENU
*& Flow logic of screen 100.
* PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
* PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
REPORT ZUS_SDN_TEXTEDIT_CTXMENU.
TYPE-POOLS: cntl. " Types for Controls
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_textedit TYPE REF TO cl_gui_textedit,
gd_name TYPE thead-tdname,
gs_header TYPE thead,
gd_langu TYPE thead-tdspras,
gt_lines TYPE STANDARD TABLE OF tline.
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_context_menu
FOR EVENT context_menu OF cl_gui_textedit
IMPORTING
menu
sender,
handle_ctxmenu_selected
FOR EVENT context_menu_selected OF cl_gui_textedit
IMPORTING
fcode
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_context_menu.
CALL METHOD menu->add_function
EXPORTING
fcode = 'MY_FUNC'
text = 'My Function'
* ICON =
* FTYPE =
* DISABLED =
* HIDDEN =
* CHECKED =
* ACCELERATOR =
ENDMETHOD. "handle_context_menu
METHOD handle_ctxmenu_selected.
CASE fcode.
WHEN 'MY_FUNC'.
MESSAGE 'My function selected from ctxmenu' TYPE 'I'.
WHEN OTHERS.
ENDCASE.
ENDMETHOD. "handle_ctxmenu_selected
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
PARAMETERS:
p_pspnr TYPE prps-pspnr.
START-OF-SELECTION.
* Get the text object
gs_header-tdid = 'LTXT'. " long text
gs_header-tdspras = syst-langu.
CONCATENATE syst-langu p_pspnr
INTO gs_header-tdname.
gs_header-tdobject = 'PMS'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = gs_header-tdid
language = gs_header-tdspras
name = gs_header-tdname
object = gs_header-tdobject
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
lines = gt_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL SCREEN '0100'.
END-OF-SELECTION.
*& Form SET_REGISTERED_EVENTS
* text
* --> p1 text
* <-- p2 text
FORM
set_registered_events .
* define local data
DATA:
lt_events TYPE cntl_simple_events,
ls_event TYPE cntl_simple_event.
TYPES: BEGIN OF cntl_simple_event,
eventid TYPE i,
appl_event TYPE c,
END OF cntl_simple_event.
ls_event-eventid = cl_gui_textedit=>event_context_menu.
APPEND ls_event TO lt_events.
ls_event-eventid = cl_gui_textedit=>event_context_menu_selected.
APPEND ls_event TO lt_events.
CALL METHOD go_textedit->set_registered_events
EXPORTING
events = lt_events
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
illegal_event_combination = 3
OTHERS = 4.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " SET_REGISTERED_EVENTS
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MAIN_0100'.
* SET TITLEBAR 'xxx'.
CLEAR: gd_okcode.
IF ( go_textedit IS NOT BOUND ).
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
* REPID =
* DYNNR =
* SIDE = DOCK_AT_LEFT
* EXTENSION = 50
* STYLE =
* LIFETIME = lifetime_default
* CAPTION =
* METRIC = 0
ratio = 90
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT go_textedit
EXPORTING
* MAX_NUMBER_CHARS =
* STYLE = 0
wordwrap_mode =
c_textedit_control=>wordwrap_at_windowborder
* WORDWRAP_POSITION =
wordwrap_to_linebreak_mode =
c_textedit_control=>true
* FILEDROP_MODE = DROPFILE_EVENT_OFF
parent = go_docking
* LIFETIME =
* NAME =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD go_textedit->set_text_as_r3table
EXPORTING
table = gt_lines
EXCEPTIONS
error_dp = 1
error_dp_create = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD go_textedit->set_enable
EXPORTING
enable = cl_gui_cfw=>true
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
PERFORM set_registered_events.
SET HANDLER:
lcl_eventhandler=>handle_context_menu FOR go_textedit,
lcl_eventhandler=>handle_ctxmenu_selected FOR go_textedit.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'EXIT' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
Regards
Uwe -
Update for RDP 8.1 Windows 7 SP1 changed explorer right click context menu
I have a 4 pcs and 3 nas drive on my network. previous to the update I could view my pcs and nas drives in explorers right pane left click one and access the folders on it. since the update I can no longer do this because "remotedesktopconnection"
has been added as the default (previously it was "open") to the right click context menu. can someone help me change this back so when I right click a network computer icon in explorer I only see:
open
AND NOT remotedesktop
open in a new window open
create shortcut open
in a new window
create
shortcut
the exact update that makes the change is: kb2592687Hi
Theoretically it could be done by modify registry. For example you could
modify right click menu on .exe file by changing values under
HKEY_CLASSES_ROOT\exefile\shellex\
However there are some problems that I cannot define that what kind of “file”
the network computer is.
And I found no article specific to this.
If you really need to restore your context menu and also need this update, I
suggest you uninstall this update first. Then back up your registry, install it
again. This time using process monitor you could record all registry modifications during
this update installation. It might take lots of work.
I tried to do that for you, unfortunately this update has been deployed in our environment which cannot be uninstalled from update history.
For more information about process monitor
https://technet.microsoft.com/en-us/library/bb896645.aspx?f=255&MSPPError=-2147217396
Regards
D. Wu
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
[TUTORIAL] Context Menu to export EML files
Hello there folks!
I'm pretty new to the topic of C3PO, GW and all the Novell stuff and one of my tasks was to "code an export mechanism for GW8 thats lats us save e-mails to our storage system". Ok, that was a hammer. But wrapping my head around it and starting to error out the things got me pretty far and I guessed it was tutorial material. So here we go:
@Moderators: This is the thread that has everything in it. the other one can be deleted.
This tutorial is intendend for C# only. I don't like VB and I'm too dumb for C++ so if you need it for another dialect you need to work it out your self.
Agenda:
Needed packages
C3PO wizard
Loading to Visual Studio 2010
Needed Imports/References
Simple MessageBoxing
Export Code
Registering and caching the .DLL
Testing (please help me with a better way here)
1. Needed packages
the novell-gwc3po-devel-2012.11.15.zip file (unzip this after downloading)
an installed version of Visual Studio 2012 C# (or if you want to work with a different dialect choose another)
cmd access to some of the registering tools:
It may be the best thing to set tose paths up in you env variables. Allthough when running the cmd with administrator privileges you can't use regasm from env variables and need to cd to the directory.
RegAsm (regasm.exe): C:\Windows\Microsoft.NET\Framework\v4.0.30319 (the version depends on the target)
GACUtil (gacutil.exe): C:\Program Files(x86)\Micrsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\ (this path is also dependent on your target framework version, I chose .NET4)
StrongName (sn.exe): C:\Program Files(x86)\Micrsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\ (this path is also dependent on your target framework version, I chose .NET4)
a good beverage :D (you should obtain multiple of these :D)
2. The C3PO wizard
In my case I wanted to add the functionality via the context menu. So the code executes when right-clicking on one or multiple messages displays another menu item and is clickable.
This is pretty easy to realize via the C3PO wizard. You'll find it in the downloaded and extracted novell-gwc3po-devel-2012.11.15.zip from above. Start it (it is located in extracted-zip-folder/gwc3po-FILES/C3POWizard/C3POWizard.exe) and setup your project:
Setup the project in the wizard step 1
I usually setup the Wizard inside my Visual Studio 2010 projects folder, create a new folder there with the name of the project and check the options i want to have.
In the next step I chose which type of View should display my custom context menu. Since I was only interested in exporting and working with e-mails I chose "GW.MESSAGE.MAIL" and added it to the bottom list via, you guessed it, "Add".
Setup theView that invokes the new context menu item
In the next step you I had to setup a new entry for the context menu. You could make side-droppable menus here etc. But for me a simple "Add Menu" was enough. Give it a name of your choice (beware: I'm yet to find out where to change this setting in the source files).
Creating a Menu Item in step 3
Click through next and the wizard will sum up you choices. In the next dialog window you will be prompted to specify the language you want the code to be generated. I chose .NET C#.
In the prompt after that you will be asked if the wizard should create a .DLL-project. You click yes.
Quit the wizard with the "Done" button.
3. Loading to Visual Studio 2010
Open up your Visual Studio and go to File -> Open Project. Navigate to the folder where you just created the files with the C3PO-Wizard. and open up the .csproj file.
All the files get loaded and it seems quite well. but now it's time for some other stuff: Signing, or better, providing a key for signing.
Allthough the README.txt (also in your project folder) states this is not neccessarily needed I did not get it to work without a key file.
Open up a terminal and tpye in sn /? to see if the environment variables work. If not you can yuse the abolute path to sn (see: 1: Needed packages). If everything works as expected you can generate your keyfile with sn -k <PathToYourProject>\Archive.snk.
In Visual Studio, go to Project -> <ProjectName>-Properties -> Signing -> Sign assembly [x] -> Search and pick the .snk-file you just created.
Good. A first compilation of the project with F6 should rumble through without problems. Go to <ProjectFolder>\bin\Release and copy the .dll files to <GroupWiseInstallPath>.
After that you need to open a cmd windows as administrator and cd to the RegAsm.exe directory and execute the following: [I]regasm "<GroupWiseInstallPath>\<TheDllName>.dll". Then execute gacutil -i "<GroupWiseInstallPath>\<TheDllName>.dll".
RegAsm will register the extension to the Windows registry and GACUtil will cache the .dll content to make it available to GroupWise.
You need to re-cache the .dll everytime you compile in VS. So basically the workflow is Compile -> Copy dll to GroupWise directory -> re-cache with gacutil -i -> Start Groupwise
I have not found a method to post-build execute a script that does that. Problem is the copying and the gacutil caching (both must be done as administrator).
IIf everything worked you see a new entry in the context menu when right-clicking a mail in Groupwise. When you click it, there will appear a message box.
The MessageBox is defined in GWCommand.cs L. ~125
4. Needed Imports/References
Since we got the skeleton to compile and function properly, it's time to get our own code in there. FOr rapid prototyping I do all the stuff in GWCommand.cs.
Go to Project -> add Reference -> COM and select "C3POTypeLibrary", "GroupWareTypeLibrary, "GroupWiseCommander", "GroupWiseConnectorLibrary" and click OK. The selected entries now appear in the project explorer.
5. Simple MessageBoxing
A thing I like to do (because I'm not a very good programmer) is to get all sorts of infos to get displayed with
Code:
MessageBox.Show();
Just fling it in the code and see what get's where etc. An important thing is allready in the comments of the file.
It is this line:
Code:
C3POTypeLibrary.IGWClientState6 myCL = (C3POTypeLibrary.IGWClientState6)WIASSArchivButton.g_C3POManager.ClientState;
. Uncomment it and play around with the myCL-object in your code.
The myCL has some properties we will use later on such as myCL.SelectedMessages which is exactly what we need for our archive functionality.
6. Export Code
Now we get to the code:
With the
Code:
ClientState
dug up in the code we can pass the
Code:
SelectedMessages
into a
Code:
MessageList
. Over this MessageList we will iterate and save each
Code:
Message
with the so called
Code:
GroupWiseCommander
to our disk. well that sounds simple. And, well after digging through a lot of threads here on the forum and the documentation, it is.
Here is the Execute() method from GWCommand.cs:
It has comments that should serve as a documentation.
Code:
public void Execute()
try
switch (m_PersistentID)
case WIASSArchivButton.vWIASS:
//C3PO WIZARD Put execute command code here for WIASS Context menu.
/* this was in the comments and is essential!
* the myCL object provides us everything we need to interact with the messages */
C3POTypeLibrary.IGWClientState6 myCL = (C3POTypeLibrary.IGWClientState6)WIASSArchivButton.g_C3POManager.ClientState;
// get the selected messages
object o = myCL.SelectedMessages;
// and convert the SelectedMessages to a MessagesList
MessageList ml = (MessageList)o;
// iterate over all the selected Messages
// this was tricky: the index of the MessageList starts by 1 and not at 0
for (int i = 1; i <= ml.Count; i++)
// the .Item() method expects either a string or a long
// see http://www.novell.com/documentation/developer/groupwise_sdk/gwsdk_gwobjapi/data/h20s5bdo.html
long index = (long)i;
// instantiate a Message object to get access to the different properties like subject, sender etc
GroupwareTypeLibrary.Message oMessage = (GroupwareTypeLibrary.Message)ml.Item(index);
// instantiate a GroupWiseCommander
// this is the interface to the TOKEN API
// TOKENS: https://www.novell.com/developer/documentation/gwtoken/index.html
GroupWiseCommander.GWCommander cmdr = new GroupWiseCommander.GWCommander();
// the GWCommander has an Execute() method that is able to take certain tokens kind of like SQL
// lets build the token (the complete list is huge and awesome) to save our Messages
// ItemSaveMessage(): https://www.novell.com/developer/documentation/gwtoken/gwtokens/data/hbt0bd7x.html
string tokenCommand = "ItemSaveMessage(\"" + oMessage.MessageID + "\"; \"C:\\archiv\\" + oMessage.MessageID + ".eml\"; 900)";
/* what happens here ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ is that we build us a TOKEN command that the
* GWCommander is able to execute.
* the actual command is ItemSaveMassge()
* everything between the semi-colons are the parameters:
* \"" + oMessage.MessageID + "\" : builds an ANSISTRING of the MessageID which we get from the oMessage onject
* \"C:\\archiv\\" + oMessage.MessageID + ".eml\" : build an ANSISTRING of the output filename
* 900 is the type we want to export. 900 stands for Mime
* CAUTION:In this example I use C:\archive\ as the destination folder. It must exist and be writable to the program
// now that we have setup our command we can get it executed by the commander
// the result is sort of a callback variable
string result ="";
cmdr.Execute(tokenCommand, out result);
/* here can the error handling be done with the result string
break;
default:
MessageBox.Show("Unsupported Case", "Error", MessageBoxButtons.OK);
break;
//A way to get the GroupWise client state with newest interface
//C3POTypeLibrary.IGWClientState6 myCL = (C3POTypeLibrary.IGWClientState6)WIASSArchivButton.g_C3POManager.ClientState;
//uncomment the code below to unblock the base command
//IGWCommand baseCmd = (IGWCommand)WIASSArchivButton.g_C3POManager.CreateGWCommand(m_objBaseCmd);
//baseCmd.Execute();
catch (Exception e)
MessageBox.Show("Error Executing GWCommand: " + m_PersistentID.ToString() + " Error: " + e.Message);
return;
7. Registering and caching the .DLL
After that you need to open a cmd windows as administrator and cd to the RegAsm.exe directory and execute the following: regasm "<GroupWiseInstallPath>\<TheDllName>.dll". Then execute gacutil -i "<GroupWiseInstallPath>\<TheDllName>.dll".
RegAsm will register the extension to the Windows registry and GACUtil will cache the .dll content to make it available to GroupWise.
You need to re-cache the .dll everytime you compile in VS. So basically the workflow is Compile -> Copy dll to GroupWise directory -> re-cache with gacutil -i -> Start Groupwise
8. Testing (please help me with a better way here)
Is there a good way to hook every thing up together to jsut stay in VS , compile, files get copied, registered, cached and GW starts?
Thanks for reading!
I wrote this up to have a documentation for myself and others. please let em know if you need help or anything is missing or not clear. It's certainly not a total noob guide and I expect a bit of knowledge to be honest.
Regards
SebastianOriginally Posted by Username951
Multiple email selection should be possible, but only those emails that are fitting some requirements should be stored finally in database.
One requirement is for example that a keyword like "ISSUE" appears in the email subject
(followed by a ":", a "space" and some characters that can be converted to an integer value),
multiple, leading "Fwd: " and/or "Re: " should be handled well,
subject should be handled case-in-sensitive.
This sounds like you should implement some sort of SelectedMessagesValidator class just to keep it clean.
Originally Posted by Username951
So here are my find outs, remarks, etc.:
1.) Visual Studio should be started under admin. rights.
Then you can write a post-build event (batch) that copies, "regasm"s and "gacutil"s everything.
As said this works fine for me.
But note that unfortunately the paths to "regasm" and "gacutil" changed
(compared to the time where you wrote your tutorial).
Definitely. That way, as you mentioned, the post build scripts integrate very well.
Originally Posted by Username951
2.) The "Novell C3PO" wizard was downloaded and worked out as described in our tutorial.
One important step was to use "GW.MESSAGE.MAIL" and not "...BROWSER..." or something else.
I can not figure out, where you have the GW.BROWSER thing from, but in my examples I allways used GW.MESSAGES.MAIL
Originally Posted by Username951
The wizard created finally the basic C# (.NET framework 2.0) project.
This project was loaded in Visual Studio 2013, automatically converted to "newest version"
and finally was a ".sln" made.
Yes. You can leave it at 2.0. I just have the 4.5 installed so i will target this version
Originally Posted by Username951
"oracle.dataaccess"
-> Note that the "Copy Local" property must be set to "true"!
(This property will be reset to "false" after a successful (re)build.
So check this and change it to "true" for the first build!
This must be made only once because after a successful build is this .dll known;
keywords: GAC -> cached
But note that "successful" means also that the post-build event ran flawless!)
This is quite specific to your case since my example on exports a flat EML file to the hard drive
Originally Posted by Username951
2.) regasm.exe needs strong names.
So a "cmd" with admin. right was opened,
a
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\sn.exe" -k "C:\Users\<username>\Documents\Visual Studio 2013\Projects\GWSaveToDatabase\GWSaveToDatabase.sn k"
fired
and the created "GWSaveToDatabase.snk" file added to the solution.
I don't want to be picky, but it's gacutil that needs the strong names. ragasm is not complaining
Originally Posted by Username951
(Development) Remarks
1.) While I used the "C3PO" wizard first time I used "Add Menu" item - as you said in your tutorial! :-(
And that is definitely wrong!
See:
The result was a C# project that does not show any new context menu entry.
So I tried at the next wizard run "Add Menu Item".
The wizard created again a C# project but still no new context menu entry in the GroupWise client.
(And that after all needed steps
like
copy to GroupWise installation path,
regasm and gacutil over all .dlls
etc.
were successful be made).
It took a complete day to get the idea to "merge" the two wizard created projects!
Why merging?
Because the second project contained a "const" which were used in the switch statement of the "Execute()" method
(with the same meaning like your "WIASSArchivButton.vWIASS" - see your code snippet above!)
and the "CustomizeContextMenu(...)" method in "CommandFactory.cs" looked also different
while the first project does not contained something similar.
( For example:
The "CustomizeContextMenu(...)" method had more statements.
And that made more sense to me compared to the first wizeard created C# project.
Since I uploaded a better example this is obsolete.
Originally Posted by Username951
So I ASSUME that the second project would work but it does not because of regasm / gacutil behaviour.
Means I believe it would work when all
with regasm registered
and
with gacutil to the cache added "things"
would be "un-registerd" and "un-cached".
This is, as I assume, due to the Interop.C3POTypeLibrary.dll. This must me cached every time the project is build. maybe you could use gacutil -i Interop.C3POTypeLibrary.dll -f to force the recaching
Originally Posted by Username951
So, finally I took the second, wizard created C# project and copied the "const", adjusted the "Execute()"
and "CustomizeContextMenu(...)" methods, etc.
After that the context menu were shown in the GroupWise client!
Thats is correct. But I never had to do this. The thing is, that the "Add Menu Item" is giving you the opputunity to specify a command, which the "Add Menu" doesn't.
Originally Posted by Username951
2.) The next issue was that the context menu was added as often as many emails were selected.
Means: For example: Three selected emails ends up in three time added context menu.
Solution:
Checking
var existsAlready = menuItems.Item("...");
if (existsAlready != null)
return;
in "CustomizeContextMenu(...)" method and leaving the method under shown circumstances.
I added a fix for this in the second post, but it isn't working in GW2012 anymore. I have a very ubly fix for that in my new code.
Originally Posted by Username951
3.) The by the wizard created registry path contained the version number "5.0".
This may confuse but it is finally ok. No need to change here anything!
On the other side:
It will NOT work when the registry entry
"SOFTWARE\\Novell\\GroupWise\\5.0\\C3PO\\DataTypes \\...."
will be changed/"adjusted to that GroupWise client version you are currently using"!
This is all part of the official documentation and wasn't touched by Novell since quite a long time.
I think i will make a github repository in the futer as a proof of concept and kind of a accessable documentation for everyone.
Maybe you are looking for
-
Syncing iWork with 2 accounts?
Hi everyone! Thanks in advance for the help! Here is my problem- I have two Apple ID's. One of these I have always used, and have a bunch of things stored. The other ID, is my school ID. We got iPad's at our school, and the state gave us Apple ID's.
-
AirPort Problems [I know posted already, but read]
hey guys, These AirPort problems are really really getting on people's nerves. 10.5.1 was perfect for most, and now after updating to .2, us .1 100% connection, the connection drops every couple of minutes. I'm on a Macbook 2.2 (White), and so I have
-
I cant open my itunes iphone 5s
On my ipone 5s my itunes isn't opening. I've tried shutting it down but it dosent work.when I I press the app down it opens for 5 sec then crashes!
-
Clearing/Canceling a FPM event
Hello all, I have a class attribute that is a flag. What I am trying to do is stop/clear/kill/cancel all events that are called while the flag is still set. I am currently looking into FPM_OVERRIDE_EVENT_OIF of the CL_LO_OIF_MODEL class, but stil
-
Opening existing photographs or .jpg files
When I try and open some of my .jpg files, photoshop wants to create a new file. Its New file window opens. I can open and view these files in a different photo editor. I am not sure whats going on. Can someone please help me??