﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on Cascading Drop Downs in MonoRail</title><description>Dave,
  
The reason is two fold:
  
A/ It is MUCH easier to do these sort of filtering on the server side.
  
B/ There are lists with many items. Imagine that I have 10 primaries, 10 secondaries per primary and 5 tertiaries per secondary. that gives me quite a few that I need to load
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment15</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment15</guid><pubDate>Tue, 09 Oct 2007 13:30:30 GMT</pubDate></item><item><title>Dave Newman commented on Cascading Drop Downs in MonoRail</title><description>Just on a side note, i've never understood why people want ajaxed cascading dropdowns.  Surely there's not that many options that it wouldn't be worth pulling all the data in the first request and doing it all client side
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment14</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment14</guid><pubDate>Tue, 09 Oct 2007 11:19:08 GMT</pubDate></item><item><title>Ken Egozi commented on Cascading Drop Downs in MonoRail</title><description>on OneCustomer view:
  
  
&lt;div &lt;%=view.Customer.IsImportant? "class='importantCustomer'" %&gt; &gt;
  
   some markup for a customer, blah blah &lt;%=view.Customer.Name %&gt; blah blah
  
&lt;/div&gt;
  
  
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment13</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment13</guid><pubDate>Mon, 08 Oct 2007 22:41:18 GMT</pubDate></item><item><title>Ayende Rahien commented on Cascading Drop Downs in MonoRail</title><description>Oh, sorry, missed the part of the view.
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment12</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment12</guid><pubDate>Mon, 08 Oct 2007 22:38:08 GMT</pubDate></item><item><title>Ayende Rahien commented on Cascading Drop Downs in MonoRail</title><description>Where does the decision for the isImportantCustomer goes?
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment11</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment11</guid><pubDate>Mon, 08 Oct 2007 22:37:23 GMT</pubDate></item><item><title>Ken Egozi commented on Cascading Drop Downs in MonoRail</title><description>Ok, I'm sketching here, using prototype syntax as that what I can do in a textarea without any reference.
  
  
I surly would have a js function like:
  
function highlightImportantCustomers() {
  
  $('.importantCustomer').each(function (importantCustomer) {
  
      SomeCoolEffectLib.HighLight(importantCustomer);
  
   });
  
}
  
  
the grid view would call a oneCustomer subview in a for loop.
  
  
the oneCustomer subview would contain:
  
&lt;%=view.Customer.IsImportant? "class='importantCustomer'" %&gt;
  
  
now the same oneCustomer view would get rendered on first page load (as subview), and on async call (just that customer element)
  
the calling js would do something like:
  
new Ajax.Updater(actionUrl, {
  
     parameters: 'customerId=' + this.value,
  
     onSuccess: highlightImportantCustomers
  
});
  
  
What I gained?
  
1. the highlight stuff is at a single place, conviniently in a js file. I can replace SomeCoolLib with another, changing only that line in the js.
  
2. The rendering logic for a customer, whether it's as part of the grid, or as a single element on an async call, is the same, located in a single place.
  
3. And I didn't need to introduce yet another language to my solution, and yet another abstraction that would've made me loose stuff instead of gain stuff
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment10</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment10</guid><pubDate>Mon, 08 Oct 2007 22:29:35 GMT</pubDate></item><item><title>Ayende Rahien commented on Cascading Drop Downs in MonoRail</title><description>Ken,
  
Translate this to  your method, please?
  
  
page.ReplaceHtml("primaries", { @partial: '/subviews/grid.brail' })
  
if isImportantCustomer:
  
  page.VisualEffect( @Highlight, "primaries" )
  
  
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment9</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment9</guid><pubDate>Mon, 08 Oct 2007 22:11:57 GMT</pubDate></item><item><title>Ken Egozi commented on Cascading Drop Downs in MonoRail</title><description>@Will: I think I might quote you on that.
  
  
@Ayende:
  
That's what the scripting language (velocity, brail, c#) is for.
  
You can do those 'decisions' in a normal view, and let the javascript deal with replacing the innerHTML.
  
I would also rather not to eval on any async call. It feels more secure imho. Having the server returning plain old markup (POM?) is much better.
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment8</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment8</guid><pubDate>Mon, 08 Oct 2007 21:52:18 GMT</pubDate></item><item><title>kevin commented on Cascading Drop Downs in MonoRail</title><description>@will, build be a layout using css that needs to display tabular data, ala excel, using non-table html, and I don't want to see any IE version and then a FF version, etc. 
  
  
Too often devs spend time trying to figure out how to display data using some css magic, having to worry about browser versions, etc when the table version looks just as good and is less work/time.
  
  
That's all I'm saying
  
  
And mootools is nice as well. jquery is just a personal preference. I find it nicer ;P
  
  
  
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment7</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment7</guid><pubDate>Mon, 08 Oct 2007 19:32:44 GMT</pubDate></item><item><title>Ayende Rahien commented on Cascading Drop Downs in MonoRail</title><description>Will,
  
Hm, no.
  
Those are silly examples, where POJ will more than do,  but brailjs is great when you have logic that need to run as JS.
  
  
For instance, if the user is an important one, highlight the new order. Which is something that I don't want to decide in JS.
  
  
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment6</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment6</guid><pubDate>Mon, 08 Oct 2007 18:46:21 GMT</pubDate></item><item><title>Will Sahatdjian commented on Cascading Drop Downs in MonoRail</title><description>BrailJS to Javascript seems like WebForms to MonoRail.  Why does everyone hate writing javascript so much?
  
  
By the way, if you like jQuery, I highly recommend Mootools (mootools.net).  I've not found a more expressive JS API anywhere.
  
  
Oh, and the main argument against tables is reduced maintainability, but their weak semantic value is becoming a good reason not to use them as well.  Especially on public-facing, SEO-conscious sites.
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment5</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment5</guid><pubDate>Mon, 08 Oct 2007 17:53:10 GMT</pubDate></item><item><title>Ken Egozi commented on Cascading Drop Downs in MonoRail</title><description>but that's the thing.
  
afaik, you cannot use subviews with brailjs.
  
It would also present problems if the subview has newlines, the javascript would creep out unless you'll introduce something like SingleLineViewFilter to remove all newlines from the subview output.
  
  
So I'm back to the .xJs  being over-complex and an unneeded abstraction to the developer's needs, and causes side-problems like that one.
  
  
Ahh.  Good ol' debate ...
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment4</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment4</guid><pubDate>Mon, 08 Oct 2007 13:56:44 GMT</pubDate></item><item><title>Ayende Rahien commented on Cascading Drop Downs in MonoRail</title><description>2/ because profession is an aggregation of several types, and I don't want to start passing my controller 5 different IRepository&lt;T&gt;
  
3/ I agree, but for a single line, it is hardly worth it.
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment3</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment3</guid><pubDate>Mon, 08 Oct 2007 13:47:40 GMT</pubDate></item><item><title>Ken Egozi commented on Cascading Drop Downs in MonoRail</title><description>My 3 cents:
  
1. Replacing the select tag as a whole is better, since replacing it's innerHTML won't always work, so your alternative is to manually create Option objects and add them to the select's .options array
  
  
2. OT, why would you create IRepo&lt;T&gt; wrappers to hide it from the controller? don't want the web project to be dependant on Rhino.Commons? or any other reason?
  
  
3. I'd have done that a bot different:
  
have a subview for each of the cascaded elements, have the controller render those views (rather than the jsviews), and use tha javascript to replace the select elements.
  
that way I gain:
  
a. avoiding duplication. U use the FormHelper.Select twice, once in the initial view, and again in the brailjs files 
  
b. side effect - keeping the view manipulation code and the call to the server in the same place
  
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment2</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment2</guid><pubDate>Mon, 08 Oct 2007 13:05:28 GMT</pubDate></item><item><title>kevin commented on Cascading Drop Downs in MonoRail</title><description>nothing wrong with using tables...people gt all up in arms about that sometimes. tables have their place. 
  
  
also, nice to see you using JQuery! More and more .net articles/posts seem to referencec jquery versus asp.net ajax. And of course, monorails just wouldn't jive with asp.net ajax, so JQuery makes sense.
  
  
kudos!
</description><link>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment1</link><guid>http://ayende.com/2847/cascading-drop-downs-in-monorail#comment1</guid><pubDate>Mon, 08 Oct 2007 12:20:18 GMT</pubDate></item></channel></rss>