on 01-15-2006 9:22 AM
Hello,
I have a dropdown box which has an event handler for it's onSelect. How can I activate this event handler manually somewhere at the code without the user actually activating it when selecting a value from the box?
Hi Roy,
If you just need to call an event handler, you can call it just like calling any other method, having a null value for the event parameter. Identify the eventhandler for the event you have assigned for the 'onSelect' property. If you have named your event as 'MyEvent' by default the eventhandler created would be something like 'onActionMyEvent(wdEvent event)'. Now you can call this eventhandler anywhere explicitly like 'onActionMyEvent(null)'.
If this is not what you were looking for, pls ignore this post.
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Roy,
<i>The onActionMyEvent I'm calling opens another window</i>
AFAIK, opening new window should be the latest operation for request / response cycle -- at least I saw this references in API docs.
So it seems this is indeed latest operation <b>in error handler</b>, but code that manually invokes this handler has some post-processing, that conflicts with opening window.
Just a guess...
Valery Silaev
EPAM Systems
Hi Roy,
Whenever we try to open a new wndow or confirmation in the wdDoInit(), we get this error. I myself had wanted to ask the forum abt this.
Valery,
If we have a requirement to show a dialog initially when the application loads, where else do we have to write the code? If possible, can you please give us a more detailed picture about why this is happening?
Thanks & regards,
Nibu.
Nibu,
Here is a cut from IWDWindow.open() API docs:
<i>Method opens the window. In the current request/response- cycle, <b>no further manipulations are allowed</b></i>
Actually, I do not know why this happens, but you may use simple workaround for your task -- use Timer UI element with minimal (1 second) delay, in event handler disable timer and show your confirmation window.
Valery Silaev
EPAM Systems
Roy,
1. Place TimedTrigger UI element on view ("Layout" tab)
2. Create attribute Delay in context (type integer)
3. Bind "delay" property of UI control to this attribute
4. Create action handler for "onAction" and assign it to UI control event
5. Do the following in action handler:
-- a. wdContext.currentContextElement().setDelay(0) -- this disables trigger
-- b. open confirmation dialog / other internal window
6. In wdDoInit write wdContext.currentContextElement().setDelay(1) -- to activate trigger
Valery Silaev
EPAM Systems
Hi,
Create another event and use the same eventhandler for this event also.
In your code whenever you want to activate this eventhandler, raise this custom event.. !
But why do u need this ? instead .. u can check some condition in the onselect event handler and call another function appropriately.
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Bharathwaj,
Thank you for your response, but why do I need to create another event handler, can't I simply use that one that was created for the onSelect already?
The reason I need this is because onSelect of combo1 I change the values on combo2 and on Init I would like that combo2 will contain already values when I set combo1 it's default value from the list...
Roy
Hi,
In the view, we have layout,implementation,action, etc.,
Select action -> New -> action .
While creating the action , it will by default have "use default" event handler selected.
Instead select "use existing" and select the event handler used for dropdown.
Now in your code call this action. Or in case of events.. u have to go the controller.. create a event ,move from controller to view and make it overtly complex manner.. !
Regards
Bharathwaj
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.