-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add HtmlPrefix parameter to IDisplayManager<TModel> #11612
Comments
IMO - Prefix is what driver author decides to keep to differentiate different inputs - You may want to dynamically build prefix inside driver if your driver needs to have specific prefix. You may need implement your driver similar to FlowPart driver |
I agreed that the driver should be defining the prefix. Adding prefix from the display manager would only concatenate to that prefix. so in the above example, the Prefix would be |
As DisplayManager creates root shape and it should start with empty prefix. You can always change prefix by defining your own driver |
In the above example, why would I have to define a new display driver just because the |
IMO if prefix is needed by parent shape for it’s child shapes then it should not be child shape’s display manager’s responsibility |
Same as @ns8482e, if FlowPart and BagPart can already do it, why not create a custom driver that defines the prefix for its inner content? But if the change is simple and not risky (just an extensibility) then please provide a PR |
I think the idea here is not having to create drivers with the same logic as existing once just because the prefix is not the same. If you think about the use case I listed above, the logic to create a user won't really change. The only thing that changes here is where the request is coming from. So I read the user data from excel file, then render a the data in a grid view. When the user submit's the data, the logic in the |
@CrestApps it’s not question about just extending behavior It’s like encapsulation, you don’t want to expose the prefix outside of root shape created by display manager if you need for some reason you can always achieve such behavior by creating and registering display driver responsible for it |
@ns8482e we have |
As I said earlier - it’s my opinion even I don’t like to have html prefix as param in |
Is your feature request related to a problem? Please describe.
I have a need to create a function that would create users in bulk from excel file. Now, that I have a collection of data (user data), I need a way to tell drivers the prefix that should be use when building the ShapeResult. For example, the UserDisplayDriver tries to bind the data from the request to
EditUserViewModel
. However, if the request has data that are prefixed withUsers[0].User_
the binding engine would not know how to bind the data in the request to the viewmodel.Describe the solution you'd like
Change the IDisplayManager to the following
Now with that change, during the post request on creating the user I can do something like this
If this is an acceptable approach I can submit a PR
The text was updated successfully, but these errors were encountered: