The CreatorCon Call for Content is officially open! Get started here.

UIB Builder: Catalog Item component: How do I refresh form after submission to reuse the page?

Phillip Melmoth
Tera Contributor

Hi

 

I'm configuring a Configurable workspace. I have a workspace-style homepage with a list on it. The list "New" button event is configured to open a new page which has a single catalog item component for the user to raise a new request from the catalog item.

 

When the request is submitted the event navigates to another page to show the newly created record.

Everything above works perfectly.

 

The problem is, when the user goes back to list view and clicks to create a 2nd new request, it goes back to the catalog item page and the Submit button is greyed out. I have to refresh the page to reset the form to create a new request.

 

My question: How can I configure the catalog item component to reset the form at the same time as navigating to the new record page?

6 REPLIES 6

I should add, my New button no longer goes to a catalog item form. Maybe I scrapped that idea as it's now configured to just create a new record instead.

Tim Preston
Tera Contributor

So, this is an older post, but in case anyone runs across this, I ran into the same issue. What I ended up doing was creating a data broker that returns whatever value is passed to it (so if you sent it "yes", it would return "yes"), and added it to the page twice. Both data resources are set to run when invoked instead of immediately.

 

  1. One of the resources has a similar catalog item to the desired one, which is called a "blank cat item".
    1. If the user doesn't have access to the catalog item you choose, they can't fill it out, so as long as you have the user criteria set appropriately, it shouldn't cause an issue.
  2. The other resource has the sys_id of the desired catalog item, which is called "desired cat item".

 

You could probably script this out instead of using custom data transforms/brokers, but what I did was set the "sys id" property of the catalog item component to a client state parameter with the default value set to the desired catalog item, and whenever the catalog item generates the request, it opens a modal that displays some basic info on the generated request. When the user closes the modal or clicks the button to view the record (which is on the modal), the first data resource "blank cat item" is triggered, which changes the sys id property on the component. I trigger the second resource on the "Data Fetch Succeeded" event of the "blank cat item" data resource, which changes it back to the desired catalog item. Turns out, whenever the sys id property is changed, the component "resets" all the fields, so I tried to take advantage of that.

 

It works, but I didn't like how it showed the form changing if you just closed the modal instead of navigating to the generated record, so what I ended up doing was hiding the component whenever the modal is closed and displaying a loading component in its place until the second data resource finishes changing the catalog item back to the desired one. This was the only way I could think of to reset the component with its current limitations.