iterating over nested collections
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   danny_rebello
Posted On:   Wednesday, September 29, 2004 01:19 AM

iterating over 2 collections having a common field hi Everyone, My problem is about iterating over 2 collections having a common field in both the collections at the same time. The common field is : itemName : which contains the itemCode and itemCode : which contains the itemCode in both the collections In my first collection(outer collection)named : AddItemResults contains a Billorder object having fileds such as : itemCheck : which is the index such as 0,1,2 itemName : which is the item code itemQty :wich is the item quantity itemRate : which is the item rat   More>>

iterating over 2 collections having a common field

hi Everyone,

My problem is about iterating over 2 collections
having a common field in both the collections

at the same time.

The common field is :

itemName : which contains the itemCode

and

itemCode : which contains the itemCode

in both the collections


In my first collection(outer collection)named :

AddItemResults contains a Billorder object

having fileds such as :

itemCheck : which is the index such as 0,1,2

itemName : which is the item code

itemQty :wich is the item quantity

itemRate : which is the item rate



In my second collection(inner collection)named :

SearchResultItemNames contains Item object

having fileds such as :

itemCode : which is the item code

itemName : which is the item name


Now when a user selects items (which is done using the

inner collection containing the itemName and itemCode)

and saves the bill , the itemcode gets saved in the

table .

Now when the user wants to see the contents of a bill

he selects a bill no and get the items for the

bill which is contained in the outer collection

(such as itemCheck,itemName(which is itemCode),itemQty

and itemRate)

what i want is that , the corresponding itemCode from the

outer collection should match with the inner itemcode

(itemName) of the inner collection of that

bill which is not happening .

Even though the itemcode and itemName match, the

statement

value is not equal gets printed


The code is given as below






















**itemcode: --

itemname: **



<%
System.out.println("value is equal");
%>




<%
System.out.println("value is not equal");%>









   <<Less
About | Sitemap | Contact