Using <a4j:log>
To see this in action, you can use an <a4j:log>, which shows request
data, response data, DOM tree changes on update, and other useful debug
information. When placed on the page, the control doesn’t produce any
visible output, but after hitting Ctrl+Shift+L (the default register hotkey), a
debug window will open. If for some reason a debug log window doesn’t
open, change the hotkey by setting the hotkey attribute to a letter of your
choice, for example, <a4j:log hotkey="D"/>.
…
</rich:panel>
<a4j:log/>
------------------------------------
<h:inputText value="#{profile.age}">
<a4j:support event="onblur" reRender="userInfo"
ajaxSingle="true">
</h:inputText>
is equivalent to this:
<a4j:region>
<h:inputText value=”#{profile.age}”>
<a4j:support event=”onblur” reRender=”userInfo”>
</h:inputText>
</a4j:region>
*********a4j:support****************
----------------------------------------
JavaScript Interactions
Although RichFaces shields you from writing JavaScript, sometimes you
might want to invoke a custom JavaScript function. Injecting custom
JavaScript is possible by using the following attributes on components that
initiate an Ajax request:
- onsubmit: Just before Ajax request is sent
- onbeforedomupdate: Before any DOM updates are processed
- oncomplete: After DOM updates have been processed
-----------------------
Using bypassUpdates
When just validating form values, set bypassUpdates="true". When set
to true, the Update Model and Invoke Application phases will not be
invoked, improving response time.
-------------------------------------------
Using eventsQueue and requestDelay
Use the eventsQueue attribute when possible. When setting
eventsQueue, the next request will not be set until the previous request
comes back (the response). To further control the sending of requests, use
requestDelay to delay the sending of a request by some number of
milliseconds.
--------------------------------------------------------
Another attribute is data, which allows you to get any additional data from
the server during an Ajax request. The data attribute can simply point to a
bean property via EL, and the data will be serialized in JSON format and
available on the client side. Here’s an example:
<a4j:commandButton value="Submit" reRender="out"
data="#{bean.text}"
oncomplete="alert(data)"/>
where text is as follows:
private String text = "Nice, I can get any data from the server";
*********/a4j:support****************
--------------------------------------------------------------------------
Notice that the event on which an
Ajax request is sent is onblur. The onblur event means the user has to tab
out of the current field or click somewhere else using the mouse.
-------------------------------------------------------------------
To show a modal window with a status "Please wait" and block everything in the background, you can do something like this:
<h:form>
<a4j:commandButton actionListener="#{bean.calculate}"
value="Calculate"/>
</h:form>
<rich:modalPanel id="mp" style="text-align:center">
<h:outputText value="Please wait..."
style="font-weight:bold;font-size:large"/>
</rich:modalPanel>
186 Using RichFaces
<a4j:status id="actionStatus"
onstart="#{rich:component('mp')}.show('',{height:'80',
width:'150'})"
onstop="#{rich:component('mp')}.hide()" />
This blog is mainly about Java...
Subscribe to:
Post Comments (Atom)
Labels
- Seam (14)
- Java (11)
- Hibernate (5)
- JPA (4)
- Seam 2 (4)
- Seam 2.1.1 (4)
- Seam Series (4)
- Devoxx (3)
- EJB3 (3)
- JavaOne (3)
- MySQL (3)
- PDF (3)
- jodconverter (3)
- jodconverter 3 (3)
- axis2 (2)
- hash password (2)
- pdfa (2)
- sigar (2)
- swing (2)
- testng (2)
- webservice (2)
- AngularJS (1)
- Cache (1)
- Comment (1)
- Dropwizard (1)
- Encryption (1)
- Enum (1)
- Freemarker (1)
- Guava (1)
- IE8 (1)
- IdentityManager (1)
- InnoDB (1)
- Iran (1)
- JOOReport (1)
- JSF (1)
- Jasypt (1)
- JavaPolis (1)
- Memory (1)
- MyISAM (1)
- ODT (1)
- OSS (1)
- OpenOffice (1)
- REST (1)
- Seam book (1)
- Tehran (1)
- UTF-8 (1)
- Ubuntu hardy (1)
- Windows vista (1)
- ant (1)
- chess (1)
- damenes tale (1)
- filters (1)
- firefox (1)
- html cache (1)
- interceptor (1)
- java 5 (1)
- java 6 (1)
- java 7 (1)
- javazone (1)
- javazone 2015 (1)
- jaxb (1)
- jboss (1)
- jboss 4 (1)
- jboss-ws (1)
- jdbc (1)
- jquery (1)
- jrebel (1)
- julebord (1)
- junit (1)
- musehÄnd (1)
- ojdbc (1)
- oracle (1)
- persistence.xml (1)
- prettify (1)
- ptql (1)
- richfaces (1)
- rollermouse pro (1)
- rpi (1)
- s:cache (1)
- seam-gen (1)
- second level cache (1)
- treecache (1)
- wicket (1)
No comments:
Post a Comment