Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

[HELP] calling loadRole and loadAction #145

Open
1 of 2 tasks
TriStarGod opened this issue Sep 27, 2022 · 0 comments
Open
1 of 2 tasks

[HELP] calling loadRole and loadAction #145

TriStarGod opened this issue Sep 27, 2022 · 0 comments
Labels

Comments

@TriStarGod
Copy link

Environment

Please provide as many details as you can:

  • Hosting type
    • Form.io
    • Local deployment
      • Version:
  • Formio.js version: 4.14.8

When I load a form, I can't load anything else that might be connected with it without creating a new Formio or setting static variables
ie.

const formio = new Formio(`${baseUrl}/form/${form}`);
// these works
await formio.loadForm()
await formio.loadRoles()
await formio.loadActions()
await formio.actionInfo(name);

// but these dont
await formio.loadRole();
await formio.loadAction();

// unless I
formio.actionId = "blah doesn't matter, just has to be true"; 
formio.actionUrl = `${baseUrl}/form/${formId}/action/${actionId}`;
await formio.loadAction();
// or create a new Formio with the url set to actionUrl or roleUrl

Expected behavior

// To reuse Formio object without doing
formio.actionId = "blah doesn't matter, just has to be true"; 
formio.actionUrl = `${baseUrl}/form/${formId}/action/${actionId}`;
// but instead
formio.loadAction(actionId);

Observed behavior

Its not working as I expect so I'm assuming I'm doing something wrong. Any advice to optimize my use of this great library?

Example

If possible, please provide a screenshot, live example (via JSFiddle or similar), and/or example code to help demonstrate the issue.

For code or form JSON, please enclose in a code block:

// your code here
@TriStarGod TriStarGod added the bug label Sep 27, 2022
@TriStarGod TriStarGod changed the title [BUG] [HELP] calling loadRole and loadAction Sep 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant