Application_FindComponent. Nested Depth

0
0

https://docs.wisej.com/api/wisej.web/general/application#findcomponent-match

Is there a limitation to how deep this method will locate a IWisejComponent?
I have an implementation where it is properly identifying (finding) open pages, as I am attempting to prevent duplicates from being opened.
Control openViewInstance = (Control)Application.FindComponent(o => o is Control && ((Control)o).Name == viewName);

But it is not finding open pages that are four elements deep in the fully qualified namespace.
For Example:
it will locate an open instance of this IWisejComponent: Controls.Production.SomeControlName
but not this one: Controls.Production.Labor.SomeOtherControlName

Thank you

 

  • You must to post comments
0
0

There is no depth for FindComponents(). The list is flat. Send a small runnable complete test project that shows your issue and we may be able to help you further.

 

  • You must to post comments
0
0

Hi Christian,

there should be no limit, you might want to check your search predicate.
Please note that it stops after finding the first match.
There is also a FindComponents method that finds all matches.

Best regards
Frank

  • Christian Programmer
    I included that I was successfully using FindComponent() with the code snippet of my search predicate. I just tested another section that has a control nested 4 deep and it finds it properly from FindComponents so I can avoid opening a duplicate. But there is another folder who’s IWisejComponent’s are not being found by FindComponent(). I verified that the controls are consistently being inherited from the same type of base. I just checked another folder group to again make sure it wasn’t the # of folder depth, and yes another area of the solution is working fine with that four deep path. Please What else can I trouble shoot ? Can I view the contents of the app’s Component list and peek myself (?) .. despite the control being literally open and in my face, & yet FindComponents isn’t “seeing” it ? FindComponent() is attempting to use just the control’s name in my (WORKING) predicate: Control openViewInstance = (Control)Application.FindComponent(o => o is Control && ((Control)o).Name == viewName); I have tried to use a string for ‘viewName’ instead of just the usercontrolName with the fully qualified namespace and user control name & still it doesn’t find the active control. PLEASE ADVISE This doesn’t make sense
  • Luca (ITG)
    As Frank indicated there is no depth. The problem is in your code mixing names with namespaces. Send a small self contained runnable problem with a clear description and we may be able to help you find the error as a courtesy.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.