How t print out selected values from a Jlist
hi iam trying to get the selected values from a list to print out as a string but iam getting ,Invalid cast from java.lang.Object[] to java.lang.String.is there any way to get the selected values t print ut as a string?? import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MultipleSelection2 extends JFrame {
private JList colorList, copyList;
private JButton copy;
private String colorNames[] =
{ "Black", "Blue", "Cyan", "Dark Gray", "Gray",
"Green", "Light Gray", "Magenta", "Orange", "Pink",
"Red", "White", "Yellow" };
public MultipleSelection2()
super( "Multiple Selection Lists" );
Container c = getContentPane();
c.setLayout( new FlowLayout() );
colorList = new JList( colorNames );
colorList.setVisibleRowCount( 5 );
colorList.setFixedCellHeight( 15 );
colorList.setSelectionMode(
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION );
c.add( new JScrollPane( colorList ) );
// create copy button
copy = new JButton( "Copy >>>" );
copy.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent e )
// place selected values in copyList
copyList.setListData(
colorList.getSelectedValues());
String s1 =(String)colorList.getSelectedValues();
Since the JList method 'getSelectedValues' returns an object array you'll need to iterate through the array and cast each object in the array to a string as you access them.
Object[] o = colorList.getSelectedValues();
for(int count=0,end=o.length; count<end; count++) {
String s = (String) o[count];
Hope that helps
Talden
Similar Messages
-
How to print out multilingual reports from the main report using Xliff temp
Hi all,
How to print out multilingual reports from the main report using Xliff temp?
When I want main report call subtemplate and finish xliff tranlation
<?for-each@section:INVOICE?><?end for-each?>
<?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
<?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
Prints out fine with Finnish translation
But if I want in main program to check what language is used e.g.
if trx_number = 142 call Finnish translation and if trx_number =144,
call English translation.
<?for-each@section:INVOICE?><?end for-each?>
<?if:TRX_NUMBER=’142’?>
<?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
<?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
<?end if?>
<?if: TRX_NUMBER=’144’?>
<?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.US/?>
<?start:body?><?call:Header?><?call:Line?><?call:Weights?><?call:Banks?><?end body?><?call:Footer?>
<?end if?>
Prints out always in English and never the Finnish translation.
Program goes fine to if branch but does not print out Finnish
Does anybody know what could be wrong?
BR
KariThanks Amit,
I have two layout, main-layout and sub-layout
Main layout call subtemplate
I have registered layout and xliff-file
Main template
Localized Templates
File Name Language Territory
XXNS_INVOICE_MAIN.rtf English
SUB template
Localized Templates
File Name Language Territory
XXNS_INVOICE_SUB.rtf English
Translatable Template
File Name Language Territory
XXNS_INVOICE_SUB.rtf English United States
Available Translations
Language Territory Progress
English Finland Complete
If main report call subtemplate and finish xliff tranlation
<?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
Prints out fine with Finnish translation
But if I want in main program to check what language is used e.g.
if....
<?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.FI/?>
.....end if;
if....
<?import:xdo://XXIH.XXNR_XXINVPRINT_SUB.en.US/?>
.....end if;
Prints out always in English and never the Finnish translation.
Program goes fine to if branch but does not print out Finnish
Do you it's set up problem or program problem
BR
Kari -
How to capture the selected values from module pool dialog list box !
Hi experts,
Can anyone help me out in capturing the values from the list box.
i am able to set the values in the list box.But i am not able to capture the selected value from the list box. Always the list box name is getting as "space"
I also tried in using the FM "VRM_GET_VALUES" but it is retireving all the values. Is there is any flag for filttering out the selected value.
Your inputs are appreciated.
Thanks,
Vijay.Along with the PBO and PAI event, add a POV event in the flow logic of the screen
DEMO_DROPDOWN_LIST_BOX -is a good demo example.
PROCESS ON VALUE-REQUEST.
FIELD structure_name-field_name MODULE create_dropdown_box.
In the report :
MODULE create_dropdown_box INPUT.
SELECT carrid carrname
FROM scarr
INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CARRID'
value_org = 'S'
TABLES
value_tab = itab_carrid
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
ENDMODULE.
In the layout, assign a Function Code , for eg : 'SELECTED' to the listbox and lets say name of the field is SDYN_CONN-CARRID. So in the PAI module,
MODULE user_command_0100 INPUT.
CASE ok_code.
WHEN 'SELECTED'.
MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
ENDCASE.
ENDMODULE.
sdyb_conn-carrid will contain your selected field -
How do I pass selected values from dynamic LOV to Command SQL in Oracle
My environment:
Crystal 11
Oracle 10
I've created and tuned a SQL script for a report. In the Database Expert, I've copied the SQL into a Command. I've modified the Command to create 3 parameters.
I need help with the following:
1) How do I create a dynamic, cascading LOV and associated prompt group for the three parameters defined in the Command?
2) How do I pass the user selected valueS from the prompt group into the Command SQL as limits applied to the query executed against the database?I have the same problem with same environment .
The main report is having a 2 level cascading dynamic parameters.
I created a sub report with a command as below.
*select * from (*
select DATUM,MSEC,CNT,B1_NAME,B2_NAME,B3_NAME,ELEM_NAME,INFO_NAME,m.INFOTYPE,V.NAME,rank()
over (partition by B1_NAME,B2_NAME,B3_NAME order by DATUM desc ,MSEC desc,CNT desc) currentRank
from MESSAGES m,INTYDE i,VANAME v
where DATUM <=SYSDATE and trim(B1_NAME)='{?B1Name}'
and trim(B2_NAME)='{?B2Name}'
and m.INFOTYPE=i.INFOTYPE
and i.VALUE_NAME_NUMBER = v.VALNUM) where currentRank=1
I needs to pass cmbination of B1Name and B2Name from main report. I created a formula like
formula=Join({?B1Name},{?B2Name}),'|'); But this is showing some error.
and How I will substitute this in my command . As I new to Crystal XI help expected. -
How to print out a date from the past
I am trying to print out a date from the past but I cant seem to get It,
Lets use for example Independece Day,
How would you write the code in order to print out that exact date?Look at the
[url=http://java.sun.com/javase/6/docs/api/index.html?
java/util/Date.html]Date APIActually the Calendar class would be better to use, since you can set all the different fields from year to second, plus things like day of week, day of month, week of year, etc.
too slow
Message was edited by:
hunter9000 -
How to print out the data from the file ?
hi all,
i have upload my file to here :
[http://www.freefilehosting.net/ft-v052010-05-09 ]
anyone can help me to print out the data from the file ?
the content of the file should be like this :
185.56.83.89 156.110.16.1 17 53037 53 72 1
and for the seven column is
srcIP dstIP prot srcPort dstPort octets packetshi all,
i have try to do this
public static void Readbinary() throws Exception
String file = "D:\\05-09.190501+0800";
DataInputStream dis = new DataInputStream(new FileInputStream(file));
//but then how to read the content ??????can you give me more hint ?????
i have find the netflow v5 structure by C
struct NFHeaderV5{
uint16_t version; // flow-export version number
uint16_t count; // number of flow entries
uint32_t sysUptime;
uint32_t unix_secs;
uint32_t unix_nsecs;
uint32_t flow_sequence; // sequence number
uint8_t engine_type; // no VIP = 0, VIP2 = 1
uint8_t engine_id; // VIP2 slot number
uint16_t reserved; // reserved1,2
struct NFV5{
ipv4addr_t srcaddr; // source IP address
ipv4addr_t dstaddr; // destination IP address
ipv4addr_t nexthop; // next hop router's IP address
uint16_t input; // input interface index
uint16_t output; // output interface index
uint32_t pkts; // packets sent in duration
uint32_t bytes; // octets sent in duration
uint32_t first; // SysUptime at start of flow
uint32_t last; // and of last packet of flow
uint16_t srcport; // TCP/UDP source port number or equivalent
uint16_t dstport; // TCP/UDP destination port number or equivalent
uint8_t pad;
uint8_t tcp_flags; // bitwise OR of all TCP flags in flow; 0x10
// for non-TCP flows
uint8_t prot; // IP protocol, e.g., 6=TCP, 17=UDP, ...
uint8_t tos; // IP Type-of-Service
uint16_t src_as; // originating AS of source address
uint16_t dst_as; // originating AS of destination address
uint8_t src_mask; // source address prefix mask bits
uint8_t dst_mask; // destination address prefix mask bits
uint16_t reserved;
but how to translate the structure to java,then get the data from the file ?
Edited by: 903893 on Dec 21, 2011 10:52 PM -
How to get the selected values from a selectmanylistbox?
Hi ADF Experts,
<af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb2"
value="#{viewScope.TestBean.lovValue}"
autoSubmit="true" valuePassThru="true">
<f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
binding="#{viewScope.TestBean.selectedItems}"/>
</af:selectManyListbox>
<af:commandButton text="get selected values" id="cb3"
actionListener="#{viewScope.TestBean.getSelectedValues}"
partialSubmit="true"/>
private List<String> lovValue;
private List<SelectItem> actualList;
//getters and setters
public void getSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for (String selectedItem : lovValue) {
System.out.println("Selected item: " +selectedItem.); // this is giving 1 and 3 like this. how to get the checked values as I'm getting only the indexes. In this scenario I am populating the list programmatically.Just I wanted to know how can we get the selected values(not indexes). Please suggest.
Thanks-
AbhijitHi Timo,
As I am sharing the page fragment and the Java class. So its my usecase I have mentioned below
I am sharing the jsff page fragment and java class. So that it wud be of help to others.
jsff page fragment
<?xml version='1.0' encoding='UTF-8'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
xmlns:f="http://java.sun.com/jsf/core">
<af:panelGroupLayout id="pgl1">
<af:commandButton text="Search" id="cb1"
actionListener="#{viewScope.TestBean.searchSupplier}"/>
</af:panelGroupLayout>
<af:popup id="p1" binding="#{viewScope.TestBean.searchSupplierPopup}">
<af:dialog id="d2"
type="none">
<af:table value="#{bindings.Contacts.collectionModel}" var="row"
rows="#{bindings.Contacts.rangeSize}"
emptyText="#{bindings.Contacts.viewable ? 'No data to display.' : 'Access Denied.'}"
fetchSize="#{bindings.Contacts.rangeSize}"
rowBandingInterval="0"
binding="#{viewScope.TestBean.tsupportIssues}"
filterModel="#{bindings.ContactsQuery.queryDescriptor}"
queryListener="#{bindings.ContactsQuery.processQuery}"
filterVisible="true" varStatus="vs"
selectionListener="#{bindings.Contacts.collectionModel.makeCurrent}"
rowSelection="multiple" id="t1">
<af:column sortProperty="name" filterable="true" sortable="true"
headerText="#{bindings.Contacts.hints.name.label}" id="c2">
<af:outputText value="#{row.name}" id="ot1"/>
</af:column>
<af:column sortProperty="email" filterable="true" sortable="true"
headerText="#{bindings.Contacts.hints.email.label}"
id="c1">
<af:outputText value="#{row.email}" id="ot2"/>
</af:column>
</af:table>
<af:commandButton text="OK" id="cb5" partialSubmit="true" actionListener="#{viewScope.TestBean.testMethod}"/>
<af:commandButton text="Cancel" id="cb6"
actionListener="#{viewScope.TestBean.cancelPopupSearch}"/>
</af:dialog>
</af:popup>
<af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb5"
value="#{viewScope.TestBean.lovValue}"
autoSubmit="true" valuePassThru="true"
binding="#{viewScope.TestBean.prp1}">
<f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
binding="#{viewScope.TestBean.selectedItems}"/>
</af:selectManyListbox>
<af:commandButton text="get selected values" id="cb3"
actionListener="#{viewScope.TestBean.getSelectedValues}"
partialSubmit="true"/>
<af:commandButton text="remove selected" id="cb4"
partialSubmit="true" actionListener="#{viewScope.TestBean.removeSelectedValues}"/>
</jsp:root>
TestBean.java
package com.demo.view;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.faces.component.UISelectItems;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import org.apache.myfaces.trinidad.model.RowKeySet;
public class TestBean {
private RichTable tsupportIssues;
private List<SelectItem> lovValue;
private List<SelectItem> actualList;
private RichSelectManyListbox prp1;
private List valuesChoosed = new ArrayList();
private UISelectItems selectedItems;
private RichPopup searchSupplierPopup;
public TestBean() {
super();
public void setTsupportIssues(RichTable tsupportIssues) {
this.tsupportIssues = tsupportIssues;
public RichTable getTsupportIssues() {
return tsupportIssues;
public void testMethod(ActionEvent actionEvent) {
// Add event code here...
// For learning purposes - show Select Many Button clicked
System.out.println("Select Many Button has been Clicked");
// // RowKeySet Object can hold the selected rows from a user as follows
RowKeySet rksSelectedRows = this.getTsupportIssues().getSelectedRowKeys();
// Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows
Iterator itrSelectedRows = rksSelectedRows.iterator();
// Get the data control that is bound to the table - e.g.
// OpenSupportItemsIterator
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("findAllContactsIterator");
// Information from binding that is specific to the rows
RowSetIterator rsiSelectedRows = dcIteratorBindings.getRowSetIterator();
// Loop through selected rows
int i=1;
while (itrSelectedRows.hasNext()) {
// Get key for selected row
Key key = (Key)((List)itrSelectedRows.next()).get(0);
// Use the key to get the data from the above binding that is related to the row
Row myRow = rsiSelectedRows.getRow(key);
// Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces
System.out.println(myRow.getAttribute("name"));
valuesChoosed.add(myRow.getAttribute("name"));
// actualList = new ArrayList<SelectItem>();
// String j = Integer.toString(i);
// actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
// i++;
searchSupplierPopup.hide();
AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
public void setLovValue(List<SelectItem> lovValue) {
this.lovValue = lovValue;
public List<SelectItem> getLovValue() {
return lovValue;
public void setActualList(List<SelectItem> actualList) {
this.actualList = actualList;
public List<SelectItem> getActualList() {
actualList = new ArrayList<SelectItem>();
if(valuesChoosed.size()!=0){
for(int i=0;i<valuesChoosed.size();i++){
actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
else{
actualList.add(new SelectItem("1","Select One"));
return actualList;
public void setPrp1(RichSelectManyListbox prp1) {
this.prp1 = prp1;
public RichSelectManyListbox getPrp1() {
return prp1;
public void setValuesChoosed(List valuesChoosed) {
this.valuesChoosed = valuesChoosed;
public List getValuesChoosed() {
return valuesChoosed;
public void getValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<valuesChoosed.size();i++){
System.out.println(valuesChoosed.get(i));
public void getSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<this.getLovValue().size();i++){
System.out.println("Selected Value:"+this.getLovValue().get(i));
public void removeSelectedValues(ActionEvent actionEvent) {
// Add event code here...
public void setSelectedItems(UISelectItems selectedItems) {
this.selectedItems = selectedItems;
public UISelectItems getSelectedItems() {
return selectedItems;
public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
this.searchSupplierPopup = searchSupplierPopup;
public RichPopup getSearchSupplierPopup() {
return searchSupplierPopup;
public void cancelPopupSearch(ActionEvent actionEvent) {
// Add event code here...
searchSupplierPopup.hide();
public void searchSupplier(ActionEvent actionEvent) {
// Add event code here...
RichPopup.PopupHints hints = new RichPopup.PopupHints();
searchSupplierPopup.show(hints);
package com.demo.view;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.faces.component.UISelectItems;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.adf.view.rich.component.rich.RichPopup;
import oracle.adf.view.rich.component.rich.data.RichTable;
import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
import oracle.adf.view.rich.context.AdfFacesContext;
import oracle.adf.view.rich.event.DialogEvent;
import oracle.jbo.Key;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import org.apache.myfaces.trinidad.model.RowKeySet;
public class TestBean {
private RichTable tsupportIssues;
private List<SelectItem> lovValue;
private List<SelectItem> actualList;
private RichSelectManyListbox prp1;
private List valuesChoosed = new ArrayList();
private UISelectItems selectedItems;
private RichPopup searchSupplierPopup;
public TestBean() {
super();
public void setTsupportIssues(RichTable tsupportIssues) {
this.tsupportIssues = tsupportIssues;
public RichTable getTsupportIssues() {
return tsupportIssues;
public void testMethod(ActionEvent actionEvent) {
// Add event code here...
// For learning purposes - show Select Many Button clicked
System.out.println("Select Many Button has been Clicked");
// // RowKeySet Object can hold the selected rows from a user as follows
RowKeySet rksSelectedRows = this.getTsupportIssues().getSelectedRowKeys();
// Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows
Iterator itrSelectedRows = rksSelectedRows.iterator();
// Get the data control that is bound to the table - e.g.
// OpenSupportItemsIterator
DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dcIteratorBindings = bindings.findIteratorBinding("findAllContactsIterator");
// Information from binding that is specific to the rows
RowSetIterator rsiSelectedRows = dcIteratorBindings.getRowSetIterator();
// Loop through selected rows
int i=1;
while (itrSelectedRows.hasNext()) {
// Get key for selected row
Key key = (Key)((List)itrSelectedRows.next()).get(0);
// Use the key to get the data from the above binding that is related to the row
Row myRow = rsiSelectedRows.getRow(key);
// Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces
System.out.println(myRow.getAttribute("name"));
valuesChoosed.add(myRow.getAttribute("name"));
// actualList = new ArrayList<SelectItem>();
// String j = Integer.toString(i);
// actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
// i++;
searchSupplierPopup.hide();
AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
public void setLovValue(List<SelectItem> lovValue) {
this.lovValue = lovValue;
public List<SelectItem> getLovValue() {
return lovValue;
public void setActualList(List<SelectItem> actualList) {
this.actualList = actualList;
public List<SelectItem> getActualList() {
actualList = new ArrayList<SelectItem>();
if(valuesChoosed.size()!=0){
for(int i=0;i<valuesChoosed.size();i++){
actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
else{
actualList.add(new SelectItem("1","Select One"));
return actualList;
public void setPrp1(RichSelectManyListbox prp1) {
this.prp1 = prp1;
public RichSelectManyListbox getPrp1() {
return prp1;
public void setValuesChoosed(List valuesChoosed) {
this.valuesChoosed = valuesChoosed;
public List getValuesChoosed() {
return valuesChoosed;
public void getValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<valuesChoosed.size();i++){
System.out.println(valuesChoosed.get(i));
public void getSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<this.getLovValue().size();i++){
System.out.println("Selected Value:"+this.getLovValue().get(i));
public void removeSelectedValues(ActionEvent actionEvent) {
// Add event code here...
for(int i=0;i<this.getLovValue().size();i++){
System.out.println("Selected Value:"+this.getLovValue().get(i));
System.out.println(this.getLovValue().remove(i));
AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
public void setSelectedItems(UISelectItems selectedItems) {
this.selectedItems = selectedItems;
public UISelectItems getSelectedItems() {
return selectedItems;
public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
this.searchSupplierPopup = searchSupplierPopup;
public RichPopup getSearchSupplierPopup() {
return searchSupplierPopup;
public void cancelPopupSearch(ActionEvent actionEvent) {
// Add event code here...
searchSupplierPopup.hide();
public void searchSupplier(ActionEvent actionEvent) {
// Add event code here...
RichPopup.PopupHints hints = new RichPopup.PopupHints();
searchSupplierPopup.show(hints);
Thanks,
A. Abhijit -
How to get the selected values from multiselected list
Hi,
I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
This is how it looks:
P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
If user chooses 2004 and 2007
then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
Any help is appreciated!
Thanks in advance,
Sapna.Hi,
I have a multiselect list displaying all the years from 2003 to 2008 (used dynamic LOV). The user can choose one or more years as per his needs, and then when user clicks on the link the selected values of the list are to be captured and a pop up page of a Discoveror report needs to be opened where these years get passed as a parameter. I tried several methods to capture the value, but either one or all are getting passed but not exactly what the user has chosen.
This is how it looks:
P2_FISCAL_YEAR is a multiselect list containing values from 2003,2004... 2008
If user chooses 2004 and 2007
then I want the url to capture these values and pass as parameters for my discoveror reports. as '&qp_fiscal_year=2004,2007'
Any help is appreciated!
Thanks in advance,
Sapna. -
How to get the selected values from the shuttle
Hi
Please tell me how to get the selected option values from the shuttle leading list.
Thanksyou can also obtain the option values present in the leading and trailing lists using the
following methods:
public String[] getLeadingListOptionValues(OAPageContext pageContext, OAWebBean
webBean)
public String[] getTrailingListOptionValues(OAPageContext pageContext, OAWebBean
webBean)For example, the following code sample returns an array of values in the trailing list, ordered according to the
order in which they appear in the list:
String[] trailingItems =
shuttle.getTrailingListOptionValues(pageContext, shuttle);Thanks
--Anil -
How to get the selected values from ADF select many shuttle to textfield
Hi All
Actually in my webpage, I am using text field and beside that placing the command button. When user clicks the command button, a popup window will open up with the "af:select many shuttle" component. While popup opens, it fetch the values backend and displays it to the user in left side of the component. When user selects few values to the right side of the component and clicks ok. Those selected values should be displayed in the besides inputtext field.
Code in Webpage:
<af:inputText id="disciplineVariable"
contentStyle="width:200px;"
styleClass="AFDefaultBoldFont;AFLabelTextForeground;AFDarkForeground;"
value="#{ADFStandards.input}"/>
<af:commandImageLink id="cb12" icon="/compliance/images/List.PNG" hoverIcon="/compliance/images/HoverList.PNG">
<af:clientListener type="action" method="disciplinePopupMethod"/>
</af:commandImageLink>
PopUp code:
<af:popup id="testingPopUP" contentDelivery="lazyUncached">
<af:dialog title="TestingPOPUP" dialogListener="#{testBean.testingValues}">
<af:selectManyShuttle id="sms1" valueChangeListener="#{testBean.testingPopUP}">
<f:selectItems value="#{ADFStandards.mostCommonStandards}" id="si1"/>
</af:selectManyShuttle>
</af:dialog>
</af:popup>
Could anyone please help me in this.
Regards
Venkat.SBind your value attribute for af:selectManyShuttle to the List property in ManagedBean. When the User finish the selection, in your MB set the attribute List in input string attribute (probably what you want is iterate over the list, and concatenate on the String). After that, you have to partialTriggers on the inputText component in order to refresh.
Regards, -
How to Retrieve the Selected Values from selectOrderShuttle using ADF 11g
Hi Every One,
Does anyone has idea how to retrieve the selected Items using shuttle and Order of the items using 'SelectOrderShuttle' component ?
Thanksshuttle's valuechangeevent would fire when you shuttle items back and forth.
public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
if (list != null){
for (int i=0; i<list.size(); i++) {
int l = list.size()-1;
val = list.get(l).toString(); //returns , delimited string
if (val != null){
val = val.replaceAll("[\\[\\]]", "");
StringTokenizer st = new StringTokenizer (val, ",");
int nto = st.countTokens ();
for (int j = 0; j < nto; j++)
String token = st.nextToken ();
.......... -
How to print out a contact from the address book?
I must be missing something very basic. I select a contact in my address book. Now, I want to print it... you know things like the contact's name, address, phone number, etc. When I try printing, I get a blank page. In the print dialog box, it continues to say "No Addresses ()" below the page preview, this even when I've selected one or multiple contacts in my address book. Please help! Thanks!!
In the Print dialogue box select Lists in the Style drop down box.
-
Dvt:pivotFilterBar - how to get selected values from filter
Hi all,
I have a question: how to programmatically get selected values from pivot table's filter bar?
I have tried to use
pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);but for page edge dimensions it returns BAD DATA, it seems that it returns some cached values.
Environment: JDev 11.1.1.3.0 without any patches.
thanks,
MiroslawHi,
You can retrieve the selected value in the PivotFilterBar through the model of PivotFilterBar, instead of dataaccess:
// get the model from the pivot filter bar instance
QueryDescriptior queryDescriptor = (QueryDescriptor)pivotFilterBar.getValue();
// retrieve a list of criterion, each one is used to populate each lov within the pivot filter bar
ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion();
List<Criterion> criterionList = conjunctionCriterion.getCriterionList();
for (int i=0; i<_criterionList.size(); i++) {
AttributeCriterion criterion = (AttributeCriterion)criterionList.get(i);
// _selected is the currently selected value
Object selected = criterion.getValues().get(0);
System.out.println(_selected);
Hope that helps,
Chadwick -
How do I print out the value returned by a method in main??
I'm a total newbie at java, I want to know how I can print out the value returned by this function in the "Main" part of my class:
public int getTotalPrice(int price)
int totalprice=price+(price*0.08);
return totalprice;
I just want to know how to print out the value for total price under "public static void main(String[] args)". thanks in advance,
BradFew ways you could do it, one way would be to create an instance of the class and call the method:
public class Test
public double getTotalPrice(int price)
double totalprice = price + (price * 0.08);
return totalprice;
public static void main(String[] args)
Test t = new Test();
System.out.println(t.getTotalPrice(52));
}Or another would be to make getTotalPrice() static and you could call it directly from main. -
How can i get all values from jtable with out selecting?
i have one input table and two output tables (name it as output1, output2). Selected rows from input table are displayed in output1 table. The data in output1 table is temporary(means the dat wont store in database just for display purpose).
Actually what i want is how can i get all values from output1 table to output2 table with out selecting the data in output1 table?
thanks in advance.
rajaYou could set the table's data model to be the same:
output2.setModel( output1.getModel() );
Maybe you are looking for
-
What has happened? The URL http://sap-erp:8000/sap/bc/webdynpro/zz_01_sflight was not called due to an error. Note The following error text was processed in the system ER5 : WebDynpro Exception: Application /ZZ_01_SFLIGHT/ Does Not Exist The error oc
-
I can't open aperure. Following message appears: There was an error opening the database for library.
-
MaxDB 7.x and its reorganization + SAN cloning/snapshotting
We are currently in the process of evaluating a new storage solution for all our SAP (= MaxDB) systems. Given the case we'd produce a snapshot from our production system (3,1 TB) and present the results of that to another server to create a test syst
-
Mapping : DELVRY03/SHPMNT04 Idoc outbound description
Hi All, I found usefull descriptions on SAP Support Portal - search for documents, e.g. Mapping : FI outbound remittance advice. This Excel file shows which SAP tables,fields are transmitted into which segments, fields of the Idoc and decribes possib
-
So in 2007 I extended the Sms Def MOF file and added a few lines so that mapped drives could be captured in hardware inventory. (Using the Datashift) I don't know how to do this in 2012 since for one the sms_def.mof file isn't used (its just the conf