Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » SmartField and Suggestions while Typing
SmartField and Suggestions while Typing [message #1575216] Tue, 20 January 2015 17:53 Go to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 213
Registered: November 2014
Senior Member

Hello,

I don't know why but I can't get a smart field to work properly. When I dropdown the list of a smart field I can see the entries as expected:
index.php/fa/20509/0/

But when typing "Alfred" I'd expect at least the 3 entries shown in the above screenshot. But a shown below, nothing shows up:
index.php/fa/20510/0/

Why is this?

The LookupCode looks like this:
@Override
  protected String getConfiguredSqlSelect() {
    return "SELECT F.ID, CONCAT(TRIM(F.FirstName), ' ', TRIM(F.Lastname)) AS ForrestHelperName FROM ForrestHelper F WHERE   1=1 "
        + "<key>   AND     F.ID = :key </key>"
        + "<text>  AND     UPPER(CONCAT(TRIM(F.FirstName), ' ', TRIM(F.Lastname))) LIKE UPPER(:text||'%') </text> "
        + "<all> </all> ";
  }


Looking at the console log this is shown:
SQL with binds:
SELECT    F.ID,
          CONCAT(TRIM(F.FIRSTNAME), ' ', TRIM(F.LASTNAME))
AS        FORRESTHELPERNAME
FROM      FORRESTHELPER F
WHERE     1 = 1
          AND UPPER(CONCAT(TRIM(F.FIRSTNAME), ' ', TRIM(F.LASTNAME))) LIKE UPPER(:text || '%')
IN  :text => ? [VARCHAR alfred%]


Putting this output into MySQL Workbench works as expected...

I have no idea what's wrong with that.....

Peter
Re: SmartField and Suggestions while Typing [message #1575458 is a reply to message #1575216] Tue, 20 January 2015 20:58 Go to previous messageGo to next message
Stathis Alexopoulos is currently offline Stathis AlexopoulosFriend
Messages: 5
Registered: November 2014
Junior Member
Hello Peter,

In fact there is something returned. There are three empty lines.

What is the purpose and usage of "AS ForrestHelperName" ?
Re: SmartField and Suggestions while Typing [message #1575485 is a reply to message #1575216] Tue, 20 January 2015 21:18 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 think the lookup code for MySQL needs to be

@Override
  protected String getConfiguredSqlSelect() {
    return "SELECT F.ID, CONCAT(TRIM(F.FirstName), ' ', TRIM(F.Lastname)) AS ForrestHelperName FROM ForrestHelper F WHERE   1=1 "
        + "<key>   AND     F.ID = :key </key>"
        + "<text>  AND     UPPER(CONCAT(TRIM(F.FirstName), ' ', TRIM(F.Lastname))) LIKE UPPER(CONCAT(:text,'%')) </text> "
        + "<all> </all> ";
  }

Re: SmartField and Suggestions while Typing [message #1576413 is a reply to message #1575485] Wed, 21 January 2015 09:48 Go to previous messageGo to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 213
Registered: November 2014
Senior Member

Thanks for the suggestion. I'll try it at home. Seems MySQL doesn't like the "||" Smile

Thanks.
Peter
Re: SmartField and Suggestions while Typing [message #1577028 is a reply to message #1576413] Wed, 21 January 2015 17:19 Go to previous messageGo to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 213
Registered: November 2014
Senior Member

Thanks. The missing CONCAT was the problem...
Re: SmartField and Suggestions while Typing [message #1577199 is a reply to message #1577028] Wed, 21 January 2015 19:23 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
No problems
Glad to be of help.

Congratulations with the screen layouts you created with scout.
They really look very nice.
Re: SmartField and Suggestions while Typing [message #1578975 is a reply to message #1577199] Thu, 22 January 2015 18:34 Go to previous messageGo to next message
Peter Pfeifer is currently offline Peter PfeiferFriend
Messages: 213
Registered: November 2014
Senior Member

Tore Van Grembergen wrote on Wed, 21 January 2015 19:23

Congratulations with the screen layouts you created with scout.
They really look very nice.


Thanks Smile But as you can see, "Add" and "Delete" Button are not the same size. And Im Struggling that those buttons should always have a fixed size and be right aligned, while the table should horizontally grow/shrink depending on the screen size.

Peter
Re: SmartField and Suggestions while Typing [message #1585417 is a reply to message #1578975] Mon, 26 January 2015 08:55 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Peter Pfeifer wrote on Thu, 22 January 2015 19:34
But as you can see, "Add" and "Delete" Button are not the same size. And Im Struggling that those buttons should always have a fixed size and be right aligned, while the table should horizontally grow/shrink depending on the screen size.


This is an other problem. I have opened a new thread to discuss it: Button width and style

.

[Updated on: Mon, 26 January 2015 08:55]

Report message to a moderator

Previous Topic:Width in Pixel
Next Topic:Table HeaderCollumn Wrap Text
Goto Forum:
  


Current Time: Wed Apr 24 14:23:37 GMT 2024

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

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

Back to the top