grendello at gmail.com
Mon Jan 22 13:40:14 EST 2007
On Mon, 22 Jan 2007 09:17:40 -0800, "Eyal Alaluf" <eyala at mainsoft.com>
> Hi, Marek and everyone.
> Attached is a diff to improve support for J2EE portlets for the
> TARGET_J2EE configuration. In order to keep the code paths common, most
> of the diff is not under '#if TARGET_j2EE'. Therefore I'd like you to
> review and approve it before I can commit.
> The main issue stems from the fact that portlets in J2EE render HTML
> fragments and not the whole page. That is one page can contain several
> portlets and therefore several ASP.Net pages. This breaks implicit code
> assumptions about uniqueness of global variables. The most important
> example is the 'theForm' variable. For Portlet support one cannot assume
> that on the client side there is exactly one 'theForm' defined.
> The changes common with Mono are:
> * An internal property called 'theForm' is added to
> System.Web.UI.Page. Its value for TARGET_J2EE will be different for
> every portlet.
This is fine
> functions that use it directly.
> a. In cases of callback functions (like functions assigned to
> window.onload) we create a function whose name depends upon the portlet
> * We save a reference to 'theForm' within the tree view data
> these controls to pass the form to the 'WebForm_DoCallback' function.
> these methods have an extra parameter indicating the form. This means
> code will be broken.
> feature? Unlike the C# API MS does not document these functions and even
> tries to abstract their existence in some of System.Web API (e.g. the
> ClientScriptManager class).
remains compatible with MS as far as possible, even though the documentation
doesn't exist for their JS API. The reason for this is that they may start
documenting their JS API (the sign of this is the ajax.asp.net stuff, which
does include documented JS API which, I imagine, would have to be modified in
the above way when mono includes the implementation of MS AJAX). I think there
is another way to work around the theForm problem in JS. I'm assuming that
every portlet has its own identifier of some sort and that this identifier
could be used to index a table of theForms from within the JS functions that
need to access it. The array can be generated conditionally for TARGET_J2EE
from C# code and its existence checked for inside the JS functions (you could
also add a hidden field with a value specifying that the JS is running under
mono compiled for TARGET_J2EE. That way all the J2EE specific changes would be
hidden from the "public" API and the possible future compatibility would be
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 189 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070122/324f7b04/attachment.bin
More information about the Mono-devel-list