Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » Refresh displaytext on SmartField
Refresh displaytext on SmartField [message #1797463] Wed, 31 October 2018 05:27 Go to next message
Eclipse UserFriend
Hello!

I have a SmartField with a list of companies.
I want to refresh the displaytext(Name of the company) of this SmartField and I achieved this using the following code:

getSmartField().setValue(null);
getSmartField().setValue(oldCompanyID);


However, I expected that the following code would do the same and is cleaner:
getSmartField().refreshDisplayText();


Is this a bug or is there a better workaround?

Thank you!
Re: Refresh displaytext on SmartField [message #1797605 is a reply to message #1797463] Fri, 02 November 2018 12:08 Go to previous message
Eclipse UserFriend
Hi Mario

I expect that what you want to achieve is to reload the display text because it changed on the database (while the key remained the same), after the smartfield loaded it.

The refreshDisplayText method is typically used in combination with formatting (execFormatValue or similar methods) and you have to switch how the value is displayed.
Example: NumberFields call this method when the you change the property of how many zeros after the decimal point should be displayed, which then reformats the value.

A SmartField uses a LookupCall or a CodeType to provide it with a value and display text. Calling refreshDisplayText will not change anything, because the display text is precomputed and the method's implementation is empty.
It's debatable whether it should - but that would require some discussion among other committers :)

For now, there is no better workaround that I know of that what you already use.
Previous Topic:How to Show / Hide Outlines depending on User Session
Next Topic:AbstractMobileStandaloneRwtEnvironment cannot be resolved to a type
Goto Forum:
  


Current Time: Tue Jul 15 00:57:54 EDT 2025

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

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

Back to the top