<?xml version="1.0" encoding="iso-8859-1" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:annotate="http://purl.org/rss/1.0/modules/annotate/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!--
	This feed generated for Anonymous
	More info at http://naklon.info/rss/about.htm
-->
<channel>
<title>Aranea Forum</title>
<link>http://forum.araneaframework.org/</link>
<description>Aranea support, development and announcements.</description>
<managingEditor>team@araneaframework.org</managingEditor>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>RSS Feed 2.2.4</generator>
<language>en</language>
<lastBuildDate>Thu, 28 Aug 2008 18:02:21 GMT</lastBuildDate>
<image>
	<url>http://forum.araneaframework.org/templates/subSilver/images/logo_phpBB_med.gif</url>
	<title>Aranea Forum</title>
	<link>http://forum.araneaframework.org/</link>
	<width>122</width>
	<height>56</height>
</image>
<item>
<title>MVC :: Event interceptor</title>
<link>http://forum.araneaframework.org/viewtopic.php?p=732#732</link>
<pubDate>Mon, 25 Aug 2008 10:50:55 GMT</pubDate>
<guid isPermaLink="true">http://forum.araneaframework.org/viewtopic.php?p=732#732</guid>
<description>Author: &lt;a href=&quot;http://forum.araneaframework.org/profile.php?mode=viewprofile&amp;u=735&quot; target=&quot;_blank&quot;&gt;juri&lt;/a&gt;&lt;br /&gt;
Subject: Event interceptor&lt;br /&gt;
Posted: Mon Aug 25, 2008 10:50 am (GMT 0)&lt;br /&gt;
&lt;br /&gt;&lt;span class="postbody"&gt;
Hello.
&lt;br /&gt;

&lt;br /&gt;
Is it possible to implement in aranea unsaved data validation (just like in gmail).
&lt;br /&gt;
If I have changed any data on the form and I'm trying to do the following actions:
&lt;br /&gt;
 - back/forward button click
&lt;br /&gt;
 - any link/button click
&lt;br /&gt;
 - close window
&lt;br /&gt;
then I get the popup:
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;
&lt;br /&gt;
Your data has not been saved.
&lt;br /&gt;
Discard your data? Ok. Cancel.
&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;
&lt;br /&gt;

&lt;br /&gt;
Thank you in advance&lt;/span&gt;&lt;br /&gt;
</description>
<dc:creator>juri</dc:creator>
<dc:subject>MVC</dc:subject>
<annotate:reference rdf:resource="http://forum.araneaframework.org/viewtopic.php?p=732#732" />
<comments>http://forum.araneaframework.org/posting.php?mode=quote&amp;p=732</comments>
</item>
<item>
<title>MVC :: RE: Form link messages [SOLVED]</title>
<link>http://forum.araneaframework.org/viewtopic.php?p=731#731</link>
<pubDate>Mon, 25 Aug 2008 07:33:37 GMT</pubDate>
<guid isPermaLink="true">http://forum.araneaframework.org/viewtopic.php?p=731#731</guid>
<description>Author: &lt;a href=&quot;http://forum.araneaframework.org/profile.php?mode=viewprofile&amp;u=735&quot; target=&quot;_blank&quot;&gt;juri&lt;/a&gt;&lt;br /&gt;

Posted: Mon Aug 25, 2008 7:33 am (GMT 0)&lt;br /&gt;
&lt;br /&gt;&lt;span class="postbody"&gt;
I have solved my problem adding to FormElement components LinkValidationErrorRenderer class:
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;
&lt;br /&gt;
public void addWidget&amp;#40;Object key, Widget child&amp;#41; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FormElementValidationErrorRenderer renderer = new LinkValidationErrorRenderer&amp;#40;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;#40;child instanceof FormWidget&amp;#41; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; FormWidget formWidget = &amp;#40;FormWidget&amp;#41; child;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for &amp;#40;Iterator it = formWidget.getElements&amp;#40;&amp;#41;.values&amp;#40;&amp;#41;.iterator&amp;#40;&amp;#41;; it.hasNext&amp;#40;&amp;#41;; &amp;#41; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Object element = it.next&amp;#40;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if &amp;#40;element instanceof FormElement&amp;#41; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#40;&amp;#40;FormElement&amp;#41; element&amp;#41;.setFormElementValidationErrorRenderer&amp;#40;renderer&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; super.addWidget&amp;#40;key, child&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public static class LinkValidationErrorRenderer extends StandardFormElementValidationErrorRenderer &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static final long serialVersionUID = 1L;
&lt;br /&gt;

&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void addError&amp;#40;FormElement element, String error&amp;#41; &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; EvmiMessageContext evmiMessageCtx = &amp;#40;EvmiMessageContext&amp;#41; EnvironmentUtil.requireMessageContext&amp;#40;element.getEnvironment&amp;#40;&amp;#41;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; evmiMessageCtx.showMessage&amp;#40;EvmiMessageContext.ERROR_TYPE, error, element.getScope&amp;#40;&amp;#41;.toString&amp;#40;&amp;#41;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;
&lt;br /&gt;

&lt;br /&gt;
and overriding araneaMessagingFilter in aranea-conf.xml that adds formElementId to EvmiMessageContext.
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;
&lt;br /&gt;
public interface EvmiMessageContext extends MessageContext &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public void showMessage&amp;#40;String type, String message, String formElementId&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; public Map getEvmiMessages&amp;#40;&amp;#41;;
&lt;br /&gt;
&amp;#125;
&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;
&lt;br /&gt;

&lt;br /&gt;
After that I overrided tag, that output messages:
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private void writeEvmiMessageBody&amp;#40;Writer out, String message, String elementId&amp;#41; throws Exception &amp;#123;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.write&amp;#40;&amp;quot;&amp;lt;a href=\&amp;quot;#&amp;quot; + elementId + &amp;quot;\&amp;quot;&amp;gt;&amp;quot; + StringEscapeUtils.escapeHtml&amp;#40;message&amp;#41; + &amp;quot;&amp;lt;/a&amp;gt;&amp;quot;&amp;#41;;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;#125;
&lt;br /&gt;
&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;&lt;/span&gt;&lt;br /&gt;
</description>
<dc:creator>juri</dc:creator>
<dc:subject>MVC</dc:subject>
<annotate:reference rdf:resource="http://forum.araneaframework.org/viewtopic.php?p=525#525" />
<comments>http://forum.araneaframework.org/posting.php?mode=quote&amp;p=731</comments>
</item>
</channel>
</rss>

<!-- Page generation time: 0.9702s  - Memory Usage: 1.011 Mb  - GZIP disabled -->