How can I launch the Lightning-"create Event"-Dialog with given Date and Time - xul

I would like to open the thunderbrid-lightning-create event dialog with a given date and time.
Currently I have:
window.open("chrome://calendar/content/calendar-event-dialog.xul",
"xulschoolhello-some-window",
"chrome,centerscreen")
Which opens the Dialog as expected. How can I set now the Date and Time?

Check out the openEventDialog function, which also defines some window arguments down in line 434 if you want to do it manually.
/**
* Opens the event dialog with the given item (task OR event)
*
* #param calendarItem The item to open the dialog with
* #param calendar The calendar to open the dialog with.
* #param mode The operation the dialog should do ("new", "modify")
* #param callback The callback to call when the dialog has completed.
* #param job (optional) The job object for the modification.
* #param initialDate (optional) The initial date for new task datepickers
*/
function openEventDialog(calendarItem, calendar, mode, callback, job, initialDate)
You can call this function directly on the window object of the main Thunderbird window. This could for example be done by adding a XUL overlay to the window that has a script block that eventually calls this function.

Related

Window action without having so select any record

First and for reference, what I call a window action is an action on the top of a tree view.
Example below:
Problem: if I select no record, Odoo tells me that I have to select record.
Question: I would like the action to be called even if there is no record selected: Is that possible?
Example: the action for instance will start a popup wizard, if a selection of record is done this selection will be preloaded, if no record is selected I will process myself the data preloaded.
The following context in the window action will allow it to be triggered even if no record is selected:
context="{'sidebar_without_id':True}"
Instead of Action menu you can put your own button inside control panel (e.g. beside create,import button)

Close pop-up window after row selecting

I created a TableView with some data from database table. This view opens in a pop-up window.
When I select any row from the pop-up, my selected value is saved into some global variable.
How can I close the pop-up window after the row is selected? How to redirect to the view from where the pop-up was triggered?
Make this:
Create on_close event and put its name into lc_close var
Assign it to your table view click and to popup like this
<htmlb:tableView>
....
onRowSelection = "ON_CLOSE" >
</htmlb:tableView>
gr_pop_up->set_on_close_event( iv_event_name = lc_close iv_view = me ).
gr_pop_up->open( ).
Make in popup outbound plug named EXIT
Fire this plug inside itself recursively
method OP_EXIT.
me->fire_outbound_plug( iv_outbound_plug = 'EXIT' ).
endmethod.
This will close your popup.
You can save your value in a data base table or in a Singelton-Object.
What type of pop-up are you using? POPUP_TO_CONFIRM? Or a DynPro?
If it's the Function Module POPUP_TO_CONFIRM then just implement your logic based on a if statement checking the attribute "answer" of the FM.
If it's a DynPro then you need to add logic on the closing event. In a PAI Module.

IntelliJ IDEA code completion popup does not appear on Ctrl+Space after entering few arguments of method

Suppose I have a method:
addUser(String userid, String email, String phoneNo){..}
When I write only two arguments addUser("martin","asd#gmail.com" and press Ctrl+Space then IntelliJ IDEA does not show the arguments that are accepted by this method.
Instead I need to remove them and type api. Ctrl+Space.
Code completion is supposed to work differently, once you choose addUser from the popup, you will have something like this:
Type the parameter values and press Enter to switch to the next one.
Parameter info can be shown automatically:
or manually on Ctrl+P (View | Show Parameter Info):
Code completion popup will appear after typing , next to the second parameter and pressing Ctrl+Space.

Event for back button after AT LINE SELECTION in ABAP list report?

I have a list report that uses the event block AT LINE SELECTION (and HIDE).
AT LINE-SELECTION.
WRITE: 'Testline'.
* and some more things
When I double click on a line in the main list, AT LINE SELECTION is processed, and the main list is replaced with a list that consists of the text 'Testline'.
When I klick on the green back button, the main list is shown again.
Everything works as espected.
Now to my question:
Is there some way how the report can be notified when the user clicks on the green back button to go from the detail list to the main list?
The obvious solution AT USER-COMMAND is not called.
This is the event where I want to SUBMIT the same report again to update the list.
(I know I could do this with an ALV report, but is this possible with a simple list report?)
When you check the documentation you will find the following information:
The function codes PICK and PF## ("##" stands for 01 to 24) do not cause the event AT USER-COMMAND, but the events AT LINE-SELECTION and AT PF##.
All function codes that start with the character "%" are interpreted as system functions and do not cause the event AT USER-COMMAND. The system functions for lists are listed in the following table 1.
The function codes in the following table 2, likewise, do not cause the event AT USER-COMMAND, but are handled by the list processor.
table 2 includes BACK (that's the default code for the green arrow).
What you can do: Write your own status.
REPORT ytest.
DATA pf_exclude TYPE TABLE OF sy-ucomm WITH HEADER LINE.
START-OF-SELECTION.
SET PF-STATUS 'LIST'. "<--- here
WRITE: / 'Hello World'.
AT LINE-SELECTION.
WRITE: 'Testline'.
* and some more things
AT USER-COMMAND.
BREAK-POINT.
CASE sy-ucomm.
WHEN 'MYBACK'.
ENDCASE.
Now you can define your own status:
Don't forget to define PICK - or the double click will not work.
Define your own back-function.

Save a user popup selection in a custom Automator Action

Using Xcode 5.* for a cocoa-applescript automator action.
Interface is a a simple popup menu that gets populated using an outlet with:
tell thePopupMenu to removeAllItems()
tell thePopupMenu to addItemsWithTitles_(theList)
When the action is used in a workflow (a Service actually), I want the next time it is run and the action dialog shows up (I will have "Options:Show when run" selected), I want the popup menu to change the selection to the last one that was selected. Right now, the default first item shows, even though last time it was run, the user selected a different item in the popup menu.
My thought was that I need to capture a change in the popup menu with a Sent Action handler, and then set some type of default. I have a working handler:
on thePopupMenuSentAction_(sender)
set popupValue to (popupSelectedValue of my parameters()) as string
-- save this selection somewhere???
end
What's the right way to save this? Do I use User Defaults? My Bindings are currenly all tied through Parameter object/controller. If I should use User Defaults, can someone give example code for setting up User Defaults, and then how to get and set a new value using Cocoa-Applescript?
If I can get the name string of the menu item saved somewhere, I can get the string and then change the selection of the popup menu in the
on opened {}
-- set up the action interface
end
handler which gets called just before the action is displayed each time.
Thanks for any help,
Joe
I did mine a bit differently. I will assume you are referring to what XCode calls a "pop up button" (somewhat misleading). I did not use the parameters at all, although that is probably better for larger projects. Have a look at the code:
script Insert_Picture_into_Powerpoint_Slide_Show
property parent : class "AMBundleAction"
property menuChoices : {"Insert a Beginning", "Insert at End"}
property menuSelection : missing value
if (menuSelection as string) is "missing value"
set menuSelection to 0 as integer -- sets default value
end if
end script
I bound Content Values to File's Owner and under Model Key Path I put menuChoices.
Then you just bind the Selected Index to File's Owner and for the Model Key Path type menuSelection.
Defaults
On the initial run, if the user does not click anything, the menuSelection will be missing value. Because I couldn't find a way around this, I created a conditional which tests for this and sets it to the first choice by default (the one that is shown when you add the action).
When the user selections one of the menu choices, the choice is remembered on sequential runs.