Page 1 of 1

Global Sub for All Lists

Posted: Fri Jun 07, 2013 1:37 am
by narmand
I created this subroutine for a list box on my application and it works well but I have other list controls that require the same function. How do I go about creating a argument for the object (path) so all I need to pass into the sub is the object path?

Public Sub Set_Value_TaxTypeId()

Dim strTag As String
Dim strTxt As String
Dim intItemCount As Integer

intItemCount = repo.EDITSOLUTIONSClient.TaxTypeId.Options.Count
For intCount As Integer = 0 To intItemCount
strTxt = repo.EDITSOLUTIONSClient.TaxTypeId.Options.Item(intCount).InnerText
If strTxt = "Social Security Number" Then
strTag = repo.EDITSOLUTIONSClient.TaxTypeId.Options.Item(intCount).Value
repo.EDITSOLUTIONSClient.TaxTypeId.Element.SetAttributeValue("TagValue", strTag)
End If
Next
End Sub

Re: Global Sub for All Lists

Posted: Mon Jun 10, 2013 1:57 pm
by Support Team
Hi,

You could get the RxPath using the following method of the Adapter "GetPath(PathBuildMode)" or via the "AbsolutePath" property of the RepoItemInfo.

I used the windows calculator for the small sample:
Dim myPath As RxPath = repo.Calculator.ContainerHash32770.Button121.GetPath(PathBuildMode.Reduce)
Report.Info(myPath.ToString)
        	
''' OR
myPath = repo.Calculator.ContainerHash32770.Button121Info.AbsolutePath
Report.Info(myPath.ToString)
The variable myPath could then be passed to your method.

Regards,
Markus

Re: Global Sub for All Lists

Posted: Mon Jun 10, 2013 9:36 pm
by narmand
Thanks, that helped!