REF::::
<ArrayOfCLocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<CLocation>
<DBID>75852</DBID>
<LocationName>0103E01A1</LocationName>
<SKU />
<Shelf>1</Shelf>
<Orientation>0</Orientation>
<Short>false</Short>
<Out>false</Out>
<WalkSequence>0</WalkSequence>
</CLocation>
<CLocation>
<DBID>75853</DBID>
<LocationName>0103E01A2</LocationName>
<SKU>F9719-AF1A</SKU>
<Shelf>1</Shelf>
<Orientation>0</Orientation>
<Short>false</Short>
<Out>false</Out>
<WalkSequence>0</WalkSequence>
</CLocation>
</ArrayOfCLocation>
PLEASE ANYONE How do I correctly add the newly filled
cTmpLoc OR daObject.mapLocInst to the list
mapLocList.Add
Instead of adding 268 instance of the same data to the list. My string builder says my objects being added to the list are fine. but actually they are not
SEE Attachment Image its like the object (type) gets added to the list but every added instance gets updated to the data reflecting the content of newest addition. So in effect the list ends up holding 268 instances of the last object
while the string builder shows 268 unique instances :sign0085::sign0085:
<ArrayOfCLocation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://tempuri.org/">
<CLocation>
<DBID>75852</DBID>
<LocationName>0103E01A1</LocationName>
<SKU />
<Shelf>1</Shelf>
<Orientation>0</Orientation>
<Short>false</Short>
<Out>false</Out>
<WalkSequence>0</WalkSequence>
</CLocation>
<CLocation>
<DBID>75853</DBID>
<LocationName>0103E01A2</LocationName>
<SKU>F9719-AF1A</SKU>
<Shelf>1</Shelf>
<Orientation>0</Orientation>
<Short>false</Short>
<Out>false</Out>
<WalkSequence>0</WalkSequence>
</CLocation>
</ArrayOfCLocation>
B4X:
Sub getCartLocParser_StartElement(Uri As String, Name As String, Attributes As Attributes)
If Name = "CLocation" Then
Try
daObject.mapLocInst.Initialize ' New Object Reference
Catch
Msgbox(LastException.Message, "ERROR")
End Try
End If
End Sub
Sub getCartLocParser_EndElement (Uri As String, Name As String, Text As StringBuilder)
Dim strRetVal As String
Dim strParent As String
Dim strDBId As String
If Name = "DBID" Then
Try
daObject.mapLocInst.dbId = Text
'localMapLocObj.dbId = Text
sbSanity.Append("Name: " & Name & "Value: " & Text & "First Node" & CRLF)
Catch
daObject.mapLocInst.dbId = 0
End Try
End If
If Name = "LocationName" Then
Try
daObject.mapLocInst.locNm = Text
Catch
daObject.mapLocInst.locNm = ""
End Try
End If
If Name = "SKU" Then
Try
daObject.mapLocInst.sku = Text
Catch
daObject.mapLocInst.sku = ""
End Try
End If
If Name = "Shelf" Then
Try
daObject.mapLocInst.shlf = Text
Catch
daObject.mapLocInst.shlf = 0
End Try
End If
If Name = "Orientation" Then
Try
daObject.mapLocInst.ori = Text
Catch
daObject.mapLocInst.ori = 0
End Try
End If
If Name = "Short" Then
Try
daObject.mapLocInst.sho = Text
Catch
daObject.mapLocInst.sho = 0
End Try
End If
If Name = "Out" Then
Try
daObject.mapLocInst.ot = Text
Catch
daObject.mapLocInst.ot = 0
End Try
End If
If Name = "WalkSequence" Then
Try
daObject.mapLocInst.wlkSeq = Text
Catch
daObject.mapLocInst.wlkSeq = 0
End Try
End If
If Name = "CLocation" Then
Try
Dim cTmpLoc As CLocation
cTmpLoc = daObject.mapLocInst
mapLocList.Add(cTmpLoc)
'daObject.mapLocInst = Null
sbSanity.Append("Adding Object ID:" & daObject.mapLocInst.dbId & CRLF)
Catch
Msgbox("CLocation List Fail", "Fail")
End Try
End If
If Name = "ArrayOfCLocation" Then
Msgbox(sbSanity.ToString, "RESULT")
Try
If mapLocList.Size > 0 Then
bMapLocationsFound = True
End If
Catch
Msgbox("bMapLocationsFound Boolean Flag Fail", " bMapLocationsFound Fail")
End Try
End If
End Sub
PLEASE ANYONE How do I correctly add the newly filled
cTmpLoc OR daObject.mapLocInst to the list
mapLocList.Add
Instead of adding 268 instance of the same data to the list. My string builder says my objects being added to the list are fine. but actually they are not
SEE Attachment Image its like the object (type) gets added to the list but every added instance gets updated to the data reflecting the content of newest addition. So in effect the list ends up holding 268 instances of the last object
while the string builder shows 268 unique instances :sign0085::sign0085: