Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue with Two Distinct TextWriters Causing Improper Form Rendering
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Miles Lyon  
View profile  
 More options Feb 14 2012, 5:20 pm
From: Miles Lyon <milesl...@gmail.com>
Date: Tue, 14 Feb 2012 17:20:47 -0500
Local: Tues, Feb 14 2012 5:20 pm
Subject: Issue with Two Distinct TextWriters Causing Improper Form Rendering
Hi all,

I sent Louis Dejardin a message through the Spark site this morning to
explain an issue.  Per his suggestion I have set up a gist repository
of a sample project demonstrating my issue here:

https://gist.github.com/1830082

What we are trying to do is use spark in a standalone application
(possibly a build task soon) to render out fixtures for our javascript
unit tests directly from the existing spark files.  I pointed this
console application at a number of partials and full pages with master
layouts and didn't have any issues.  However, when I started working
with a sample form from our application I encountered an issue I can't
seem to resolve.

In order to Render the View I need to set up a ViewContext and
HtmlHelper.  In the process of doing that I use some mocked objects,
but most importantly I pass a TextWriter into the constructor of the
ViewContext.  I then call RenderView and I'm also passing in the
TextWriter there.  What seems to be occurring is that these are
writing to the file distinctly.  What ends up happening is my
BeginForm extension writes the opening and close tags for the Form to
the file before any of the other content is written in.  The view
renders fine when using the spark view engine through our site and
looking at it in the debugger I don't see the same issue with the
TextWriters.

Clearly I'm doing something wrong with how I'm setting up my engine or
more likely my view.  The key files to see what I'm doing in my code
are FixtureProvider.cs and ViewProvider.cs.

We are, of course, happy to entertain any suggestions for best
practices although please understand that this is a bit of work in
progress for us.  Obviously our primary concern is figuring out what
we aren't doing correctly in setting this up as a standalone to render
our fixtures.

thanks!

Miles


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rob G  
View profile  
 More options Jul 7 2012, 4:08 am
From: Rob G <robertgreyl...@gmail.com>
Date: Sat, 7 Jul 2012 09:08:51 +0100
Local: Sat, Jul 7 2012 4:08 am
Subject: Re: Issue with Two Distinct TextWriters Causing Improper Form Rendering

Hi Miles,

Apologies for the delay in replying - I wonder if you've found a solution
for this yet?

If not, then I would take a look at controlling the order in which the
TextWriters are output in. Each web framework that uses Spark implements
its own rendering strategy to control output ordering, and if you take a
look at MVC, the Render method on the
SparkView<https://github.com/SparkViewEngine/spark/blob/master/src/Spark.Web.Mv...>object
makes use of a
ViewContextWrapper<https://github.com/SparkViewEngine/spark/blob/master/src/Spark.Web.Mv...>object
and checks for things like nested views etc. as it goes through the
rendering process.

Perhaps this is something that your Fixture Render method can look at
employing since you say your views render just fine when going via MVC.

Hope that helps,
Rob


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »