How to add and remove one by one button from firebase db? - reactjs

I need help in implementing how to make it so that when I click on the button, I add the firebase id to the database, and then delete it from the database on the same button
Here is my code, it adds but when I click again to delete it adds and deletes immediately
my code

Related

How to delete a specific item from a database when custom popup confirmation button will be cliked using react and tailwind

I'm created app where user can edit and delete items. Now i want that when user will clik the delete button a popup will be shown an user can either cancel or delete by confirming. How to do this?

Redirecting to previous page without reloading

I have a question that suppose, I have an Admin Dashboard page, on which I have given a list of users. clicking upon a particular user the details of corresponding user is shown on a different page (say on userDetails.jsp). Now I have a back button on userDetails page, Clicking of which I need to redirect admin to the last visited page that is Admin Dashboard page, I have one solution that I can "Reload" the previos page on clicking back button, but then I feel that there is the overhead of calling a server side API, retrieving all the data, Again redraw the whole admin dashboard page even when there is no change made in the userDetails[because it is read only page, modification is not allowed there]. Is there anyway that I can make user of cache or anything else so that I will not need to go to the server to fetch all the data again. I am using spring MVC, angularjs, Thank you.
On your button's click event add the following code:
$window.history.back();
make sure to use $window rather than window since you're using AngularJS

Should Commit button always be used together with Submit button in ADF JDeveloper?

I am developing an ADF Fusion Web Application and I want to be able to update and save the changes about entities into my database. Do I always have to drag and drop both Submit and Commit buttons together? I can not unserstand their difference implicitly.
The submit button actually does nothing special, it just does a submit of your form (like in normal HTML). It's the same functionality as every other button (except if you start using the immediate attribute, but not considering this here). The data from your form (or input components) will then be 'saved' in your model (so your entities). But not in the database of course.
When using the commit button, a submit happens (so everything for above happens) and then your data will get committed (saved in your db).
User404 is correct. Lets go one step further. A lot of people do not want separate submit and commit buttons. This may give an example of calling the commit programmatically from the ActionListener event handler of a button.

Hide button on PDF before flattening in LiveCycle Workbench

ASP.NET application asks user to fill in fields.
User clicks a "Request Signatures" button in the application and a LiveCycle service is called to create the pdf.
The pdf is saved in the ASP.NET application database.
This pdf has to then be digitally signed by 3 people.
A link to the pdf is shown to the first person in the workflow.
User clicks on link and the pdf is shown in the browser for them to digitally sign.
At the bottom of the pdf is a submit button, which the user clicks after signing.
The pdf is submitted to a web page which updates the pdf in the database and through other database tables, is put in the next person's "to-do" list.
2nd & 3rd person repeat #5 - #8
After the 3rd person signs, the pdf is considered complete. The pdf is to be flattened using LiveCycles Output service transformPDF
The problem is the "Submit" button on the form. I have made it "Visible - Screen only" to take care of anyone that wants to print a hard copy anytime during the process. However, I have a feeling the client will complain that the Submit button shows up on screen. Also, the final, flattened pdf should not show the button as it's being submitted to an official repository for these forms in which other forms don't have a submit button.
After the 3rd person signs, I can easily set the submit button presence to hidden. Then when it's flattened, it won't show up. The problem comes when the user wants a "Print View" before or during the signing process.
So my question is can I make a LiveCycle process that takes in a document variable (the pdf with the submit button) and output a document variable (the pdf without the submit button). Meaning the process would have to somehow run javascript inside the pdf to hide the submit button.
That event could be the prePrint event to remove the button from the layout.
And you will need postPrint event to put the button back in.
on the prePrint event of the button(to hide the button):
this.presence = "hidden";
on the postPrint event of the button(to show the button):
this.presence = "visible";

Is their a technique to create and delete content with Aloha?

I understand how the Aloha editor works, users click on some content in a live web page, edit it and save the content to a repository via ajax. This is fine for content editing, the U in CRUD.
But how do you get the *C*reate and *D*elete in CRUD?
Imagine this scenario.
A web page displays a list of people with first and last names.
They can be edited with Aloha, no problem.
But how do you add a new person in the list via the Aloha editor?
Since it is only for editing content, you can't add new content.
Similarly for content deletion, how do you delete a person from the front end, I mean completely remove the database row for that person somehow, not just put in a blank for their name.
Is their a technique or plugin for this?
you are completely right that Aloha Editor is a WYSIWYG Editor for editing content, meaning that the user can change the DOM in the browser. The actual CRUD operations have to be done by the application that uses the Aloha Editor.
To create new content, you could just add a div via jQuery and make it editable via Aloha. You can then trigger an Ajax request, that saves/creates the new item in the backend.
Same goes for deleting items. You just add a button that triggers an Ajax call to delete the item in the backend.
BR,
Chris

Resources