Hi,
(1) I've defined a ListGrid in a componentXML Screen (which works fine) and am now trying to set the initial criteria for it.
E.g. like so:
On the server I get the following:
This seems like a bug to me since 1=2 is always false and consequently nothing is returned.
(2) A related bug:
When I add another criteria in a server side DMI, e.g.
the previous critiera gets corrupted and consequently the following warning is logged (and the criteria is not applied):
(3) A related question:
What I would actually like to do here is to set a criteria date 2 weeks in the past from now on. Is this doable using just componentXML? In plain Java, I'd just do something like long value = (new Date().getTime() - 2WeeksMsInLong) but how to do this inside a componentXML?
SmartClient Version: v8.3p_2013-05-16/PowerEdition Deployment (built 2013-05-16)
Thanks,
fatzopilot
(1) I've defined a ListGrid in a componentXML Screen (which works fine) and am now trying to set the initial criteria for it.
E.g. like so:
Code:
<isomorphicXML xmlns:fmt="WEB-INF/"> <DataSource> <loadID>SomeBean</loadID> </DataSource> <NewCustomGrid dataSource="ref:SomeBean" autoFetchData="true" ID="someBeanListGrid" autoDraw="false"> <fields> <ListGridField name="startTime" title="Start Time"/> ... </fields> <listEndEditAction>next</listEndEditAction> <showFilterEditor>true</showFilterEditor> <canEdit>true</canEdit> <canRemoveRecords>true</canRemoveRecords> <initialCriteria><Criterion> <fieldName>startTime</fieldName><operator>greaterThan</operator><value>13533696000</value> </Criterion></initialCriteria> </NewCustomGrid> </isomorphicXML>
Code:
criteria: {fieldName:"startTime",operator:"greaterThan",value:"13533696000"} values: {fieldName:"startTime",operator:"greaterThan",value:"13533696000"} === 2013-05-20 15:26:57,437 [c-11] DEBUG HibernateTransaction - [builtinApplication.ref:SomeBean_fetch] Started new transaction "10778264" === 2013-05-20 15:26:57,438 [c-11] WARN HibernateDataSource - [builtinApplication.ref:SomeBean_fetch] Trying to compare date type field 'startTime' with java.lang.String type value in criterion 'greaterThan' === 2013-05-20 15:26:57,438 [c-11] INFO HibernateDataSource - [builtinApplication.ref:SomeBean_fetch] Query string: select _SomeBean from com.aCompany.SomeBean _SomeBean where 1=2 and _SomeBean.startTime is not null Hibernate: select count(*) as col_0_0_ from SomeBean SomeBean0_ where 1=2 and (SomeBean0_.start_time is not null)
(2) A related bug:
When I add another criteria in a server side DMI, e.g.
Code:
long[] clientIds = new clientIds[]{41L}; Map criteria1 = dsRequest.getCriteria(); System.out.println(criteria1); //gives {fieldName=startTime, operator=greaterThan, value=13533696000} dsRequest.addToCriteria("clientId", "inSet", clientIds); Map criteria2 = dsRequest.getCriteria(); System.out.println(criteria2); //gives {criteria=[{value=startTime, fieldName=fieldName, operator=contains}, {value=greaterThan, fieldName=operator, operator=contains}, {value=13533696000, fieldName=value, operator=contains}, {value=[41], fieldName=clientId, operator=inSet}], operator=and, _constructor=AdvancedCriteria}
Code:
=== 2013-05-20 15:53:07,681 [ec-7] WARN HibernateDataSource - [builtinApplication.ref:SomeBean_fetch] Field name: 'fieldName' specified in criteria is not defined in data source. Skipping. === 2013-05-20 15:53:07,681 [ec-7] WARN HibernateDataSource - [builtinApplication.ref:SomeBean_fetch] Field name: 'operator' specified in criteria is not defined in data source. Skipping. === 2013-05-20 15:53:07,681 [ec-7] WARN HibernateDataSource - [builtinApplication.ref:SomeBean_fetch] Field name: 'value' specified in criteria is not defined in data source. Skipping.
What I would actually like to do here is to set a criteria date 2 weeks in the past from now on. Is this doable using just componentXML? In plain Java, I'd just do something like long value = (new Date().getTime() - 2WeeksMsInLong) but how to do this inside a componentXML?
SmartClient Version: v8.3p_2013-05-16/PowerEdition Deployment (built 2013-05-16)
Thanks,
fatzopilot
Comment