Loading page with Ajax4jsf

Hi everybody I�m a newbie with Ajax4jsf, so I�m using Facelets and I want to make something similar to the Open Rico �Inner Html� demo, that�s is to load an entire page in a div. So what I tried is the following
<a4j:commandLink
              immediate="true"
              action="add_folder"
              reRender="areaContent">
            Add Folder
</a4j:commandLink>And defined the "areaContent" in two ways but neither work
<a4j:region id="areaContent" SelfRendered="true">
<a4j:page id="areaContent">The problem is that the page is getting render but not in the "areaContent� instead in the entire current page, I don�t really know if this is possible with Ajax4jsf.
This is the page referenced by the action "add_folder"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:c="http://java.sun.com/jstl/core">
<f:view>
    <form jsfc="h:form">
        Some content
    </form>
</f:view>
</html>Thank you very much for the help, I really need it :S

Hmm. All examples show how the part of the page is replaced based on client-side events.
OK. I have created the new one. Special for you. This is a replica for OpenRico innerHtml example.
This is an online demo:
http://livedemo.exadel.com/a4j-selectList/
The source code of the example you can find in the example section. Look for a4j-selectList there:
https://ajax4jsf.dev.java.net/nonav/ajax/ajax-jsf/download.html#examples
The completed code of the page itself is below. No javascript, as you required.
Only one "magic" line convert the jsf page to the AJAXable one:
<a4j:support event="onclick" action="#{backingBean.changeCurrent}" reRender="info"/>Where:
event means sending Ajax request when user clicks the item
action points to the action method that sets the current person based on new value of the list
reRender says what part of the page has to be refreshed when Ajax request is done. In our case, it is a panelGrid with id="info"
-------------------------------------------------- list.xhtml --------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
<head>
<link rel="stylesheet" type="text/css" media="screen" href="style.css" />
</head>
<body>
<h:form>
  <table width="600"  class="toptable" border="0">
   <tr>
     <td width="120" valign="top" rowspan="3"  class="toptabletd">
       <h:selectOneListbox id="list" value="#{backingBean.selectedId}">
        <a4j:support event="onclick" action="#{backingBean.changeCurrent}" reRender="info"/>
        <f:selectItems value="#{backingBean.selectList}"/>
       </h:selectOneListbox>
     </td>
     <td valign="middle"   class="toptabletd">
      <h:panelGrid id="info"  styleClass="panel"
             rowClasses="celltop, cellmiddle, cellbottom" columns="1">
        <h:panelGroup>
         <h:outputText value="#{userList.currentUser.prefix}" />
         <h:outputText value=" " />
         <h:outputText value="#{userList.currentUser.firstName}" />
         <h:outputText value=" " />
         <h:outputText value="#{userList.currentUser.lastName}" /><br />
         <h:outputText value="#{userList.currentUser.address}" />
        </h:panelGroup>
       <h:panelGroup>
        <h:outputText value="#{userList.currentUser.jobTitle}" />
       </h:panelGroup>
       <h:panelGroup>
        Phone:<h:outputText value="#{userList.currentUser.phone}" /><br />
        Cell:<h:outputText value="#{userList.currentUser.mobile}" />
       </h:panelGroup>
      </h:panelGrid>
     </td>
    </tr>
   </table>
  </h:form>
</body>
</html>

Similar Messages

  • Firefox uses all CPU resources when loading pages with lots of images.

    I just installed XP, and when I load pages with a ton of images, say, tumblr, Firefox uses ALL CPU time until it finishes loading.
    But because of the slowdown, it takes forever to download all the images.
    It's not related to my connection, I've got 15mbit downstream.
    I have Win7 on a different partition, and I have never had this problem.
    As far as I know, all my drivers and XP are up to date.
    I could have an old driver lurking, should I be looking at something specific?
    I've tried to find something on Google, but I've not found anything really helpful...

    I haven't gotten around to installing antivirus (or anything else, for that matter).
    If I watch in Task Manager, Firefox.exe goes to 100% as soon as I load the page.
    And no, that guide didn't help much. I don't have any addons or plugins yet, this is a new install.
    I got a huge slowdown a bit ago, it's because it was using almost 1.5GB of RAM o_o

  • Safari & Firefox: Won't load pages with images

    Everything was working fine one night, and then the next, I couldn't load any pages with graphics. The one caveat: Google loads without a problem, even a Google image search. Every other site, including Apple.com, either won't load at all, or will begin to load until it encounters and image, and then hangs. Thoughts?
    I've seen similar posts, but none of them really apply, and the only one that did, didn't have an answer.

    Every other site, including Apple.com, either won't load at all, or will begin to load until it encounters and image, and then hangs.
    You're saying that, in addition to images not loading, pages are loading slowly or not at all, as well?
    If this is the case, then the problem isn't isolated to images. It sounds more like a problem accessing web pages altogether.
    As a troubleshooting measure, try setting fixed DNS addresses, either in your router's configuration or in System Preferences -> Network. For the latter, click on the network connection that you use, e.g. "Airport" or "Ethernet," then click on the Configure button. Click on the TCP/IP tab and enter a pair of fixed DNS addresses in the section with that label, as follows:
    208.67.222.222
    208.67.220.220
    You can copy and paste those directly from this forum into that DNS address field.
    (Those are OpenDNS addresses, available for use by anyone. DNS addresses are the addresses of servers that tell your web browser where to look when you type a web page address in your web browser.)
    If that doesn't work, the problem lies somewhere else. But your symptoms (slow or no page loads; and even when pages load, images not loading) sound a lot like the DNS problems I had before I started using alternate DNS addresses.

  • Less than two week old iPad Air crashes with youtube/netflix and Safari when loading pages with video (i.e. Buzzfeed with links to youtube and vine). What's up with iPad Air's bugs with videos??

    Week and a half old iPad Air crashes with light usage of youtube, netflix and safari pages with video links to youtube and vine. The consistency of problems with videos has led me to determine that it must be bugs with iPad Air. Anyone else having this problem?
    Details: iPad Air 16gb wifi, have only used about 25% of space and always close all apps before opening another. I also have only had a max of two tabs open on safari of basic internet surfing (i.e. A google search page, or imdb for example). These crashes are annoying as sh......

    em74 wrote:
    These crashes are annoying as sh......
    I can well imagine that they are.
    I would backup, restore to factory settings, restore from the backup and then try again. If that fails, restore again but do not use the backup - restore as new. If the iPad functions OK as new, then slowly rebuild the iPad adding your apps, music etc, methodically to see if you can pin down what might be causing the problem.
    if all of that fails, it's time to schedule an appointment at an Apple a Store (must be done online) and have them take a look, or of it is lees than two weeks old, just return it for a refund and buy another one.

  • Feature option from app store load page with junk

    When selecting the "featured", the page loads scribbles of fonts combined with symbols. Page is not loading properly.

    Try a reset: Simultaneously hold down the Home and On buttons until the iPad shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the iPad back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray before doing the reset.

  • Safari won't load pages with pictures after installing Maverick

    I have an older iMac (2008), but it runs great and I have no problems with it.  Except now that i installed Maverick, now Safari doesn't work properly.  For most things, it works fine, then It will quit in the middle of a page.  Or, I have uploaded photos to the Walmart site and had pictures printed.  I can now access everything on that site except my photos and projects.  I get all the background ads and stuff, but not the actual photos.  That part of the page is blank.  There is not eeven the box with the question mark.  I kow they are still there because I can open them with Chrome.  I have tried all the tips I can find here, plus, I have tried Customer support for the website I am having problems with.  The CS people tell me it probably is a temporary problem, but I don't think they are Mac peaple.  So, far, nothing I have tried has helped.  I did have this same type of problem when I upgraded the last time, but was able to fix the problem.  Just wish I could remember how I fixed it.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, or by corruption of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain models.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • Having issues with loading pages with large web articles..

    I'm having issues with pages loading all the way when I read articles off of wikipedia. Mainly from pages that have tons and tons of text, but it doesn't make sense. The browser indicates that the page is loaded all the way, but when I make it half way down the page, everything becomes completely white. Like LITERALLY everything becomes white. This prevents me from reading any further down the page, even though I would force the page to scroll down all the way, that doesn't help one bit.
    Does anyone have a solution or a fix to this? I would like to continue reading my web articles, without being interrupted with these white pages/bugs.
    Post relates to: HP TouchPad (WiFi)

    Try clearing the cache for the web browser. While the browser is open, go up to Web/Preferences and choose "Clear cache".
    Also try rebooting the TouchPad via Device Info/Reset Options/Restart.
    WyreNut
    I am a Volunteer here, not employed by HP.
    You too can become an HP Expert! Details HERE!
    If my post has helped you, click the Kudos Thumbs up!
    If it solved your issue, Click the "Accept as Solution" button so others can benefit from the question you asked!

  • How can I prevent query executing on loading page with POJO dc

    I created with POJO datacontrol with a method return a list of data. I created a taskflow with a page fragment to add the POJO function as a form. I found the method is called every time when the page is being loaded. How can I control it not to be invoked at loading time. Only invoked when I click the button binding to the method. Thanks.

    Hi,
    I created with POJO datacontrol with a method return a list of data. I created a taskflow with a page fragment to add the POJO function as a form. I found the method is called every time when the page is being >loaded. How can I control it not to be invoked at loading time. Only invoked when I click the button binding to the method. Thanks.remove the pojo function added as a form from pageDef file (you can do it manually by rightclick on page -> page defination.
    then click '+' icon on Bindings section -> on insert item dialog box select method binding.
    then select your pojo data control and select the method that you want to add (if it has parameters then leave it blank for now.)
    for executing operation binding(method call) create a button action action listener and add following code
    BindingContext bindingContext = BindingContext.getCurrent();
    BindingContainer bindings = bindingContext.getCurrentBindingsEntry();
    OperationBinding operationBinding = bindings.getOperationBinding("method name");
    operationBinding.getParamsMap().put("param-name", "param-value"); //incase if method has parameters
    // Invoke the method
    operationBinding.execute();Regards,

  • Loading pages with non-English language scripts (e.g., Arabic)

    When I try to load a page that has non-English script, specifically Arabic, it just show's up as question marks or weird symbols. How do I get it to show the words but in Arabic or any other non-English script?

    Make sure that the correct encoding is selected.
    *Firefox > Web Developer > Character Encoding
    *View > Character Encoding

  • Not able to load page with contents to be shown on selecting first option

    I have one.jsp which has a select box whose values are got from the database..on change of option, the two.jsp is excuted (which includes one.jsp using one.jsp) and the corresponding results are shown...
    As of now i am using the select box with the first option as "select the option"..
    Now in the select box, i dont want the use
    [<option>--Select the option--</option>/code]
    ...i want to load the select box with the database values in one.jsp and load the corresponding contents to be shown for the  first option value automatically using two.jsp by default...
    can anyone help me out in this....Urgently needed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Let me try to explain this with example:
    Say The select box contain these values: Fruits and Vegetable which say are retrieved from the database.
    the onchange function retrieves the following if Fruits are selected:
    Examples of fruits: mango,apple
    Similarly if Vegetables are selected, the followin is displayed:
    Example of Vegetable: Raddish, Carrot.
    Since i was using the "Select a option" as the first option, when i clicked on fruits the examples of fruits are displayed and if i select vegetable the example of vegetables are displayed.
    Now i dont want to use the "Select a option". I just want to show the option values as fruits and vegetables and by default the examples of fruits should be displayed. If i select vegetables the examples of vegetables should be selected.
    Currently what is happening is that i am not able to show the examples of fruits by default. Secondly, I am able to show the examples of vegetables on selecting the Vegetables from the select box but if i select the Fruits again, the examples of fruits are not been displayed.
    Hope you get this better now...Any solutions...

  • Firefox crashes when I load pages with Flash content

    Whenever I load a page that uses the Flash player plugin, Firefox crashes. When I disable the plugin, the browser works fine. I am also unable to install version 3.6.6. The update downloads, but when I restart the browser, either says "the partial update could not be applied," and tries to download a larger full version, or, if it has downloaded the full version, upon restart it says that firefox needs to be updated to 3.6.6

    I solved the problem by downloading the Firefox 3.6.6 installer and then upgrading manually.. Now everything seems to be working fine again..

  • Firefox quits when loading page with flash content

    Hey
    I have just connected my old imac to the internet with firefox 2. Everything works ok but it would not play flash content. I downloaded the new version of flash but firefox now quits when i get to a flash content page. any ideas
    cheers

    Are you getting the crash reporter when it crashes? If so, please provide a crash id -> https://developer.mozilla.org/en/How_to_get_a_stacktrace_for_a_bug_report

  • Failure on loading pages with Yosemite-upgrade

    After tree upgrades/corrections on Yosemite, my mac still can't upload 100% on some sites.Last correction was done this morning.  Is this a problem for other users, or is it only me?

    For Firebug performance, please contact the developer of the add on:
    *[http://getfirebug.com/ Firebug Community Support]
    I also understand that this happens with the Web Development Tools. The Performance tool might be able to shed some light on what is taking it a while to load: [https://developer.mozilla.org/en-US/docs/Tools/Performance]

  • Unable to load page with Safari

    My access to the internet with Safari has been incredibly slow recently, I think especially for sites that require a logon, secure or not, including my online banking, Wall Street Journal, Comcast Email. I get an unable to load error message after a long wait. I recieved a security update recently and I think the problem started about then. I have read this forum and tried what I could for slow Safari like resetting but without improvement. I can't access the Apple website because it takes too long to load. I can access iTunes.

    Hi
    Welcome to Apple Discussions
    Secured sites are affected by the Keychain file contents, especially the X509 Anchors. Go to your Utilities folder>Keychain Access.app - open the application. On the left you'll see your various collections. Please confirm you see x509 Anchors. While there, go to the Keychain Menu>Keychain First Aid. Select, then enter your password and select "repair". If any errors appears, rerun until you get a clean pass.
    If errors were present, restart the system, and try Safari. If no errors...
    Another possible avenue of resolution is to reapply the 10.4.9 combo update. After the install/restart (don't use the computer for other tasks while the installer is running) "repair permissions" using Disk Utility in your Utilities menu.
    Post back

  • FireFox not loading page with passed argument

    I have a simple url that includes an argument passed to a php process: http://everydaycats.com/ec_video_purr.php?image=K7_CE_raN_s
    If you load this url in any other browser, even older versions of FF it works. When I installed FF 4 today it suddenly stopped working. I used FireBug to inspect all elements and everything appears to be ok. Not sure if this is a bug, but certainly is a problem.
    There should be a YouTube video displayed in the center of the screen. Use another browser to see display.

    OK, Solved. My original code included the code in example #1 below which was an 'object embed' (YouTube states this is OLD code), so I changed it to example #2 which is an 'iframe' and this fixed the problems:
    Example: #1
    document.writeln('<object width="560" height="349"><param name="movie" value="http://www.youtube.com/v/EWeMETA92A8?fs=1&hl=en_US&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/EWeMETA92A8?fs=1&hl=en_US&rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true"></embed></object>);
    Example: #2
    document.writeln('<iframe width="425" height="349" src="http://www.youtube.com/embed/'+qsParm['image']+'" frameborder="0" allowfullscreen></iframe> ');

Maybe you are looking for

  • How do I open multiple documents at a time?

    In Adobe reader for Windows 8, whenever I have a document open and then double click on another document to open it, the new document just replaces the old one in the Adobe reader window. How do I open up both documents at once in order to view them

  • Can't install Boot Camp on intended disk..

    This is frustrating.. I've recently put a second drive, an SSD, into my iMac (late 2009) and am now trying to install Windows on the HDD. Boot Camp simply will not let me install a new partition on any other drive but the SSD. I've even gone so far a

  • How to customize F140_ACC_STAT_01 to change ides logo and footer.

    Hi Experts, I want to customize form F140_ACC_STAT_01 to change default logo (ides logo) and default footer coming on the standard account statement we generate using Tcode F.27. In this regard I have copied form F140_ACC_STAT_01 to ZF140_ACC_STAT01

  • Drag and Drop a Portal iView in WPC

    I would like to drag and drop a portal iView into a container in the Page Editor. In a container that allow resource type portal iview, I clicked on the "pencil logo" and click on Add. A "Web Content Browser" is invoked. It there, the portal iView is

  • Automatic Cancellation Date in Sales Order

    Is there a setting such that when the Cancellation Date in a Sales Order occurs that the Sales Order is cancelled automatically