Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810008] |
Mon, 29 July 2019 06:25 |
Tore Van Grembergen Messages: 19 Registered: July 2014 Location: Bassevelde |
Junior Member |
|
|
Hi,
I have created a tabbed page setup via a TabBox with different groupboxes.
@Order(1000)
public class PersonDetailBox extends AbstractTabBox {
@Order(1000)
public class PersonInfoBox extends AbstractGroupBox {
@Override
protected String getConfiguredLabel() {
return TEXTS.get("PersonInfo");
}
..............
Most tabs contain tablefields
@Order(3000)
public class LoyaltyPointsHistoryBox extends AbstractGroupBox {
@Override
protected String getConfiguredLabel() {
return TEXTS.get("loyaltypointshistory");
}
/*
*
*/
@Order(1000)
public class tblLoyaltyPointsHistoryField
extends AbstractTableField<tblLoyaltyPointsHistoryField.Table> {
public class Table extends AbstractTable {
public transactionTypeColumn gettransactionTypeColumn() {
return getColumnSet().getColumnByClass(transactionTypeColumn.class);
}
public transactionDescColumn gettransactionDescColumn() {
return getColumnSet().getColumnByClass(transactionDescColumn.class);
}
public transactionReasonColumn gettransactionReasonColumn() {
return getColumnSet().getColumnByClass(transactionReasonColumn.class);
}
public transactionDateColumn gettransactionDateColumn() {
return getColumnSet().getColumnByClass(transactionDateColumn.class);
}
public balanceColumn getbalanceColumn() {
return getColumnSet().getColumnByClass(balanceColumn.class);
}
public pointsColumn getpointsColumn() {
return getColumnSet().getColumnByClass(pointsColumn.class);
}
@Order(1000)
public class transactionDateColumn extends AbstractStringColumn {
@Override
protected String getConfiguredHeaderText() {
return TEXTS.get("transactiondate");
}
@Override
protected int getConfiguredWidth() {
return 100;
}
}
@Order(2000)
public class transactionTypeColumn extends AbstractStringColumn {
@Override
protected String getConfiguredHeaderText() {
return TEXTS.get("transactionType");
}
@Override
protected int getConfiguredWidth() {
return 100;
}
}
.............
The idea is to have the dataof the tablefield loaded of the different groupboxes via the "on click" of the tab to simulate incremental page loading.
@Override
protected void execTabSelected(IGroupBox selectedBox) {
// TODO Auto-generated method stub
// super.execTabSelected(selectedBox);
if(selectedBox.equals(getLoyaltyPointsHistoryBox()))
{
IPersonService service = BEANS.get(IPersonService.class);
PersonFormData formData = new PersonFormData();
exportFormData(formData);
formData = service.loadCIMHistoryPoints(formData);
importFormData(formData);
}
else if(selectedBox.equals(getCommunicationMatrixBox()))
{}
else if(selectedBox.equals(getVouchersBox()))
{}
}
The event itself is recognized correctly and data is fetched at the correct moment.
It executes
@Override
public PersonFormData loadCIMHistoryPoints(PersonFormData formData) {
if (!ACCESS.check(new ReadPersonPermission())) {
throw new VetoException(TEXTS.get("AuthorizationFailed"));
}
String sPartyId;
sPartyId = formData.getPartyId();
if (!StringUtility.isNullOrEmpty(sPartyId)) {
// TODO [torevg] add business logic here.
PersonConnector Person = new PersonConnector();
formData = Person.SearchCIMHistoryPoints(formData);
}
return formData;
}
which gets the data from a rest service
RestSearchMapCIMHistoryPoints001ds historyPoints = null;
Gson gson;
String strResponse;
String sPartyId;
sPartyId = formData.getPartyId();
tblLoyaltyPointsHistory historyTable = formData.getTblLoyaltyPointsHistory();
historyTable.clearRows();
strResponse = this.requestSearchHistoryPoints(sPartyId);
if (!StringUtility.isNullOrEmpty(strResponse)) {
gson = new Gson();
historyPoints = gson.fromJson(strResponse, RestSearchMapCIMHistoryPoints001ds.class);
System.out.print(historyPoints.toString());
if (historyPoints.ttSICIMHistoryPoint.getHistoryPointSearchResult()!= null) {
for (RestSearchMapCIMHistoryPoints003cl historyPoint : historyPoints.ttSICIMHistoryPoint.getHistoryPointSearchResult()) {
tblLoyaltyPointsHistoryRowData historyRow = historyTable.addRow();
historyRow.setTransactionDate(historyPoint.getTransactionDate());
historyRow.setTransactionDesc(historyPoint.getTransactionDesc());
historyRow.setTransactionReason(historyPoint.getTransactionReason());
historyRow.setTransactionType(historyPoint.getTransactionType());
historyRow.setPoints(historyPoint.getPoints().toString());
historyRow.setBalance(historyPoint.getBalance().toString());
}
}
}
return formData;
}
The different rows are retrieved, but the data is not show.
(see screenshot, rows are added to the tablefield, but the content is not shown.)
I checked the HTML and the rows are in the HTML, but data is empty
When debugging the flow, it looks like the formData in the PersonForm contains the data retrieved via the webservice, however the contents of the individual columns is not shown.
System.out.println("----------------------------------");
System.out.println("in PersonForm");
System.out.println("----------------------------------");
tblLoyaltyPointsHistory tableHistory = formData.getTblLoyaltyPointsHistory();
tblLoyaltyPointsHistoryRowData[] tableRows = tableHistory.getRows();
for(tblLoyaltyPointsHistoryRowData tableRow : tableRows)
{
System.out.print(tableRow.getTransactionDate() + "," + tableRow.getTransactionType() );
System.out.println("");
}
Output :
----------------------------------
in PersonForm
----------------------------------
2019-07-19T11:13:00.000+02:00,Reward
2019-06-29T11:03:00.000+02:00,Reward
2019-06-29T11:03:56.961+02:00,Redeem
2019-06-21T12:53:00.000+02:00,Reward
2019-06-15T17:08:06.788+02:00,Redeem
2019-06-15T17:07:00.000+02:00,Reward
2019-05-03T17:11:00.000+02:00,Reward
2019-04-27T16:58:00.000+02:00,Reward
2019-04-27T16:59:08.073+02:00,Redeem
2019-04-03T17:35:05.810+02:00,Redeem
2019-04-03T17:33:00.000+02:00,Reward
2019-03-04T17:19:00.000+01:00,Reward
2019-03-13T13:39:25.616+01:00,Redeem
2019-02-23T14:06:00.000+01:00,Reward
2019-02-06T13:26:02.150+01:00,Redeem
2019-02-06T13:25:00.000+01:00,Reward
2019-02-02T17:27:00.000+01:00,Reward
2018-12-20T12:40:00.000+01:00,Reward
2018-12-20T12:41:48.204+01:00,Redeem
2018-12-14T16:32:00.000+01:00,Reward
2018-11-07T14:48:07.356+01:00,Redeem
2018-11-07T14:47:00.000+01:00,Reward
2018-09-05T14:37:00.000+02:00,Reward
Does anybody have an idea how to get the data shown ?
[Updated on: Tue, 30 July 2019 06:16] Report message to a moderator
|
|
|
Re: Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810069 is a reply to message #1810008] |
Tue, 30 July 2019 09:19 |
|
Hi Tore,
it looks like the table cell values are missing indeed, as you already have noticed. You can verify that it is not a UI (=JavaScript) issue by checking what is sent to the browser. If the json does not contain the cell texts it is likely an issue in the Java layer and the UI works correctly.
Can you verify that the values of the table cells are correctly set in the service itself, right after the form data is filled?
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04158 seconds