11g Faces, How do i get the id of a selectOneChoice in JavaScript
Hi,
I can't seem to get the id of a selectOneChoice in JavaScript using the ClientListener API.
I've tried to find the ID using the JS AdfRichSelectOneChoice and AdfValueChangeEvent but neither provide a method to give the ID of the changing component.
I need the ID because the selectOneChoice is in an af:table and I need to sync some other values in the table on the client side when the selectOneChoice is changed. The id contains the row id of the row the selectOneChoice is currently on. I can then set other inputs components using this id.
help would be appreciated!
Brenden
Test JSP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>
<f:view>
<af:document>
<af:form>
<af:panelFormLayout>
<f:facet name="footer"/>
<af:selectOneChoice label="Fruit Selection" id="FruitSelect1"
clientComponent="true" valuePassThru="true">
<af:selectItem label="Apple" value="Apple"/>
<af:selectItem label="Banana" value="Banana"/>
<af:clientListener method="fruitChanged" type="valueChange"/>
</af:selectOneChoice>
</af:panelFormLayout>
</af:form>
<script type="text/javascript">
function fruitChanged(event){
var source = event.getSource();
// need to get the id full id of FruitSelect1 here,
// either from the event or the source component AdfRichSelectOneChoice
</script>
</af:document>
</f:view>
Give this a shot mate
event.getNativeEventTarget();That will allow you to access the DOM object directly
Id can be retrieved via
event.getNativeEventTarget().id;
Similar Messages
-
How do I get the Photoshop layer tags in JavaScript?
I asked this question at graphic design stack exchange but they pointed me here:
http://graphicdesign.stackexchange.com/questions/35374/how-do-i-get-the-photoshop-layer-ta gs-in-javascript?noredirect=1#comment48962_35374
I want to do actions based on the tagged layer color (these thing 1) in Photoshop. I can't find a property inside the JavaScript documentation or the ExtendScript Toolkit that might contain the value.
I'd prefer not to abuse the name for that, the layer tags look like a very clean solution to my problem. If only I could fetch them.
Any Ideas?
Kind Regards,
MiiHi, these functions will select all your layers with the specified color:
use the command: selectAllByColor("red");
function getIDXwithsameColor(TheColor){// search and return a list of indexes for the layers with the specified color
var ref = new ActionReference();
var toRet = [];
try{activeDocument.backgroundLayer;var a=0 }catch(e){ var a = 1; };
while(true){
ref = new ActionReference();
ref.putIndex( charIDToTypeID( 'Lyr ' ), a );
try{var desc = executeActionGet(ref);}catch(err){break;}
var cl = desc.getEnumerationValue(charIDToTypeID("Clr "));
cl = typeIDToStringID(cl);
var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
ls = typeIDToStringID(ls);
if(ls != 'layerSectionEnd'){
if(cl == TheColor){
toRet.push(a);
a++;
return toRet;
function multiSelectByIDX(idx) {// selection function
if( idx.constructor != Array ) idx = [ idx ];
var layers = new Array();
var desc = new ActionDescriptor();
var ref = new ActionReference();
for (var i = 0; i < idx.length; i++) {
layers[i] = charIDToTypeID( "Lyr " );
ref.putIndex(layers[i], idx[i]);
desc.putReference( charIDToTypeID( "null" ), ref );
executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
function selectAllByColor(TheColor){// main function
theSameClIDX = getIDXwithsameColor(TheColor);
multiSelectByIDX(theSameClIDX);
//...example::
// selectAllByColor("none");
//selectAllByColor("red");
// selectAllByColor("orange");
// selectAllByColor("yellowColor");
// selectAllByColor("grain");
// selectAllByColor("blue");
// selectAllByColor("violet");
// selectAllByColor("gray"); -
How do i get the current version of web logic server on obiee 11g
Hey
I am pretty new to 11g and Weblogic
How do i get the current version of web logic server on obiee 11g(11.1.1.5), I know that it should be higher than 10.3.5.
ThanksHi,
Obiee11.1.1.5.0/6.0 both version supporting weblogic 10.3.5.0/6.0 both are no issues.
http://blog.whitehorses.nl/2012/02/26/a-few-quick-tips-for-upgrading-ofm-11g-to-patch-set-5/
also refer
http://docs.oracle.com/cd/E23943_01/bi.1111/e16452/bi_plan.htm#BABECJJH
Thanks
Deva -
Face hits buttons while I am on a call. How do I get the screen off when I am talking? Obviously new to iPhone!
ThanksThe iPhone has a proximity sensor that will turn the screen off if you hold the phone up to your ear. Don't hold it inches away hold it up close and the screen will go dark, hold it away from your ear and the screen will come alive.
-
How do you get the ringer sound to work in Face Time for incoming call on my IPAD 2?
How do you get the ringer to sound on my iPad 2 when a face Time call is coming in?
iPad User Guide iOS 5
http://manuals.info.apple.com/en_US/ipad_user_guide.pdf -
ADF and JQuery: How can I get the data back to server listener.
Jdeveloper 11g Version 11.1.1.2.0
I use Jquery to draw the signature. How can I get the svgOutput back to my server listener.???
e.getSource give me the error e.getSource is not function.
Both of function saveSignatureCapture(which calling from ADF button) and $('#save-output').click(function (event) can not send the the data back to my server listener.
Thanks.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="dSignature" title="Signature Capture">
<af:resource type="javascript" source="../resources/lib/jquery/jquery-1.4.2.min.js"/>
<af:resource type="javascript" source="../resources/js/jquery.drawbox.js"/>
<af:resource type="javascript">
var svgOutput = '';
function saveSignatureCapture(e) {
var signatureText = $('#drawbox-data').val();
var source = e.getSource();
var type = 'saveSignatureCapture_ServerListener';
var immediate = true;
var params = {
signatureText : signatureText
AdfCustomEvent.queue(source, type, params, immediate);
function beginSignatureCapture(e) {
$('#drawbox').drawbox( {
caption : 'This is a caption', lineWidth : 3, lineCap : 'round', lineJoin : 'round', colorSelector : true
$('#view-output').click(function () {
svgOutput = window.open('data:image/svg+xml,' + $('#drawbox-data').val());
svgOutput.document.close();
return false;
$('#save-output').click(function (event) {
var signatureText = $('#drawbox-data').val();
var source = $(document);
var type = "saveSignatureCapture_ServerListener";
var immediate = true;
var params = {
signatureText : signatureText
AdfCustomEvent.queue(source, type, params, immediate);
return false;
$(document).ready(beginSignatureCapture);
</af:resource>
<af:panelStretchLayout id="psSignature">
<f:facet name="bottom"/>
<f:facet name="center">
<af:panelGroupLayout id="pgSignature" layout="vertical">
<f:verbatim>
<div id="divSignature">
<canvas id="drawbox" width="600" height="200">
<p>Your browser does not support <canvas></p>
</canvas>
</div>
<br/>
<br/>
<a href="#" id="view-output">View Rendered SVG Output</a>
<br/>
<br/>
<a href="#" id="save-output">Save Signature</a>
</f:verbatim>
<af:spacer width="10" height="10" id="s10"/>
<af:panelGroupLayout id="pghl14" layout="horizontal" halign="center">
<af:commandButton text="Save Signature" id="cbSaveSignatureButtonId" partialSubmit="true">
<af:clientListener method="saveSignatureCapture" type="click"/>
<af:serverListener type="saveSignatureCapture_ServerListener"
method="#{backingBeanScope.mainBackingBean.saveSignatureCapture_ServerListener}"/>
</af:commandButton>
</af:panelGroupLayout>
</af:panelGroupLayout>
</f:facet>
<f:facet name="start"/>
<f:facet name="end"/>
<f:facet name="top"/>
</af:panelStretchLayout>
</af:document>
</f:view>
</jsp:root>Edited by: user553450 on Sep 17, 2010 4:02 PM
Edited by: user553450 on Sep 17, 2010 4:13 PMHi Frank,
Thank you so much for your advice, I got lot of knowledge from your book and articles since I am in transition from forms to JDeveloper.
By surrounding <af:panelStretchLayout id="psSignature"> with <af:form id="f1">
Now the following code is work on Firefox, everything fine, I can get the data back and call my server listener as I expected.
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1" title="Signature Capture">
<af:resource type="javaScript" source="../resources/js/excanvas.js"/>
<af:resource type="javascript" source="../resources/lib/jquery/jquery-1.4.2.min.js"/>
<af:resource type="javascript" source="../resources/js/jquery.drawbox.js"/>
<af:resource type="javascript">
function saveSignatureCapture(e) {
var signatureText = $('#drawbox-data').val();
alert(signatureText);
var source = e.getSource();
var type = 'saveSignatureCapture_ServerListener';
var immediate = true;
var params = {
signatureText : signatureText
AdfCustomEvent.queue(source, type, params, immediate);
function beginSignatureCapture(e) {
var cmd = "$('#drawbox').drawbox({lineWidth:3,lineCap:'round',lineJoin:'round',colorSelector:true});";
if (navigator.userAgent.indexOf('MSIE') != - 1) {
setTimeout(cmd, 1000);
else {
$('#drawbox').drawbox( {
caption : 'This is a caption', lineWidth : 3, lineCap : 'round', lineJoin : 'round', colorSelector : true
</af:resource>
<af:form id="f1">
<af:panelStretchLayout id="psSignature">
<f:facet name="bottom"/>
<f:facet name="center">
<af:panelGroupLayout id="pgSignature" layout="vertical">
<f:verbatim>
<canvas id="drawbox" width="600" height="200">
<p>Your browser does not support <canvas></p>
</canvas>
</f:verbatim>
<af:spacer width="10" height="10" id="s10"/>
<af:panelGroupLayout id="pghl14" layout="horizontal" halign="center">
<af:commandButton text="Save Signature" id="cbSaveSignatureButtonId" partialSubmit="true">
<af:clientListener method="saveSignatureCapture" type="click"/>
<af:serverListener type="saveSignatureCapture_ServerListener"
method="#{backingBeanScope.mainBackingBean.saveSignatureCapture_ServerListener}"/>
</af:commandButton>
</af:panelGroupLayout>
</af:panelGroupLayout>
</f:facet>
<f:facet name="start"/>
<f:facet name="end"/>
<f:facet name="top"/>
</af:panelStretchLayout>
</af:form>
<af:clientListener method="beginSignatureCapture" type="load"/>
</af:document>
</f:view>
</jsp:root> However, I got the error following error when I run the page from IE8.
Assertion failed: Incorrect use of AdfRichUIPeer.GetDomNodeForCommentComponent.AdfRichCommandButton[oracle.adf.RichCommandButton] id=cbSaveSignatureButtonId StackTrace:function(x217)[AdfRichCommandButton[oracle.adf.RichCommandButtonId]..........
FYI, the following simple testing code has the similar error in IE8 too (not for Firefox).
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<f:view>
<af:document id="d1">
<af:resource type="javaScript" source="../resources/js/excanvas.js"/>
<af:form id="f1">
<f:verbatim>
<canvas id="drawbox" width="600" height="200">
<p>Your browser does not support <canvas></p>
</canvas>
</f:verbatim>
</af:form>
</af:document>
</f:view>
</jsp:root>The error is: Assertion failed: Incorrect use of AdfRichUIPeer.GetDomNodeForCommentComponent.AdfRichDialog[oracle.adf.RichDialog] id:::msgDlg StackTrace function(x217).......
Your advice is very much appreciated. -
i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos
Well I'll guess you're using iPhoto 11:
Option 1
Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
If that fails:
Option 2
Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.
Regards
TD -
Please, How do i get the values from a h:selectManyCheckbox ?
How do i get the values (selected or not) of a <h:selectManyCheckbox> tag and show them .For instance
i have the folowing options :
<h:selectManyCheckbox
id="cartas"
layout="pageDirection"
value="#{store.cartas}">
<f:selectItems
value="#{cartas}"/>
</h:selectManyCheckbox>
<h:message styleClass="validationMessage" for="newsletters"/>with my faces-config.xml:
<managed-bean>
<description></description>
<managed-bean-name>cartas</managed-bean-name>
<managed-bean-class>java.util.ArrayList</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
<list-entries>
<value-class>javax.faces.model.SelectItem</value-class>
<value>#{cartas0}</value>
<value>#{cartas1}</value>
<value>#{cartas2}</value>
<value>#{cartas3}</value>
</list-entries>
</managed-bean>
<managed-bean>
<managed-bean-name>cartas0</managed-bean-name>
<managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>label</property-name>
<value>Semanal</value>
</managed-property>
<managed-property>
<property-name>value</property-name>
<value>200</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>cartas1</managed-bean-name>
<managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>label</property-name>
<value>As bruxas</value>
</managed-property>
<managed-property>
<property-name>value</property-name>
<value>201</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>cartas2</managed-bean-name>
<managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>label</property-name>
<value>Exercise</value>
</managed-property>
<managed-property>
<property-name>value</property-name>
<value>202</value>
</managed-property>
</managed-bean>
<managed-bean>
<managed-bean-name>cartas3</managed-bean-name>
<managed-bean-class>javax.faces.model.SelectItem</managed-bean-class>
<managed-bean-scope>none</managed-bean-scope>
<managed-property>
<property-name>label</property-name>
<value>Gusman Park</value>
</managed-property>
<managed-property>
<property-name>value</property-name>
<value>203</value>
</managed-property>
</managed-bean>Thanks for the atention!! All the best!!Hi,
In your backing bean you will need to add a new variable to bind your control to, I think this variable needs to be of teh "HtmlSelectManyCheckbox" type. The on your jsp page you can add binding="#{myBean.myVariable}".
When you want to get the values of the selectMany in your backing bean, you can call the getSelectedValues() function on your HtmlSelectManyCheckbox variable.
in backing bean:
private HtmlSelectManyCheckbox hsmc;
public HtmlSelectManyCheckbox getHsmc(){
return hsmc;
public void setHsmc(HtmlSelectManyCheckbox hsmc){
this.hsmc = hsmc;
public void someFunction(){
Object[] obs = hsmc.getSelectedValues();
}On jsp page:
<h:selectManyCheckbox
id="cartas"
layout="pageDirection"
value="#{store.cartas}"
binding="#(myBean.hsmc}">
<f:selectItems
value="#{cartas}"/>
</h:selectManyCheckbox> -
How can i get the SQL of a tablespace from the database
Hello All,
I am using Oracle 11g R2. I want to get the SQL of some tablespaces on my database. in the same way i get the DDL of the table using the GET_DDL function.
How can i get that ?
Regards,try this please
select dbms_metadata.get_ddl('TABLESPACE',tb.tablespace_name) from dba_tablespaces tb;or
select 'create tablespace ' || df.tablespace_name || chr(10)
|| ' datafile ''' || df.file_name || ''' size ' || df.bytes
|| decode(autoextensible,'N',null, chr(10) || ' autoextend on maxsize '
|| maxbytes)
|| chr(10)
|| 'default storage ( initial ' || initial_extent
|| decode (next_extent, null, null, ' next ' || next_extent )
|| ' minextents ' || min_extents
|| ' maxextents ' || decode(max_extents,'2147483645','unlimited',max_extents)
|| ') ;'
from dba_data_files df, dba_tablespaces t
where df.tablespace_name=t.tablespace_name Edited by: Mahir M. Quluzade on Mar 14, 2011 4:51 PM -
How do you get the applications folder on mac book pro
How do you get the applications folder on mac book pro?
To access it, you open the Finder (blue face at bottom left of dock) and click the Applications shortcut you'll find there.
Matt -
How can i get the all values from the Property file to Hashtable?
how can i get the all values from the Property file to Hashtable?
ok,consider my property file name is pro.PROPERTIES
and it contain
8326=sun developer
4306=sun java developer
3943=java developer
how can i get the all keys & values from the pro.PROPERTIES to hashtable
plz help guys..............The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
InputStream is = new FileInputStream("tivoli.properties");
props.load(is); -
I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?
Delete the broken links in iTunes then look at your purchased list to redownload.
If this happened because you were deleting files from the iTunes folder in Finder, don't. You have to let iTunes do all the deleting and moving or you will end up with broken links. -
How can I get the iCloud/iTunes password for my (now) deceased Father-in-Law's iMac? I have a list of his passwords, but nothing works! I know his email, but that account has been cancelled for security purposes, so we can't just request a new one. I tried his security questions to no avail.
ThanksSince that password is tied to his Apple ID, you will need to contact Apple; as far as I know, it will be a somewhat lengthy procedure and you will need to furnish necessary paperwork (including a death certificate as far as I know). Best to either stop at an Apple store or call them to find out exactly what it is you need to do.
-
I deleted a calendar tab. How can I get the data back?
I accidently deleted the calendar tab of my wife and deleted all her apoointments on her iphone and the iMac. I am in ****. How can I get the calendar data back=?
Sync is only oneway, from PC to your device. Unless you have the music on your PC, iTunes is going to wipe out what you have on your device if you are syncing to a new library.
You can only transfer Purchased music over to Itunes on your PC.
iTunes Store: Transferring purchases from your iOS device or iPod to a computer
http://support.apple.com/kb/HT1848
As for you own music, you may have to use a third party software. A good Free one is called Sharepod which you can download from Download.com here:
http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2 -
Can't install the software for the Brother MFC-9440CN because it is not currently available from the Software Update server....how do I get the driver then..it ised to work in my old mac..but cant print to it in my new unit
Download the Brother Mountain Lion drivers here.
Maybe you are looking for
-
Hey! So basically, I've been using my Wifi connection (from home) lately, I had no troubles what-so-ever. I turned on my 3G network this morning, and again, everything's going perfectly fine with my connection. I came home around half 4 from school a
-
My computer says most of my stuff is "Downloaded" when I had to clean out my PC, and I want to get this stuff back on my PC! I tried uninstalling and reinstalling iTunes and Quicktime, deuathorizing and authorizing my account on iTunes, but still no
-
Most of my album artwork is missing after updating to iOS 5
I just updated my iPod Touch 4G to iOS 5 and now all my album artwork is missing. What should I do? Is there a way to get back the album art in my iPod? Can Apple fix this problem?
-
Error encountered when saving a query
hi, I created a new query in the development system and while saving it i get an error the query cannot be saved due to problem in transport,Bex transport request is nto available,choose teh existing request. I did create atransport requests and trie
-
Inner Classes - when to use with Swing?
Hi again, I was creating a GUI with JTabbedPane as content pane, while doing the single panes in the different tabs i started wondering about some design issues. Let�s say you have a pane that is composed of 3 "subpanes" ( containing all the interact