Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Tablefield - Tablefield data not shown on a tab in a groupbox(Tablefield - Tablefield data not shown on a tab in a groupbox)
Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810008] Mon, 29 July 2019 06:25 Go to next message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 19
Registered: July 2014
Location: Bassevelde
Junior Member
Hi,

I have created a tabbed page setup via a TabBox with different groupboxes.
index.php/fa/36029/0/

		@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.)
index.php/fa/36023/0/

I checked the HTML and the rows are in the HTML, but data is empty
index.php/fa/36024/0/

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 Go to previous messageGo to next message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
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.
index.php/fa/36030/0/

Can you verify that the values of the table cells are correctly set in the service itself, right after the form data is filled?
Re: Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810072 is a reply to message #1810069] Tue, 30 July 2019 09:43 Go to previous messageGo to next message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 19
Registered: July 2014
Location: Bassevelde
Junior Member
As far as I can see, the json file is showing the rows, but the rows look empty.

index.php/fa/36031/0/.

What do you mean with "Can you verify that the values of the table cells are correctly set in the service itself, right after the form data is filled?".

Based on the output of the contents of the formData, the required values are sitting in the tabledata.
Is there something specific I can test / check except for printing the value to system.out ?


Re: Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810073 is a reply to message #1810072] Tue, 30 July 2019 10:02 Go to previous messageGo to next message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 19
Registered: July 2014
Location: Bassevelde
Junior Member
I just checked the data in the service layer of scout and it looks like the formdata is sitting correctly in the tablefield

		if (formData.getTblLoyaltyPointsHistory().getRowCount() > 0) {
			System.out.println("----------------------------------");
			System.out.println("in PersonService");
			System.out.println("----------------------------------");

			tblLoyaltyPointsHistory tableHistory = formData.getTblLoyaltyPointsHistory();
			tblLoyaltyPointsHistoryRowData[] tableRows = tableHistory.getRows();
			for (tblLoyaltyPointsHistoryRowData tableRow : tableRows) {
				System.out.print(tableRow.getTransactionDate());
			}
		}


----------------------------------
in PersonService
----------------------------------
2019-07-19T11:13:00.000+02:002019-06-29T11:03:00.000+02:002019-06-29T11:03:56.961+02:002019-06-21T12:53:00.000+02:002019-06-15T17:08:06.788+02:002019-06-15T17:07:00.000+02:002019-05-03T17:11:00.000+02:002019-04-27T16:58:00.000+02:002019-04-27T16:59:08.073+02:002019-04-03T17:35:05.810+02:002019-04-03T17:33:00.000+02:002019-03-04T17:19:00.000+01:002019-03-13T13:39:25.616+01:002019-02-23T14:06:00.000+01:002019-02-06T13:26:02.150+01:002019-02-06T13:25:00.000+01:002019-02-02T17:27:00.000+01:002018-12-20T12:40:00.000+01:002018-12-20T12:41:48.204+01:002018-12-14T16:32:00.000+01:002018-11-07T14:48:07.356+01:002018-11-07T14:47:00.000+01:002018-09-05T14:37:00.000+02:002018-09-05T14:39:35.610+02:002018-08-31T10:33:18.327+02:002018-08-31T10:32:00.000+02:002018-08-31T10:33:16.385+02:002018-08-28T10:47:00.000+02:002018-07-28T12:06:59.470+02:002018-07-28T12:05:00.000+02:002018-07-16T17:39:00.000+02:002018-06-29T10:52:00.000+02:002018-06-26T17:51:00.000+02:002018-06-09T15:49:00.000+02:002018-06-01T15:35:00.000+02:002018-06-01T15:36:10.483+02:002018-05-19T09:39:03.204+02:002018-05-19T09:38:00.000+02:002018-05-05T10:19:00.000+02:002018-04-30T17:43:00.000+02:002018-04-30T17:44:29.163+02:002018-04-21T15:55:10.677+02:002018-04-21T15:54:00.000+02:002018-04-05T18:17:00.000+02:002018-04-05T18:18:37.706+02:002018-03-07T14:08:00.000+01:002018-02-03T15:31:26.216+01:002018-02-03T15:30:00.000+01:002018-01-27T17:51:00.000+01:002018-01-05T14:30:00.000+01:002018-01-05T14:31:16.392+01:002017-12-15T16:55:43.536+01:002017-12-15T16:55:00.000+01:002017-09-09T10:07:00.000+02:002017-09-09T10:08:53.729+02:002017-08-30T14:17:30.351+02:002017-08-30T14:07:00.000+02:002017-08-05T10:09:00.000+02:002017-07-20T12:25:00.000+02:002017-07-15T10:06:00.000+02:002017-06-28T15:08:00.000+02:002017-05-26T10:17:00.000-00:002017-05-26T10:26:07.851+02:002017-05-19T16:18:13.955+02:002017-05-19T16:09:00.000-00:002017-04-14T18:09:00.000-00:002017-04-14T18:10:07.257+02:002017-04-08T09:41:07.555+02:002017-04-08T09:40:00.000-00:002017-04-05T14:28:04.361+02:00
Re: Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810076 is a reply to message #1810073] Tue, 30 July 2019 10:10 Go to previous messageGo to next message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 19
Registered: July 2014
Location: Bassevelde
Junior Member
I don't know if it is relevant but please find below the java version

java -version
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Re: Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810141 is a reply to message #1810076] Thu, 01 August 2019 09:59 Go to previous messageGo to next message
Tore Van Grembergen is currently offline Tore Van GrembergenFriend
Messages: 19
Registered: July 2014
Location: Bassevelde
Junior Member
Is it possible that the issue is related to this part of code in TableRowDataMapper ?

  protected IColumn findColumn(ColumnSet columnset, FastPropertyDescriptor rowDataPropertyDesc) {
    String columnId = capitalize(rowDataPropertyDesc.getName());
    return columnset.getColumnById(columnId);
  }


the field balance is e.g. translated Balance.

  @SuppressWarnings("unchecked")
  public <T extends IColumn> T getColumnById(String id) {
    return (T) m_idIndexes.get(id);
  }


When looking up balance with Balance, the above code returns null.

I changed the field from balanceColumn to BalanceColumn and the data showed up.

index.php/fa/36043/0/

I don't know if this is by design or a bug ?
Re: Tablefield - Tablefield data not shown on a tab in a groupbox [message #1810147 is a reply to message #1810141] Thu, 01 August 2019 12:39 Go to previous message
Claudio Guglielmo is currently offline Claudio GuglielmoFriend
Messages: 256
Registered: March 2010
Senior Member
Hi Tore

I am glad you found it out. The Java naming convention says that the first letter of a class should always be in uppercase. I wasn't aware that Scout relies on that but I recommend you to follow the convention. I would not consider this a bug, rather a feature to enforce good coding style ;-)

Cheers
Claudio
Previous Topic:Using PDF.js under JSP (Tomcat)
Next Topic:Object from Database
Goto Forum:
  


Current Time: Thu Apr 25 05:05:17 GMT 2024

Powered by FUDForum. Page generated in 0.03038 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top