Flash/Session messages in cakephp 2.x - cakephp-2.0

How to show flash messages in a page without losing POST request? What I am trying to say is show some error flash messages and prevent from loading the page so that I can also prevent losing entered data?
Currently I am doing this in my controller:
$this->Flash->error('All fields are required');
$this->redirect($this->referer());
And what happen is the flash message will be shown but my data is now gone.

Related

React show error message on a specific section of a page

I'm trying to generate custom errors messages for different types of errors, I have resorted to react-error-boundary because I liked how instead of showing a white blank page, a fallback UI is shown.
Yet, for example, if I get an error from a specific graph displayed in a page, instead of showing the fallback UI, I hoped to be able to show an error message only in that section where the graph is (e.g. "Graph is unavailable"), while everything in the page stays where it is.
I don't know if that's possible to do with react-error-boundary, this is my first time ever using it.
Any suggestions, or advice would be appreciated.
Thanks,

firebase console database display instantly flips back to Overview

In testing a firestore database and reviewing the results in the firebase console, the database data will not load and keeps returning to the Overview display. By using two devices to test with, I can determine that the updates are correct.
This problem started with one rogue record on the console causing the data display to backout but all other records were correctly displayed. Other project database records display correctly.
Is there any way I isolate the problem by finding an error message?
firebaser here
This is indeed a bug in the Firestore console: if you select a document with a newline (\n) in its ID, the URL of your browser doesn't reflect the selected document.
Thanks for reporting! This will be fixed in an upcoming update to the Firebase console.
In the meantime, the API will allow you to access these documents without problems. So your apps should continue to work, and consider performing actions on affected documents through the API instead of through the console.

Need to display customized error messages on the login screen of SPA

Working with AngularJS frontend and spring security , need to show meaningful error messages on the login screen.
By searching some posts I came to know that implementing AuthenticationFailureHandler we can create meaningful messages and show them
on the login screen
My doubt is how to link these message from server to client(AngularJS) , I mean
how to display them on angularjs, most of the posts I reffered are not using
AngularJS as frontend.
please help me

Handle error in AngularJs if iFrame page post throws exception

I have a web application that needs to display dynamically created MS Word files and it has following constituents:
A web service that returns the Word file Stream
An intermediate server page that calls the web service and writes the stream to Response
A web page (built in AngularJs) that collects user inputs and posts data to the intermediate page. Input also contains a file that user uploads from his computer.
From the AngularJs page, I post data to the intermediate page using a hidden iFrame. Entire setup works well and when the user clicks Submit and the browser duly shows Open/Save/Cancel dialog.
How do I display a message if web service throws exception? I am not able to catch it from AngularJs code.
PS: I can use the intermediate page to display the message in iFrame but then I need to clear it out when user takes another action on the form. How can I do that from AngularJs?

How can I refresh browser in silverlight 4 application?

I have an Silverlight 4 application, in log-in process I have some validations and data preparation, for any reason in each step if I get an exception, I want to stop my application and refresh the browser but I want save my exception message from my last session and then update my error text block in log-in screen and inform my user about exception message.how can I save my variable in session and then refresh browser?
On silverlight side you may use HtmlPage namespace ,
Beside this refreshing a page in silverlight is not a good practice,and shows your app. as if broken.Siverlight is a RIA. using benefits of this Rich platform is better I think.
HtmlPage.Window.Navigate(HtmlPage.Document.DocumentUri, "_self");
/* You may also add Query String to your URL as Bryant said,
Uri myUri=new Uri(HtmlPage.Document.DocumentUri.toString()+ "?Exception=True", UriKind.RelativeOrAbsolute);
HtmlPage.Window.Navigate(myUri, "_self");
*/
Hope helps!
Just take the current url and append your error message to the query string and then use javascript to open the current page to that url. You can then get the query string from silverlight to get the error message.

Resources