-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3985825
By: simon_massey
I have a button that does a page reload:
<button id="reload" label="Reload" onClick="String tmp=inner.src; inner.src=null; inner.src=tmp;"/>
And I have another button that calls some arbitrary zscript that does some work.
After that I want to programmatically lick the refresh button with something
like:
<button id="create-restaurant" label="Create Restaurant"
onClick="createRestaurant(name.value); reload.click()"/>
but that does not work. Is there something that I can do with the event handling classes in my arbitrary createRestaurant(...) function to do the job instead?
thanks!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3986006
By: henrichen
Events.postEvent() to put the event at the end of the ZK event queue and will be called later.
or
Events.sendEvent() to "call" directly the event handler.
See Developer's Guide and JavaAPI for details.
/henri
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=3986238
By: simon_massey
excellent! it worked as follows:
<!-- this button does some work and then sends the current ON_CLICK event to the component with the id 'reload' --> <button id="create-restaurant" label="Create Restaurant"> <attribute name="onClick"> {
// do lots of stuff
Events.sendEvent(reload, event);
}
</attribute>
</button>
<!-- this is the reload button that i wanted to call at the end of the button click that above that did a lot more work --> <button id="reload" label="Reload" onClick="String tmp=inner.src; inner.src=null; inner.src=tmp;"/>
Asked: 2006-10-29 12:48:26 +0800
Seen: 938 times
Last updated: Oct 29 '06