New topic: Getting the names of WebContainer controls on a page
<http://forums.realsoftware.com/viewtopic.php?t=44779> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message JohnV Post subject: Getting the names of WebContainer controls on a pagePosted: Thu Jul 19, 2012 5:04 pm Joined: Sun Jan 28, 2007 2:38 pm Posts: 108 I have X number of WebContainer controls on a page. Each one of them has a WebLabel control I wish to read the .text of each label What I think i need to know is: 1. How do I know how many controls are on the page? 2. How do I know their names? Help! Top Bob Keeney Post subject: Re: Getting the names of WebContainer controls on a pagePosted: Thu Jul 19, 2012 5:42 pm Joined: Fri Sep 30, 2005 11:48 am Posts: 3125 Location: Lenexa, KS How are you adding the WebContainers in the first place? You could always iterating through the controls on the page. Read about ControlAtIndex and ControlCount at http://docs.realsoftware.com/index.php/WebView _________________ Bob K. 36+ hours of Real Studio Video Training at http://www.bkeeney.com/ Real Studio Consulting http://www.bkeeney.com/consulting/real-studio-consulting BKeeney Briefs Blog For Real Studio Developers http://www.bkeeneybriefs.com/ Top JohnV Post subject: Re: Getting the names of WebContainer controls on a pagePosted: Thu Jul 19, 2012 5:50 pm Joined: Sun Jan 28, 2007 2:38 pm Posts: 108 Figgured it out dim i as integer dim c as WebControl dim theNameOfTheControl as String for i = 0 to self.ControlCount -1 c = WebControl(self.ControlAtIndex(i)) if c isa My_container_control then theNameOfTheControl=My_container_control(c).Name // My_container_control(c).MyObject.MyProperty=MyValue // to manipulate the object in the control end if next Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
