Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Preconfigurations Time interval inputbox

The window contains input box for time interval (time from - to).
 
This preconfiguration can be activated when creating a new object (e.g. by "New object" in the local object menu or by pressing the Insert key after selecting the object) and is included in the group: " / Panels (PmPanel) / Date and time inputbox".

This preconfiguration can be used with the objects: PmFolder, PmRoot, PmPanel or PmWorkspace.

 
- Preconfiguration creates an object of type PmPanel.
- The preconfiguration is created including the panel (PmPanel object) functionality as a WEB panel.
 
The OpenView method with entry parameter oExtra can be used to open the panel. See How to work with modal windows.

The arrow buttons (of the PmiButton type) in the onButtonUp event allow changes in time input item (PmiWEdit).

In the onPanelStartEnd event, the input values of the argument are are read into the corresponding PmiWEdit items. In the onPanelStopEnd event, the PmiWEdit values are joined into a variable. The variable is then returned back to the object that called the OpenView method.

These configurators can be set before the preconfiguration is created:
The name of created objectName of the object created in the application object tree. This is a system name and must not contain empty string, diacritics, spaces and the first character must not be a number.

Default: "SetTimeFromTo"

PermissionsOn this page permissions of the object are defined. See Description of the page Permissions.
Enable as WEB componentIt indicates if this object has to be registered as a WEB server component

After this preconfiguration is created, the configurator is se to: PmPanel > Web Server > Enable as WEB component.

Example:
The entry values of the array (time t1, t2) will be displayed in the graphic items of the window. The edited values will be returned into the aVal variable.
-------------------------
An example in VBScript syntax:
Opening the preconfigured window in the panel using the onButtonUp event of the PmiButton graphic item.
Dim oExtra, aTime, t1, t2
t1 = Time
t2 = TimeSerial(Hour(Time) + 1, 0, 0)
aTime = Array(t1,t2)
Set oExtra = Pm.CreatePmMap()
oExtra.mapSetValueAt "Arguments", aTime
oExtra.mapSetValueAt "onClose", Pm.CreatePmAction(1, pMe, "ClosePanel")
pMe.PmPanel.OpenView "/SetTimeFromTo", "target:_blank;modal:1;", "", oExtra
Obtaining returned value of the ClosePanel user method with parameters oSystem and oPrivate of this graphic item.
Dim aVal
aVal = oSystem.ReturnValue
If Pm.IsValid(aVal) Then
  Pm.Debug "time1=" & aVal(0)
  Pm.Debug "time2=" & aVal(1)
End If
-------------------------
An example in JavaScript syntax:
Opening the preconfigured window in the panel using the onButtonUp event of the PmiButton graphic item.
t2.SetHour(t2.GetHour() + 1, t2.GetMinute(), t2.GetSecond());
aTime.SetItem(t1.GetValue(), 0);
aTime.SetItem(t2.GetValue(), 1);
var oExtra = Pm.CreatePmMap();
oExtra.onClose = Pm.CreatePmAction(1, pMe, "ClosePanel");
pMe.PmPanel.OpenView("/SetTimeFromTo", "target:_blank;modal:1;", "", oExtra);
Obtaining returned value of the ClosePanel user method with parameters oSystem and oPrivate of this graphic item.
var aVal = oSystem.ReturnValue;
if(Pm.IsValid(aVal))
{
  Pm.Debug("time1=" + aVal.GetItem(0).Format("%H:%M:%S"));
  Pm.Debug("time2=" + aVal.GetItem(1).Format("%H:%M:%S"));
}
 
This preconfiguration is used in PreCfg - Preconfiguration examples.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice