the default value is defined with the template definition, so it cannot be changed dynamically.
To make dynamic changes to the forms, you need a rule. With this rule here you can read the template and save it somewhere
<PROPERTY name="TEMPLATE" source="#global"/>
<PROPERTY name="VALUE" source="st_Template/>
But in the metadata it would be the page template of the metadata, which is always the same. So it's a bit more complicated.
Maybe the following will solve your problem:
Define a hidden input component within each page template, which you assign the desired "default value" for the respective pagetemplate. It's important that it's the same input component (COMBOBOX) that should be pre-populated in the metadata (otherwise the value cannot just be copied)
If the value of the page template should always be taken (so it is not a default value, but an automatic defined value), it should be sufficient to use the following rule (adjust the component names):
<SCHEDULE delay="0" id="metadatadropdown" service="FormDataValueService">
<PROPERTY name="PAGE_UID" source="#global"/>
<PROPERTY name="VALUE" source="md_myCombobox"/>
More Information about the FormDataValueService can be found here:
FirstSpirit Online Documentation - Accessing information from other forms
But if it is really a default value, then you need another hidden input component, this time in the metadata. The value from the page template must then be transferred to this component (via the above rule) and adopted as the default value in the final target component with a second rule, which is only executed if the target input component is empty.
I hope this will help you to solve the problem.