SISBLU Software Posted August 18, 2020 Share Posted August 18, 2020 how to go to first line memo? No work: UniSession.AddJS(UniScrollBox1.JSName+'.getTargetEl().scrollTo("top");'); Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted August 18, 2020 Author Share Posted August 18, 2020 no work: UniSession.AddJS(UniMemo1.JSName+'.getTargetEl().scrollTo("top");'); Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 19, 2020 Share Posted August 19, 2020 13 hours ago, Daha Software said: how to go to first line memo? Hello, One possible solution: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniMemo1.JSInterface.JSCall('inputEl.scrollTo', ['top']); end; Quote Link to comment Share on other sites More sharing options...
SISBLU Software Posted August 19, 2020 Author Share Posted August 19, 2020 Perfect. Thank You Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Share Posted August 20, 2020 On 8/19/2020 at 12:20 PM, Sherzod said: procedure TMainForm.UniButton1Click(Sender: TObject); begin UniMemo1.JSInterface.JSCall('inputEl.scrollTo', ['top']); end; I have the same problem, but this solution doesn't work in modal form. I've noticed that sometimes JSCall, JSCode, AddJS have effect only if UniSynchronize call presents before, but in modal form I can't use UniSynchronize May be there's some secret I don't know yet? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 You can also use a clientSide solution I think. Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Share Posted August 20, 2020 3 minutes ago, Sherzod said: You can also use a clientSide solution I think. Sorry for my slow wits but what do you mean? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 For example, How will you call the code, through a click? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 If yes, you can use ClientEvents... Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Share Posted August 20, 2020 20 minutes ago, Sherzod said: How will you call the code, through a click? I call this code in UniTimer.OnTimer event I have a thread which makes some actions and adds error messages to it's string "Errors" property. Then, in the OnTimer event , when thread's variable fWorking = False, that is my thread ends it's job - I display value of "Errors" in UniMemo. And I additionally add some lines to it. I'm not sure which ClientEvent I could use to update umiMemo just AFTER I fill it by my "Errors" text Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 2 minutes ago, Nadya said: adds error messages... And this moment is working properly? Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Share Posted August 20, 2020 3 minutes ago, Sherzod said: And this moment is working properly? You mean, thread? Yes, thread works properly, "Errors" - means not application errors, but just incorrect records list, which user attempts to save to database. In other words, it's correct application behaviour. I make some additional description strings, add them to "Errors" list and add it to uniMemo. The only problem - memo scroll to last line after that Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 31 minutes ago, Nadya said: The only problem - memo scroll to last line after that Can you try this approach?: procedure TMainForm.UniFormCreate(Sender: TObject); begin with UniMemo1.JSInterface do JSAddListener('dirtychange', 'function(){this.inputEl.scrollTo("top")}'); end; Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Share Posted August 20, 2020 2 hours ago, Sherzod said: with UniMemo1.JSInterface do JSAddListener('dirtychange', 'function(){this.inputEl.scrollTo("top")}'); Sorry, it doesn't help Quote Link to comment Share on other sites More sharing options...
Sherzod Posted August 20, 2020 Share Posted August 20, 2020 14 minutes ago, Nadya said: Sorry, it doesn't help Strange, maybe I didn't understand your issue. Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 20, 2020 Share Posted August 20, 2020 26 minutes ago, Sherzod said: Strange, maybe I didn't understand your issue. I'll try to make a testcase 1 Quote Link to comment Share on other sites More sharing options...
Nadya Posted August 21, 2020 Share Posted August 21, 2020 15 hours ago, Sherzod said: Strange, maybe I didn't understand your issue. Morning, Sherzod! I've changed my previous testcase with nonmodal and modal windows to bring it's components and structure maximally closer to my real project. Yes, it's "business logic" looks like ravings of a madman I know and I'm sorry for that testcase So please, do following: 1) on MainForm press button "Show nonmodal form 1" 2) on page "NonModalForm1" press button "Show modal test form" 3) on modal form press button 'Start thread' and in UniFileUpload select one or two .txt files. WorkThread copying files on server, then in a cycle makes some actions with every file. In case of errors the thread remembers them in property "Errors" UniTimer traces thread work and after thread ends - adds "Errors" text to mmLog content. I'm really sorry for annoing questions Thank for you kindness and help, Sherzod! 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.