I don't have a GOOD concrete example but could someone please attempt to educate me ... :sign0163:
With this CallSubDelayed method now in HttpUtils2 I find that the tasks (calls) are going by so swiftly that method calls I have blocked out in my Activity create by boolean flags are actually being called before the boolean flags have been set to allow entry into the code portion of Activity_Create that invokes the Calls to HttpUtil2..
How do I adequately describe this...
This isnt the offending section but it will adequately assist my description..
theres a code section ( most of these examples are in activity_Create ) above this first example that fills a list from repeated calls to a HttpUtil2's call to a web service. As you all know this lands in job_done and the job_Done sub calls a related XML Sax parser to truly fill my list object. ( you you guessed it a Global Uggg)
I had to introduce this counter because the boolean flag was being set before the list was completely filled .. allowing entry into the UI creation portion which you can imagine is a NIGHTMARE... views atop views atop more views. all now mis labled and chaos-'ed up .... in another section [My current concern] I had to create a Map and throw id's into the Map and check if they were there already to prevent their re creation from the redundant Perhaps too fast re entry into a call to the HttpUtil2 to again fill some list...
C'mon people help me out here.. I honestly understand async & sync. I understand polling and callbacks but this is killing me forcing me to write code I'm assuredly not fond of let alone proud of.. for a RAD tool Rapid application development - Wikipedia, the free encyclopedia its becoming quite laborious and frustrating. Assuredly this could be my lack of understanding some basic concept in this use of the tool and its add ons..(HttpUtils2) Please advise ASAP!!!! :sign0085: :sign0104:
Check this out,,,,,, that last call to FetchOrderByID returns and calls itself again with the same ID before its Job Done can complete...heck even before job done is called
for earlier tasks not to mention even before job done is called using the first orderId, its already trying to do it again with the same orderid which if I recall correctly is called by a counter / incrementer----> List.Get(counter/incrementer) which is incremented when the results are added to the list ... Yea I checked the incrementeer is in the job_done versus the parser not like it mattered where I placed it
With this CallSubDelayed method now in HttpUtils2 I find that the tasks (calls) are going by so swiftly that method calls I have blocked out in my Activity create by boolean flags are actually being called before the boolean flags have been set to allow entry into the code portion of Activity_Create that invokes the Calls to HttpUtil2..
How do I adequately describe this...
This isnt the offending section but it will adequately assist my description..
theres a code section ( most of these examples are in activity_Create ) above this first example that fills a list from repeated calls to a HttpUtil2's call to a web service. As you all know this lands in job_done and the job_Done sub calls a related XML Sax parser to truly fill my list object. ( you you guessed it a Global Uggg)
I had to introduce this counter because the boolean flag was being set before the list was completely filled .. allowing entry into the UI creation portion which you can imagine is a NIGHTMARE... views atop views atop more views. all now mis labled and chaos-'ed up .... in another section [My current concern] I had to create a Map and throw id's into the Map and check if they were there already to prevent their re creation from the redundant Perhaps too fast re entry into a call to the HttpUtil2 to again fill some list...
C'mon people help me out here.. I honestly understand async & sync. I understand polling and callbacks but this is killing me forcing me to write code I'm assuredly not fond of let alone proud of.. for a RAD tool Rapid application development - Wikipedia, the free encyclopedia its becoming quite laborious and frustrating. Assuredly this could be my lack of understanding some basic concept in this use of the tool and its add ons..(HttpUtils2) Please advise ASAP!!!! :sign0085: :sign0104:
B4X:
#Region----------------------{ User Interface creation }--------------------------
'-----------{ xyz }- ----Left Top Width Height------- ' 1280 x 800Reference
If bBeginUiCreation Then
subSpecificCounter = subSpecificCounter + 1
If subSpecificCounter < 2 Then
' Msgbox("Number of Loops Through UI Creation Block: " & subSpecificCounter, "COUNT UI Loops ")
' If bPreventReCleanUI = False Then
' CleanHouse
' End If
'
#Region---------------------{ Create header }--------------------
bPreventReCleanUI = True
panHeader.Initialize("")
panHeader = uiLogic.InitHeaderBlock(panHeader)
Activity.AddView(panHeader,0%x,0%y,1280dip,80dip)
#End Region
B4X:
'#3 Get Order Assignments If MapList has been obtained
If mapLocList.Size > 1 AND bOrderAssignmentListCreated = False Then
FetchOrderAssignments ' Fills lstOrderAssignments sets flag 'CallToHttpUtil2 inside of this method
mapDuplicatePrevention.Initialize
End If
'
B4X:
#Region ---------------------------{ OrderAssignments EXIST }----------------------
If bOrderAssignmentListCreated AND iOrdAssignmentListSize > 0 Then 'OAssignment list created and OAList has content / Count
If bOrderAssignmentsToMainLst = False Then 'Process of adding assignments to MAIN Source List hasnt been completed
AssimilateOrderAssignments 'CallToHttpUtil2 inside of method that this calls
'bOrderAssignmentsToMainLst = true its been completed
Else
If iRemainderBins > 0 Then 'slots remain for scan based acquisition
If bMapLocScanCompleted = False Then ' Force ScanCurrentLoc to Fill Remining Bins
Activity.LoadLayout("lo_ScanLocation")
Return ' Break out of this
End If
' next loop when bMapLocScanCompleted = true
If bLocationScanValidated = False Then
ValidateScannedMapLocation 'CallToHttpUtil2
End If
' next loop when bLocationScanValidated = true
If bMapLocOrderListCreated = False Then ' Boolean Toggle True When iRemainderBins decremented to 0 AssimililateOrders 'CallToHttpUtil2 inside of method that this calls
'GetNext Order & Assign Order to Cart --> into recall Activity_Create(False)
End If
Else
bMapLocOrderListCreated = True
bBeginUiCreation = True
'CalculateNextAvailablePosition
End If
End If
End If
#End Region
B4X:
Sub AssimilateOrderAssignments
'bins to create = Max - SizeOf OAlst
If iOrdAssignmentListSize <= MAX_BIN_COUNT Then
iRemainderBins = MAX_BIN_COUNT - iOrdAssignmentListSize
End If
If iordAssignmentsToMainListCounter < MAX_BIN_COUNT Then
If iordAssignmentsToMainListCounter < iOrdAssignmentListSize Then
lclOrdAssign = lstOrderAssignments.Get(iordAssignmentsToMainListCounter)
m_CartPosition = lclOrdAssign.pos
m_cartState.orderID = lclOrdAssign.ordId
If mapDuplicatePrevention.ContainsKey(lclOrdAssign.ordId) = False Then
mapDuplicatePrevention.Put(lclOrdAssign.ordId,lclOrdAssign)
'Msgbox("OrderId Sent To Method: " & m_cartState.orderID , "FetchOrderByID")
FetchOrderByID 'CallToHttpUtil2 looped - JobDone calls Activity_Create
Else
' DO NOTHING Assuredly not add the Duplicate
Msgbox("Preventing Duplication : " & m_cartState.orderID, "FetchOrderByID")
End If
'DoEvents
End If
Else
If iordAssignmentsToMainListCounter = MAX_BIN_COUNT Then
bBeginUiCreation = True
End If
End If
End Sub
Check this out,,,,,, that last call to FetchOrderByID returns and calls itself again with the same ID before its Job Done can complete...heck even before job done is called
for earlier tasks not to mention even before job done is called using the first orderId, its already trying to do it again with the same orderid which if I recall correctly is called by a counter / incrementer----> List.Get(counter/incrementer) which is incremented when the results are added to the list ... Yea I checked the incrementeer is in the job_done versus the parser not like it mattered where I placed it