Populate values selects with select one choice
How I can to create in Java??
use a managed bean property of type ArrayList<SelectItem> and generate accessors. The reference it from f:selectItems in the selectOneChoice
Frank
Similar Messages
-
How to populate table rows with selected listbox items?
Hello,
I am trying to populate a table with selected listbox items. Each item should be a new row in the table. The picture below is the listbox and table I am using. I need to get the selected name to populate the Attendee column of the table when the user clicks the Add button. How do you do this with mutltiple attendees selected?
Thank you,
AngieSo you're considering the fact the if the user clicks the button twice, the name will appear twice and you don't want this, right?
Then you must check if any value is the same than the one you are about to add in the row..
for (var i = 0 ; i < ListBox1.length; i++){
if (ListBox1.getItemState(i) == true){
for (var x = 0 ; x < Table1._Row1.count; x++){
var boNewAttendee = true;
var strAttendee = Table1.resolveNode("Row1[" + x.toString() + "]").txtAttendee;
var newAttendee = ListBox1.getDisplayItem(i);
if (strAttendee.rawValue == newAttendee){
boNewAttendee = false;
break;
if (boNewAttendee){
txtAttendee.rawValue = ListBox1.getDisplayItem(i); -
How to set selected field in one choice
Hi,
I am using ADF 11.1.1.3 and dynamic tab shell.
In my application i create a question based on different subjects.
This subject is a drop down and the value of this drop down is coming from a VO.I dropped that VO as Select One Choice on my page fragment.
And create question.But when i go to edit that question i want to show the subject ( which was selected at the time of question creation) as selected and the other options in drop down.
For Example-
While creating i had 3 subjects
A,B,C .I selected B and created a question.
When i tried to edit the question i fetch the selected subject from one VO (VO to fetch the quetsions detal) and the list from another one.
The option i tried to resolve this is -
I drop the subject VO on edit page as select one choice and in in value of select ites i set the subject from questiondetailVO
*<af:selectOneChoice*
label="Subject:"
shortDesc="Select the program description"
*binding="#{backingBeanScope.backing_fragments_Ques.existingSubject}"*
*id="existingSubject"*
*showRequired="true"*
*unselectedLabel="Select Subject"*
*value="#{bindings.Subject_DESC.inputValue}"> (selected SUbject fom questionVO*
*<f:selectItems value="#{bindings.SubjectVO1.items}"*(Subject list from Subject VO)
*binding="#{backingBeanScope.backing_fragments_Ques.selectItems10}"*
*id="selectItems10"/>*
*</af:selectOneChoice>*
Any idea why this is not wokring or what is the correct way to achieve the same?Hi,
I used following code
OAMessageLovInputBean lovbean=(OAMessageLovInputBean)webBean.findIndexedChildRecursive("AssetNumber");
OAMessageChoiceBean Choicevalue=(OAMessageChoiceBean)webBean.findIndexedChildRecursive("EamWrPriority");
if (pageContext.isLovEvent())
String lovInputSourceId = pageContext.getLovInputSourceId();
if(lovInputSourceId.equalsIgnoreCase("AssetNumber"))
if(lovbean!=null)
String slovVal=(String)lovbean.getValue(pageContext);
String prValue = getPRValue(pageContext.getApplicationModule(webBean).getOADBTransaction(),slovVal);
//String prValue = "1";
Choicevalue.setValue(pageContext,prValue);
}// end of processFormRequest
private String getPRValue(OADBTransaction con,String slovVal)
// System.out.println("In WorkRequestDffCO.getContextValue.organizationID" + organizationID);
String prValue = null;
String sql = "select decode(ml.meaning,'AC1',1,'AC2',1,'AC3',3,'AC4',3,null) from FND_LOOKUP_VALUES_VL ml ,mtl_serial_numbers msi where ml.lookup_type = 'MTL_EAM_ASSET_CRITICALITY' and msi.ASSET_CRITICALITY_code = ml.lookup_code and msi.serial_number = 'slovVal' ; //'30AC-TR002B'"
Statement st = null;
ResultSet rs = null;
try
st = con.createStatement(1);
rs = st.executeQuery(sql);
if(rs.next())
prValue = rs.getString(1);
catch(Exception e)
e.printStackTrace();
finally
try
if(st != null)
st.close();
if(rs != null)
rs.close();
catch(Exception e)
e.printStackTrace();
return prValue;
Query is executing but no value is retuning, if i use hard coded value in where condition like '30AC-TR002B' it is tt's returning value . -
Why cannot populate value in nested:select onchange field???
<div class="labelledField">
<nested:select styleId='<%="pvqList.questions"+index.intValue()+".questionDropDown"%>' property="questionDropDown" styleClass="formFieldSelect" tabindex='<%=""+((5*index.intValue())+1)%>' onchange="togglePVQ('customQuestion<%=index.intValue()%>FieldLabelPair','<%=index.intValue()%>');return false;">
<option value=""><cibc:text key="ref.text.app.changePVQStep1.dropdown.selectAQuestion"/></option>
<option value="">--------------------</option>
<option value="CUSTOMQUESTION">Create Custom Question</option>
<option value="">--------------------</option>
</nested:select>
<a href="# tabindex='<%=""+((5*index.intValue())+2)%">' onclick="togglePVQ('customQuestion<%=index.intValue()%>FieldLabelPair','<%=index.intValue()%>');return false;">
try</a>
</div>
Outside nested:select, onclick can correctly populate to onclick="togglePVQ('customQuestion1FieldLabelPair','1');return false;"
but onchange in nested:select cannot populate, it only show :
onchange="togglePVQ('customQuestion<%=index.intValue()%>FieldLabelPair','<%=index.intValue()%>');return false;"
why??? How to solve it??
please help.Fabio,
1) what settings do you use for Default Value Type and Default Value?
2) which error is raised?
brgds,
Peter
Blog: http://www.oracle-and-apex.com
ApexLib: http://apexlib.oracleapex.info
BuilderPlugin: http://builderplugin.oracleapex.info
Work: http://www.click-click.at and http://www.wirsindapex.at -
Checkedlistbox allows multiple selections with Selection mode set to one
I have a simple CheckedListBox with three options. I set Selection Mode to One. When I test the form, it allows me to have more than one box checked. I can clear the other two with a program, but my understanding of Selection Mode was that it would not
allow more than one box to be checked if set on one.Option Strict On
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
CheckedListBox1.SelectionMode = SelectionMode.One
For i = 1 To 10
CheckedListBox1.Items.Add("Number" & i.ToString)
Next
End Sub
Private Sub CheckedListBox1_ItemCheckChanged(sender As Object, e As ItemCheckEventArgs) Handles CheckedListBox1.ItemCheck
Dim ItemIndex As Integer = e.Index
For i = 0 To CheckedListBox1.Items.Count - 1
If i <> ItemIndex Then
CheckedListBox1.SetItemCheckState(i, CheckState.Unchecked)
End If
Next
End Sub
End Class
La vida loca -
How to populate value node with values?
Hi Experts,
I have created a new view with a vlaue node of table type.
How can I populate values into the value node?
Which method will be useful?
Is there any material for Web UI Programing?
Please help me in this.
Thanks,
Adi.Hi Adi
If ZVal is your value node then,
DATA: lref_entity TYPE REF TO cl_bsp_wd_value_node,
lref_bo_coll TYPE REF TO if_bol_bo_col,
lref_data TYPE REF TO <<your ZStructure>>,
ls_data type <<your ZStructure>>.
ls_data-<<field1>> = 'XYZ'
ls_data-<<field2>> = 'XYZ'
CREATE OBJECT lref_bo_coll TYPE cl_crm_bol_bo_col.
CREATE DATA lref_data.
CREATE OBJECT lref_entity
EXPORTING
iv_data_ref = lref_data.
lref_entity->set_properties( ls_data ).
lref_bo_coll->add( lref_entity ).
typed_context->ZVal->set_collection( lref_bo_coll ).
Hope this was helpful.
Best Regards,
Lakshminarayana -
Mulitple selection with select option on subscreen
Hi colleagues,
I've the following issue:
I'm programming a dynpro this dynpro contains two subscreens. The lower subscreen will contain another dynpro defined as subscreen with an ALV to display results.
The top subscreen (0150) area will be filled with a generated subscreen with the command
SELECTION-SCREEN BEGIN OF SCREEN 0150 AS SUBSCREEN.
with select options I define my selection area like:
SELECT-OPTIONS: sa_6 FOR gs_rp_attrib_sel-sonr.
If I call my transaction starting up the dynpro containing the two subscreens the result looks quit how I expect it. BUT then I try to start up the multiply selection Pop-UP for the selection field by pressing the button just right behind the HIGH input field, nothing happens. The multiply selection pop-up basicly does not show up.
Any clues what I need to add that it will show up?
Does the mulitply selection not work with
SELECTION-SCREEN BEGIN OF SCREEN 0150 <b>AS SUBSCREEN</b>???
(If I do a simple test program with a selection screen not being a subscreen, the multiply select popup comes up.)Hi,
A subscreen cannot call another screen.
I guess this is the reason why u are facing this problem.
Thanks,
Rashmi. -
How to Populate values dynamically in Select Box.
Hi All,
I have few select boxes in my webdynpro application. Right now I am populating them using Harcoded values in the Dictionary. But I dont want to harcode the values in the dictionary, i want pull the values from database tables or text files of EP KM. Just let me know which is the better way to populate the select box without hardcoding & why ?
Thanks in Advance.
Regards,
Aditya MetukulHi Aditya,
Getting values from KM and database is possible
It depends on your requirement
ie if the dropdown should contain details of documents from KM or it should display the details in a table
if it is oracle table see this link
Webdynpro and Oracle
if you want to get data from km see this tutorial
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using knowledge management functions in web dynpro - 26.htm
Hope this helps you
Regards
Rohit
Regards
Rohit -
Hi
I have a site which has 8 services.each service has it own
page. When the user goes to the service page there will be a link
which will take them to a form. I want the form to be able to
identify which service is there and select that one automatically.
I have done this previously but only with a form. Can you
please help me to fix this.
Link on service page
<a href="moreinfo.cfm?service=WorkGroup Consultancy">Click
here for Further Information</a>
select box in form
<select name="service">
<option value="UK Immigration" <cfif
structKeyExists(form,"UK Immigration") AND form.service eq
"WorkGroup Consultancy">selected="selected"</cfif>>UK
Immigration</option>
<option <cfif structKeyExists(form,"WorkGroup
Consultancy") AND form.service eq "WorkGroup
Consultancy">selected="selected"</cfif>value="WorkGroup
Consultancy">WorkGroup Consultancy</option>
<option value="Legal Managment Software" <cfif
structKeyExists(form,"Legal Managment Software") AND form.service
eq "Legal Managment
Software">selected="selected"</cfif>>Legal Managment
Software</option>
<option value="Search Engine Optimization" <cfif
structKeyExists(form,"Search Engine Optimization") AND form.service
eq "Search Engine
Optimization">selected="selected"</cfif>>Search Engine
Optimization</option>
<option value="Marketing Consultancy" <cfif
structKeyExists(form,"Marketing Consultancy") AND form.service eq
"Marketing
Consultancy">selected="selected"</cfif>>Marketing
Consultancy</option>
<option value="Project Management" <cfif
structKeyExists(form,"Project Management") AND form.service eq
"Project Management">selected="selected"</cfif>>Project
Management</option>
<option value="Training" <cfif
structKeyExists(form,"Training") AND form.service eq
"Training">selected="selected"</cfif>>Training</option>
<option value="Web Design"<cfif
structKeyExists(form,"Web Design") AND form.service eq "Web
Design">selected="selected"</cfif>>Web
Design</option>
</select>I have tried both was and still cannot get it to work. Please
shwo me the correct way to do this
<cfselect name="service" selected="#url.service#">
<option value="UK Immigration" >UK
Immigration</option>
<option value="WorkGroup Consultancy">WorkGroup
Consultancy</option>
<option value="Legal Managment Software" >Legal
Managment Software</option>
<option value="Search Engine Optimization" >Search
Engine Optimization</option>
<option value="Marketing Consultancy" >Marketing
Consultancy</option>
<option value="Project Management">Project
Management</option>
<option value="Training" >Training</option>
<option value="Web Design">Web Design</option>
</cfselect>
And the other way
option value="UK Immigration" <cfif structKeyExists(URL,"UK
Immigration") AND url.service eq "WorkGroup
Consultancy">selected="selected"</cfif>>UK
Immigration</option>
<option <cfif structKeyExists(url,"WorkGroup
Consultancy") AND url.service eq "WorkGroup
Consultancy">selected="selected"</cfif>value="WorkGroup
Consultancy">WorkGroup Consultancy</option>
<option value="Legal Managment Software" <cfif
structKeyExists(url,"Legal Managment Software") AND url.service eq
"Legal Managment
Software">selected="selected"</cfif>>Legal Managment
Software</option>
<option value="Search Engine Optimization" <cfif
structKeyExists(url,"Search Engine Optimization") AND url.service
eq "Search Engine
Optimization">selected="selected"</cfif>>Search Engine
Optimization</option>
<option value="Marketing Consultancy" <cfif
structKeyExists(url,"Marketing Consultancy") AND url.service eq
"Marketing
Consultancy">selected="selected"</cfif>>Marketing
Consultancy</option>
<option value="Project Management" <cfif
structKeyExists(url,"Project Management") AND url.service eq
"Project Management">selected="selected"</cfif>>Project
Management</option>
<option value="Training" <cfif
structKeyExists(url,"Training") AND url.service eq
"Training">selected="selected"</cfif>>Training</option>
<option value="Web Design"<cfif
structKeyExists(url,"Web Design") AND url.service eq "Web
Design">selected="selected"</cfif>>Web
Design</option> -
"Open pdfs in" with only one choice
I am seeing the following behavior: the newest upgrade of StashPro (1.5, very handy for protecting pictures, movies, and now documents) features a document section and is now able to store (and open) pdfs. since installing it, all the pdf attachments in mail only want to open in StP. I do not even get another choice, despite having Goodreader installed (would be my preferred app).
Does anybody knows how to rebuild the list of possible apps that appears???Try this:
• Turn the iPad off and on again (hold the sleep/wake button for about 4 to 5 seconds until a red slider appears with the label "slide to power off")
• If it din't help, try a hard reset - hold the sleep/wake button and the home button simultaneously for about 4 to 5 seconds, until the iPad tunes off. Then turn it on again.
• Remove the App and check again, if it is fine then try to install again.
• If it does not help, restore the firmware with iTunes - IMPORTANT, don't let iTunes use one of your backups…
set it up as a new device.
Please let us know if it helps.
enjoy your magic machine -
CS5 Disable Picture Content Select with Selection Tool
I'm not sure if this was added in CS4, because I skipped CS4, but I know it wasn't there in CS3. With my Selection Tool (solid cursor), I can grab the contents of a picture box represented by circle mark that appears in the center of an image on mouse rollover. If I come close to it, I grab the picture, not the frame (what I don't want). But if I keep my selection closer to the edge, I select box and contents (what I want). How can I disable this feature? I have looked through my preferences to no avail. I mean, I thought that's what the Direct Selection Tool was for? If I want the contents selected, I use the hollow cursor. Why mess with that? Please tell me this can be disabled. It would make my day.
I did a search, but was hitting nothing. And I was looking in the wrong spot for it in the app.
You... have made my day. Thank you, thank you. -
Dynamic select with select-opitons
Hi all,
i have a selction screen with a Select-options : S_monat for bkpf-monat.
Depending on what the user has entered in that selection i need to select the field WOG001 to WOG016 from table COSP.
for example if user has entered Period '01' to Period '12' , then i should do SELECT ( WOG001 to WOG012) from COSP. How to program that dynamic select fields??
Cann anyone help???
Thanks!I hope this will solve your porblem.
SELECt-OPTIONS: monat for bkpf-monat OBLIGATORY.
DATA: BEGIN OF ITAB,
WTG001 TYPE COSP-WTG001,
WTG002 TYPE COSP-WTG002,
WTG003 TYPE COSP-WTG003,
END OF ITAB.
BREAK-POINT.
LOOP AT monat.
if monat-LOW = '01' AND MONAT-HIGH IS INITIAL.
select SINGLE WTG001 FROM cosp INTO CORRESPONDING FIELDS OF ITAB where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.
elseif monat-LOW = '01' AND MONAT-HIGH eq '01'.
select SINGLE WTG001 FROM cosp INTO CORRESPONDING FIELDS OF ITAB where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.
ELSEIF MONAT-HIGH = '02'.
select SINGLE WTG001 WTG002 INTO CORRESPONDING FIELDS OF ITAB FROM cosp where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.
ELSEIF MONAT-HIGH = '03'.
select SINGLE WTG001 WTG002 WTG003 INTO CORRESPONDING FIELDS OF ITAB FROM cosp where kstar = '0007110102' and vrgng eq 'COIN' AND BEKNZ = 'H'.
ENDIF.
ENDLOOP.}
Edited by: ZAHID HAMEED on Aug 9, 2011 12:35 AM
Edited by: ZAHID HAMEED on Aug 9, 2011 12:38 AM -
Oracle ADF example of use of Single One Choice with Hierarchy Viewer
I am using JDeveloper Studio 11.1.2.3.0.
I am looking for a simple example where one can select a value from a Single One Choice component and have it drive a query
for populating the Hierarchy Viewer.You can just use a VO with parameter as the base of your HV - then drag the executeWithParam operation to the page as a parameter form.
And possibly add a list or LOV to the parameter.
https://blogs.oracle.com/shay/entry/adding_an_lov_to_a_query_param
Instead of the table in the video use the HV. -
SPRY data set select auto selected
I have created a three selects related for a vehicle year,
make, model search using spry. The first select uses a spry dataset
to get the years from the database. When you select a year, spry
auto populates the second dropdown with makes and then you select a
make and the third dropdown auto populates models. I have this all
working perfectly but what I would like to do is that when the user
makes their choice and they go to the search result page, I would
like to present them the year, make, model dropdowns again but have
them preselected with what they already chose. I am using a server
technology (ColdFusion) that will allow me to capture their
selected choice from the form post, but I cant seem to figure out
how to have the spry form pre selected with their previous choice.
This is what I have right now:
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:spry="
http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title></title>
<script type="text/javascript"
src="/jscripts/xpath.js"></script>
<script type="text/javascript"
src="/jscripts/SpryData.js"></script>
<script type="text/javascript">
var dsYears = new Spry.Data.XMLDataSet("year.cfm",
"years/year");
var dsMakes = new Spry.Data.XMLDataSet("{dsYears::url}",
"makes/make");
var dsModels = new Spry.Data.XMLDataSet("{dsMakes::url}",
"models/model");
</script>
</head>
<body>
<form method="post" name="selectForm">
<div id="yearSelector" spry:region="dsYears"
class="Spry:Region dsYears">
<select spry:repeatchildren="dsYears" name="yearSelect"
onChange="document.selectForm.makeSelect.disabled =
true;dsYears.setCurrentRowNumber(this.selectedIndex);">
<option spry:if="{dsYears::ds_RowNumber} == 0"
value="{name}" selected="selected">{name}</option>
<option spry:if="{dsYears::ds_RowNumber} != 0"
value="{name}">{name}</option>
</select>
</div>
<div id="makeSelector" spry:region="dsMakes"
class="Spry:Region dsMakes">
<select spry:repeatchildren="dsMakes" name="makeSelect"
onChange="document.selectForm.modelSelect.disabled =
true;dsMakes.setCurrentRowNumber(this.selectedIndex);">
<option spry:if="{dsMakes::ds_RowNumber} == 0"
value="{name}" selected="selected">{name}</option>
<option spry:if="{dsMakes::ds_RowNumber} != 0"
value="{name}">{name}</option>
</select>
</div>
<div id="modelSelector" spry:region="dsModels"
class="Spry:Region dsModels">
<select spry:repeatchildren="dsModels"
name="modelSelect">
<option spry:if="{dsModels::ds_RowNumber} == 0"
value="{name}" selected="selected">{name}</option>
<option spry:if="{dsModels::ds_RowNumber} != 0"
value="{name}">{name}</option>
</select>
</div>
<input type="submit" value="SUBMIT">
</form>
</body>
</html>Ok so I figured out how to do it using spry:when, but now the
problem is when the value is preselected, it is not pre populating
the next dropdown. So if I choose 2008 in my previous form and
preselect 2008 on the search results page, the "Makes" dropdown is
empty until you choose another year in the year dropdown. How do I
force a refresh of the data when I force a value in the dropdown.
This is what i tried. still not sure if its even right.
<cfoutput>
<form method="post" name="selectForm">
<div id="yearSelector" spry:region="dsYears"
class="Spry:Region dsYears">
<select spry:repeatchildren="dsYears" name="yearSelect"
onChange="document.selectForm.makeSelect.disabled =
true;dsYears.setCurrentRowNumber(this.selectedIndex);"
spry:choose="spry:choose">
<option spry:when="'#form.yearSelect#' == '{name}'"
value="{name}" selected="selected">{name}</option>
<option spry:when="{dsYears::ds_RowNumber} == 0"
value="{name}" selected="selected">{name}</option>
<option spry:when="{dsYears::ds_RowNumber} != 0"
value="{name}">{name}</option>
</select>
</div>
... -
Get selected value from a select one choice in the bean
I'm trying to do with the SelectOneChoice valueChangeListener and this is the code of my method, I'm using jdeveloper11g if alguin can help as I need the value you selected in the bean
public void cambioCombo(ValueChangeEvent valueChangeEvent) {
CoreSelectOneChoice csoc = (CoreSelectOneChoice) valueChangeEvent.getSource();
List childList = csoc.getChildren();
for (int i = 0; i < childList.size(); i++) {
if (childList.get(i) instanceof CoreSelectItem){
CoreSelectItem csi = (CoreSelectItem) childList.get(i);
if (((String)csi.getValue()).equals((String) valueChangeEvent.getNewValue()) ){
System.out.println("------------>"+csi.getLabel());
I get the following error when running the application and selecting in my select one choice
oracle.adf.view.rich.component.rich.input.RichSelectOneChoice cannot be cast to org.apache.myfaces.trinidad.component.core.input.CoreSelectOneChoiceThis is an example of some code that i wrote.
public void changeDesc(ValueChangeEvent valueChangeEvent) {
// Add event code here...
System.out.println("value "+ valueChangeEvent.getNewValue().toString());
//System.out.println("old value "+ valueChangeEvent.getOldValue().toString());
if (valueChangeEvent.getNewValue().toString().equals("Area Uno")){
this.descripcion.setValue("RR.HH");
} else {
this.descripcion.setValue("Finanzas");
AdfFacesContext.getCurrentInstance().addPartialTarget(this.descripcion);
For get the Value select in the "SelectOneChice" component i use this: valueChangeEvent.getNewValue().toString()
cheers
Maybe you are looking for
-
I want to upgrade to leopard but not got intel
i purchased my g5 a while ago now and since apple released snow leopard the original leopard is impossible to buy. With the original g5 being power pc and not intel im unable to purchase any newer versions apart from os x leopard. i just don't want t
-
Album and Music library are blank
Their are songs and pictures in the phone. They can be accessed via the file manager. The album and Music library show that there is no content. Help.
-
Resize my InDesign document?
My document size is 8.50 x 11 inches but I need it in 2 different sized. I also need it in 8.25 x 10.75. My document has a background image and a few other small snippets of images along with text so when I resize it everything within the document ne
-
ScrnXtra - Trying to save to Windows as BMP; getting error -10
Hello Fellow Director hanger-on-ers! I have a question on awesome cast member to output ScrnXtra v2.2.0. Am trying to save screen shot of the stage to a file (bmp). The OS that is not working for me is Windows 7 using Director 11.5. Tested on Mac
-
Formating External Drive - Removing Time Machine Back up
I have a 400GB Toshiba external drive, 1st time when I connected that with MAC than it asked if i want to use that as a time machine back up. I selected yes, but now when I am trying to connect that external drive to windows pc than its not detecting