Problem starting with release 7.0.71.1993

With or without the uDAFields.pas changed?

Why don’t use the latest stable?

I do a complete clean install and with version RO 7.0.71.1093 work as expected, but after install latest stable RO 7.0.73.1111 it fails again.

Hello,
We reproduced it. Logged as #67158. We will send you a workaround after fixing

@DonaldShimoda: it is a bug in DevEx. set breakpoint as

procedure TDACustomField.InternalOnSetText(Sender: TField; const Text: string);
begin
  if Assigned(fOnSetText) then //<<<< here

and start your testcase in debug mode. you will see in call stack that it passes LookupKey value instead of LookupResult for VendorName fld

as a workaround, you can manually disable this event as

ClientDataModule.tbl_PRODUCTS.Open;
ClientDataModule.tbl_PRODUCTS.FieldByName('Vendorname').BoundedField.OnSetText := nil;

@evgenyk i will test it, but have no sense. Why it happens with some RO versions and don’t with others?

@DonaldShimoda: we have introduced support of OnSetText/OnGetText events for TDAField a some time ago and devex dislikes it …

I let Devex know about the problem will wait a solution from them.

https://www.devexpress.com/Support/Center/Question/Details/Q581798

Thanks for your support.

Well, seems like devexpress vxl team forget how works delphi at all. They try to install trial version and get a error and don’t know how to resolve.

Anybody can help them?

@DonaldShimoda
this can happen if the system path is very long before installing, as a workaround - check “Adding to Delphi’s override paths” at installing DAD

by other hand, this case should be also reproduced with this code without DA:

{ 
procedure TField.SetEditText(const Value: string);
begin
  if Assigned(FOnSetText) then FOnSetText(Self, Value) else SetText(Value);
end;
}

type THackField = class(TField);
procedure TForm1.MySetText(Sender: TField; const Text: string);
begin   
   THackField(fField).SetText(Text);  // perform the same processing as in TField.SetEditText in case event is not assigned
end;

<lookupfield>.OnSetText := MySetText;
// try to change lookup and see LookupKey instead of LookupResult in MySetText

@EvgenyK i will pass your suggestion to the devexpress team, remember, they have this problem , not me, and according to mac comments seems like them don’t want to collaborate at all.

FYI

http://www.devexpress.com/Support/Center/Question/Details/Q581798#answer-c92e3fc6-b9a1-11e3-8f17-005056c00008

Let me know if they are correct or not.

Reading http://docwiki.embarcadero.com/Libraries/XE5/en/Data.DB.TField.OnGetText it looks to me like it is meant to work like DevExpress have done it, though I don’t understand why if I put something on a grid column to specify a format, then it doesn’t use that but they assume the DB field’s formatting is to overrule that.

I logged the same issue when it first popped up in builds after .71.1097 (RO #65455 and #65492 refer) after I’d logged a question with DevExpress (Q555207) and they’d convinced me it was the data table where the problem was. Now I’m not so sure, even after reading EMB’s docs.

I also notice OnGetText (and probably OnSetText also) in Delphi which was around the time the issue popped up, not sure if it’s related.

I think, DevEx detects that OnGetText/OnSetText events are present and doesn’t format these fields. If field’s format is set on dataset level via TDAField, it works as expected

request for these events was here

Hello,
Now we have only latest trial Devex version and can’t test this fix.

What about if you change TDACustomField.Bind so it only calls InternalOnGetText if there is something set to override it, for example:

if DisplayFormat>'' then begin
  fField.OnGetText := InternalOnGetText;
  fField.OnSetText := InternalOnSetText;
end;

I just tried this and it seems to work in all scenarios (with or without Devexpress grid column settings)

Thats sound fine to me. Is ok for RO?

Donald, note I didn’t try it on your case, just on the issue I was having but it is the same thing I think so you can easily try it (and it’s a whole lot easier than modifying the DevExpress code and waiting half an hour for its installer to recompile everything). FYI, in my original RO case I was advised to comment out the two lines above, which I continue to do with each DA release, though having read more into you case, I think something along the lines I’ve suggested could work without breaking those who asked for Get/SetText support (even though it’s broken our code!)

Hello,
We can’t apply this fix because it can break logic for another users.

… and yet the change you made that brought this to light has broken the logic for existing users.

Why will this break the logic for other users?

Exactly! We need a decision on this situation right now to know what to do.