<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Zona J &#187; jsf</title>
	<atom:link href="http://zonaj.org/category/jsf/feed/" rel="self" type="application/rss+xml" />
	<link>http://zonaj.org</link>
	<description>Zona Java - Um blog português sobre java.</description>
	<lastBuildDate>Sun, 29 Jun 2014 18:29:19 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Forms com poucos Enters</title>
		<link>http://zonaj.org/2007/05/04/forms-com-poucos-enters/</link>
		<comments>http://zonaj.org/2007/05/04/forms-com-poucos-enters/#comments</comments>
		<pubDate>Fri, 04 May 2007 20:27:37 +0000</pubDate>
		<dc:creator><![CDATA[bgoncalves]]></dc:creator>
				<category><![CDATA[jsf]]></category>

		<guid isPermaLink="false">http://www.zonaj.org/?p=31</guid>
		<description><![CDATA[Num projecto em JSF implementar o seguinte requisito : o formulário só deve ser submetido ao escolher umas das acções (botões/links) disponíveis.. Isto é o contrário de: se um campo de texto estiver seleccionad cheap lasix online o o formulário é submetido se carregarmos a tecla enter. Isto acontece para campos com a tag input; &#8230; <a href="http://zonaj.org/2007/05/04/forms-com-poucos-enters/" class="more-link">Continue reading <span class="screen-reader-text">Forms com poucos Enters</span></a>]]></description>
				<content:encoded><![CDATA[<p>
Num projecto em JSF implementar o seguinte requisito : <em>o formulário só deve ser submetido ao escolher umas das acções (botões/links) disponíveis.</code></em>.
</p>
</p>
<p>
Isto é o contrário de: se um campo de texto estiver seleccionad
<div style="display: none"><a href='http://buylasixonline24.com/' title='cheap lasix online'>cheap lasix online</a></div>
<p>o o formulário é submetido se carregarmos a tecla <code>enter</code>. <br />Isto acontece para campos com a tag <code>input</code>; não acontece por exemplo para a <code>textarea</code>.
</p>
<p>
Um requisito óbvio (<em>usabilidade</em>) é que o site continue a ser navegável com teclas. Logo, <code>inputs</code> do tipo <code>submit</code> e <code>button</code>, bem como todas as outras <code>tags</code>, deveriam continuar a processar o <code>enter</code>.
</p>
<p>
Eis a solução final, testada em FF2 e IE6:
</p>
<pre class="prettyprint" id="html">
&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;This form doesn't submit with Enter key&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form id="formID" .../&gt;
       ...
    &lt;/form&gt;
  
    &lt;script type="text/javascript"&gt;&lt;!--

/* Checks if enter key was pressed and this is allowed.
 * This functions tries to solve issue : "If a text field has focus, the 
 * form will submit upon hitting the enter (or return) key."
 * @param e the event
 * @return true if enter key <div style="display:none"><a href='http://viagraformcanadasr.com/'>viagra from canada</a></div> is pressed for input fields (input tags not of 
 * type 'button' or 'submit') ; false otrhewise
 */
function disableEnterKeyForInputs(e){

  // next lines suport multibrowser
  var key = (window.event) ? event.keyCode : e.which;
  var srcElement = (window.event) ? event.srcElement : e.target;
  
  if (key == 13) {
    var tagName = srcElement.tagName.toUpperCase();
    if ( tagName == 'INPUT' ) {
       // only inputTags have enter issue
       // and buttons and submit should respond to enter
       switch ( srcElement.type.toUpperCase() ){
         case 'BUTTON' :
         case 'SUBMIT' :
            return true;
          break;
         default :
            return false;
       }
    }
  }
  return true;
}

if ( (theForm = document.getElementById("formID") ) != null)   
  theForm.onkeypress=disableEnterKeyForInputs;

// --&gt;
    &lt;/script&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>
<em>tanx to Ricardo Antunes, Lurdes Spínola</em>
</p>
<p><b>Leituras</b></p>
<ul>
<li>[1] Nabble Forums : Form Submit On Enter (<a target="_blank" href="http://www.nabble.com/Form-Submit-On-Enter-t1320364.html">http://www.nabble.com/Form-Submit-On-Enter-t1320364.html</a>)
  </li>
<li>[2] http://www.jsftutorials.net/defaultActionTag.html (<a target="_blank" href="http://www.jsftutorials.net/defaultActionTag.html">http://www.jsftutorials.net/defaultActionTag.html</a>)
  </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zonaj.org/2007/05/04/forms-com-poucos-enters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JSF Config Metadata: &#8216;atribute&#8217; e &#8216;property&#8217;</title>
		<link>http://zonaj.org/2007/04/04/jsf-config-metadata-atribute-e-property/</link>
		<comments>http://zonaj.org/2007/04/04/jsf-config-metadata-atribute-e-property/#comments</comments>
		<pubDate>Wed, 04 Apr 2007 11:21:43 +0000</pubDate>
		<dc:creator><![CDATA[bgoncalves]]></dc:creator>
				<category><![CDATA[jsf]]></category>

		<guid isPermaLink="false">http://d6038509.u101.jodoshared.com/?p=15</guid>
		<description><![CDATA[A framework Java Server Faces (JSF) &#233; configurada com um ou mais ficheiros &#39;faces-config.xml&#39;. Al&#233;m de v&#225;rias tags para configura&#231;&#227;o do runtime, a especifica&#231;&#227;o prop&#245;e a utiliza&#231;&#227;o de generic cialis without prescription metatags informativas que possibilitam ajuda ao desenvolvimento. Tags para metadata em ficheiros xml de configura&#231;&#227;o s&#227;o usuais, como por exemplo ou . Novo &#8230; <a href="http://zonaj.org/2007/04/04/jsf-config-metadata-atribute-e-property/" class="more-link">Continue reading <span class="screen-reader-text">JSF Config Metadata: &#8216;atribute&#8217; e &#8216;property&#8217;</span></a>]]></description>
				<content:encoded><![CDATA[<p>
A framework Java Server Faces (JSF) &eacute; configurada com um ou mais ficheiros &#39;<code>faces-config.xml</code>&#39;. Al&eacute;m de v&aacute;rias tags para configura&ccedil;&atilde;o do runtime, a especifica&ccedil;&atilde;o prop&otilde;e a utiliza&ccedil;&atilde;o de
<div style="display: none"><a href='http://cialiss-no-prescription.com/'>generic cialis without prescription</a></div>
<p> metatags informativas que possibilitam ajuda ao desenvolvimento.
</p>
<p>
Tags para metadata em ficheiros xml de configura&ccedil;&atilde;o s&atilde;o usuais, como por exemplo <code><description></code> ou <code><display-name></code>.<br />
Novo para mim foram as tags<code><attribute></code> e<code>
<property></code>. De [3]
</p>
<div style="margin-left: 40px;"><code><attribute></code><br />
<i>Use to describe an attribute of a custom component, converter, validator, or renderer.</i><br />
<code>
<property></code><br />
<i>Use to describe a property of a custom component, converter, or validator.</i>
</div>
<p>
Quando utilizadas em converters ou validators permite descrever as propriedades e atributos que estes possuem.<br />
Por exemplo</p>
<p style="margin-left: 40px;"><code><faces-config
xmlns="http://java.sun.com/JSF/Configuration"><br />
    <...><br />
    <validator></p>
<p><validator-id>myNumberValidator</validator-id></p>
<p><validator-class>mypackage.MyNumberValidator</code><code></validator-class></p>
<p><attribute></p>
<p><attribute-name>minNumber</attribute-name></p>
<p><attribute-class>java.lang.Integer</attribute-class></p>
<p><default-value>0</default-value></p>
<p><suggested-value>5</suggested-value></p>
<p></attribute></code><code><br />
    </validat
<div style="display: none"><a href='	http://life4success.net/75-de-comision-como-curar-las-hemorroides-naturalmente	' title='	75% De Comision - Como Curar Las Hemorroides Naturalmente	'>	75% De Comision - Como Curar Las Hemorroides Naturalmente	</a></div>
<p>or><br />
    <...><br />
</faces-config></code></p>
<p>Isto permite ao <a href="http://pt.wikipedia.org/wiki/Ambiente_de_Desenvolvimento_Integrado">IDE</a> ajudar o programador pois ao escrever</p>
<pre class="prettyprint">
<h:inputText id="fieldValue_id"
             value="#{managedBean.fieldValue}">
  <f:validator validatorId="myNumberValidator"/>
</h:inputText>
</pre>
<p>poder&aacute; sugerir</p>
<pre class="prettyprint">
<h:inputText id="fieldValue_id"
             value="#{managedBean.fieldValue}">
  <f:validator validatorId="myNumberValidator"/>
  <f:attribute name="minNumber/>
</h:inputText>
</pre>
<p>e ainda</p>
<pre class="prettyprint">
<h:inputText id="fieldValue_id"
             value="#{managedBean.fieldValue}">
  <f:validator validatorId="myNumberValidator"/>
  <f:attribute name="minNumber" value="5"/>
</h:inputText>
</pre>
<p>Neste momento ando a utilizar o Oracle JDeveloper 10.1.3 que tem algumas funcionalidades para JSF mas não esta.</p>
</p>
<p><b>Leituras</b>
</p>
<ul>
<li>[1] JSF for nonbelievers: JSF conversion and validation (<a target="_blank" href="http://www-128.ibm.com/developerworks/java/library/j-jsf3/">http://www-128.ibm.com/developerworks/java/library/j-jsf3/</a>)
  </li>
<li>[2] Oracle JDeveloper 10g (10.1.3) Documentation (<a target="_blank" href="http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/">http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/</a>)
  </li>
<li>[3] Faces-Config DTD (<a target="_blank" href="http://www.horstmann.com/corejsf/faces-config.html#faces-config">http://www.horstmann.com/corejsf/faces-config.html#faces-config</a>)
  </li>
</ul>
<div style="display: none">zp8497586rq</div>
]]></content:encoded>
			<wfw:commentRss>http://zonaj.org/2007/04/04/jsf-config-metadata-atribute-e-property/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
