Pop up data is not clearing in Richfaces 4.0 - jsf-2

I am new to Rich Faces and we are using richfaces 4.0. We are having an pop up requirement in our project and we used rich:popupPanel.
In the pop up we are having a form with 5 to 10 input text boxes and selectManyCheckbox components.
Whenever the user opens the pop up, fills the data and click Save, the data is being saved properly.
But when the user opens the pop up again, the already entered data is being displayed, actually it should be an empty form.
Can anyone help me on this?
Thanks in advance.

It is probably because the backing bean that supply the values to your controls in the rich:popupPanel is in the session scoped and you forget to clear these values in the action method when the save button in the rich:popupPanel is pressed.
Please check if you really clear these values in that action method

Related

Angular/Bootstrap ui modal dialog with a form issue

I have an Angular JS app with a bootstrap ui modal dialogue hosting a simple edit form.
The form can be for a new "thing" or a populated "thing".
I find that when I cancel out of the modal with the form populated, submit is being called.
Any help appreciated.
Plunkr here... http://plnkr.co/edit/XhQCqlGUfcmQOhqLDeXR?p=preview
I forked your plunk and got it working here: http://plnkr.co/edit/jgg5pDQOH46XgrbW3Mvh?p=preview I think the cancel button was participating in the form submit event since it was inside the form element. Moving it outside of the form seems to have fixed the problem. I also set up the submit event to fire the modalInstance close event and the cancel event to fire the modalInstance dismiss event. This gives you the opportunity to handle things appropriately in the parent controller (ModalDemoCtrl).
EDIT
You could also stop the click event from propagating in the cancel event and still use the save as an input element inside the form tag. See this plunk for example: http://plnkr.co/edit/A81KkUUQEL3IBbOSnHQb?p=preview
I was having a similar problem. My problem was that when I clicked in the button to open the modal, my form was submited. I was using a "button" html tag, without specifying the "type" attribute. So, I found your problem and I went to the W3C documentation. I found that:
Tip: Always specify the type attribute for a button element. Different browsers use different default types for the button element. (http://www.w3schools.com/tags/tag_button.asp)
I wasn't defining the type of my button, so the default type of my browser was submit. I defined the type to "button" and everything is ok now.

Handle changes to a big form. Alert before closing modal

I am currently working on a Customer Management application made in SmartGWT 2.0.
The Add Customer form is a fairly big one with multiple tabs and each tab has lot of fields. This form is opened in a modal window which have a save and a close button at the bottom.
Since this is a huge form, sometimes the rep accidentally hits Close without noticing that there is some information in one of the tabs.
We want to add some kind of alert when user tries to close the form after he has made changes to it.
I saw that there is ChangeHandler on text items which can flag a change which can be evaluated before firing the close event. However currently doing this for so many fields is a little bit cumbersome. Is there a way of achieving this on a DynamicForm level or even better on the Window level?
I am looking for a SmartGWT equivalent of this jquery code:
$("input:text, select, input:checkbox, input:radio, input:password").change(function(){
unloadRoutineFlag = true;
});
Take a closer look at this handler at the dynamicForm level.
addItemChangedHandler(ItemChangedHandler handler)
Handler fired when there is a changed() event fired on a FormItem
within this form.
Typically, when a formItem fires the changed() event, the form gets notified. Let us know if this works.

Dismiss the keyboard in uiwebview in case I d'ont want to submit the form

I am developing a application in phonegap. In the app, there is a page which contains two textfields and a image. No submit button because I don't want to submit the form. the desired working is as follow..
the user taps the text fields, the keyboard appears.
clicking on the image below calls a javascript(jquery method-> $.post()) function which picks the data from the textfields and send it to server(json). that means I m not submitting the form.
and the go button on the virtual keyboard is supposed to submit the form. But in my case as I m not submitting the form so go button doesn't work and it doesn't look appropriate.
I want to get rid of the button..either it may dismiss the keyboard or call the jquery function which it is not supporting.
I searched a lot over the net. I came to know that if i remove the form tag the go button changes to return button which really worked then the return button again looks dumb.
So please help me to get rid of either of the button(preferably the return button).
I don't think you will be able to get rid off the button. What you could do instead, is to have the input field in form with and onsubmit event. This event should perform the jquery $.post method and return false to prevent standard form submission. This way your go button would actually work the way user expects and you don't have to disable it.

DBLookupComboBox and Refreshing of Contents

I have Delphi 7 and I'm using NexusDB for the database.
I have a main form where I have a DBLookupComboBox to list the contents of a Table.
If I press a button I have on the form to add a new item to the list (which opens a 2nd dialog box) and then come back to the main form I want the newly added item to show up immediately
I can't seem to get that to work.
I've tried refreshing the DataSet under the ListSource object.
Anyone have any ideas?
Thanks,
David
DBLookupComboBox1.ListSource.DataSet.Close;
DBLookupComboBox1.ListSource.DataSet.Open;

MVC question - hide /show a panel with partial postback from radiobutton submit

I have 2 radio button with values New & Existing. If user chooses New, then I show a textbox on the form and if Existing a dropdown and textbox is hidden. The question is , does the hide/show of the textbox/dropdownlist have to be written in the View or the Controller class? Also when I choose the selection my whole form is posting back and hence all validation error msgs are being shown which should not be shown nless the save button is clicked, how do I a partial postback without full form submission? Any code snippets or urls would be benificial in this respect.
The question is , does the hide/show of the textbox/dropdownlist have to be written in the View or the Controller class?
Just show/hide with jQuery that.
Also when I choose the selection my whole form is posting back and hence all validation error msgs are being shown which should not be shown nless the save button is clicked, how do I a partial postback without full form submission? Any code snippets or urls would be benificial in this respect.
Perform 'partial postbacks' through javascript.
Post form to save action only once when it's ready (when Save button is clicked).
Some resources:
jQuery tutorial
jQuery AJAX
About form AJAX`ifying
If I understand you correctly, the answer is the hiding and showing of controls should be done on the view as it's display specific.
If you use javascript to show and hide the controls then because it's on the client side you would not have to postback the form, and could do server side validation when the save button is clicked.
jQuery is very good: Jquery Website
Hope that helps?

Resources