Removing selected items from listbox
Hi ADF Experts,
I have a selectmanylistbox with few values displaying in UI and a Remove Button at the bottom.
User selects certain items from the listbox and clicks on Remove button. The selected items should be reomved. Can anybody suggest how to do this.
Thanks,
Animesh
Duplicate of https://forums.oracle.com/thread/2562542
User, please don't ask the same question multiple times. If you don't get the answer you want it may be because you did not give the right information and or use case me understand.
Timo
Similar Messages
-
How to get the selected items from listbox
Regarding listbox i have two questions
1) I want to get the selected items as per the order in which ihave selected.Presently i'm getting in the ascending order.For example after selcting the 1,2,6 if i select 3 then its giving 1,2,3,6.But i want it in the order 1,2,6,3
2)I want to select items from a single list box to many other listboxes.(ie) my first selection should goto first,second one to the second listbox and like this.How should i write the logic.
please give me a suggestion.In order to have the selected items line up in accordance to the selection order, please do it one at a time. (That's the limit for that VI)
If you need more than that (i.e. to regconize which item clicked first and which one comes later), you may have to figure it out ya
Wish you good luck. Perhaps, someone else has a already made vi.
Cheers!
ian.f
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010
依恩与LabVIEW
LVVILIB.blogspot.com -
Display selected item from Listbox
hi,
i get <h:selectOneListbox> value from database, now i want to know which item is selected in the listbox
my JSP code is
<h:selectOneListbox binding="#{DynamicListBean.std_list_lbx}" id="std_list_lbx" immediate="true"
onchange="common_timeoutSubmitForm(this.form, 'std_list_lbx');" required="true" size="5"
style="height: 312px; left: 168px; top: 192px; position: absolute; width: 216px" value="#{DynamicListBean.selectedCategory1}" valueChangeListener="#{DynamicListBean.std_list_lbx_processValueChange}">
<f:selectItems id="listbox1SelectItems1" value="#{DynamicListBean.items1}"/>
</h:selectOneListbox>Java code is public String getSelectedCategory1() {
return selectedCategory1;
public void setSelectedCategory1(String selectedCategory1) {
this.selectedCategory1 = selectedCategory1;
public void std_list_lbx_processValueChange(ValueChangeEvent vce) {
connection();
int n1 = 0;
String a = "";
if (con != null) {
try {
stmt = con.createStatement();
String query = "select std_id, std_name from std_detail";
rs = stmt.executeQuery(query);
String iddata = "";
if (rs != null) {
while (rs.next()) {
iddata = rs.getString("std_id");
// System.out.println(rs.getInt("std_id"));
stmt1 = con.createStatement();
String query1 = "select chpt_detail from chapter_detail right outer join std_detail on chapter_detail.std_id = std_detail.std_id where chapter_detail.std_id = " + iddata + " ";
String data3 = "";
rs1 = stmt1.executeQuery(query1);
if (rs1 != null) {
while (rs1.next()) {
data3 = rs1.getString("chpt_detail");
chpt_lst_lbx.setValue(data3);
dList2.add(data3);
stmt1.close();
rs1.close();
List selectItems = new ArrayList();
Iterator it = dList2.listIterator();
while (it.hasNext()) {
String label = (String) it.next();
chpt_lst_lbx.setValue(label);
selectItems.add(new SelectItem(label));
items2 = (SelectItem[]) selectItems.toArray(new SelectItem[0]);
stmt.close();
rs.close();
con.close();
} catch (Exception e) {
System.out.println("Sorry failed to display values from the database table. " + e.getMessage());
System.out.println(e);
}any idea or suggestion tell meYou usually use the property behind value="#{DynamicListBean.selectedCategory1}" for that. But in your case you'll need the vce.getNewValue() as the valueChangeListener is been invoked before the property is been set.
Having said that, your code is terrible. Please read on about the DAO pattern. Further on, did you know that you can also just use List<SelectItem> instead of SelectItem[] as f:selectItems value?
If you want to populate child menu's, you may find this article useful to avoid future and painful problems: [http://balusc.blogspot.com/2007/10/populate-child-menus.html]. -
Get Selected Items from ListBox
Hi,
How do I get the Selected items of a List in Flex.
I am using a multi-select List.
ThxNever mind..I got it.
it as simple as that:
Alert.show (lst.selectedItem.fieldname);
;) -
URGENT: How to remove an Item from HTMLB listbox
Hi All,
I am designing a page, which contains a listbox, whose contents(items) need to be changed dynamically.
I can populate it dynamically using
listbox.addItem(key, string)
But, i don't see any specific methods to remove an item from it.
Please Help Me in this Regard..
vijayHi Vijay,
(a) every request on SDN is expected as urgent... If you won't use this word in the future, you'll have more time for solving your problems
(b) If your listbox.getModel() returns the DefaultListModel, you can call removeItem(String key) on the model; see http://media.sdn.sap.com/javadocs/preNW04/SP2/60_sp2_javadocs/htmlb/com/sapportals/htmlb/DefaultListModel.html#removeItem(java.lang.String) for details
Hope it helps
Detlev
PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance! -
How to remove an item from a list box?
Here's my previous code.
I hope someone can help me. Thanks.
public partial class frmJaialai : Form
List<Jaialai> source;
public frmJaialai()
InitializeComponent();
private void frmJaialai_Load(object sender, EventArgs e)
source = new List<Jaialai>();
private void btnAdd_Click(object sender, EventArgs e)
if (IsValidData())
int bet;
if (string.IsNullOrEmpty(txtJaialaiNumber.Text) || !Int32.TryParse(txtBet.Text, out bet))
MessageBox.Show("Must be a required field.", "Entry Error");
return;
var existingProduct = source.Where(x => x.JaialaiNumber == txtJaialaiNumber.Text).SingleOrDefault();
if (existingProduct != null)
existingProduct.Bet += bet;
else
source.Add(new Jaialai { Bet = bet, JaialaiNumber = txtJaialaiNumber.Text });
lstJaialaiNumbersList.DataSource = null;
lstJaialaiNumbersList.DataSource = source;
txtJaialaiNumber.Text = "";
// save the jai-alai numbers list on a txt file
const string sPath = @"C:\Automated Jai-alai Program\Jai-alai Numbers List.txt";
System.IO.StreamWriter SaveFile = new System.IO.StreamWriter(sPath);
foreach (var item in lstJaialaiNumbersList.Items)
SaveFile.WriteLine(item);
SaveFile.Close();
public class Jaialai
public string JaialaiNumber { get; set; }
public int Bet { get; set; }
public override string ToString()
return string.Format("{0} = {1}",
JaialaiNumber, "₱" + Bet.ToString());
private bool IsValidData()
return Validator.IsPresent(txtJaialaiNumber) &&
Validator.IsPresent(txtBet) &&
Validator.IsInt32(txtBet);Hi ,
Here is a sample about remove Item from listBox.
// listBox1.Items.Clear();// remove all
int SelItemCount = listBox1.SelectedItems.Count;
for (int i = 0; i < SelItemCount; i++)
listBox1.Items.Remove(listBox1.SelectedItem);//remove which one you selected
You also can check in MSDN
https://msdn.microsoft.com/en-us/library/aa983551(v=vs.71).aspx
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Hi all,
I am making a vi where I have to save the selected value from listbox with its respective tab control dropdown selcted values in another listbox.Whenever I select Item1 then the heading change and respective tab will open for that item.But Now I just want to save the selection and put it in another ListBox.SO that I can renmove or add according to my wish. Plz help me.
Solved!
Go to Solution.
Attachments:
my_vi.png 83 KBHi, I successfully make the vi to insert itmes from listbox1 to listbox2.Whenever I select itmes 1 in listbox 1 it display same elected item in listbox2 , but it not appending the items in listbox2.Like If 1 is selected in listbox1 then 1 will display , next time after saving when I selct next item like 3 then in listbox 2, 1 is replaced by 3,it dont come in second row of listbox2.Hope I am able to explain.\
Plz help me to resolve this.
Attachments:
listbox_update.vi 11 KB -
Getting selected item from combobox itemrenderer and storing in object
Hi Guys,
Can anyone help me in this regard. Its very urgent.
I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corressponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corressponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck up with, how to store the selected item value of the combobox and corressponding values of all other columns of the rows into an Object ?.
Can anybody help me with sample to store selected item from combobox and its corressponding values of all other columns into an object which i can send to db...?
Kindly help me in this regard.
Thanks,
Anand.Hi!
Are you using a collection of VO or DTO as the dataprovider of the combobox component?
If so, have you created some attribute there to control the user's selection in the combobox?
For instance:
private var selected:Boolean = false;
If your solution fits this approach, you may create a new collection that contains just the objects that were selected by the user, it means you can loop through the datagrid's dataprovider and only insert in this new collection those objects that have the attribute "selected" set to true.
For instance:
private function getSelectedRecords(datagridDataProvider:ArrayCollection):ArrayCollection
var newCollection:ArrayCollection = new ArrayCollection();
for each (var item:Object in datagridDataProvider)
if (item.selected)
newCollection.addItem(item)
return newCollection;
Afterwards, you may serialize this new collection with your back-end.
Hope it helps you!
Cheers,
@Pablo_Souza -
Unable to remove this item from GRIR. It was a consignment PO receipt done
Hi Guys,
The user saying that"unable to remove this item from GRIR. It was a consignment PO receipt done improperly, so it needs to be deleted".
Because of this the the material documet which shows $6725.43-(Negative) in GRIR account.when i check this this transation was originated through MI10(Physical inventory differenvces posting).May be user done wrongly.
Now the problem is this
- how this transaction originated?
- Why is this posted to GR/IR account?
- How do we correct the open item in the GR/IR account?
- What need to happen to rectify the mistake?
can any tell me how can we do this,i will be greatful to u.
Thanks&Regards,
Babu,
09930154536Hi Jurgen,
when i check the material document and accounting document,it was showing that said amount in negative sign and transaction done by MI10 means posted differences with out reference to document.
it means the user may entered wrongly i think.
was there any GRIR account for MI10?
MI10 does not have reversal or cancel?
so how to resolve it?
as per my idea it can be done by FI posting.
please help to resolve.
Thanks in advance.
Regards,
Babu
09930154536 -
How to get selected items from a tree in backing bean without adfbc
Hi ADF Experts,
Below is my code for af:tree. My question is how can I get selected Items from the selectionListener (without adf bc) this uses formation of tree from backing bean.
Using Jdev 11.1.1.7.0
<af:tree var="node" value="#{pageFlowScope.MerchandizeBean.model}"
binding="#{pageFlowScope.MerchandizeBean.treeModel}" id="tree" immediate="true" autoHeightRows="0"
styleClass="AFStretchWidth" rowSelection="multiple"
selectionListener="#{pageFlowScope.MerchandizeBean.treeNodeSelection}">
<f:facet name="nodeStamp">
<af:commandLink text="#{node.classDescription}"
actionListener="#{pageFlowScope.MerchandizeBean.createListManyItemForMerchandise}" id="displayTable" partialSubmit="true">
</af:commandLink>
</f:facet>
</af:tree>
public void treeNodeSelection(SelectionEvent selectionEvent) {
// Add event code here...
RichTree tree = (RichTree)selectionEvent.getSource();
TreeModel model = (TreeModel)tree.getValue();
//get selected value
Thanks
RoyHi,
in a multi select case, try
RowKeySet rks = tree.getSelectedRowKeys();
Iterator iter = rks.iterator();
while(iterator.hasNext()){
Object aKey = iterator.next();
tree. setRowKey(aKey);
Object rowData ? tree.getRowData();
.... do something with the data here ...
Frank -
To remove line items from invoice which have 0 qty.
Dear Friends,
Requirement: To remove line items from invoice which have 0 qty.
For this I wrote the code in RV60AFZZ. It is very well happening, but when last line item comes it is failing.
What I have written is " DELETE XVBRP WHERE FKIMG = '0' ." . This code is deleting all the line items with 0 qty except last line item.
Actually, this exit works line item wise. Once the line item is appended, the code what I have written is working. For the last line item, record is not appended when this exit is triggerred, thats why last record is not deleted.
The include where all line items are getting appended in XVBRP is LV60AB03. I modified this also. Same code I have written here to delete the records once it is appended. But after doing this the problem is - invoice is not getting created.
Please help me in doing this so as to delete this last record also. I tried with other logics also, not able to track the last record.
Please help me to resolve this problem.
Thanks.Hi,
Check user exit RV60AFZC.
RV_INVOICE_DOCUMENT_ADD is the FM which is called to generate number for the invoice after all the line items have been added to vbrp structure. Add a break-point here and check.
All the best.
Regards,
Amit -
Remove an item from right-click menu?
How do I remove an item from a right-click menu? An application I installed but later removed placed an item on my right-click menu. I want to remove the right-click item it placed there. I've looked in .../user/library/contextual menu and /library/contextual menu but don't see anything there that suggests it might be related.
Thanks.I suddenly realized this was a FireFox Add-on. Once I realized that it was easy to go to Add-on menu in Firefox and remove it.
Problem solved. -
To remove work item from Universal worklist
Hi,
Can we remove work item from Universal Worklist by deleting. We don't want to approve or reject them but want to remove from inbox.
Is there a way for this?
Regards
PVHi Parveen,
check the below note
check below note
Note 49545 - Deleting unnecessary work items
Koti Reddy -
I would like to remove an item from my desktop but don't know how to do it
Hi can anyone help me remove an item from my desktop, i do not know how to do it.
If it's not a mounted disk image, drag it to any one of the items in the Finder's sidebar, or any other folder if you're running Mac OS 9. If it is, drag it to the Trash.
(64024) -
How to remove an item from side bar?
Can anyone teach me how to remove following item from side bar: Thank you!
Niel thank you very much for you help.
Maybe you are looking for
-
How do I read a singal on row 1 with my DMM connected to the HVBP
I have placed a signal on c1 of my SCXI 1129 and connected it to r1. Then I connected r1 to com1 and com1 to ab1. At this point how do I read that voltage using my DMM that is connected to the backplane. I was able to do it by using c0, r0, com0, ab0
-
BPM - Bundle 2 Files to 1 - Mapping error.
I'm using BPM to bundle 2 messages into 1. The two Data Types for the Abstract MT are completly diferent. I got the BPM to work but my final Message are in different order. IF I check each xml before the transformation they are both in perfect order.
-
Creating slideshow/gallery in catalyst
I am a designer (non-web) and I really want to utilize catalyst for a portfolio site. I was wondering if there was an easy way to create a "proffesional" looking gallery of portfolio images. I am somewhat familiar with catalyst, just stuck on this on
-
Everything is fine with my iPhone, the 3G turns back on as soon as I reboot my phone and I can turn it off and on no problem as long as its not off for more than about 24 hours Anyone else getting the same problem?
-
Is Oracle E-Business Suite 12.1.3 certified with Oracle Application Server
Is Oracle E-Business Suite 12.1.3 certified with Oracle Application Server Single Signon 10.1.4.3.0 on Linux x86-64 SLES 11 (not SLES 10) ? I do see Oracle Application Server Single Signon 10.1.4.3.0 listed on the certification matrix for R12.1.3 , h