Use of ListBox with a lookupcall [message #1078082] |
Fri, 02 August 2013 10:15  |
Eclipse User |
|
|
|
Hi,
I use ListBox which is populate with a Lookupcall and I want to know how is the SQL script to use with it.
SELECT P.IDPROD,
P.NOMPROD
FROM PROD P
WHERE 1 = 1
AND (P.CAT_IDCAT = :master
OR
:master IS NULL)
I get the error:
java.sql.SQLException: Operand should contain 1 column(s)]]
[Updated on: Fri, 02 August 2013 10:21] by Moderator
|
|
|
|
|
Re: Use of ListBox with a lookupcall [message #1079843 is a reply to message #1078214] |
Mon, 05 August 2013 02:34  |
Eclipse User |
|
|
|
Hi,
I think you are exactly in this case: Operand should contain 1 column(s)
Quote: I think, the problem is the "WHEN (${CampType}) IS NOT NULL"
For this case, the value should not be a list.
Instead of "${CampType}" eclipse scout uses a syntax like this ":campType", but this is the same.
I do not know MySQL very well. I cannot tell what your solution could be.
Ranto ANDRIANJAFY wrote on Fri, 02 August 2013 19:36My question is:
Is there any function to get the master value (like getMaster()) in a LookupService (server side)?
I am not sure what you want to do. Please notice that for your lookup service, you can extend AbstractSqlLookupService or AbstractLookupService.
1/
Extending AbstractLookupService is more generic. You implement:
* LookupRow[] getDataByKey(LookupCall call)
* LookupRow[] getDataByText(LookupCall call)
* LookupRow[] getDataByAll(LookupCall call)
* LookupRow[] getDataByRec(LookupCall call)
In this case you have access to call.getMaster().
2/
If you extend AbstractSqlLookupService, you get implementations for the four methods that are based on the SQL statement provided by getConfiguredSqlSelect(). The call object is provided as SQL bind. This means that you are limited to what you can do in the SQL statement.
If you need a more complex logic, you might need to use AbstractLookupService instaead of AbstractSqlLookupService. This way you can build the SQL script with more flexibility.
|
|
|
Powered by
FUDForum. Page generated in 0.03736 seconds