Update / Refresh a TableField after an update / change [message #1016705] |
Thu, 07 March 2013 12:33 |
Henrique Meira Messages: 13 Registered: November 2012 |
Junior Member |
|
|
I created a form, called TitleForm, and I added a TableField, called DetailTableField. In this DetailTableField I added an Edit menu to open another form, called DetailForm, obviously, for changes of the details from a title.
Until this point, everything work fine.
When I press the OK button, the changes are stored at database.
The problem is when the DetailForm is closed. The DetailTableField from TitleForm not is refreshed/reloaded.
I include the following code in my execAction method:
protected void execAction() throws ProcessingException {
DetailForm form = new DetailForm();
form.setGcf_titulo_det_id( getTable().getGcf_titulo_det_idColumn().getSelectedValue() );
form.startModify();
form.waitFor();
if (form.isFormStored()) {
reloadTableData(); // try 1
getDetailTableField().reloadTableData(); // try 2
}
}
Need I to write any other code to update the DetailTableField?
[Updated on: Mon, 11 March 2013 13:19] Report message to a moderator
|
|
|
|
|
|
Re: Update / Refresh a TableField after an update / change [message #1017219 is a reply to message #1017023] |
Mon, 11 March 2013 08:45 |
Urs Beeli Messages: 573 Registered: October 2012 Location: Bern, Switzerland |
Senior Member |
|
|
Henrique Meira wrote on Fri, 08 March 2013 17:48Thanks Urs Beeli.
I get a compilation error:
"The method reloadPage() is undefined for the type TitleForm.MainBox.DetailBox.DetailField.Table.AddMenu".
reloadTableData() is a method of an AbstractTable, but reloadPage not.
I was commenting on your code a few posts above mine:
protected void execAction() throws ProcessingException {
DetailForm form = new DetailForm();
form.setGcf_titulo_det_id( getTable().getGcf_titulo_det_idColumn().getSelectedValue() );
form.startModify();
form.waitFor();
if (form.isFormStored()) {
reloadTableData(); // try 1
getDetailTableField().reloadTableData(); // try 2
}
}
To me, that looked like the code on your PageWithTable, I merely suggested to replace this with
protected void execAction() throws ProcessingException {
DetailForm form = new DetailForm();
form.setGcf_titulo_det_id( getTable().getGcf_titulo_det_idColumn().getSelectedValue() );
form.startModify();
form.waitFor();
if (form.isFormStored()) {
reloadPage();
}
}
Assuming the execAction is part of an AbstractPageWithTable, this should work, because reloadPage() is defined in AbstractPage.
I am succesfully using this on the PersonPage of the Minicrm tutorial, it makes sure that if I add a new person to the DB using a form, the table is then page (and therefore the table) is reloaded.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03869 seconds