dkeene Posted January 19, 2020 Share Posted January 19, 2020 Howdy All I seem to be working well with uniGui components and have a great deal of experience with Delphi. I am having trouble communicating between the uniForms and Javascript and am looking for documentation on the interaction between these two worlds. For example, I correctly capture mousemove from a component and can set the X and Y values on my form with: function mousemove(sender, x, y, eOpts) { if (fmGenericTableEdit.LDesignModeNumber==0) { fmGenericTableEdit.LabelX.setText(fmGenericTableEdit.LDesignModeNumber); fmGenericTableEdit.LabelY.setText(Math.trunc(y)); } else { fmGenericTableEdit.LabelX.setText("D"+Math.trunc(x)); fmGenericTableEdit.LabelY.setText("D"+Math.trunc(y)); } fmGenericTableEdit.UniConsole.setText(fmGenericTableEdit.LDesignModeNumber); } However when I try to access fmGenericTableEdit.LDesignModeNumber, (a variable to indicate a mode, for example), it is coming through as "undefined". Also, is there a guide to debugging the javascript code in the IDE? is that possible? thanks!!! doug Quote Link to comment Share on other sites More sharing options...
dkeene Posted January 20, 2020 Author Share Posted January 20, 2020 Anyone? Quote Link to comment Share on other sites More sharing options...
dkeene Posted January 24, 2020 Author Share Posted January 24, 2020 Anyone? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted January 24, 2020 Share Posted January 24, 2020 Hi, Can you please explain what are you trying to do? Also can you please create a test case? Quote Link to comment Share on other sites More sharing options...
dkeene Posted January 25, 2020 Author Share Posted January 25, 2020 Hello, thank you Hayri for your reply. I am trying to pass a parameter to the mousemove such that the behavior changes if the LDesignEditMode is a certain value. So far, I can't seem to find documentation on how to pass values to this function. So for example, if LDesignEditMode is equal to 0, do something, else do another thing. Thanks Doug Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 25, 2020 Share Posted January 25, 2020 Hello, Sorry, but you already received a response from Farshad in the support portal: "Those properties will not be visible to client side. Only uniGUI components will be defined. However, the defined object is the corresponding Ext JS object not a Delphi object. For example for TUniEdit we have Ext.form.Field.Text. You will be able to use object properties and method defined for Ext.form.Field.Text. Delphi side properties and methods won't be available on client side."... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 25, 2020 Share Posted January 25, 2020 You can also create a property on the client side: procedure TMainForm.UniFormCreate(Sender: TObject); begin ... Self.WebForm.JSInterface.JSAssign('LDesignMode', [LDesignMode]); end; and in the setter method of your field: procedure TMainForm.SetDesignMode(const Value: Boolean); begin FDesignMode := Value; Self.WebForm.JSInterface.JSAssign('LDesignMode', [Value]); end; ... Quote Link to comment Share on other sites More sharing options...
dkeene Posted January 25, 2020 Author Share Posted January 25, 2020 Thank you Sherzod. Could you please tell me where this is documented? thanks doug Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 25, 2020 Share Posted January 25, 2020 You can also analyze these examples: \FMSoft\Framework\uniGUI\Demos\Desktop\CustomControl-xx 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.