Eugeniusz Rink Posted February 5 Share Posted February 5 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? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 6 Share Posted February 6 Hello, And how would you like to set focus if the element is not visible? Quote Link to comment Share on other sites More sharing options...
Eugeniusz Rink Posted February 6 Author Share Posted February 6 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 6 Share Posted February 6 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. Quote Link to comment Share on other sites More sharing options...
Eugeniusz Rink Posted February 6 Author Share Posted February 6 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? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 7 Share Posted February 7 On 2/6/2024 at 4:56 PM, Eugeniusz Rink said: So my question is how to check if component have set allowblank true or false? You can also use the CustomAttribs property for this. Quote Link to comment Share on other sites More sharing options...
Eugeniusz Rink Posted February 7 Author Share Posted February 7 1 hour ago, Sherzod said: You can also use the CustomAttribs property for this. That's it, thanks a lot 🙂 Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted February 7 Share Posted February 7 4 hours ago, Sherzod said: Você também pode usar a propriedade CustomAttribs para isso. How can I use this property? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 8 Share Posted February 8 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.