What is the better way to end a ajax request in JSF?

Hi, i hav a question.
Im working with AJAX inside JSF, using a phaseListener, when i finish my work i do:
context.responseComplete( );But i want to save the view, i dont want lose the changes ive made in my backbeans, what can i do?
tkz.

Ok, ill try to explain in better way:
AJAX goes to the server and update the model, server response xml and update the client, i hav tags in my jsp like saveState (save the state of object), its a tomahawk component, the jsf_sequence goes with AJAX, i need save the view state using that sequence, because another sequence will be back to the client.
When client go with normal request (get, post), the server doenst restore my previous state (because i think ajax ended the lifecycle first).
Some time ago, i did something like this:
          Map map = context.getExternalContext().getRequestMap();
          Integer sequence = (Integer) map.get(RendererUtils.SEQUENCE_PARAM);
          if (sequence == null || sequence == 1) {
               logger.warn("JSF_SEQUENCE error");
          } else {
               sequence--;
               synchronized (context.getExternalContext().getSession(true)) {
                    context.getExternalContext().getSessionMap().put(
                              RendererUtils.SEQUENCE_PARAM, sequence);
               synchronized (map) {
                    map.put(RendererUtils.SEQUENCE_PARAM, sequence);
context.getApplication().getStateManager().saveSerializedView(
                         context);The code back the jsf_sequence and i dont touch in the jsf_sequence on cliente, so when client post with normal away, everything is fine because faces saved the last view in that sequence. I dont wanna do that again, i wanna discover a soft way.
tkz.
Message was edited by:
CasMeiron

Similar Messages

  • What is the better way to change name of a site with paths and links?

    Hi!
    i m using dreamweaver cs4 and i have a site already configured on dreamweaver
    i need to change the name of the site and at the same time, every path names and every links
    This site has about 50 pages so i would like to know what is the better steps to do for modified the name of the site unless problem?
    I read the informations about  'manage site' but its not clear for me about links and path names!!
    thank you

    Just use site manager to change the site name. Nothing complicated with that.
    What exactly do you mean by changing path names? Do you want to change the name of folders in the site? If so, just change them within DW and it will prompt if you want to update links.

  • I now have 4 itouchs, 1 ipad mini, and three iphones for my own family members.  What's the bet way for me to setup itunes so that we can all share the same music, apps, movies, shows, etc?

    I now have 4 itouches, 1 ipad mini and 3 iphones in use by my direct family.  What's the best way for me to set things up so that we can all share the same music, apps, movies, shows etc?
    I would prefer to have one account to input dollars which allows all the users (my direct family) to share and buy things.
    Can we all have different user ID's however share the same account?

    I'll try to help a bit.
    ITunes match space is different to icloud space. With iTunes match you get storage for 25,000 non iTunes purchased tracks and other than a limit for individual file size, there is no memory limit.
    You can turn match on individuallyon each device (I have it turned off on my iPod but turned on on my iPad and iPhone). When you turn it on then you get access to all the tracks, and in my experience any playlists I create have transferred over very well. I understand that some people have had trouble with playlists though.
    I'm not quite clear with exactly what you mean regarding cleaning up your library, but be careful about using Match for this. There is no guarantee that matched songs will be exactly the same version as your own copy, due to some mismatches, so you could find some problems there. Personall, I am cleaning up my library before matching, but I am rather particular about keeping my library the way I want it. If you aren't as fussed then match could be the answer.
    Hope that helped.

  • What's the easiest way to end workout?

    When ending workout does everyone hit pause, menu, end workout. If you use an arm band, clip when you hit pause, the announcement says "Pause Workout", but if you follow the instructions in the manual, it says to stop workout, hit Menu, End Workout. That's fine and good, but I wish it would voice over to tell you that you hit the button. I missed the button and the chart when downloaded showed my pace as walking at the end with a higher mile pace.
    I guess I'll pause first for future runs, take off the arm band and then end workout.

    you can checkout this post on the easiest way to end your workout w/o it effecting your stats:
    http://discussions.apple.com/thread.jspa?threadID=562833&tstart=0
    basically you can just hit the pause button on the nano and your workout will be paused. then you can hit the menu button and end your workout whenever it is convenient. or just hit the pause buttin again to resume your workout.

  • What is the best way to submit a Concurrent Request over a DB Link?

    Hi,
    We have a requirement to submit a Concurrent Request over a DB Link. What is the best way to do this?
    What I've done so far is I've created a function in the EBS instance that executes FND_GLOBAl.APPS_INITIALIZE and submits the Concurrent Request. I then call this function remotely from our NON-EBS database. It seems to work fine but I found out from metalink article id 466800.1 that this is not recommended.
    Why are Concurrent Programs Calling FND_GLOBAL.APPS_INITIALIZE Using DBLinks Failing? [ID 466800.1]
    https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?_afrLoop=11129815723825&type=DOCUMENT&id=466800.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=17dodl8lyp_108
    Can anyone suggest a better approach?
    Thanks,
    Allen

    What I've done so far is I've created a function in the EBS instance that executes FND_GLOBAl.APPS_INITIALIZE and submits the Concurrent Request. I then call this function remotely from our NON-EBS database. It seems to work fine but I found out from metalink article id 466800.1 that this is not recommended.
    Why are Concurrent Programs Calling FND_GLOBAL.APPS_INITIALIZE Using DBLinks Failing? [ID 466800.1]
    https://support.oracle.com/epmos/faces/ui/km/SearchDocDisplay.jspx?_afrLoop=11129815723825&type=DOCUMENT&id=466800.1&displayIndex=1&_afrWindowMode=0&_adf.ctrl-state=17dodl8lyp_108
    Can anyone suggest a better approach?Please log a SR and ask Oracle support for any better (alternative) approach. You can mention in the SR that your approach works properly and ask what would be the implications of using it (even though it is not recommended).
    Thanks,
    Hussein

  • What is the better way to open and close connection in bean

    Hello, may i ask about the best way to open and close the connection?
    At the first, the connection code is store in Conn class bean. The JSP page will call a method in Process bean to process the query and update of database. the Process bean is using th Conn to connect to database.
    In my process bean, it have a method for each type of sql like select, insert, update, and delete for each tables. Each method will call the Conn to open and close the connection. The jsp page can simply call a method retrieve or update records.
    However, when calling the processUpdate method, it is a method that update a group of tables base on the query result of another group of tables and calculation. If I calling the query method in the same bean file, it will open and close the connection many times (more than 1000 times). After open and close the connection several times, the connection to mySQL will be fail.
    Currently, i include 2 method in Process that is only calling the Conn to open the connection and close connection. When calling the openConnection method, it will also set the boolean connected in the class to true and call Conn to open connection. When calling the closeConnection method, it will also set the boolean connected in the class to false and call Conn to close connection.
    After that, i add some change to the query method which is when the connected is false, it will open the connection by calling the Conn and close the connection themself. If the connected is true, it will not call the Conn to open and close the connection because it already connected to the database.
    Now, i when i calling the query method in jsp, it can open the connection and close the connection individually. When i call the processUpdate in the jsp, this method will calling the openConnection before calling the query and calling closeConnection at the end. It not only faster the process(less open and close), it also no cause the connect to mySQL fail error again. However, it also make the coding in the bean file more longer and complex.
    Is there have any better solution?

    Use connection pooling. This will put the connection management in the hands of the webserver, not your code. Check out this post:
    http://forum.java.sun.com/thread.jspa?threadID=741788&messageID=4252932#4252932

  • What is the cheapest way to end service and change to Tmobile?

    I currently have a family plan with 5 phones and 1 tablet and am paying way too much. I would like to switch to Tmobile. 4 of the phones have contracts up in a month but the other phone and tablet have another year. However we do not use those lines, they were added in order to get a premature phone upgrade (I now see the mistake I made there..). What ETFs am I looking at for those two lines? What would be the best way to change to Tmobile?

    Actually you can port all the numbers over as Lizdance stated on the 4 lines. Do this when the lines are free from contract. Otherwise T-Mobile will pay $120 per line if you leave one month early. However you have to pay the etfs first.
    The other two lines can also be ported out but again you will be paying the fees first.
    Please be aware if you read up on the reimbursement of the T-Mobile program many complaints about not getting the money from them (actually gift cards) they are denying many submission's for a number of reasons, some they claim were not submitted on time, some have missing information etc. So be very careful.
    Also you will need to purchase all new devices, pay activation fees and may have to pay deposits. The service may not be all that great coverage wise so be certain all works before you switch.
    Good Luck

  • What is the better way to pass input parameters between components?

    Hi all,
    I had a dispute with a colleague about passing data between different WDP Development Components. The situation is like this:
    Colleague has a SearchWDP (parent) und I have a BrowseWDP (child). After searching for some objects and clicking a hit in the SearchWDP, the corresponding details should be shown in BrowseWDP, via passing a bunch of parameters such as selected item's id, etc.
    Now which of the following is the better practice:
    - Defining a node in BrowseWDP (child) with isInputParameter set to TRUE, creating a similar node from the same type (simply via ModelBinding, both WDPs are using the same model) in SearchWDP, and defining a mapping between them so that SearchWDP fills the input nodes. From BrowserWDPs perspective, I'd call this Pull method.
    or...
    - Defining a node in BrowseWDP (child) with isInputParameter set to FALSE, creating a setter method in BrowseWDP Interface Controller for the collection (to be passed as parameters) and calling a wdContext.nodeBlaBla().bind(pInputParameterFromModelType). From BrowserWDPs perspective, I'd call this Push method.
    The colleague's argumentation in favor of Push has not convinced me at all and I'd like to ask your opinions. Is there a best practice or recommendation for this scenario? TIA
    ps: Any answer will be rewarded.

    Hi Cuneyt,
    Refer the links below, they are very informative!
    http://help.sap.com/saphelp_nw04s/helpdata/en/22/15a441cd47a209e10000000a155106/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/67/cc744176cb127de10000000a155106/content.htm
    These links are a part of the WebDynpro ABAP documentation, but the concepts are same for WDA and WDJ.
    Considering your scenario, I would recommend the first alternative you have mentioned (if you refer the second link its called External Context Mapping), where component controller context node of component A (SearchWDP) is the source for Interface controller context (same name) of component B (BrowseWDP).
    Thanks.
    Chitrali

  • What is the better way to join table for ASE 12.5?

    To join table with T-SQL, there are 2 options:
    select * from tab1 a join tab2 b on a.id = b.id where x=y
    select * from tab1a, tab2 b where a.id = b.id and x=y
    this is only a syntax difference or there is a performance difference? which one is better for performance?

    The first query (using the join clause) is the ANSI standard way of writing joins and is usually supported by all mainstream RDBMSs.
    The second query is the T-SQL method of writing joins and may have limited re-usability with other RDBMSs.
    In most cases which one you use is usually one of preference, ie, which ever one you're comfortable with.
    From a technical perspective there are some join constructs that you cannot build with T-SQL joins, but can build with ANSI joins (eg, you may have problems in T-SQL with a table that you want to be both a) an inner table of an outer join and b) part of a equi/inner join).
    Soooo, ANSI joins provide you a lot more flexibility in coding as well as portability (between other RDBMSs).  But if you're going to work with ASE you'll still need to understand how T-SQL joins work as you'll see quite a lot of T-SQL join-based queries.

  • What is the better way to put a kernel badi in a Sap program?

    I'm trying to put a kernel badi into transaction VA01.
    How can I put this new BAdi?, Inside a User Exit?

    Can you explain what is Kernal BADI

  • What is the better way to change hosted site from Bluehost to BC but keep existing email accts on BlueHost?

    My client currently has their old website and several email accounts hosted with BlueHost. We are going to host their new website (created in Muse) on Business Catalyst, however they want to keep all their existing email accounts on BlueHost's account. At first, I changed the Nameservers on Bluehost so the site will host on BC, but then noticed that affected their emails.
    I found some conflicting info though when trying to research how best to do this: One said that in order for emails to be unaffected and continue to exist with BlueHost, I need to create an A-Record on Bluehost with BC server names so only the new website is on BC. Another forum I found said that I have to change the name servers, then add an MX record in Business Catalyst (but wouldn't that affect their current emails?). Thanks for any advice on how to do this. I'm quite new to BC.

    You just need to change the A-record
    https://my.bluehost.com/cgi/help/a_record
    Point the web traffic to BC only.

  • What is the best way to organize photos? iPhoto or Aperture?

    I am a mom taking tons of photos of my young children. On my old PC I used to organize everything within "My Pictures" by Month & Year (May 2008). I am a very organized, linear person and don't like to change the way I do things midstream so I am having a hard time figuring out how to organize our family photos now that I have switched to a Mac with iPhoto and Aperture. In the future I hope to learn about Aperture's professional tools (which as a mom & not a professional photographer I currently do not use). I would love to take photography classes at a local community college someday...
    My questions are as follows:
    1) What is the better way for ME to store our photos? Should I be uploading to iPhoto or Aperture? I basically want all of my "master photo images" in the same location in an organized fashion. I am hoping to do this without clogging up my computer. At this point I am thinking at the end of each year I will burn the year's photos to a disk for save keeping. But until then...
    2) Is the "library" the over-arching place where all photos are stored? In general, I am having a hard time following the hierarchy of where my photos are being stored, how to organize them and how to completely delete bad photos.
    3) Can I do everything I can do in iPhoto in Aperture? Obviously I know I can do more but is it as easy to edit/fix up photos?
    I have listened to/watched several tutorials on both programs and have read through many other folks' questions/answers but I am still not sure of what to do.
    I really appreciate any help/advice anyone is willing to give!
    Thanks!

    I'm not a professional either, just a grandma with a love of digital photography who takes lots of photos. We used to live in a motorhome full time, so we had lots of opportunities to take many photos.
    I personally like Aperture better than iPhoto because I like to use some of the NIK software/plugins where I can do the adjusting right in Aperture and don't always have to send the photos to PhotoShop. Also you have a bit more flexibility as to file set ups with Aperture. In iPhoto you don't have as many nesting capabilities. iPhoto is great, but pretty basic.
    I had my photos set up as files on the PC, long before I got my first Mac. So I set them up the same way. I'll try to explain
    In Finder:
    Pictures (in side bar on left in Finder)
    Folder - My Photos
    2nd Folder - by year
    In the year folder I have a folder by date ie: 20000722 (year,month,date) and the photos from that date in there.
    Once I got to using Aperture, I have my years set up as "projects" and the dates set up as "Albums". When importing the whole set of photos into Aperture, it was easy. I highlighted the "library", then did a right mouse click and selected "import folders as projects". That imported the photos into Aperture the same way I have them in finder.
    Once everything is in Aperture, and you have new photos to add, I make an album under the corresponding year and import.
    I do all my photos as referenced and don't duplicate them again, as I have them backed up in a couple of other places.
    IMHO you can't back up enough! Don't wait and do it only once a year! Hard drives have a way of crashing and you'll loose all your photos. Use DVD's, thumb drives, ext. hard drives or what ever works for you. But always back up.
    When I take my photos off of the memory card, I immediately send a copy to the back up external HD. Once the photos are adjusted etc. I make sure I have a copy elsewhere too. Only then do I erase them off of the memory card. Might be a bit redundant, but I'm not about to loose any of my photos. When we lived in the motorhome we were always aware of the possibility of theft or fire. So I got in the habit of taking some time to reduce the size of the photos and keep them on a thumb drive that I kept out of the RV. If anyone broke in or we had a fire, I'd still have the photos. Maybe not the originals or the bigger size, but we wouldn't loose them either.
    If you want more info on non professional filing, send me a PM and I can send you a photo of my file hierarchy . (suemach (at) mac (dot) com)
    Allie

  • What is the best way of returning group-by sql results in Toplink?

    I have many-to-many relationship between Employee and Project; so,
    a Employee can have many Projects, and a Project can be owned by many Employees.
    I have three tables in the database:
    Employee(id int, name varchar(32)),
    Project(id int, name varchar(32)), and
    Employee_Project(employee_id int, project_id int), which is the join-table between Employee and Project.
    Now, I want to find out for each employee, how many projects does the employee has.
    The sql query that achieves what I want would look like this:
    select e.id, count(*) as numProjects
    from employee e, employee_project ep
    where e.id = ep.employee_id
    group by e.id
    Just for information, currently I am using a named ReadAllQuery and I write my own sql in
    the Workbench rather than using the ExpressionBuilder.
    Now, my two questions are :
    1. Since there is a "group by e.id" on the query, only e.id can appear in the select clause.
    This prevent me from returning the full Employee pojo using ReadAllQuery.
    I can change the query to a nested query like this
    select e.eid, e.name, emp.cnt as numProjects
    from employee e,
    (select e_inner.id, count(*) as cnt
    from employee e_inner, employee_project ep_inner
    where e_inner.id = ep_inner.employee_id
    group by e_inner.id) emp
    where e.id = emp.id
    but, I don't like the complication of having extra join because of the nested query. Is there a
    better way of doing something like this?
    2. The second question is what is the best way of returning the count(*) or the numProjects.
    What I did right now is that I have a ReadAllQuery that returns a List<Employee>; then for
    each returned Employee pojo, I call a method getNumProjects() to get the count(*) information.
    I had an extra column "numProjects" in the Employee table and in the Employee descriptor, and
    I set this attribute to be "ReadOnly" on the Workbench; (the value for this dummy "numProjects"
    column in the database is always 0). So far this works ok. However, since the numProjects is
    transient, I need to set the query to refreshIdentityMapResult() or otherwise the Employee object
    in the cache could contain stale numProjects information. What I worry is that refreshIdentityMapResult()
    will cause the query to always hit the database and beat the purpose of having a cache. Also, if
    there are multiple concurrent queries to the database, I worry that there will be a race condition
    of updating this transient "numProjects" attribute. What are the better way of returning this kind
    of transient information such as count(*)? Can I have the query to return something like a tuple
    containing the Employee pojo and an int for the count(*), rather than just a Employee pojo with the
    transient int inside the pojo? Please advise.
    I greatly appreciate any help.
    Thanks,
    Frans

    No I don't want to modify the set of attributes after TopLink returns it to me. But I don't
    quite understand why this matters?
    I understand that I can use ReportQuery to return all the Employee's attributes plus the int count(*)
    and then I can iterate through the list of ReportQueryResult to construct the Employee pojo myself.
    I was hesitant of doing this because I think there will be a performance cost of not being able to
    use lazy fetching. For example, in the case of large result sets and the client only needs a few of them,
    if we use the above aproach, we need to iterate through all of them and wastefully create all the Employee
    pojos. On the other hand, if we let Toplink directly return a list of Employee pojo, then we can tell
    Toplink to use ScrollableCursor and to fetch only the first several rows. Please advise.
    Thanks.

  • Allocate asset balance to other assets - what's the best way

    Hi there,
    I need to allocate the balance of an asset to multiple assets but this allocation should only impact a single depreciation area.  We have 3 depreciation areas, so the other 2 shouldn't get the allotment.  What is the better way to do this?
    Thanks,

    Hi,
    You can create a new Transaction Types for postings to only some Depreciation Areas. (the same you can do for Retirements, Transfers, ...)
    Asset Accounting / Transactions / Acquisitions / Define Transaction Types for Acquisitions
    The posting you can make then with the transaction ABSO - Miscellaneous
    Paul

  • What's the best way to create basic scrolling up end credits

    What's the best way to create basic scrolling up end credits with FCE. I want create normal look after the film that has a gap between the working title and the name (center-aligned, two-column
    scrolls)
    In the FCE Manual there was a good way to to do it with an asterisk (*) between the the words, but problem occurs when I had an umlaut (ÄÖ) in the word. The asterisk becomes visible and as many umlauts in the working title so many letters missing from the beginning of the name. I'm from Finland and we have lots of umlauts. So is there any other way to do this with FCE.

    You can use Title Crawl in Boris to do this. You set it up like a word processor with a right aligned tab, a gap and then a left aligned tab. Double click in the ruler to create a tab stop. Double click it again to change its alignment. You use the tab key to move between the stops. It's kind of hard to explain, but if you play with it, I think you'll get it.
    There is also Boris documentation on the install disc which will explain it more fully.
    Message was edited by: Tom Wolsky

Maybe you are looking for

  • Macbook Pro Early (2008) will not turn on!

    I have same problem with my macbook pro early (2008) I think is unfair to have this problems in the "perfect world notebook" I hope you can help me on this Regars, Carlos. ---- MrAngel Discussion----- Ok. It looks like does not matter what model is b

  • MS Word email attachments do not open on my E6

    When I receive a MS Word attachment via email and try to open it, I get a "Unable to open. Attachment file not supported" message. When I use QuickOffice and access my Dropbox, I can open any document and make edits. Does anyone have an idea what cou

  • GW client crash ater 5 seconds, no display of e-mails

    Hello All; I have 1 user which crashes after 5 seconds after entering the users password. GW Client 7.04. The user can use GWWebaccess to view e-mails and the BES (4.17) reads the e-mails so the user can use a BB. Windows event ID of 1000 Faulting ap

  • [Desktop][Playlists] View 2 Playlists at the same time

    Hello, It would be very useful if two playlists could be shown at the same time on the desktop version. It would be much easier to edit the playlists and to put the song exactly where i want it without jumping between the playlists the whole time.

  • My lenovo b450 can't install with any windows include win 7 and xp

    i was hard to install with windows 7 again after i install with windows xp to my laptops, and then i have problems with install another windows version. its hard to believe that all operating system installation for my b450 is stop before sucessfuly