Refine doesn't display the green message of successfully submitted

I successfully uploaded a Form in the database, but It doesn't show up the successfully submitted green message on top of page and it doesn't empty the text fields in the Form page.
kapa.ai
kapa.ai382d ago
Hi @ging_freecs. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai382d ago
---------------------- To show a success notification after the form is submitted successfully, you can use the successNotification prop in the useForm hook. Make sure you have the NotificationProvider (https://refine.dev/docs/api-reference/core/providers/notification-provider/) in your project for this prop to work. Here's an example of how to use the successNotification prop:
useForm({
successNotification: (data, values, resource) => {
return {
message: `Post Successfully created with ${data.title}`,
description: "Success with no errors",
type: "success",
};
},
});
useForm({
successNotification: (data, values, resource) => {
return {
message: `Post Successfully created with ${data.title}`,
description: "Success with no errors",
type: "success",
};
},
});
Regarding clearing the form fields after submission, you can use the reset function provided by the useForm hook. Call the reset function after the form is submitted successfully. Unfortunately, I don't have enough information from the provided extracts to give you a specific code example for resetting the form fields. However, you can refer to the useForm documentation for more information on how to use the reset function: - Refine useForm documentation (https://refine.dev/docs/api-reference/core/hooks/useForm) ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
Notification Provider | refine
refine let's you set a notification API by providing the notificationProvider property to the `` component.
useForm | refine
useForm is a hook that allows to manage forms. It has some action methods that create, edit and clone the form. The hook return value comes to according to the called action and it can run different logic depending on the action.
kapa.ai
kapa.ai382d ago
<@296624290843983873> kapa.ai is still learning and improving, please let us how it did by reacting below
fair-rose
fair-rose382d ago
hi, do you have notification provider ? and which ui library are u using ?
optimistic-gold
optimistic-gold382d ago
material ui. About the notification provider i think i am using the default one, cause I am watching the Javamastery youtube video
fair-rose
fair-rose382d ago
but it shows notification in tutorial video, isn't it ?
optimistic-gold
optimistic-gold382d ago
exactly, just i am making my customizations. I think in the tutorial the message that appears on top of page is in the server side, with res.status(200).json({ message: "Property created succesfully!" }); in the network message i can see it by inspecting the page
fair-rose
fair-rose382d ago
i suggest you to double check your implementation because our examples works as normal. https://codesandbox.io/s/github/refinedev/refine/tree/next/examples/form-material-ui-use-form?from-embed=&file=/src/pages/posts/create.tsx and bot it's right, if you can customize like that
useForm({
refineCoreProps: {
successNotification: (data, values, resource) => {
return {
message: `Post Successfully created with ${data.title}`,
description: "Success with no errors",
type: "success"
};
}
}
});
useForm({
refineCoreProps: {
successNotification: (data, values, resource) => {
return {
message: `Post Successfully created with ${data.title}`,
description: "Success with no errors",
type: "success"
};
}
}
});
optimistic-gold
optimistic-gold382d ago
Thank you very much
More Posts
Pagination & SearchI am using useTable from antd.I want to search table by name, but if I am in page 3 and searching dauseFormI build a custom hook that generates the form my problem is if i created a new record , then i clickAnyway to send my own alerts similar to when a new entry is created?I am hoping to subscribe to supabase events and display a notification on everypage when certain evedynamic i18n resource route prefix pathI already configured the router package (`react-router-dom` v6) to add a "lang" path prefix to my apReact-hook-form typesHi everyone hope you doing all well how to add types for the register functions for the @refinedev/rEslint integrationHi i have started Refine with vite ,so how to integrate eslintTranslate label for custom pagesI am using i18n for the changing the language. The example page labels all get translated but my cusmultiple different list/create/edit/view API endpoints for the same REST entityWhat is the recommended implementation way/hack strategy when I have resources that have several difNested rowKey in a tableMy rowkey value is nested. the example below doesn't work because rowKey don't accept this format. aunable to create refine-appon typing "npm create refine-app@latest" command in terminal getting error "✖ Could not found sourceFetch instead of axiosHeya, quick question - is it possible to provide the dataProvider with fetch instance rather than axExample for using API platform and interpreting its docs.jsonldAPI platform also provides a complete auto-generated documentation about the api, its endpoints, theDouble requests for listWhy there are doubled requests, after I I replaced the list view with the interferencer result?API Platform example, simple RESTIs there an example for using API platform and a simple REST dataProvider?Hello everyone I just want to understandHello everyone.. I just want to understand something but IDK if this is the right channel or should :disableTelemetry prop in the Refine node does not exist, how to disable telemetry?The manual states that one can disable telemetry by adding the prop disableTelemetry to the Refine nEdit button not working in the useModalFormHi all, I'm using a useModalForm hook to create a edit form. My approach is working for create actioExample of overriding getOne()Is there an en example of how to Override the GetOne call to a graphql backend. I need to send additgoogle auth re-render problemNew refine user here! When I create a new refine app with `npm create refine-app@latest`, with GoogStale TimequeryOptions: { staleTime: "infinity" }, is giving error Type 'string' is not assignable to type '