Dynamically resetting repository items
Posted: Fri Jul 12, 2013 3:06 pm
Background:
I have a multi-tab form used for performing searches. Each tab contains basically the same objects, with the only difference being the tab's index. I am creating rooted folders in my repository. Rather than create 5 folders containing the same 20 objects (100 total objects), I want to create 1 folder with 20 objects and set/reset the folder based on which tab I need to use.
Issue one:
When resetting the repository path of my rooted folder, my change is being appended to the current path as opposed to updating it.
The update is not being applied to items nested inside the folder.
I have a multi-tab form used for performing searches. Each tab contains basically the same objects, with the only difference being the tab's index. I am creating rooted folders in my repository. Rather than create 5 folders containing the same 20 objects (100 total objects), I want to create 1 folder with 20 objects and set/reset the folder based on which tab I need to use.
Issue one:
When resetting the repository path of my rooted folder, my change is being appended to the current path as opposed to updating it.
string PathOriginal = RepoPath.VariableTab.SelfInfo.AbsolutePath.ToString(); //Reset Path RepoPath.VariableTab.SelfInfo.Path = "container["+i+"]"; string PathUpdated = RepoPath.VariableTab.SelfInfo.AbsolutePath.ToString(); //I am getting PathOriginal = "form/element/container" PathUpdated = "form/element/container/container[2]" //I am expecting PathUpdated = "form/element/container[2]"Issue two:
The update is not being applied to items nested inside the folder.
string ChildPathOriginal = RepoPath.VariableTab.textbox_IDInfo.AbsolutePath.ToString(); //Reset parent folder's path RepoPath.VariableTab.SelfInfo.Path = "container["+i+"]"; string ChildPathUpdated = RepoPath.VariableTab.textbox_IDInfo.AbsolutePath.ToString(); //I am getting ChildPathOriginal = "form/element/container/.//text[@name='id']" ChildPathUpdated = "form/element/container/.//text[@name='id']" //I am expecting ChildPathUpdated = "form/element/container[2]/.//text[@name='id']"Thanks