reading the windowobject Control array Control[]

has anyone tried reading and/or modifying the contents of
the windowobject control array?  the help file says you
"shouldn't" do this, it does not say you "can't".  we are
using PB 9.0.1
thanks
0
Darren
5/27/2005 7:48:25 PM
sybase.powerbuilder.general 62418 articles. 19 followers. Follow

4 Replies
1446 Views

Similar Articles

[PageSpeed] 0
Get it on Google Play
Get it on Apple App Store

Reading it, yes, writing to it, can't say.  It's common to 'walk' the
control array, perhaps to set a property, trigger an event, or update a
datawindow control.

Larry

<Darren> wrote in message news:42977985.1587.1681692777@sybase.com...
> has anyone tried reading and/or modifying the contents of
> the windowobject control array?  the help file says you
> "shouldn't" do this, it does not say you "can't".  we are
> using PB 9.0.1
> thanks


0
Larry
5/27/2005 7:53:32 PM
You shouldn't try to modify, because it won't do anything. Reading it is fine
(in fact, lots of Sybase references suggest it; you should report this
documentation "bug" to Sybase with the free issue reporting in the Support
section of their web site). If you want to "modify" it by adding or removing
controls, you should use Open/CloseUserObject(). If you're wanting to do
something else, if you let us know maybe we can come up with more precise
suggestions.

Let us know,

Terry [TeamSybase] and Sequel the techno-kitten

On 27 May 2005 12:48:25 -0700,
 in sybase.public.powerbuilder.general
 <Darren> wrote: 
>has anyone tried reading and/or modifying the contents of
>the windowobject control array?  the help file says you
>"shouldn't" do this, it does not say you "can't".  we are
>using PB 9.0.1

*********************************
Click once a day to help the hungry
http://www.thehungersite.com
*********************************

Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a free PowerBuilder Developer's Toolkit. 
Version 2.2.06 now available at the Sandbox
See the PB Troubleshooting Guide at the Sandbox
^ ^
o o
=*=
0
Terry
5/27/2005 8:06:10 PM
The problem I am having is that different windows in our app
have a different list of controls.  I am able to walk
through the control array and get the classname of the
various controls.  the problem I am trying to resolve is
taking the classname of the control and using it to change
the properties of the datawindow control or command button
using a dot notation.

this loop will tell me I have an update button on my window
called cb_update.  I know I have to disable cb_update but I
am having a problem with the syntax.  the classname returns
as a string but the dot notation won't let me use the
string.

string	the_class[]
integer	i

FOR i = 1 TO UpperBound(control[])
    the_class[i] = control[i].ClassName()
	
	 if left(the_class[i],2) = 'cb' then
		//this is a command button

	elseif left(the_class[i],2) = 'dw' then
		//this is a datawindow control
		
	end if
NEXT


> You shouldn't try to modify, because it won't do anything.
> Reading it is fine (in fact, lots of Sybase references
> suggest it; you should report this documentation "bug" to
> Sybase with the free issue reporting in the Support
> section of their web site). If you want to "modify" it by
> adding or removing controls, you should use
> Open/CloseUserObject(). If you're wanting to do something
> else, if you let us know maybe we can come up with more
> precise suggestions.
>
> Let us know,
>
> Terry [TeamSybase] and Sequel the techno-kitten
>
> On 27 May 2005 12:48:25 -0700,
>  in sybase.public.powerbuilder.general
>  <Darren> wrote:
> >has anyone tried reading and/or modifying the contents of
> >the windowobject control array?  the help file says you
> >"shouldn't" do this, it does not say you "can't".  we are
> >using PB 9.0.1
>
> *********************************
> Click once a day to help the hungry
> http://www.thehungersite.com
> *********************************
>
> Sequel's Sandbox: http://www.techno-kitten.com
> Home of PBL Peeper, a free PowerBuilder Developer's
> Toolkit.  Version 2.2.06 now available at the Sandbox
> See the PB Troubleshooting Guide at the Sandbox
> ^ ^
> o o
> =*=
0
Darren
5/27/2005 8:53:25 PM
Once you have the right element in the control array, you have to cast 
it to a variable of the appropriate type.

commandbutton lcb
datawindow ldw
string	the_class[]
integer	i

FOR i = 1 TO UpperBound(control[])
     the_class[i] = control[i].ClassName()
	
	 if left(the_class[i],2) = 'cb' then
		//this is a command button
		lcb = control[i]
		lcb.Enabled = FALSE

	elseif left(the_class[i],2) = 'dw' then
		//this is a datawindow control
		ldw = control[i]
		ldw.Object.yada.yada.yada
		ldw.Descibe ()
		ldw.Modify()
		
	end if
NEXT

Darren wrote:
> The problem I am having is that different windows in our app
> have a different list of controls.  I am able to walk
> through the control array and get the classname of the
> various controls.  the problem I am trying to resolve is
> taking the classname of the control and using it to change
> the properties of the datawindow control or command button
> using a dot notation.
> 
> this loop will tell me I have an update button on my window
> called cb_update.  I know I have to disable cb_update but I
> am having a problem with the syntax.  the classname returns
> as a string but the dot notation won't let me use the
> string.
> 
> string	the_class[]
> integer	i
> 
> FOR i = 1 TO UpperBound(control[])
>     the_class[i] = control[i].ClassName()
> 	
> 	 if left(the_class[i],2) = 'cb' then
> 		//this is a command button
> 
> 	elseif left(the_class[i],2) = 'dw' then
> 		//this is a datawindow control
> 		
> 	end if
> NEXT
> 
> 
> 
>>You shouldn't try to modify, because it won't do anything.
>>Reading it is fine (in fact, lots of Sybase references
>>suggest it; you should report this documentation "bug" to
>>Sybase with the free issue reporting in the Support
>>section of their web site). If you want to "modify" it by
>>adding or removing controls, you should use
>>Open/CloseUserObject(). If you're wanting to do something
>>else, if you let us know maybe we can come up with more
>>precise suggestions.
>>
>>Let us know,
>>
>>Terry [TeamSybase] and Sequel the techno-kitten
>>
>>On 27 May 2005 12:48:25 -0700,
>> in sybase.public.powerbuilder.general
>> <Darren> wrote:
>>
>>>has anyone tried reading and/or modifying the contents of
>>>the windowobject control array?  the help file says you
>>>"shouldn't" do this, it does not say you "can't".  we are
>>>using PB 9.0.1


-- 
"Don't just fix; teach."

  Some informative links:
    news:news.announce.newusers
    http://www.geocities.com/nnqweb/
    http://www.catb.org/~esr/faqs/smart-questions.html
    http://www.caliburn.nl/topposting.html
    http://www.netmeister.org/news/learn2quote.html
1
Jason
5/27/2005 9:40:08 PM
Reply:

Similar Artilces:

Question on Control Array or Control[]
I have some question about the Control Array or Control[] Does anyone nowhere I can fine out how it is defined ? ie its structure. I am using the control array to get all of the controls from a window and changing each control's text to French or English depending on a variable. The function call is fired on the open event of each window. This is simple enough. My problem is a Control of type DataWindow. I what to change the statictext fields to French or English, but don't know to access them genertically from the Control Array. If control[x].typeof() = DataWi...

control array of tab control
Hello friends, Is it possible to get the type of control on a tab control? I have a function that will check the tab control's control array for each and every control, and than check the typeof(), however, the typeof is only userobject, irrespective of what control i put on the tab. For example my tab control has datawindows, buttons and dropdown list box, however when I do the typeof() checking its only returning UserObject! how do i check if that particular userobject is a datawindow or button? I hope there is a solution. Your help appreciated. Syed. -- Syed Ibrahim...

How do I control one control from another control?
I have a page page1.aspx which is within a master page. On page I have a table with two cells. Within each cell I have placed two controls (ascx) that I have developed. Now I'd like to be able to get these two controls to interact. One needs to update the other. One has some search criteria that the other one needs to update its gridview. One needs to make the other visible/not visible at certain times. Out of the box neither control can see each other at all. Is there a good article or someplace I can find some information on how to do this?  AllAboutFocus.com. Information Technolo...

Custom Control within a Control Control
I am developing a custom controls that will render headers for different web sites. Within these controls, I want to place another custom control that will change the language. I created the language control and had it implement IPostBackDataHandler. This control works fine if I drag it on a new web form, but if I tell a header custom control to render it problems occur. The Language Selector custom control does not have a Page member anymore and the event handlers do not work. Does anyone have any experience with doing something similiar? Anyone have any suggestions? Thanks, ...

Dynamic array of controls
Hey,I am using the MultiView control to create a Wizard style web app. At some point in the Wizard I need the user to input 2 values which correspond to rows and columns. On the next step in the Wizard i proceed to create and put in a View rows*columns textboxes. Here is some of my code:Global declaration:  public TextBox[] textBoxBarCodes;Code to write the textboxes to the view:  textBoxBarCodes = new TextBox[numRows * numCols];        int k = 0;        for (int j = 0; j < numRows; j++)    ...

Trying to load a control into a control from another control
Exactly as the subject states, I'm trying to load a control into another control from a control loaded into a page, I keep getting this error from the code I have below. I've also tried the findcontrol but it keeps coming up null. (67): 'System.Web.UI.UserControl' denotes a 'class' where a 'variable' was expected UserControl ut = ((webcontrols.BrowseItems)UserControl).LoadControl("BrowseItems"); ((webcontrols.BrowseItems)UserControl).pnl_browse_main.Controls.Add(ut); This is how we Load User controls into a content place holder. try { UserCont...

How do you control the placement of controls in a user define control
I have a user define control.  I put the control on the (C# Visual Studio 2008) page where I want them. When I run the program, the controls are all over the page.  How do I place them where they do not move form where I put them? You'll need to study the HTML output and see what it's producing, then start to look at how to do an HTML layout. hi, there are absolute and Relative position in html. I guess you must use relative position. For example, at design-time, you place a TextBox below an Image, at run-time, no matter what size is the image, the TextBox is alway bel...

Reading a user control from another user control
I have 2 user controls on a page. The first one (UserControl1) is called "header.ascx". This contains a drop down list box called "ddlLang". The other user control (UserControl2) is called "menu.ascx". I want this user control to check the value of "ddlLang" in the header user control. How do I do it? Quite stuck at the moment! Thanks hi, even i am stuck to the same problem. what i came to know is 1) You have to find the page of control....(or if u want to hardcore it say its menuholder.aspx) 2) then u can use menuholder.use...

Passing Controls to Controls
I have built a very simple DropDown control similar to what Microsoft uses on their website, and the one listed in the control gallery. This control exposes 2 properties, Title and Text. The code looks something like this: <script> Public PassedTitle as String Public PassedText as String .... .... MyText.Text=PassedText </script> .... .... <asp:Literal id="MyText" /> I also have another control that scans the DB at my workplace and pulls up the last 10 articles that have been posted to the knowledgebase and lists their titles and h...

Control In Control Problem
Hi, guys.I've written two web controls for reservation system.One is a Datepicker which alows user to pick a date (pretty obvious ) and another one is a Reservation which alows user to pick a location (hotel) and number of rooms and number of people in each room.Both of them inherit WebControl and implement ICallbackEventHandler and INamingContainerI bind to them list with available days... List of hotels and regions (if it's to be used for reservation in hotels chain) well... whatever...Both of them work great while I don't try to include the DatePicker in the Reservation... Her...

Upload control / color chart control / calendar control
Does anyone know of an advanced upload control with all the bells and whistles available? The same for a color chart and calendar control. Thank you, Steve About a chart control you can try one I wrote: WebChart Control It is free. Chart FX for .NET is the most advanced charting control for ASP.NET. You can check it out at www.softwarefx.com --- IG Software FX Yep. But Dundas isn't shabby either. DonDon Kiely, MCP, MCSDIn the Last Frontier, Interior AlaskaPlease post questions and replies to the forum! And remember to MARK AS ANSWER when someone defi...

Control InkPicture
Hi! Which Control is used by the InkPicture in PB. Is it the RichInk Control of Microsoft? ...

Controls.Add in Composite Control that inherits another control
Hi! I created a composite control that inherits from the WebControls.Button. I added the following in the Load event:         Dim mHidden As New WebControls.HiddenField        Me.Controls.Add(mHidden) but the control is not created. Why?Dimitris PapadimitriouSoftware Development Professional Hi,Child controls on Button do not make much sense (how would you expect them to be rendered, doesn't button allow only text into value attribute?). Button allows child controls to be added, but they won't be rendered b...

How do you control the menu control?
I am using the ASP 2.0 menu control.  When my submenus display, they display on top of the text that is already there from the content page.  The result is an unreadable mixture of text from both the page and the submenu.  Is there a way to force the submenu text to be on top of the content page's text without showing the content page text?  I don't see a property that can do this.  Thanks. The pop out panels should not be transparent and they should appear on top of the content page (unless the z-index of your controls are greater than 1). Please could you pr...

Web resources about - reading the windowobject Control array Control[] - sybase.powerbuilder.general

Creating a MSN Spaces Type Layout with Prototype
Welcome to Reality V2.0. A weblog talking about the Internet, the Web 2.0 revolution, and important trends in the industry.

Resources last updated: 1/17/2016 11:04:30 PM