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

How to retrieve form data from nodes when saving processes #441

Open
xuzeyu91 opened this issue May 21, 2024 · 0 comments
Open

How to retrieve form data from nodes when saving processes #441

xuzeyu91 opened this issue May 21, 2024 · 0 comments

Comments

@xuzeyu91
Copy link

<div>
    <Card Size="small" TitleTemplate="titleTemplate" Style="width:300px;">
        <Body>
            <p>选择应用</p>

            <Select 
                    @bind-Values="appIds"
                    Placeholder="选择应用"
                    TItemValue="string"
                    TItem="string"
                    Size="@AntSizeLDSType.Default">
                <SelectOptions>
                    @foreach (var app in _appList)
                    {
                        <SelectOption TItem="string" TItemValue="string" Value="@app.Id" Label="@app.Name" />
                    }
                </SelectOptions>
            </Select>
        </Body>
    </Card>
   

    @foreach (var port in Node.Ports)
    {
        // In case you have any ports to show
        // IMPORTANT: You are always in charge of rendering ports
        <PortRenderer @key="port" Port="port" />
    }
</div>

@code {
    // This gets filled by the library
    [Parameter] public AppNode Node { get; set; } = null!;
    [Inject] IApps_Repositories _apps_Repositories { get; set; }
    RenderFragment titleTemplate =@<div><Icon Type="windows" Theme="outline" />选择应用</div>;
    private List<Apps> _appList = new List<Apps>();
    IEnumerable<string> appIds;

    protected override void OnInitialized()
    {
        base.OnInitialized();
        _appList = _apps_Repositories.GetList();
    }
}

For example, when I use custom nodes, each node will have custom form content. How should I retrieve this data when saving? Currently, I can only retrieve nodes and links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant