Is there a way to get a (return) value back after running Javascript statements in the backing bean?

I have a usecase  where I need to run a javascript function from within the backing bean and get the value returned by the function.
Example:
          In Java I have two variables  x and y, I want the javascript to return the larger value z.
          This is what I'm doing, but I have no means to get the values of variable z.
          StringBuilder script = new StringBuilder();
          script.append("var  z;");
          script.append("var  x = " + x + ";");
          script.append("var  y = " + y + ";");
          script.append("if  (x > y)  z = x  else z = y");
          FacesContext fctx = FacesContext.getCurrentInstance();
          ExtendedRenderKitService erks = Service.getRenderKitService(fctx,
          ExtendedRenderKitService.class); erks.addScript(fctx, script);
     The actual usecase is a bit complicated. It's a dragNdrop paradigm.
     I cannot capture the muse Release event (DropEvent ?) in the client side as (most likely) it is captured by ADF.
     The drop target is a RichTextEditor. I need to convert the DropEvent.getDropX() and DropEvent.getDropY() to get the caret position in the text editor.
Any other solution to the issue is highly appreciated.
Thanks,
-ab

you can try it!
erks.addScript(fctx, js_funcation_name("'"+x+"'","'"+y+"'","'"+x+"'","'"+x+"'",.....));//bean-> javaScript
add javascript:
               AdfCustomEvent.queue(p, 'XXXXX', {parameter:parameter_value},true);
add:
<af:serverListener type="XXXXX" method="#{ManageBean.funcation}"/>//js->bean

Similar Messages

  • Is there a way to get a user login record after sleep?

    I know that by opening terminal and typing in "last" (without the quote marks) that it will give me about a 3 week record of who has logged on my computer after shutdowns and restarts.
    What I want to know is this:
    a) Is there a way to get a user login record after the computer only goes to sleep?
    b) is there a way to get the terminal to go back further than just 3 weeks or so for the shutdown/restart records?
    Is there software that might do this???
    Thanks in advance, this is important for me.

    bikinijack wrote:
    Thanks, Dave: so this is what I type in the terminal? "ls -l /var/log/wtmp*" (without the quotes). And how do you unzip something that has been "gzipped"?
    "man gzip" will give you the details for using gzip
    My first question can be explained this way: To get into the computer when it is coming out of sleep you need to type in a password, then it opens to the desktop. Is there a way I can find out the times over the course of a day/week/month that this is being done? i.e., is there a log being made somewhere of when the computer is being opened and signed onto after being asleep?
    When you wake the computer from a sleep, you are not logging in again so there will be
    no record of the event as a "login"
    My computer possibly could be used by a few other people that have access to my computer password (don't ask why) and I basically want to know if they are signing on when I am away from my desk.
    You may want to look at /var/log/asl.log or /var/log/secure.log which contain details of
    authentication attempts (which is what you are doing) and failures.
    I am not asking why you have multiple people accessing your computer with your password --
    but consider setting up separate username, it is a lot easier to manage and you will probably
    not be asking questions like this one.
    Dave

  • HT4623 I bought my iPad from a friend and updated to iOS 7.1. Now in order to activate it I need to sign in using the original iTunes account but I can't contact the owner. Is there a way to get past this or should I toss my iPad into the garbage?

    I bought my iPad from a friend and updated to iOS 7.1. Now in order to activate it I need to sign in using the original iTunes account but I can't contact the owner. Is there a way to get past this or should I toss my iPad into the garbage?

    Ask previous owner to remove his device from account
    http://support.apple.com/kb/TS4515

  • I used to be able to select an arbitrary "column" in MS Word, but since upgrading to OS 10.9.4 and MS Word for Mac 2001 v. 14.4.3, it doesn't work anymore.  Is there any way to get this handy functionality back?

    I used to be able to select an arbitrary "column" in MS Word, but since upgrading to OS 10.9.4 and MS Word for Mac 2001 v. 14.4.3, it doesn't work anymore.  Is there any way to get this handy functionality back?

    http://www.microsoft.com/mac/support
    http://answers.microsoft.com/en-us/mac/forum/macword?auth=1
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macword/microsoft-wor d-for-mac-2011-will-not-open-error/ecc42616-6f49-40bb-b8f5-e21c711ea359

  • Is there any way to get windows environment variables like %USERNAME% with javascript?

    is there any way to get windows environment variables like %USERNAME% with javascript using Adobe 10 pro?

    There is a fair amount of Acrobat JavaScript and Acrobat knowledge need to sort all of this out.
    The identity object holds a lot of sedative information. First, upon installation of Acrobat, only the login name is available in the identity object and the end user of the application needs to complete the "Name", "email" and "Organization Name" in the application's preferences. These are the only fields that are available to Acrobat JavaScript identity object as corporation, email, loginName, and name.
    Using the instructions in The Acrobat JavaScript Console (Your best friend for developing Acrobat JavaScript) you can run the following script in the JS console to see the items of the identity object:
    for(i in identity) {
    console.println(i +": " + identity[i]);
    and the following will appear in the console:
    loginName: georgeK
    name: George Kaiser
    corporation: Example
    email: [email protected]
    true
    The documentation states you need to use a trusted function to access this data, but you can access it at startup of Acrobat/Reader and add the properties of the identity object to an array:
    // application variable to hold the properties of the identity object
    var MyIdentity = new Array();
    // loop through the properties of the identity object
    for (i in identity) {
    // place each property of the identity object into an element of the same name in the Identity array
    MyIdentity[i] = identity[i];
    console.println(i +": " + MyIdentity[i])
    You access the items with:
    var loginUser = MyIdentity[loginName];  // get the loginName property
    In the user application level JavaScript file. See Acrobat Help / User JavaScript Changes for 10.1.1 (Acrobat | Reader) for the location of the application level folder you need to use.
    I would change the name of the array used in this post so an untrusted user cannot get to your data. Some of this data can be used in hacking into a user's system.

  • Just downloaded itunes on new computer, is there a way to get my purchased folder back?

    I just bought a new computer and downloaded itunes. Is there a way to get my purchased folder back? My old computer crashed and wont turn on.

    Ensure you have iTunes 10.3.1 or later.
    Open iTunes, in the sidebar choose 'Purchased', on the 'Purchased' page choose 'Download Previous
    Purchases'

  • I recently swapped providers but didn't think about recording my saved voice messages before doing so.  Is there any way to get those personal treasures back?

    Due to family troubles I dropped out of a family plan and picked up with another provider.  I had voices messages of my girls when they were very young on my answering machine that I had saved for years; now I'm unable to access them.  Is there a way to get those back?  Thank you!

    Probably NOT gone yet...
    If you hurry you might be  able to get them. They are only saved for so long...
    I was told by verizon:
    "You can access your old voicemails by calling 812-320-2957, and just use your voicemail password to access the messages." for a short period of time (mine was 2 weeks, but it may depend on where your bill falls etc...)  This should be the usual password you use to call voicemail.
    You will have to use an app to record it or like do it like me.  I'm simply going to put it on speakerphone and record it with my camcorder and another phone...

  • CANON VIXIA TO DVD FROM FCPX - APPARENTLY YOU HAVE TO TRANCODE THE FOOTAGE.  IS THERE A WAY TO GET A CLEAN DVD WITHOUT FREAKING TRANSCODING.  DONT HAVE THE TIME  TO MUCH WORK.

    FCPX - editing system

    IS THERE A WAY TO GET A CLEAN DVD WITHOUT FREAKING TRANSCODING. (?)sic
    Nope.
    DONT HAVE THE TIME  TO MUCH WORK.
    Then you need to find another delivery method.
    x

  • Is there a way to get my book marks back into Safari from a TM backup?

    Hello fellow Mac users. Is there a way to "restore" my wife's book marks from an earlier TM backup in safari?
    My wife deleted a bunch of files on her MBP. I went back to an earlier days TM backup and restored things in her documents folder etc but when she went into Safari all of her book marks are gone. Is there a way to get them back from one of the TM back ups? There was also another user that was deleted. Can that be restored?
    Thanks Very Much!

    To get the Safari bookmarks back, you need to locate the 'booksmarks.plist' file which should be located in the username/library/safari folder and replace the same file in the same folder for the user you want the bookmarks for.
    As far as restoring a previous user, I'm not sure. It might be easier to just make a new one. You should still be able to get the files from the previous user from your Time Machine backup if that's what you intended. If you could restore a user, it would have to be by using Migration Assistant, although I couldn't say as to whether that would work.

  • PC has broken - Is there a way to get my iTunes library back?

    Hi
    My PC which has my iTunes library on it won't turn on. Is there a way to get the library back on a different PC/Laptop?
    Many thanks in advance
    T

    If you have made a backup, you can use your backup copy to re-create the library on a new machine.
    Or, if the problem with your current machine is the CPU rather than the hard drive, you can read the contents of the hard drive into a new computer (or have the Geek Squad do it for you).

  • How do I get iTunes songs which were downloaded from external back-up drive to play on new computer and is there a way to get my play lists back?

    When I try to play a song from my re-installed iTunes library, I get the error message:  "Song xxx could not be played because original file could not be found.  Would you like to locate it?" > "Locate" or "Cancel."  When I click on "Locate" I can't figure out how to get the song to play from any of the places that were "located."  The path is C:\users\Janet\libraries\music\iTunes
    However, iTunes songs chosen from my library will play in iTunes (current version) when I have the external back-up drive plugged in!  I recently copied my backed-up iTunes library from my external back-up drive to a new computer.
    Most of the songs, but not all, magically appear in Windows Media Player and I can play those just fine. 
    I can see my iTunes library in the newest version of iTunes, recently downloaded to new computer, but can't play songs without connecting to the external back-up drive - so maybe there is something else on that external drive that needs to be on my C: drive? 
    I am using an HP Pavillion Notebook, Windows 7, 64-bit.  My previous computer was Windows Vista.  Before Vista, I had XP. 
    Back when I had XP, I wanted to purchase some songs to download to my computer. Because iTunes had the ability, I used it to create a massive library of songs, most of which were ripped from my CDs.  I don't have an iPod and iTunes worked fine for creating playlists and then burning them to CDs. 
    Also, I'd like to know if there is a way to get back my playlists.
    And another thing - in the older version of iTunes, there was a folder in the lists on the left-hand side of the screen where I could click to see all the songs I had purchased.  I'd like to get that ability back if possible.
    In hindsight, iTunes was probably not the best choice for me to build my music library in a Windows operating system, but it seemed to be the best choice at the time.  I really wish I could convert all the songs to mp3 format.
    I have been working with computers since the days of DOS, black and white screens, and no mice.  The first computer I bought for my own use at home was a Mac and it had "Flying Toasters" as a screensaver.  (I miss that screensaver.)  It did not have a tower and I believe they called it a laptop, even though the thing was as big as a suitcase and probably weighed around 30 pounds.  However, I am by no means a computer expert.  In other words, pretend you're trying to tell your mother how to do what I am asking. =)
    Many thanks in advance to anyone who can help me.

    I copied the iTunes file from the external drive and it's in both places.  I thought all I would need is the iTunes program (which I downloaded to new computer) and my iTunes library file.  There must be something else that's missing.  My iTunes library looks the same on the new computer as it does when I open it on the external drive.  If I click on an iTunes library song from my new computer, it will only play if I have the external drive plugged in.
    My back-up drive is a mess.  I have multiple copies of music, video, photo, and document files and I don't know how that happened. ={  Obviously, I don't know how to back up stuff properly and there are back-up files extending over a 6- to 8-year period.  I think all I did was just drag and drop the main folders from the back-up drive to the same main folders on the C: drive.  Also (and I'm kind of fuzzy on this) Windows used to automatically save music files in a folder within my document files (which makes no sense to me).  As my Jewish friends would say, "Oy Vey!" 

  • Is there a way to get QuickTime 7.2 back???

    I am about to install Avid Media Composer, however, Avid says it works with QuickTime 7.2. It didn't say if there were any issues with the current 7.3 version. I contacted Apple Support and they told me the only way to get QuickTime is through the Apple site and that they don't have previous versions of QuickTime on disc.

    I'm a lil' ****** off about this!
    Just upgraded to 10.4.11 and all went well, installed QT 7.3 via software update and now have problems playing numerous live streams i frequently view.
    Can't downgrade to QT Pro 7.2 without an OS install yet 10.4.11 did not overwrite my original QT Pro 7.2 installation upon upgrading the system so... it's obviously not required so why will they not allow one to downgrade without the hassle of reinstalling the system?
    I'd understand if i had made the jump to leopard but this makes no sense.
    Geesh!

  • Is there a way to get my purchased apps back after an accidental restore

    I was updating my ios software and accidentally unplugged the ipad before it finished.  That locked my ipad in 'restore mode'.  I tried starting/restarting, all the typical things, and the only way to unlock it was to go through with the restore.  I planned to reset it with a backup, however the backup is not there.  Right now, everything is gone and it's back to factory settings.  Please tell me there is a way to get my info back!

    You can download your purchased content again. Just go to the purchased tabs of all of the stores, iTunes, the App Store and iBooks, and download your paid content again. Virtually all of it will be free to download again as long as it is still in the store, as long as you use the same Apple ID and as long as the feature for the free download is available where you live,
    So just start in one of the stores, tap on the purchased tab, and start downloading again.

  • HT1766 If you had already restored your ipod touch without backing up, is there any way to get your old data back?

    Somehow, all my ipod touch's music was deleted so I restored it but forgot to back up. Now around a term past but I still don't how to get my old data back. Now the music thing still doesn't work so I don't know what happened. Maybe my itunes is stuffed??

    i wanna know if my warranty covers it
    No. The warranty covers manufacturing defects and faults that develop after purchase. Your dogs' mauling is neither of those.
    if it doesnt how much it will cost
    A Google search for "ipod touch 2g parts" returned this. There are others you can find yourself.
    $50 for back panel
    http://www.rapidrepair.com/shop/4405-chrome-backing-ipod-touch-2g.html
    $90 for glass panel
    http://www.rapidrepair.com/shop/4421-digitizer-glass-ipod-touch-2g.html
    do not reply to this unless u have an answer
    Yeah, 'cos people often do that...

  • TS4006 Is there a way to get a device's last known location (via iCloud), beyond the 24-hour mark?

    Lost an iPad 1 but for reasons that are too long to explain (leave it that we are traveling at the moment), didn't realize we'd lost it for 10 days. Trying to back track to figure out where we lost it but for some reason iCloud only provides prior location for 24-hours. Obviously we are beyond that point. I am wondering if there is a way to get the last known location of a device beyond that 24-hour window?
    Thanks. Much appreciated.

    Welcome to the Apple Community.
    Unfortunately, Find my phone doesn't keep a location history.

Maybe you are looking for

  • "Error: Out of memory" [not able to open timeline or videos in 'Viewer']

    Hello all, I am opening an old project from FCP 4 to Studio 1. The old system used a 'Cinewave' capture card. The new system is AJA Kona. I opened and changed timeline settings for many projects and they worked. This project the option fails. If I op

  • Reg:BPM

    Hi All, I am new to Business Process Management(BPM) can anyone tell me What is BPM? and the business scenario actual use of BPM and provide me any useful material on this. Thanks, Rahul. Edited by: rahul.girmaji on Dec 22, 2011 7:27 PM

  • Confirmation for received mail?

    Hi everyone, I have a big question: is out there any option for Mail that confirms or send a confirmation when a mail is received? I have seen this in the old MaxBulk program. And for work, I NEED to know when my email is being read or trashed, or ev

  • Searching by tag name

    When searching for images in Elements 10 by tags such as "cats" is there any way to prevent Elements 10 from displaying all the images in a stack which might contain one image tagged "cats"?

  • SLDAccess set to true, but not available -  http to RFC Scenario

    Hello Experts, I have created http to RFC scenario in DEV system and it is working fine. But after transporting the scenario to QAS system. It is giving following error. com.sap.engine.interfaces.messaging.api.exception.ConfigException: SLDAccess set