declarativewidgets icon indicating copy to clipboard operation
declarativewidgets copied to clipboard

urth-core-function argument properties should declare types with polymer

Open peller opened this issue 9 years ago • 1 comments

For example, if a function argument is a boolean, passing in "true" should be treated as a boolean, not a string.

To test, I changed the test case in 3b to use "false" instead of "{{checked}}":

%%html
<template is="dom-bind">
    <urth-core-function id="f3b" ref="aFunctionWithBoolean" arg-b="false" result="{{res}}" auto></urth-core-function>
    <paper-toggle-button checked="{{checked}}"></paper-toggle-button>
    <span>{{res}}</span> World
</template>

peller avatar Mar 07 '16 16:03 peller

Here is a summary of the problem.

When the element initializes, there is code that reads the arg-* attributes and put their values in the args property. At this point, there is no information about the function signature, so types are unknown. Later on a signature arrives. At this point we would need to do the following:

  1. Check if the param in the signature has type information
  2. If there is a value in args and it is string type, then coarse the value to the type in the signature
  3. Set that value as the default value of the dynamically created arg.* property.

lbustelo avatar Mar 08 '16 15:03 lbustelo