Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.37 KB

portalfx-blades-outputs.md

File metadata and controls

29 lines (18 loc) · 1.37 KB

Blade Outputs

In some cases, you may want to pass information from the current blade back to the parent blade. Blades can define a list of output properties that flow back to the calling blade. A common use for this binding is to return data from a child blade back to a part.

![Typical use of blade outputs][part-settings]

In this example, the parent blade defines a BladeAction which passes an id property to the child blade. This will allow changes in the View Model on the child blade to flow back to the view model on the parent blade.

\SamplesExtension\Extension\Client\Bindings\OutputBindings\OutputBindings.pdl

<CustomPart Name="ParentPart"
            ViewModel="{ViewModel Name=OutputBindingsParentPartViewModel,
                                  Module=./OutputBindings/ViewModels/OutputBindingsViewModels}"
            Template="{Html Source='Templates\\Parent.html'}">

  <BladeAction Blade="OutputBindingsChildBlade">
    <BladeOutput Parameter="currentNumber"
                 Target="currentNumber" />
  </BladeAction>
</CustomPart>

In the snippet above, OutputBindingsChildBlade will be opened with a currentNumber parameter. The child blade will be responsible for setting the value on the output binding. After that value is set, onInputsSet of the part will be invoked, this time with a value named currentNumber.