triggering events of a window control from another window

Hi,
I'm trying to trigger the "clicked" event of a command button on a window
from another window.
I made it by using a child window with this script in its close event:

    parentwindow().control[2].triggerevent("clicked")

This works but I must know the index (in this case 2) of the control[] array
in the first window associated with the command button.
I would like to know how to obtain this index at runtime,
or if there is another way to do the same without using a child window with
the "parentwindow().control[]" notation.

Thanks


0
MicheleCS
11/23/2001 2:39:52 PM
sybase.powerbuilder.objects 3160 articles. 0 followers. Follow

1 Replies
607 Views

Similar Articles

[PageSpeed] 53

To do what you're asking, you can loop through the parentwindow's control
array and find the TypeOf and/or ClassName of each control to see if it's
the button you want. But what most here in the newsgroup would suggest is
this:
Create a window function or event on the parentwindow. Have the button
trigger this function/event. Then, your child window's close event could
trigger the same function/event. That way, your child window doesn't need to
know what's on the parent (OO concept here), but can just ask the parent to
do something.


"MicheleCS" <a@a.it> wrote in message
news:5OYdb3CdBHA.234@forums.sybase.com...
>
> Hi,
> I'm trying to trigger the "clicked" event of a command button on a window
> from another window.
> I made it by using a child window with this script in its close event:
>
>     parentwindow().control[2].triggerevent("clicked")
>
> This works but I must know the index (in this case 2) of the control[]
array
> in the first window associated with the command button.
> I would like to know how to obtain this index at runtime,
> or if there is another way to do the same without using a child window
with
> the "parentwindow().control[]" notation.
>
> Thanks
>
>


0
Bug
11/26/2001 1:32:02 PM
Reply:

Similar Artilces:

Fire an event of a window from a control of another window.
Good afternoon everyone, Is it possible to fire an control's event of a window from another different window's control. i.e. I have window A and window B. Window A has a Save button and window B has a Find button. What I want to do is When I hit Save button in Window A, this action should fire the clicked event in the Find button of the other Window. Any comment is appreciated. Thank you in advance. Sonny In article <36AF78DA.655628C1@erols.com>, sonnydo@erols.com says... > Good afternoon everyone, > > Is it possible to fire an control's event...

Windows handle of a PowerBuilder object in WINDOW XP
Hi all, I have powerbuilder application. In the pb code flow if handle(w_win) >0 then //message end if ; When I try to run an executable version of my PB application in windows xp operating system, I am getting following error message and application crash. Error text = Unresolvable external w_win when linking reference. "handle" function support windows XP operating system ? Thanks Leela ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp Sure does. pbm_thisusuallydoesnothelp:-)) Philip Salgannik ...

How to Control a Window from other Window
Hi, I have a window with a complex customer datawindow report (wr_report.dw_report)... Now, I need to automatize the printing of these reports. I will try explain in a simply way.... I've created a "controler window" with a reference to the "report window" w_report wr wr = create w_report I assing values from the "controler window" to the "report window". wr.t_from = x wr.t_ultil = y wr.t_customer = z wr.load_data() wr.print_data() On Debug I can see the parameters are right...

How do I trigger an event in another window?
I have a window with a grid style datawindow. For inserts into this table, the users now have to insert one at a time, but want to be able to perform multiple inserts. I have a response window that allows them to select multiple rows to insert, and I had planned on using the existing ue_insertrow event to do this, but can't quite figure it out. My 'base' and 'response' windows both inherit from a framework. Thanks in Advance, Jason Jason Vargas wrote: > > I have a window with a grid style datawindow. For inserts into this > table, the users now ...

design probelm
Dear All, I'm facing a design problem on a project I'm doing and was wondering if someone has some ideas on whether it is possible to implement the following in ASP.NET using VB.It is regarding the transfer of data between a webpage in a window to another webpage in another window, both originating from the same server witihn the same ASP app.Never done this before and have no idea how to do it and by now I'm questioning if it can be done the way I have in mind. I have a page named search.aspx (window 1) where I want the result set to appear. I have three options to look f...

weird...doubleclick in modal window triggers event in parent window
Hi all I have a window with a dw. In that dw is a button that when pressed brings up a response window with a dw providing a list to choose from. Users doubleclick the right value and the window is close with the value returned. All works as planned however whats happening is if you doubleclick on a row that just happens to be directly over the button on the parent window the value gets returned but the underlying button event fires again and reinstantiates the window. I can replicate this and only if the row is over the button. It's almost as if the second half of the ...

trigger an event of a window from a tab control.
good afternoon everyone, How would trigger an event of a window when I am in a datawindow of a tab control. i.e. I have an event "ue_addmat" in a window, and I am in a datawindow's itemchanged event of tab control. I want to trigger the ue_addmat from this itemchanged event but could not succeed. Please provide me some hints. This is my code in the itemchanged event: ls_col_name = tab_case.tabpage_material.dw_3.getcolumnname() if ls_col_name = "specimen_add_mat_flag" then //Check for additional mat. ls_add_mat = tab_case.tabpage_material.dw_3.object.s...

Using Isvalid( object in another window ) teminates appln when window is invalid
Using Isvalid() to check if an instance variable of datatype 'datastore' declared another window teminates application when that window is not opened during run time. e.g. ---I've coded the following--- { In w_window1, Declare Instance Variables: datastore ids_1 } { In w_window2 clicked event, IF IsValid( w_window1.ids_1 ) then messagebox('','') } ---Problem Scenerio--- Open only w_window2, click on w_window2, Application Terminates! ---How i Temporary coded to Solve it using extra check on validity of w_window1--- { In w_window2 clic...

Using Isvalid( object in another window ) teminates appln when window is invalid
Using Isvalid() to check if an instance variable of datatype 'datastore' declared another window teminates application when that window is not opened during run time. e.g. ---I've coded the following--- { In w_window1, Declare Instance Variables: datastore ids_1 } { In w_window2 clicked event, IF IsValid( w_window1.ids_1 ) then messagebox('','') } ---Problem Scenerio--- Open only w_window2, click on w_window2, Application Terminates! ---How i Temporary coded to Solve it using extra check on validity of w_window1--- { In w_window2 clic...

Using Isvalid( object in another window ) teminates appln when window is invalid
Using Isvalid() to check if an instance variable of datatype 'datastore' declared another window teminates application when that window is not opened during run time. e.g. ---I've coded the following--- { In w_window1, Declare Instance Variables: datastore ids_1 } { In w_window2 clicked event, IF IsValid( w_window1.ids_1 ) then messagebox('','') } ---Problem Scenerio--- Open only w_window2, click on w_window2, Application Terminates! ---How i Temporary coded to Solve it using extra check on validity of w_window1--- { In w_window2 clic...

Can I use Windows Standard GroupBox Control (Container objects) in Window Painter?
Can I use Windows Standard GroupBox Control (Container objects) in Window Painter? If that is sure, how to do? No. You can add the groupbox in script. That said, the PB groupbox is a windows control wrapped in a PB class. Is there a specific reason why the PB groupbox control is not meeting your needs? /ck "Netforum's Client" <netforum@netforum.com> wrote in message news:QRNxvavgBHA.335@forums.sybase.com... > Can I use Windows Standard GroupBox Control (Container objects) in Window > Painter? > > If that is sure, how to do? > &g...

opening javascript window in new window leaves [object] on parent window
   Hi All, I have written javascript window to open page in window as follows 'javascript:window.open('+''+'"Planning.aspx?PCODE='+GridRowColumnValue("PLAN_TRANSACTION.PRODUCT_CODE")+"&"+'MCODE='+ GridRowColumnValue("PLAN_TRANSACTION.CMCODE")+"&"+'MONTH='+Cstr(ToNumber({?MonthTo}))+"&"+'YEAR='+Cstr(ToNumber({?YearTo}))+"&"+'SBU='+Cstr({?SBU})+'","W",'+''+'"toolbar=no, directories=no, location=no,status=ye...

How to assign a window to Window Object
dear all, i have used the script below to create a window object window lw_window lw_window = w_main //w_main is a window in the application lw_window.show() however, it said "null ohject reference" when rearch this script. how can i assign the window to the window object thx a lot need if w_main is not exist.... lw_window = create w_main or... need this too... w_main lw_window Good Luck <Victor> �b�l�� news:3f6fea88.68ef.846930886@sybase.com �����g... > dear all, > i have used the script below to create a window object > > window lw...

Having one Window over another window?
Hi Everybody, I was wondering, how do I make a Window appear on top of another window? Joe That question is a little vague, could you be more specific about what you are trying to do? John On Tue, 3 Jul 2001 16:14:22 -0700, in powersoft.public.powerbuilder.general Joe Munoz <joemunoz@idealease.com> wrote: >Hi Everybody, > >I was wondering, how do I make a Window appear on top of another window? > > ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp Joe Assuming that your popup window is already...

Web resources about - triggering events of a window control from another window - sybase.powerbuilder.objects

White policeman kills black teen in St Louis, triggering fresh protests
A white off-duty policeman shot and killed a black teenager in St Louis triggering a night of protests just kilometres from the site of another ...

Court ponders 'trespass' by triggering iPad alarm
A court has been asked to decide whether a man trying to find his allegedly stolen iPad was acting unlawfully when he tracked it down to a north ...

Information overload is triggering Alzheimer’s fears among the ‘worried well’ say doctors
INFORMATION overload is convincing people they have Alzheimer&#8217;s disease when their brains are simply reaching their processing limits. ...

White policeman kills black teen in St Louis, triggering fresh protests
Sydney Morning Herald White policeman kills black teen in St Louis, triggering fresh protests Sydney Morning Herald A white off-duty policeman ...

White policeman kills black teen in St Louis, triggering fresh protests
A white off-duty policeman shot and killed a black teenager in St Louis on Wednesday, officers said, triggering a night of protests just miles ...

OPEC keeps oil output on hold, triggering price slump
OPEC has decided against cutting the amount of oil it produces despite a glut in global supplies, triggering a five-dollar collapse in crude ...

MH17: Abbott government may declare downing of plane a terrorist attack, triggering payments to families ...
The federal government is considering declaring the MH17 disaster a terrorist attack, which would trigger payments of up to $75,000 to the families ...

Nepal earthquake: Aftershock measuring magnitude 6.7 hits region, triggering more avalanches on Mount ...
A magnitude-6.7 aftershock hits earthquake-devastated Nepal, triggering more avalanches on Mount Everest.

Refugee crisis: Hungary reopens Budapest train station, triggering new standoff
Thousands of people desperate to reach Western Europe rushed into a Budapest train station Thursday after police ended a two-day blockade, setting ...

Strong quake hits Japan near Fukushima, triggering small tsunami
A 6.8-magnitude earthquake hit Japan's northern coast near the nuclear power plant crippled in the 2011 earthquake and tsunami.

resources last updated: 11/20/2015 8:09:35 PM