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

Add HtmlAttributes.ToString that renders the html #135

Merged
merged 1 commit into from
Oct 28, 2015

Conversation

fsateler
Copy link
Contributor

Otherwise you end up with weird stuff like: form.Write(navigation.Submit("text") rendering ChameleonForms.Component.ButtonHtmlAttributes

Otherwise you end up with weird stuff like: `form.Write(navigation.Submit("text")` rendering `ChameleonForms.Component.ButtonHtmlAttributes`
@robdmoore
Copy link
Member

I'm very comfortable pulling this in, but I'm very curious about why you are using form.Write?

robdmoore added a commit that referenced this pull request Oct 28, 2015
Add HtmlAttributes.ToString that renders the html
@robdmoore robdmoore merged commit f0cbc32 into MRCollective:master Oct 28, 2015
@fsateler
Copy link
Contributor Author

Well, a lot of my forms have just a single button. So I created an extension method that basically does:

using (var n = form.BeginNavigation()) {
    form.Write(n.Submit());
}

But then I had the class name printed instead of a button ;)

@robdmoore
Copy link
Member

Another way is to get your extension method to return the IHtmlString from f.Submit()

That way you don't need to call Writr and you retain control of the output stream within your razor file.

On 28 Oct 2015, at 8:18 pm, Felipe Sateler [email protected] wrote:

Well, a lot of my forms have just a single button. So I created an extension method that basically does:

using (var n = form.BeginNavigation()) {
form.Write(f.Submit());
}
But then I had the class name printed instead of a button ;)


Reply to this email directly or view it on GitHub.

@fsateler fsateler deleted the patch-1 branch October 28, 2015 15:59
@fsateler
Copy link
Contributor Author

Ah, that makes sense. BTW, is there an ETA or a list of issues to be finished before we get a new release? I don't see milestones in the issue tracker.

@robdmoore
Copy link
Member

I'm just waiting for a PR review of #132 from @MattDavies and then we will release 2.0.

@fsateler
Copy link
Contributor Author

OK, thanks

On 28 October 2015 at 13:20, Rob Moore [email protected] wrote:

I'm just waiting for a PR review of #132
#132 from @MattDavies
https://github.com/MattDavies and then we will release 2.0.


Reply to this email directly or view it on GitHub
#135 (comment)
.

Saludos,
Felipe Sateler

@fsateler
Copy link
Contributor Author

FWIW, the suggestion didn't work, because the Navigation.Dispose method also writes to the stream directly, and thus the button ends outside the navigation section.

@robdmoore
Copy link
Member

Ahh right of course. Good catch.

On 29 Oct 2015, at 3:45 am, Felipe Sateler [email protected] wrote:

FWIW, the suggestion didn't work, because the Navigation.Dispose method also writes to the stream directly, and thus the button ends outside the navigation section.


Reply to this email directly or view it on GitHub.

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

Successfully merging this pull request may close these issues.

2 participants