Skip to content

Commit

Permalink
Add docs for RenderTemplateOverride. (#317)
Browse files Browse the repository at this point in the history
Small improvement in attribute name in AX.
  • Loading branch information
Brano5 authored Jun 10, 2024
1 parent f27c819 commit 29dd546
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
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

0 comments on commit 29dd546

Please sign in to comment.