Code Sample
Xperience
>
API Reference
>
AppData
>
Code Sample
SoapAction | n/a |
Input Name | AppData |
Output Name | AppDataResponse |
Input Namespace | n/a |
Group Name | Xperience |
Container | XP_MsgBus.xsd |
AppData.cs
// Allows the application to change the title bar and status bar strings.
// The request can be made by any application including itself.
// If AppId is blank, changes will be applied to the requesting application window's tab.
// If AppId is supplied and exists, the changes will be applied to that application's tab.
// If WinId is blank, the changes will be applied to the main application window's tab.
// If WinId is supplied and exists, the changes will be applied to that child window.
// The requested WinId must be a child or the main window of the AppId.
// If both the ‘TitlebarVectorImgCode’ and ‘TitlebarIcon’ are supplied, the vector image
// will be shown.
// The ‘TitlebarVectorImgCode’ must be a valid code based on the JHAWPFCtrls that Xperience
// references to be valid. If the code is not valid, the ‘TitlebarIcon’ will be used, if
// supplied. If not supplied, the icon will not be changed.
AppDataRq_MType request = new AppDataRq_MType()
{
HostId = hostedWindowBase.WindowId,
StatbarTxt = "Change the Window Status",
TitlebarTxt = "New Window Title",
TitlebarVectorImgCode = JHAControls.WPF.JHAStandardVectorIcon.IconTypes.Wizard.ToString(),
TitlebarIcon = Convert.FromBase64String(
this.CreateBase64ImageFromResource("Demo.Images.splashButterfly.png"))
};
Helper.FillHeader(request);
this.messageBus
.Send(request)
.RegisterResponseHandler(this.OnApplicationDataColorChangeResponse);
/////////////////////////////////////////////////////////
AppDataRq_MType request = new AppDataRq_MType()
{
ThemeContext = new ThemeContext_CType()
{
ColorType = "Tang"
}
};
var hostedWindow = XperienceContext.Current.WindowManager.GetByContentInstance(this);
if (hostedWindow != null)
{
request.HostId = hostedWindow.WindowId;
Window window = hostedWindow.GetWindow();
JHAThemeManager.LoadThemeForOneElement(
window,
ThemeChangeMessageHandler.CurrentApplicationTheme,
JHAThemeManager.JHAThemeColors.Tangerine,
string.Empty);
var childWindowHosts = XperienceContext.Current.WindowManager.GetChildren(hostedWindow);
if (childWindowHosts != null)
{
foreach (var child in childWindowHosts)
{
Window childWindow = child.GetWindow();
JHAThemeManager.LoadThemeForOneElement(
childWindow,
ThemeChangeMessageHandler.CurrentApplicationTheme,
JHAThemeManager.JHAThemeColors.Tangerine,
string.Empty);
}
}
}
MessageHelper.FillHeader(request);
this.messageBus
.Send(request)
.RegisterResponseHandler(this.OnApplicationDataColorChangeResponse);
AppData.js
var request = new jackHenry.xperience.businessObjects.AppData();
request.StatbarTxt = "New Status";
request.TitlebarTxt = "New Title";
sampleXPWebProductAngular.Helper.FillHeader(request);
var responceCallback = jackHenry.xperience.messageBus.send(request).registerResponseHandler(onChangeTitleCallback);
var request = new jackHenry.xperience.businessObjects.AppData();
request.ThemeContext = new jackHenry.xperience.businessObjects.ThemeContext_CType();
request.ThemeContext.ColorType = "Tang";
sampleXPWebProductAngular.Helper.FillHeader(request);
var responceCallback = jackHenry.xperience.messageBus.send(request).registerResponseHandler(onChangeColorCallback);
Have a Question?
Have a how-to question? Seeing a weird error? Get help on
StackOverflow.
Register for the Digital Toolkit Meetup
where we answer technical Q&A from the audience.
Last updated Mon Apr 11 2022