PDA

View Full Version : Form submission problem after form is cleared. 2 Forms on 2 tabs.



Tumac
8 Sep 2010, 11:35 AM
I have a viewport with a grid on the left. When i click the data in the grid on left, it loads data into a form on the right. I also can populate new data into the form on the right. When done submitting, it clears the form and I can either enter more data or load details from the grid on left.

I added a tab to the viewport with another form. So I have the grid on the left and 2 forms on the right.

I think I have a scope issue when I clear the second form. When I clear the second form after entering data and enter new data into the form, I always get my field validation error for that form and have to refresh page.

Code is long not sure how to best represent. Please excuse some of the sloppy code as I am a novice/part-time programmer.

darthwes
8 Sep 2010, 11:42 AM
You say you have a problem when you clear the 2nd form? Can you show us the code that runs to "clear the 2nd form" ? Which one is the second form? POShipmentForm? POEntryForm?

Tumac
8 Sep 2010, 12:44 PM
Any of my functions that eventually call the clearForm function on the POShipmentForm.js will cause this problem. The clearForm function calls a clearForm function in the FormBaseCls.js. This is where I think there is a scope issue?

Does that help?

darthwes
8 Sep 2010, 7:46 PM
clearForm : function() {
var form = this.getForm();
form.reset();
form.clearInvalid();
this.data = null;
},


Is that what you're after?

Tumac
9 Sep 2010, 9:09 AM
And it seems to be working. I need to run more tests, but will say thanks cuz this looks like it solved.