Author: SeanRogers
Date: 2009-12-21 02:22:35 -0500 (Mon, 21 Dec 2009)
New Revision: 16176
Modified:
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-0.xml_sample
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-1.js
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-2.xml_sample
Log:
Fixed rendering errors
Modified:
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml
===================================================================
---
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml 2009-12-21
07:03:04 UTC (rev 16175)
+++
root/docs/trunk/Component_Reference/en-US/chap-Component_Reference-Resources.xml 2009-12-21
07:22:35 UTC (rev 16176)
@@ -62,7 +62,7 @@
The <acronym>JSF</acronym>
<methodname>javax.faces.component.UIViewRoot.setLocale()</methodname> method
can be used to update the locale through a Java class:
</para>
-<programlisting language="java" role="JAVA">
+<programlisting language="Java" role="JAVA">
<xi:include
href="extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-1.js"
parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
</step>
@@ -230,7 +230,7 @@
The <varname>createContent</varname> attribute points to the method used
for generating the displayed content. If necessary, the
<varname>value</varname> attribute can be used to pass input data to the
content generation method specified with <varname>createContent</varname>. The
<varname>cacheable</varname> attribute specifies whether the resulting content
will be cached or not.
</para>
<para>
- The <varname>mimeType</varname> attribute describes the type of output
content, and corresponds to the type in the header of the
<acronym>HTTP</acronym> request. The <varname>element</varname>
attribute defines <attribute>XHTML</attribute> element used to display the
content:
+ The <varname>mimeType</varname> attribute describes the type of output
content, and corresponds to the type in the header of the
<acronym>HTTP</acronym> request. The <varname>element</varname>
attribute defines <acronym>XHTML</acronym> element used to display the
content:
</para>
<itemizedlist>
<listitem>
@@ -277,39 +277,41 @@
The <sgmltag><a4j:mediaOutput></sgmltag> component uses the
<methodname>MediaBean.paint</methodname> method to create the image. The
method generates a random number, which is then converted into an output stream and
rendered to a <acronym>JPEG</acronym> image. The
<classname>MediaBean</classname> class is as follows:
</para>
-<programlisting language="XML" role="XML">
+<programlisting language="Java" role="JAVA">
<xi:include
href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example-0.js"
parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
<para>
Another class, <classname>MediaData</classname> is required by the
<varname>value</varname> attribute for keeping data to be used as input for
the content creation method. The <classname>MediaData</classname> class is as
follows:
</para>
-<programlisting language="XML" role="XML">
+<programlisting language="Java" role="JAVA">
<xi:include
href="extras/exam-Component_Reference-a4jmediaOutput-a4jmediaOutput_example-1.js"
parse="text"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
+ <para>
+ The <sgmltag><a4j:mediaOutput></sgmltag> component uses the
<classname>MediaBean</classname> and
<classname>MediaData</classname> classes to generate a new image on each page
refresh, which appears as shown in <xref
linkend="figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result"
/>
+ </para>
+ <blockquote>
+ <figure
id="figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result">
+ <title><sgmltag><a4j:mediaOutput></sgmltag> example
result</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result.png"
format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ The generated image containing a random verification number.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+ </blockquote>
</example>
<note>
- <title>Note</title>
+ <title><classname>Serializable</classname> interface</title>
<para>
A bean class passed using the <varname>value</varname> attribute of
<sgmltag><a4j:mediaOutput></sgmltag> should implement the
<classname>Serializable</classname> interface so that it will be encoded to
the <acronym>URL</acronym> of the resource.
</para>
</note>
- <para>
- The <sgmltag><a4j:mediaOutput></sgmltag> component uses the
<classname>MediaBean</classname> and
<classname>MediaData</classname> classes to generate a new image on each page
refresh, which appears as
- </para>
- <figure
id="figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result">
- <title><sgmltag><a4j:mediaOutput></sgmltag> example
result</title>
- <mediaobject>
- <imageobject>
- <imagedata
fileref="images/figu-Component_Reference-a4jmediaOutput-a4jmediaOutput_example_result.png"
format="PNG" />
- </imageobject>
- <textobject>
- <para>
- The generated image containing a random verification number.
- </para>
- </textobject>
- </mediaobject>
- </figure>
</section>
</chapter>
Modified:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-0.xml_sample
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-0.xml_sample 2009-12-21
07:03:04 UTC (rev 16175)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-0.xml_sample 2009-12-21
07:22:35 UTC (rev 16176)
@@ -1,9 +1,9 @@
<application>
- <locale-config>
- <default-locale>en</default-locale>
- <supported-locale>en</supported-locale>
- <supported-locale>de</supported-locale>
- <supported-locale>it</supported-locale>
- </locale-config>
- <message-bundle>demo.message</message-bundle>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>en</supported-locale>
+ <supported-locale>de</supported-locale>
+ <supported-locale>it</supported-locale>
+ </locale-config>
+ <message-bundle>demo.message</message-bundle>
</application>
Modified:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-1.js
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-1.js 2009-12-21
07:03:04 UTC (rev 16175)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-1.js 2009-12-21
07:22:35 UTC (rev 16176)
@@ -1,44 +1,29 @@
package demo;
+import java.util.Locale;
+import javax.faces.context.FacesContext;
- import java.util.Locale;
+public class ChangeLocale {
- import javax.faces.context.FacesContext;
+ public String germanAction() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ context.getViewRoot().setLocale(Locale.GERMAN);
+ return null;
+ }
- public class ChangeLocale {
- public String germanAction() {
+ public String englishAction() {
- FacesContext context = FacesContext.getCurrentInstance();
+ FacesContext context = FacesContext.getCurrentInstance();
+ context.getViewRoot().setLocale(Locale.ENGLISH);
+ return null;
+ }
- context.getViewRoot().setLocale(Locale.GERMAN);
+ public String italianAction() {
- return null;
-
- }
-
-
- public String englishAction() {
-
- FacesContext context = FacesContext.getCurrentInstance();
-
- context.getViewRoot().setLocale(Locale.ENGLISH);
-
- return null;
-
- }
-
-
-
- public String italianAction() {
-
- FacesContext context = FacesContext.getCurrentInstance();
-
- context.getViewRoot().setLocale(Locale.ITALIAN);
-
- return null;
-
- }
-
+ FacesContext context = FacesContext.getCurrentInstance();
+ context.getViewRoot().setLocale(Locale.ITALIAN);
+ return null;
+ }
}
Modified:
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-2.xml_sample
===================================================================
---
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-2.xml_sample 2009-12-21
07:03:04 UTC (rev 16175)
+++
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jloadBundle-a4jloadBundle_example-2.xml_sample 2009-12-21
07:22:35 UTC (rev 16176)
@@ -1,8 +1,8 @@
<h:form>
- <a4j:loadBundle var="msg" basename="demo.message"/>
- <h:outputText id="messageBundle" value="#{msg.greeting}"/>
- <a4j:commandLink value="De" action="#{changeLocale.germanAction}"
reRender="messageBundle" />
- <a4j:commandLink value="Eng"
action="#{changeLocale.englishAction}" reRender="messageBundle" />
- <a4j:commandLink value="It"
action="#{changeLocale.italianAction}" reRender="messageBundle" />
+ <a4j:loadBundle var="msg" basename="demo.message"/>
+ <h:outputText id="messageBundle" value="#{msg.greeting}"/>
+ <a4j:commandLink value="De"
action="#{changeLocale.germanAction}" reRender="messageBundle" />
+ <a4j:commandLink value="Eng"
action="#{changeLocale.englishAction}" reRender="messageBundle" />
+ <a4j:commandLink value="It"
action="#{changeLocale.italianAction}" reRender="messageBundle" />
</h:form>