ADF/JavaScript - get dynamically variable of bean

I'm trying to recovery value of bean in JavaScript according to the element in the source:

function getValue(actionEvent){
  actionEvent.cancel();
   var component=actionEvent.getSource();
   var id=component.getId();
   var substr= id.substr(2,4); //This gives me "l11" for a component
   //Now I need the value of the bean variable MyBean.value<substr>
   //For this case, I need the value MyBean.valuel11
   //If I do something like alert("#{MyBean.valuel11}"); it works
   //But I need dynamically
   var val =   "#\{MyBean.value" + substr + "\}";
  alert(val);
}

But the result appears:

{MyBean.valuel11} and not the value of bean.

Could you help me?

Thanks in advance.

JavaScript don't know the Expression Language of ADF Faces components.

You must use an af:clientAttribute tag

Read more here:

http://www.Oracle.com/technetwork/developer-tools/jdev/1-2011-JavaScript-302460.PDF

Tags: Java

Similar Questions

  • [ADF, JDev12.1.3] UI component: when link (to a variable of bean), its value and when to link UIC together?

    Hallo,

    in lots of examples that I have seen that sometimes the whole (through the Binding property) UI component is bound to a variable of bean and sometimes only the value property is bound to a variable of bean.

    I understand that when it comes to the UIC connection on the Value property value is sufficient.

    But I ask myself... which is the approach recommended in general?

    And is there a situation in which the binding using the Binding property must avoid?

    I have created a search custom form with the field (inputTexts, checkboxes,...) the values are handled in a bean. Which would be, in this case, the approach of linking advisable?

    Thank you

    Federico

    But I ask myself... which is the approach recommended in general?

    You should almost always use concrete goods (such as the ' value')

    In some cases, you will need to update some components of the user interface programmatically (with AdfFacesContext.getCurrentInstance () .addPartialTarget (component)), and for this you need reference to any component.

    But even in this case, you can use another approach to get the reference of the component instead of binding to the beans (but of course, "binding" attribute is the best way to get the reference of the component)

    See also: that binds the JSF component? When it is best to use? -Stack overflow

    And is there a situation in which the binding using the Binding property must avoid?

    -If you do not need any component

    -If you have scope of pageFlow/view/session bean

    I have created a search custom form with the field (inputTexts, checkboxes,...) the values are handled in a bean. Which would be, in this case, the approach of linking advisable?

    Probably the "value" property

    Dario.

  • How to pass variable from bean to resourceID for the document map?

    Hello experts, I have added WebCenter workflow Microsoft document explore task in my ADF which as a parameter called resourceId.   I want to pass variable bean to this setting, because the content ID (doc name or ID) are determined dynamically.

    When I provide ${"UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI"} as a resource in the expression ID, it works very well.    But samething if I attribute to a bean bean variable and entitlement in the form ${sessionScope.MyBean.docName}, it evaluates the variable bean in the form ${"UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI"} and then below throws the exception:

    [2013-10 - T 02, 14: 34:50.369 - 04:00] [DefaultServer] [WARNING] [WCS-07219] [oracle.webcenter.doclib.internal.view.backing.ContentProvider] [tid: [ASSETS].] [ExecuteThread: '10' for the queue: "(self-adjusting) weblogic.kernel.Default"] [username: anonymous] [ecid: d50192415c689920:-7d97126c:1417a5d6a49: - 8000 - 000000000000008 a, 0] [APP: CreateContactWSProxy] invalid parameter combination: the login name specified by resourceId = ${"UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI"} is not specified in the parameter connectionName = UCM57Server.

    Variable bean is defined as:

    private String Nomdoc = "${" UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI "} ;

    Please give me some advice on how to pass the value to resourceId dynamically via the variable of bean.

    Thank you.

    private String Nomdoc = "UCM57Server #dDocName:1379596941565_CONTACT_OPTREGI";

    Without $ {}

  • Can a Flash SWF embedded save and get a variable with the drive?

    My SWF content contains text in different languages.  The user selects a language and it appears.

    Is there a way to store this setting locally so that the correct language is displayed when the pdf file is reopened?

    I only need a two-letter string, such as "EN", "FR", "ZH", etc., and the SWF file takes care of the rest.

    I tried calling multimedia_saveSettingsString of SWF Actionscript, and I tried to set a global variable in Acrobat and local setPersistent using Actionscript and .js files. It works in Acrobat, but not the reader on a users system.

    I also tried to use a separate pdf form to store a global variable and then tried to get this variable using the SWF Actionscript.

    Could it be a problem with Acrobat properties or security settings?

    I'm not a virtuoso, would help the sample scripts.

    (Windows 7; ActionScript 3; Acrobat 9 and XI are available; Adobe Reader 9 is installed base, but I may be able to move to a more recent version of the player)

    I asked a similar question in the Acrobat Javascript community, but didn't get any response. I have here reformulated with additional details

    Thank you.

    Here's my example section linking to the Save and Load buttons. evalText, infoText and replyText are the three fields TextArea.

    Note that it is important to send a string and returns an object and cast it to a string. EI.call () has no idea what is sent to JavaScript.

    // button handlers
    butSave.addEventListener(MouseEvent.CLICK, doSave);
    
    function doSave(e:MouseEvent):void {
        var rtn:Object = ExternalInterface.call("multimedia_saveSettingsString",evalText.text);
        if (rtn == null) {
            infoText.appendText("Save: REPLY = null");
        } else if (rtn.toString() == "") {
            infoText.appendText("Save: REPLY = empty string");
        } else replyText.appendText("Save: reply = " + rtn.toString());
    }
    
    butLoad.addEventListener(MouseEvent.CLICK, doLoad);
    
    function doLoad(e:MouseEvent):void {
        var rtn:Object = ExternalInterface.call("multimedia_loadSettingsString");
        if (rtn == null) {
            infoText.appendText("Load: REPLY = null");
        } else if (rtn.toString() == "") {
            aT(infoText,"Load: REPLY = empty string");
        } else replyText.appendText("Load: reply = " + rtn.toString());
    }
    
  • With regard to the dynamic variable repository

    Hi Experts,

    I made a dynamic variable repository. This variable is calculated the date of beginning of the week.
    I use this variable in the command as a default prompt.
    the problem I am geeting that its value is not getting updated. It shows the static value that I gave you in default initializer
    RPD.i want to, its value is changed in every week, but it does not change, his shows always value that have default
    in view of the RPD.

    Please share any solution for this problem.

    Hello

    Please use the below SQL syntax in the default selection of the guest of dashboard.

    SELECT CASE WHEN 1 = 0 THEN date_column of another TIMESTAMPADD(SQL_TSI_DAY,-0, CURRENT_DATE) END OF SH

    Concerning
    Young

    NOTE: Please mention if this solved your problem/still face and close the message.

  • How to use the 'Get Shared Variable list' VI on a target RT?

    Hello

    I would like to browse all variables shared in a library hosted on my CompactRIO programmatically. I dropped the 'Get Shared Variable list' VI in my VI in real time, but when I tried deploying, LabVIEW says

    Deployment PRC_GetVarList.viPRC_GetVarList.vi loaded with errors on the target and was closed.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListEnd:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.
    LabVIEW: Unable to load the shared library dscProc.dll:ni_lvdsc_process_GetTagListBegin:C. ensure that the library is present on the target of RT. MAX allows you to install software from OR or FTP to transfer custom RT target libraries.

    I watched the wizard of the MAX software, but cannot find the DSC-based modules. Where should I look?

    Thank you!

    Hello

    The palette of DSC is not supported on the screws in real-time and will lead to errors when they are deployed.  Unfortunately, to have a successful build you will need to modify your application and remove the screws from the palette of DSC on your target of RT.

  • WRT160N: Getting dynamic IP address 169

    Hello!

    Linksys WRT160N, bought yesterday and I want it behaves same way did my Buffalo WHR-HP-G54. So I live in apartment building for students, and we don't have modems, just the RJ-45 ports in the wall. If I plug the cable directly from the wall of the network card in my computer, my computer receives the dynamic ip address from the ISP. With my Buffalo, I connected the ethernet to the WAN sa-port cable and changed the router in bridge mode. In this way, there was 4 other ports free for the other PC and of course wireless too much for the other PC. Each PC connected via the Buffalo had a dynamic ip address from ISP, up to five addresses, which is the limit of my ISP. I plugged the ethernet cable from the wall of WRT160N Internet port and disabled NAT, dynamic routing (RIP) and DHCP server on the router Linksys, so all my computers have addresses ip starting with 169. And when I plug the ethernet cable from the wall to a port other than Internet-port of Linksys, all computers get the correct IP addresses via a wireless cable. What is wrong, is at - it a setting I have not seen? Some setting that I can use Internet-port and have other 4 free ports for other devices and other devices can get dynamic IP from my ISP.

    Ignore the Scrooge. What he wrote has nothing to do with your problem.

    Unlike the Buffalo WHR the Linksys doesn't have a configuration option or switch to alternate between the 'bridge' and the router mode. The Linksys always uses the internet port on a different interface of the numbered ports. You can't fill.

    For example, if you want to 'bridge' with the Linksys is the configuration you already have when wiring from the outlet ports numbered, i.e. do not use the internet port. You will have to "give up" the internet port then. If you need more wired ports, you must connect a switch to the router.

  • How to get the variable 'dn' in a script

    Hello

    I have a problem, get the variable "dn" of the script is not a "public" variable, but I'm able to see in the log file. I bet it's in an object java somewhere - I don't know how to access it. No one knows how to get it. I have attached some of the newspaper:)

    CN = 8485 [5-6] XX, dn = 8485601 = 9812 cgn, ani = null, dnis = null, clid = null, atype = FORWARD_ALL lrd = 9817, ocn = 9817,

    I have a similar problem but I did not find the repo. package... Where?

    Thank you

  • Despite his uniform and fixed on my form of task settings, I get thickness variable and facing interiors of the curves. I really wish it was just smooth and uniform. Any ideas?

    Despite his uniform and fixed on my form of task settings, I get thickness variable and facing interiors of the curves. I really wish it was just smooth and uniform. Any ideas?

    This question cannot be resolved when you use the brush with an effect.

    It cannot be solved with the form of the task.

    Try just drawing on larger scale, maybe then it won't happen.

  • PowerCLI Invoke-VMScript re - ip guest - how to get the variable hostname comments

    I run the following script as a task Post-Power-we a re - ip our VMs after that MRS. them rocking.  I was able to run this script successfully without the variable hostname of comments (in the test, he runs a script by test VM with the hostname assigned...), but I'm stumped on how to get comments variablized according to the machine's host name works on, it will take the host name and use it in the GuestUser variable and the command - VM.  I tried the bold part, but it does not work.

    $srv = Connect-VIServer 10.0.0.10 - administrator of the username-password password

    $Hostname = (get-wmiobject win32_computersystem). Name

    $script = "%windir%\system32\cmd.exe/c c:\dr\drIPsettings.bat".

    $HostUser = "root".

    $HostPassword = "password"

    $GuestUser = ' $Hostname\Administrator '.

    $GuestPassword = "password"

    $ScriptType = "bat".

    SE connect-VIServer 10.0.0.10 - Session $srv. SessionID

    Invoke-VMScript - ScriptText $script - VM $Hostname - HostUser $HostUser - HostPassword $HostPassword - GuestUser $GuestUser - GuestPassword $GuestPassword - ScriptType $ScriptType

    Thank you!

    How you code the - VM on the Invoke-VMScript cmdlet parameter, it seems that Displayname of the guest is the same as the host name.

    Can't you just use a loop on guests and then use the displayname property

    $script = "%windir%\system32\cmd.exe /c c:\dr\drIPsettings.bat"
    $HostUser = "root"
    $HostPassword = "password"
    $GuestPassword = "password"
    $ScriptType = "bat"
    
    Get-VM | %{
       $GuestUser = $_.Name + "\Administrator"
       Invoke-VMScript -ScriptText $script -VM $_ -HostUser $HostUser -HostPassword $HostPassword -GuestUser $GuestUser -GuestPassword $GuestPassword -ScriptType $ScriptType
    }
    

    You can encode the Get - VM with more specific selection criteria or use a Where-Object after the Get - VM.

    ____________

    Blog: LucD notes

    Twitter: lucd22

  • Get a variable to a symbol editing

    Hello

    Could someone point me in the right direction (perhaps there is some pre-existing discussion I can have failed to spot) to whether or not I can do the following?

    What I have to do is "enabled" a variable in the timeline of a symbol and then 'get' on the main timeline.

    I have a symbol called "audio" and on his script, I have the code:

    sym.setVariable ("on_off", "on");

    Then, on the main timeline, I have an 'onClick' that has the following code:

    var audioStatus = sym.getVariable ("on_off");

    This doesn't seem to work; so I tried too:

    var audioStatus = sym.getSymbol("audio").sym.getVariable ("on_off");

    But who doesn't either.

    Any ideas?

    Thank you very much in advance

    Hello

    You are very close!

    If you define a variable on a timeline of symbol, so you get the symbol before you can get the variable - but you do not use sym twice online. Then try this:

    var audioStatus = sym.getSymbol("audio").getVariable ("on_off");

    HTH,

    Joe

  • How to remove all the dynamic variables of a movieclip?

    I have the movieclip:
    mcGrazer

    with a certain dynamic variables like this:

    mcGrazer.var1

    mcGrazer.var2

    etc.

    If I use:

    delete mcGrazer;

    It does not remove the variables.

    But if I use:

    delete mcGrazer.var1

    It removes this individual variable.

    is there a way to destroy information (variables) to a particular movieclip?

    Thank you.

    You can use:

    function deleteVariablesF(mc:MovieClip):Void {}

    for (var s:String MC) {}

    delete a [s];

    }

    }

  • Repository dynamic Variables

    Hi guys,.

    I noticed a problem in obiee 11g (thousands, unfortunately).

    I create different dynamic variables (repository) to be evaluated by a single query.
    If I test the block of initialization, it's all ok, and each variable to find a corresponding value from the query.

    But the programmer does not work and all the variables that remains to be equal to the default values.

    Why this behavior? Does anyone have the same problem? Solutions?

    Thank you very much.







    moved here from Business Intelligence Application *.

    Hi andysax

    I faced a similar problem when editing online a repository of 11 g. Oracle noted a bug (10394725) and developed a patch to me correct the fault. It was caused by the administration tool does not release its lock on the init block.

    A couple things to check to verify that it is the same problem. Look in your nqServer.log to see if there is an error concerning «unable to acquire an exclusive lock...» ». You edit your SPR in online mode and took a very long time recording?

    Kind regards
    Paul
    http://total-bi.com

  • How to get the variable substitution essbase in ODI

    Hi all
    I have a problem that I need to get the variable substitution of Essbase /EAS to work on a SQL in ODI.
    How can I do in ODI?
    Thank you all for...

    Thomas

    Hello

    If you read my blog:-http://john-goodwin.blogspot.com/2009/11/odi-series-planning-11113-enhancements.html
    In the post, there is a section on the recovery of the essbase substitution variables and their use in ODI.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Dynamic variable names

    Well, I just need to understand how to make dynamic variable names. In this case, I have a loop, and inside the loop, I need to create a table for each iteration of the loop. Something like

    < cfloop from = "0" to = "10" index 'i' = >
    < cfset LoopArray #i # = Some Value >
    < / cfloop >

    But it does not work. How can you make a dynamic variable named? I think it's probably something to evaluate them with or, but I don't know how to use them and the livedocs are meaningless to me. Thank you!

    See attached example.

Maybe you are looking for

  • 'Restore previous Session' unavailable

    I found 2 similar questions for 10 months ago on forum, ch. w / 25-30 additional people with the prob. 2 weeks ago, I asked about 2 problems, were unable to fix them. Now focus on this one only. Session restore doesn't work after quitting and restore

  • Is antivirus a good idea for phones?

    Just ask, and I can't find anything already validated by research, the use of an antivirus on these phones application. My husband and I were discussing whether or not we need to install an and if so, which. We know better than to open emails and esp

  • Screw worked in LabVIEW 2009 but do not work in LabVIEW 2010

    The screws were initially written in BT 7.1 but then compiled in 2009 LV, and saves. These screws worked well on the Windows XP machine. Unfortunately, the XP machine was crushed and I try to run these screws in LV 2010, with windows 7, 32 bit. I ins

  • Windows 7 x 64 won't goto sleep

    Sorry if this is the wrong forum, but did not know where it is.  In any case, whenever I try to set my machine to sleep he wakes upward almost immediately, if I try manually to do sleep or automatic timer.   I tried: -updated the video driver and chi

  • Push the connection interrupted by device - using eclipse of the bb Simulator

    Using BlackBerry plugin for Eclipse For OS 6 After taking two weeks to try and correct an error "not close until you have finished" simple with SQLite, I now have a bit of a configuration issue with the Eclipse software. When I push a message to the