Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » ProposalField in RAP and SWT
ProposalField in RAP and SWT [message #1403131] Mon, 21 July 2014 14:49 Go to next message
Dennis Geesen is currently offline Dennis GeesenFriend
Messages: 46
Registered: June 2014
Member
Hi,

can someone confirm my potential bug!?

I want to have a proposal for a field, but it should also be possible to add own values. For example, add new cities: If it already exists, use it, otherwise create a new one.

After some investigations I found out that there was a "allowCustomText" property, which was removed in 4.0 due to redesign and the introduction of the proposal field.
So I used the proposal field to implement my content assits field.
First question is: Is this the new and correct field!?

It seems to work within SWT, but in my RAP client I cannot add any custom text, because I only can choose from proposed values. so in RAP the proposal field has the same behavior like in SWT. Therefore, my second question is: Is it a bug or is some setting missing?

The code is simple, but here it is:

@Order(20.0)
  public class CityField extends AbstractProposalField<Long> {

    @Override
    protected String getConfiguredLabel() {
      return TEXTS.get("City");
    }

    @Override
    protected Class<? extends ILookupCall<Long>> getConfiguredLookupCall() {
      return CityLookupCall.class;
    }
}



thanks!
Re: ProposalField in RAP and SWT [message #1403184 is a reply to message #1403131] Tue, 22 July 2014 08:59 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Dennis Geesen wrote on Mon, 21 July 2014 16:49
After some investigations I found out that there was a "allowCustomText" property, which was removed in 4.0 due to redesign and the introduction of the proposal field.
So I used the proposal field to implement my content assits field.
First question is: Is this the new and correct field!?



This is correct.
It was introduced with Scout 4.0.0 and refactoring: „Add generics in LookupCall and LookupServices"

I never took time to look at this new field, so your question is a good opportunity for me.

In SWT it looks like this:
index.php/fa/18607/0/

When I enter "Baden" that is not in the list, I can enter it:
index.php/fa/18608/0/

The LookupCall is from type Long, see the list of LookupRow I use in the Server:
return Arrays.asList(
    toLookupRow(1L, "Zurich"),
    toLookupRow(3L, "Basel"),
    toLookupRow(7L, "Bern")
    );


Notice that the CityField is a Value Type form type String.

When I do "getValue()" on the CityField I get: "Baden" or "Basel" (and not the Long key 3L as it would be the case with a SmartField).

The behavior is exactly the same with RAP.

I imagine you have other expectations (or I have not understood your question). Can you describe what you expect?
Re: ProposalField in RAP and SWT [message #1403188 is a reply to message #1403184] Tue, 22 July 2014 09:36 Go to previous messageGo to next message
Dennis Geesen is currently offline Dennis GeesenFriend
Messages: 46
Registered: June 2014
Member
Yes, this is what I expected and I did some tests with RAP. After some further research, I found out that the problem only appears in the tablet version of RAP.

The behavior in the tablet-RAP is the following. When I click on the text field a new dialog is open where I can choose from the proposals (this behavior is equal to the smart field).
Since the dialog opens directly on entering/focusing the field, you don't have the possibility to enter some custom text.
Re: ProposalField in RAP and SWT [message #1403197 is a reply to message #1403188] Tue, 22 July 2014 10:04 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Ok this might be a bug. Can you open a new bug? We will try to look into it.
Re: ProposalField in RAP and SWT [message #1403206 is a reply to message #1403197] Tue, 22 July 2014 10:54 Go to previous messageGo to next message
Dennis Geesen is currently offline Dennis GeesenFriend
Messages: 46
Registered: June 2014
Member
bug opened: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440091
Re: ProposalField in RAP and SWT [message #1403636 is a reply to message #1403206] Thu, 24 July 2014 17:47 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Thanks for opening this bug. I hope we will be able to look into it.

I have created an initial version of the ProposalField page in the Wiki, with some of the info contained in this forum thread.
Previous Topic:Page closing issue
Next Topic:Swing Browser
Goto Forum:
  


Current Time: Thu Apr 25 09:54:55 GMT 2024

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

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

Back to the top