Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for RenderTemplateOverride. #317

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docfx/articles/blazor/RENDERABLECONTENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ Primitive types are generated in **Control** presentation type whereas IxCompone

### **RenderIgnore and custom labels**


Thanks to the support of custom attributes in the PLC code you can specify, which elements you want to exclude from rendering. You can also set custom names for each element. See the example below.

Let's have the following PLC code with attributes:
Expand Down Expand Up @@ -172,6 +171,17 @@ testIxComponent: IxComponent;
```
<div id='id-editprop'/>

### **RenderTemplateOverride**

You can use the RenderTemplateOverride attribute to override the generated template. This attribute replaces the generated template with the template you specified.

When you specifying a template name, it is necessary to include the full name with a namespace.

```
{#ix-attr:[RenderTemplateOverride("ixBlazor.App.Custom.MySimplePrimitiveStruct")]}
testRenderTemplateOverrideStruct : stSimplePrimitive;
```

### **Edit Property**

Then renderer binds variables to `Cyclic` or `Edit` property of an Onliner. When an element gets focus, value is bound to `Edit` property and UI updates stops. After the focus is lost, the value is bound back to `Cyclic` property and the value in the UI start updating again.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ CLASS MAIN
cu00: CU00x;
cuBase: CUBase;

{#ix-attr:[RenderTemplateOverrideAttribute("ixBlazor.App.Custom.MySimplePrimitiveStruct")]}
{#ix-attr:[RenderTemplateOverride("ixBlazor.App.Custom.MySimplePrimitiveStruct")]}
OverridedSimpleStruct : stSimplePrimitive;

{#ix-attr:[RenderTemplateOverrideAttribute("ixBlazor.App.Custom.MySimplePrimitiveTag")]}
{#ix-attr:[RenderTemplateOverride("ixBlazor.App.Custom.MySimplePrimitiveTag")]}
OverridedSimpleTag : WORD;

END_VAR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ CLASS testingProgram

testLayouts : stTestLayouts;

{#ix-attr:[RenderTemplateOverrideAttribute("ixBlazor.App.Custom.MySimplePrimitiveStruct")]}
{#ix-attr:[RenderTemplateOverride("ixBlazor.App.Custom.MySimplePrimitiveStruct")]}
testRenderTemplateOverrideStruct : stSimplePrimitive;

{#ix-attr:[RenderTemplateOverrideAttribute("ixBlazor.App.Custom.MySimplePrimitiveTag")]}
{#ix-attr:[RenderTemplateOverride("ixBlazor.App.Custom.MySimplePrimitiveTag")]}
testRenderTemplateOverrideTag : WORD;
END_VAR

Expand Down
Loading