CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

rule EqualTo

by yocko » 15 May 2017 13:11

Hi,

I am experimenting with latest development version 4.0.0.3 (download link is saying 4.0.0.5, but installer says 4.0.0.3).

In your demo (unit CGJQEditFeatures) I added new edit on frame and included this code (I found it as your suggestion in one forum post):

Code: Select all
procedure TCGJQEditFeaturesFrame.IWCGJQFrameCreate(Sender: TObject);
begin
  IWCGJQNewEdit.JQValidateOptions.Enable:= True;
  with IWCGJQNewEdit.JQValidateOptions.Rules.Add do
    begin
      Rule  := jqvorvEqualTo;
      Value := '#' + IWCGJQEdit7.JQHTMLName;
    end;
end;


As you see on video bellow, rule EqualTo doesn't work... After values are equal it still reports error...
Image

Regards
yocko
 
Posts: 28
Joined: 12 Mar 2017 19:27

by Jorge Sousa » 15 May 2017 14:35

Hi

About

I am experimenting with latest development version 4.0.0.3 (download link is saying 4.0.0.5, but installer says 4.0.0.3).


We cannot confirm this, can you please check again, and tell us wiyyou think is 4.0.0.3 instead of 4.0.0.5

Please try with

Value := '#' + IWCGJQEdit7.HTMLName;

instead
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by yocko » 15 May 2017 16:21

Jorge Sousa wrote:Hi

About

I am experimenting with latest development version 4.0.0.3 (download link is saying 4.0.0.5, but installer says 4.0.0.3).


We cannot confirm this, can you please check again, and tell us wiyyou think is 4.0.0.3 instead of 4.0.0.5


Installer (downloaded some day back - probably on friday) is reporting 4.0.0.3
Image

I downloaded again today and now it is reporting 4.0.0.5 (also installer size is different)




Jorge Sousa wrote:Please try with

Value := '#' + IWCGJQEdit7.HTMLName;


It does NOT work either :( Same behaviour as in video in my first post.
yocko
 
Posts: 28
Joined: 12 Mar 2017 19:27

by Alexander Bulei » 16 May 2017 15:34

Hi yocko,

Please send us simple testcase...we've tested here and works as expected.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by yocko » 17 May 2017 08:30

Alexander Bulei wrote:Hi yocko,

Please send us simple testcase...we've tested here and works as expected.

Best Regards.


Reproducing is easy with your original demo.

In your edit demo (unit CGJQEditFeatures) I added new edit on frame and included this code (I found it as your suggestion in one forum post):

Code: Select all
procedure TCGJQEditFeaturesFrame.IWCGJQFrameCreate(Sender: TObject);
begin
  IWCGJQNewEdit.JQValidateOptions.Enable:= True;
  with IWCGJQNewEdit.JQValidateOptions.Rules.Add do
    begin
      Rule  := jqvorvEqualTo;
      Value := '#' + IWCGJQEdit7.JQHTMLName;
      //Value := '#' + IWCGJQEdit7.HTMLName;  --> doesn't work either
    end;
end;


Attached is also a simple demo project. I have two rules created in design time and one rule added in run time. And that run time added rule (EqualTo) doesn't work.

Here is video to show error for rule EqualTo (second edit to first edit) in my demo
Image

Regards
You do not have the required permissions to view the files attached to this post.
yocko
 
Posts: 28
Joined: 12 Mar 2017 19:27

by Alexander Bulei » 17 May 2017 12:31

Hi yocko,

Please check your changed demo in attachment.

Best Regards.
You do not have the required permissions to view the files attached to this post.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by yocko » 17 May 2017 19:03

Thanks. Your corrected demo works (if only one frame is used).

Here is my feedback for run time created rule using multiple frames:

If I am using multiple frames I must use real frame name (as you suggested) for every frame I create It can't be just 'Frame' as I saw in your original cgDevTools demo code:
Code: Select all
CGFindUniqueComponentName(Self,'Frame')


That was the reason why run time created rule for new edit I added to your original edit features frame demo didn't work (see video in my first post).

In demo I sent you (and you corrected it) I added another frame and run time created rule works correctly on ALL frames ONLY if I use:
Code: Select all
function TIWComponentForm.CreateNewFrame(AFrameClass: TIWCGFrameClass): TFrame;
var
  NewName: string;
begin
  NewName:= CGFindUniqueComponentName(Self,Copy(AFrameClass.ClassName,2,length(AFrameClass.ClassName)-1)); //not just 'Frame' !!!
  ...
  ...


If I add same code to your original cgDevTools demo (edit features frame with my new edit added) it works too. So obvioulsy run time created rule works correctly ONLY if frame is created with not only correct FrameClass BUT ALSO frame's real name.

Is it OK to create frames that way?
Code: Select all
NewName:= CGFindUniqueComponentName(Self,Copy(AFrameClass.ClassName,2,length(AFrameClass.ClassName)-1));

At least rune time created rules works in that case ;)

I am newbie, learning new cgDevTools stuff every day. Thanks for your help. I really appreciate it.


P.S. (not related to topic)
As a total newbie I am missing some cgDevTools programming tutorial how to do some things. There are so many properties so now I am learning by studying your demo and reading all forums topics, but as there are so many cgDevTools properties it is hard to find out what to change to get some result.

Your support is TOP. No question about that. But I understand we are taking away your time for basic questions which could be described in some tutorial with basic topics (working with frames, validating input...). So here is my +1 vote for such tutorial. :)
yocko
 
Posts: 28
Joined: 12 Mar 2017 19:27


Return to JQEdit

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.