How to create dialogs and return values? #25
-
In the WorkloadClient we have this function: const result = await workloadClient.dialog.open({
dialogType: DialogType.IFrame,
route: { path: "/some-route" },
workloadName: "Org.WorkloadSample",
mode: OpenMode.Append,
options: {
height: "600px",
width: "600px",
hasCloseButton: true
}
}) The description of the function is: Then my route looks like this: export const router = createBrowserRouter(
[
{
path: "/some-route",
element: <NiceDialog />
},
etc...
] Should we do it this way? Because when I try, the first time it opens my whole app(path: ""), the second time it loads my "dialog route". Seems like I need to preload it or something like that. And how do I return values from the dialog? The example application only calls a dialog from the "worker". Or should we just use the "fluent ui" dialogs and skip the "workloadClient.dialog.open" function. If we call it this way the backdrop is only the portion of iframe(for modals), which is not ideal but works. some context: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @WilcoHendriksen, Regarding the dialog's value, currently Fabric's framework does not support returning values from the dialogs opened using workloadClient.dialog.open for the Iframe dialogType, and for MessageBox type the return value is an object { value: { clickedButton: string } }. Other \ custom return values are not supported at the moment. |
Beta Was this translation helpful? Give feedback.
Hi @WilcoHendriksen,
Could you please elaborate on "the first time it opens my whole app(path: ""), the second time it loads my "dialog route"""? What exactly is your scenario?
Regarding the dialog's value, currently Fabric's framework does not support returning values from the dialogs opened using workloadClient.dialog.open for the Iframe dialogType, and for MessageBox type the return value is an object { value: { clickedButton: string } }.
Other \ custom return values are not supported at the moment.