RobYost Posted December 5, 2017 Share Posted December 5, 2017 If you put a TUnimEdit on a form and then change the .Text field the x-clear-icon image disappears. If you make a change to the field with your phone it comes back. But the problem is I want to put a value in the field at form show. This makes the X disappear and the user can not easily clear the field. I was able to reproduce this on your basic mobile demo. procedure TMainmForm.UnimButton1Click(Sender: TObject); begin UnimLabel1.Caption := 'Hello World!'; edt1.Text := '2000.00'; edt1.JSInterface.JSConfig('clearicon', [True]); end; clicking on UnimLabel1 causes the text in edt1 to change to 2000.00 and the x-clear-icon to disappear. I then added the JSConfig line, but I get the following error. >>> Do you know how to fix this problem? <<< --------------------------- Debugger Exception Notification --------------------------- Project basic.exe raised exception class Exception with message 'Config Option: O30->clearicon:true<br/>is refering a previous request,<br/>it's not allowed in AJAX request or JS handler.<br/>Use equivalent Public Property or Method instead.'. --------------------------- Break Continue Help --------------------------- Quote Link to comment Share on other sites More sharing options...
Sherzod Posted December 6, 2017 Share Posted December 6, 2017 Hi, Can you try to use this approach for now ?!: ... //edt1.Text := '2000.00'; edt1.JSInterface.JSCall('setValue', ['2000.00']); Quote Link to comment Share on other sites More sharing options...
RobYost Posted December 6, 2017 Author Share Posted December 6, 2017 Thank you, that works. But I have to call a function every time I want to change the value in code. Is there a way for you to add this to the code, or tell me how to add it to a component derived from TUnimEdit. Here is what I use: https://unigui.miraheze.org/wiki/TmUniRyEdit I tried adding DoOnChange and DoOnEnter, but neither was ever called: protected procedure DoOnChange; override; procedure DoOnEnter; override; ... procedure TmUniRyEdit.DoOnChange; begin inherited; JSInterface.JSCall('setValue', ['1000.00']); end; procedure TmUniRyEdit.DoOnEnter; begin inherited; JSInterface.JSCall('setValue', ['2000.00']); end; Quote Link to comment Share on other sites More sharing options...
herculanojs Posted March 16, 2018 Share Posted March 16, 2018 How can I hide the clean content icon from a unimedit. For many times this further disturbs what helps. On most devices there is already an option on keyboards to handle this. And such an icon occupies too much space Again the suggestion is that the components for mobile have more options. 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.