Global Sub for All Lists

Class library usage, coding and language questions.
narmand
Posts: 13
Joined: Thu Mar 21, 2013 11:20 pm

Global Sub for All Lists

Post by narmand » Fri Jun 07, 2013 1:37 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Global Sub for All Lists

Post by Support Team » Mon Jun 10, 2013 1:57 pm

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
.
Image

narmand
Posts: 13
Joined: Thu Mar 21, 2013 11:20 pm

Re: Global Sub for All Lists

Post by narmand » Mon Jun 10, 2013 9:36 pm

Thanks, that helped!