Comments (5)
Wondering though about the role of < form > in Blazor app. As the discussion progresses, shall I Remove the < form > from the component so you can wrap it the way indicated? That would be the least opinionated way of doing it I think.
from blazor-adminlte.
Hi Johan,
Sjef made the Card, I saw a lot of different uses and refactored it. I am not surprised certain types of implementation have not been added to the Card yet since I have not seen all the uses yet, and they vary slightly a lot of times.
I think that you mean there are sometimes Forms within the card around the body, but often not.
There are a couple of options:
Making a CardBody Component. So the card body tag which is now <Body>@Content</Body>
would then look like <Body><CardBody>@Content</CardBody></Body>
If you want to add a form wrapper you can make it <Body><CardForm><CardBody>@Content</CardBody></CardForm></Body>
if you wanted to add a form wrapper.
I feel the downside to this is that you make a lot of components and the more complex the less ease of use. But the upside is that is a lot more versatile and correct.
If Form is the only wrapper used then I would suggest using this approach:
You just add all form properties (in Blazor that should be 0? since you don't need a no target or post/get specification). So basically Card gets an extra parameter: [Parameter] public bool HasForm { get; set; }
Then you would have to make this code
<div class="card-body">
@Body
</div>
into
@if (HasForm) {
<form>
<div class="card-body">
@Body
</div>
</form>
}
else {
<div class="card-body">
@Body
</div>
}
I would prefer the last one in this case. Just a simple if statement, clean and visible.
There is a dirty option by using old ASP @:
to conditionally generate a tag without it counting as a tag... but using that requires more soap to feel clean than I have in my home at the moment...
from blazor-adminlte.
Resolved in Commit 35011f9 as per Marijn's instructions. Though submits could also be handled by Blazor without form tags. But for backward compatiblity purposes we added it, (i.e. direct submit to another form processor that does not run blazor). Though the latter will need more form tag properties exposed in blazor to do such a call. We will enhance this future when this request arrives.
from blazor-adminlte.
I see but now the form can only exist inside the body. The original AdminLte demo site had some cards with controls in the body and the submit button in the Footer, look at the top left one here (one of my other Pull requests. The form is then wrapped arount both the body and the footer, and I would even include Header so you could punt controls in there as well and wrap the entire contents inside the Card in a form.
As you said there are a lot of different uses so thats why I suggested not wrapping it and leaving it to the user. Perhaps I even want 2 Cards wrapped inside the same Form depending on the layout.
from blazor-adminlte.
Form tag has been removed in commit 9696d8f
from blazor-adminlte.
Related Issues (20)
- Help with template HOT 4
- Card Maximize button does not call OnMaximize event
- "btn-block" class should not be part of the Button class
- layout-navbar-fixed not working HOT 2
- Needs ability to switch from light to dark theme.
- Complete start guide HOT 2
- Fluent API for components
- How we can use the defaults toastrs ?
- Skin
- Blazorized not found
- Unable to hide sidebar with smallest screensize (Phone) HOT 2
- Expose SideBarTreeView state as parameter
- Page Title HOT 3
- Validation
- License collision
- How to Globalize?
- SmallBox loading state
- Can multiple tab pages be supported?
- Support for dotnet 7 and boostrap 5.0 HOT 1
- Support for AdminLTE v4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blazor-adminlte.