Jump to content

UniDBEdit allowBlank SetFocus


Eugeniusz Rink

Recommended Posts

Hi.

I set UniDBEdit on the form and define the requirement for completion using:

UniDBEdit1.JSInterface.JSConfig('allowBlank', [False]);

UniButton4.JSInterface.JSAddListener('click', 'function(){return '+ Self.WebForm.JSForm.JSName +'.isValid()}');

Everything works great, but I have a problem when TUniDBEdit is on one of the tabs, e.g. UniPageControl.

I wanted to program the SetFocus event but I have no idea how to download UniDBEdit that has not been filled in and is not currently visible to the user?

Link to comment
Share on other sites

5 hours ago, Sherzod said:

Hello,

And how would you like to set focus if the element is not visible?

The elements are visible. They are not hidden, they are located in the tabs tab. I would like to switch the tab programmatically and set SetFocus to UniDBEdit if it is not populated. Therefore, I need a list of UniDBEdit elements that have satatus 'allowBlank', [False] and have not been populated by the user.

Link to comment
Share on other sites

1 hour ago, Eugeniusz Rink said:

The elements are visible. They are not hidden, they are located in the tabs tab.

Well, this can also be considered as hidden at the moment.

You can set focus after the tab is activated.

Link to comment
Share on other sites

Quote

Well, this can also be considered as hidden at the moment.

You can set focus after the tab is activated.

OK, maybe we will start over.

So for example I have form and 4 uniDBEdits. 3 of them must be validated (no empty) so I make this in form create:

UniDBEdit1.JSInterface.JSConfig('allowBlank', [False]);

UniDBEdit2.JSInterface.JSConfig('allowBlank', [False]);

UniDBEdit3.JSInterface.JSConfig('allowBlank', [False]);

UniDBEdit4.JSInterface.JSConfig('allowBlank', [True]);

UniButton4.JSInterface.JSAddListener('click', 'function(){return '+ Self.WebForm.JSForm.JSName +'.isValid()}');

Now I wants to expand validation for new feature - showmessage and setfocus.

So I want to write procedure that will check in loop if all UniDBEdits in that form has allowblank set to false and UniDBEdit text is empty

if that 2 condition is fulfilled then procudure will show message and set focus current UniDBEdit in that loop.

So my question is how to check if component have set allowblank true or false?

Link to comment
Share on other sites

11 hours ago, eduardosuruagy said:

How can I use this property?

For example:

1. OnCreate event or during initialization ->

  UniDBEdit1.JSInterface.JSConfig('allowBlank', [False]);
  UniDBEdit1.CustomAttribs.Values['allowBlank'] := 'False';

2. And usage ->

  if UniDBEdit1.CustomAttribs.Values['allowBlank'] = 'False' then
  begin
    //
  end
  else if UniDBEdit1.CustomAttribs.Values['allowBlank'] = 'True' then
  begin
    //
  end
  else
  begin
    // 
  end;

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...