Subform Parameters

Michael Monschau michael at brainydata.co.uk
Sun Sep 25 14:23:52 UTC 2022


Sorry, I was mixing up sub-forms and sub-windows here. The notation

	Do $cinst.$objs.mySubwindow.$parameters.$assign(parameter)
	Do $cinst.$objs.mySubwindow.$classname.$assign(“windowX”)

will work for windows and sub-windows, but it does not work for subforms. I suspect the difficulty is that the parent form and its sub-form field (which owns the $parameters property) remain instantiated on the client, whereas the only code that can tokenise a new list of parameters is the main Omnis executable on the server. Hence the remote form has the additional limitation of not being able to execute class notation once the form is instantiated.

 I hope I haven’t confused things more

Michael




Brainy Data Limited
The Home for Omnis components
Web: www.brainydata.com
GitHub: https://github.com/BrainyData



> On 25 Sep 2022, at 12:40, Michael Monschau <michael at brainydata.co.uk> wrote:
> 
> Hi Das,
> 
> I could be wrong but I think the key is that these parameters are passed to the construct of the subform, that means $parameters has to be assigned prior to an instance existing, which means assigning $parameters when designing the subform, or programatically via class notation:
> 
> 	$clib.$remoteforms.myForm.$objs.mySubform.$parameters.$assign(…)
> or
> 	$clib.$windows.myWindow.$objs.mySubwindow.$parameters.$assign(…)
> 
> Once the instance is constructed, assigning $parameters will have no effect, i.e.
> 	
> 	$cinst.$objs.mySubwindow.$parameters.$assign(…)
> 
> However, if you change the class of a subform at runtime, it may be that the following would still work:
> 
> 	Do $cinst.$objs.mySubwindow.$parameters.$assign(parameter)
> 	Do $cinst.$objs.mySubwindow.$classname.$assign(“windowX”)
> 
> That may be worth trying. 
> 
> In any case, if I am right, perhaps the wording in the documentation may could do with further clarification. 
> 
> Hope this makes sense
> 
> Michael
> 
> 
> 
> Brainy Data Limited
> The Home for Omnis components
> Web: www.brainydata.com
> GitHub: https://github.com/BrainyData
> 
> 
> 
>> On 22 Sep 2022, at 16:10, Das Goravani <goravanis at gmail.com> wrote:
>> 
>> 
>> The docs have this paragraph:
>> 
>> You can send parameters to the subform’s $construct() method by including a comma-separated list of parameter values in the $parameters property when you create the subform field. The $parameters property can only be assigned in the remote form editor, and it has no effect at runtime. If you attempt to set it at runtime in your code, the error "$parameters cannot be assigned at runtime" will be displayed on the client.
>> 
>> Why would they have parameters that have no effect at runtime?
>> 
>> When then are they good for?
>> 
>> Does this mean something else? 
>> 
>> Will I find that the parameters property works at runtime?
>> _____________________________________________________________
>> Manage your list subscriptions at https://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 
> 
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 



More information about the omnisdev-en mailing list