irigsoft Posted March 16 Share Posted March 16 Hello. I need to read (and use) value in MyVariable declared as public on uniMainModule I have uniEdit.ClientEvents.ExtEvents keydown and I want to show alert with MyVariable value, is it possible to do it? function keydown is hardcoded on uniEdit, so is not possible to use it when form is created. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 17 Share Posted March 17 4 hours ago, irigsoft said: I have uniEdit.ClientEvents.ExtEvents keydown and I want to show alert with MyVariable value, is it possible to do it? function keydown is hardcoded on uniEdit, so is not possible to use it when form is created. Hello, Can you please explain in more detail? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted March 17 Author Share Posted March 17 5 hours ago, Sherzod said: Hello, Can you please explain in more detail? Hi. uniMainMOdule public ReplacePswCnt : Integer; 1. FormCreate ReplacePswCnt := 5; 2. uniEdit.ClientEvents.ExtEvents.Values ['keydown'] 3. I enter some key and result must be (ReplacePswCnt + 5) = 10: alert ('key=10'); 4. result nothing is happening ! Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 17 Share Posted March 17 11 minutes ago, irigsoft said: 4. result nothing is happening ! Well, the replacePswCnt variable was not found on the client side... Quote Link to comment Share on other sites More sharing options...
irigsoft Posted March 17 Author Share Posted March 17 6 minutes ago, Sherzod said: Well, the replacePswCnt variable was not found on the client side... Yes. How to use it on uniEdit.ClientEvents.ExtEvents ['keydown'] ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 17 Share Posted March 17 Using custom property for example... Quote Link to comment Share on other sites More sharing options...
irigsoft Posted March 17 Author Share Posted March 17 3 minutes ago, Sherzod said: Using custom property for example... is possible to give me some kind of code example ? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 17 Share Posted March 17 10 hours ago, irigsoft said: is possible to give me some kind of code example ? Sorry for late response. One possible solution: 1. UniEdit1... function keydown(sender, e, eOpts) { var customVar = ajaxRequest(sender, 'getCVar', {}, false).responseText; alert(parseInt(customVar) + 5); } 2. procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'getCVar' then begin // Instead of 10, "any variable"... UniSession.SendResponse(10.ToString()); end; end; 1 Quote Link to comment Share on other sites More sharing options...
irigsoft Posted March 17 Author Share Posted March 17 1 minute ago, Sherzod said: Sorry for late response. One possible solution: 1. UniEdit1... function keydown(sender, e, eOpts) { var customVar = ajaxRequest(sender, 'getCVar', {}, false).responseText; alert(parseInt(customVar) + 5); } 2. procedure TMainForm.UniEdit1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); begin if EventName = 'getCVar' then begin // Instead of 10, "any variable"... UniSession.SendResponse(10.ToString()); end; end; Thanks I will try it. 1 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.