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

Can submit button be used in a frame on a formview? #345

Open
MarkLFT opened this issue Mar 28, 2023 · 5 comments
Open

Can submit button be used in a frame on a formview? #345

MarkLFT opened this issue Mar 28, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@MarkLFT
Copy link

MarkLFT commented Mar 28, 2023

My Question Here ?

I am using a FormView, as the form is quite long, I want to display it in small cards. I am using Frames to group blocks of inputs, but if I try to put the Submit button into a frame for aesthetic purposes, it no longer triggers the command defined using the FormView submit command. Is this by design or am I just doing something wrong?

<input:FormView SubmitCommand="{Binding SubmitCommand}"
                    IsValidated="{Binding IsValidated}"
                    Spacing="10">
<Frame>
<Button Text="Save" input:FormView.IsSubmitButton="True"/>
</Frame>
</input:FormView>
@enisn enisn added the question Further information is requested label Mar 28, 2023
@enisn
Copy link
Owner

enisn commented Mar 28, 2023

Yeah, it should be working since it looks or it recursively. If it doesn't work we can fix it if you share reproduction steps

@MarkLFT
Copy link
Author

MarkLFT commented Mar 28, 2023

Thanks for the prompt response, I originally tried it in a frame, then in a plain VerticalStackLayout, and in both cases the command did not fire. But keep it as a direct child of the FormView and it fires.

Many thanks, this project is a great help for me. I am making my first app, and enjoying it.

@enisn
Copy link
Owner

enisn commented Mar 28, 2023

Ok, I'll investigate. It should be working, and currently it seems it's a bug. By the way, you can set your frame as submit button as a workaround until the bug is solved:

<Frame input:FormView.IsSubmitButton="True">
    <Button Text="Save" InputTransparent="True"/>
</Frame>

InputTransparent might be required for iOS & OSX

@enisn enisn added bug Something isn't working and removed question Further information is requested labels Mar 28, 2023
@MarkLFT
Copy link
Author

MarkLFT commented Mar 28, 2023

Many thanks for the prompt action.

@MarkLFT
Copy link
Author

MarkLFT commented Mar 29, 2023

Just to provide a little more feedback... The validations do not work also when in a frame.

'''

            <material:TextField Title="Manager Name" Icon="{FontImageSource FontFamily=MaterialRegular, Glyph={x:Static micons:MaterialRegular.Person}}" Text="{Binding License.Customer.CustomerName}" AllowClear="True">
                <validation:RequiredValidation/>
            </material:TextField>
            <material:TextField Title="Email Address" Icon="{FontImageSource FontFamily=MaterialRegular, Glyph={x:Static micons:MaterialRegular.Email}}" Text="{Binding License.Customer.EmailAddress}" AllowClear="True">
                <validation:RequiredValidation/>
                <validation:RegexValidation Pattern="{x:Static input:AdvancedEntry.REGEX_EMAIL}" Message="Please type a valid e-mail address." />
            </material:TextField>

        </VerticalStackLayout>
    </Frame>

'''

This code does not raise any warnings and goes directly to the Submit command, removing the frame and warnings are displayed as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants