Comments (5)
Add
@using FormFactory;
@using FormFactory.AspMvc;
To your view
from formfactory.
Harry, thanks for the quick reply. I had the second reference but not the first. Works like a charm. Very impressive what you’ve done. Now I’m just trying to figure out where I alter things in your templates to make the labels adjacent to the values (think the bootstrap class I want is form-horizontal).
This is indeed a very nice contribution to the community.
Craig
From: Harry McIntyre [mailto:[email protected]]
Sent: Monday, June 06, 2016 11:55 AM
To: mcintyre321/FormFactory [email protected]
Cc: craig2l [email protected]; Author [email protected]
Subject: Re: [mcintyre321/FormFactory] Trying to get started with FormFactory.AspMvc (#26)
Add
@using FormFactory;
@using FormFactory.AspMvc;
To your view
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #26 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AFBafjmj5B_ePrgOGIrQh_Mk_nwEFS-Yks5qJGzvgaJpZM4IvMag . https://github.com/notifications/beacon/AFBafqkYcicLlphk5Zs3-BlFmxW_GGfbks5qJGzvgaJpZM4IvMag.gif
from formfactory.
Harry,
Sorry to bother you with another question. Incidentally, I am starting to get comfortable with modifying your various templates and did successfully make the change to make my form horizontal and changed the format of the date as well.
Now trying to suppress the display of my Id column. In my model I have the Id field set to [HiddenInput(DisplayValue = false)]. When I’m debugging, however, in Form.Property.cshtml, the Model.IsHidden value is false, but the Model.GetCustomAttributes() returns System.Web.Mvc.HiddenInputAttribute. Any guidance here? Thank you!
Craig
From: Harry McIntyre [mailto:[email protected]]
Sent: Monday, June 06, 2016 11:55 AM
To: mcintyre321/FormFactory [email protected]
Cc: craig2l [email protected]; Author [email protected]
Subject: Re: [mcintyre321/FormFactory] Trying to get started with FormFactory.AspMvc (#26)
Add
@using FormFactory;
@using FormFactory.AspMvc;
To your view
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #26 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AFBafjmj5B_ePrgOGIrQh_Mk_nwEFS-Yks5qJGzvgaJpZM4IvMag . https://github.com/notifications/beacon/AFBafqkYcicLlphk5Zs3-BlFmxW_GGfbks5qJGzvgaJpZM4IvMag.gif
from formfactory.
If you look at PropertyVm.cs#L58
IsHidden = pi.GetCustomAttributes(true).OfType<DataTypeAttribute>().Any(x => x.CustomDataType == "Hidden");
so you need to use:
[DataType("Hidden")]
rather than the Mvc attribute. It's been a while since I wrote this, but I think this is probably to avoid a dependency on Mvc in the core library. If I ever get the time, I'd like to create a/ a pluggable way to add support for external attributes, and b/ a set of built in attributes, and c/ some better documentation!
from formfactory.
Harry,
Thank you for taking the time to answer this; I really appreciate your generosity.
I actually “solved” this issue myself, though I’m sure in a much less elegant manner than your solution. In the Form.Property.cshml, at the top where you check for:
If (Model.IsHidden)…
I replaced this with:
If (Model.IsHidden || Model.GetCustomAttributes().OfType(System.Mvc.HiddenInputAttribute>.Count > 0)…
It works, but you’ve shown me that this code should obviously be pushed down into the IsHidden call. Thank you! Again, an impressive product!
Craig
From: Harry McIntyre [mailto:[email protected]]
Sent: Tuesday, June 07, 2016 1:22 AM
To: mcintyre321/FormFactory [email protected]
Cc: craig2l [email protected]; Author [email protected]
Subject: Re: [mcintyre321/FormFactory] Trying to get started with FormFactory.AspMvc (#26)
If you look at PropertyVm.cs#L58
FormFactory/FormFactory/PropertyVm.cs
Line 58 in f391a4c
IsHidden = pi.GetCustomAttributes(true).OfType().Any(x => x.CustomDataType == "Hidden");
so you need to use:
[DataType("Hidden")]
rather than the Mvc attribute. It's been a while since I wrote this, but I think this is probably to avoid a dependency on Mvc in the core library. If I ever get the time, I'd like to create a/ a pluggable way to add support for external attributes, and b/ a set of built in attributes, and c/ some better documentation!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub #26 (comment) , or mute the thread https://github.com/notifications/unsubscribe/AFBaft2UOzJz5rx0AYj9-KQ0Ze3O1jIAks5qJSongaJpZM4IvMag . https://github.com/notifications/beacon/AFBafub5I008UdVsxkIhNhDw7GN54GYyks5qJSongaJpZM4IvMag.gif
from formfactory.
Related Issues (20)
- Installation not working with .net core 3+ HOT 1
- Sorry, an error occurred while processing your request. HOT 2
- Improvement for radio buttons
- The sample site doesn't load HOT 1
- Looking a way to extend FormFactory functionalities HOT 5
- For the dynamic form submit, how to add an additional Save button which does not do FF client side validation?
- add and remove actions don't work for the editable collection
- Validation not working on programmatically created form HOT 1
- Live Website Docs are Down HOT 4
- Asp Net Core 3.0 AggregateException The partial view 'FormFactory/Form.Property' was not found. HOT 9
- File Upload Control HOT 1
- Multiple Textbox HOT 1
- IIS Publish Error HOT 1
- Dynamic forms from Propertyvm HOT 2
- Repeatable row/table? HOT 2
- Client validations not working when using PropertyVms to create Dynamic Forms. HOT 3
- Documentation on custom templates? HOT 2
- No example provided for a server side validation HOT 1
- FormFactory Templates installs all files in root of project
- Does this work with Blazor? HOT 1
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 formfactory.