Executing code after a transition has finished
Hi,
Is there any kind of language construct in JavaFX to allow a certain block of code to be executed after a transition has finished? Or do I have to pause the current thread with sleep() or similar?
The ideal would be something like this, but of course such a thing like onComplete does not exist AFAIK:
FadeTransition {node: selectedNode duration: 1s fromValue: 1 toValue: 0 onComplete: executeThis()}.play();
Hello,
By "delete node" you mean delete it from scene? This example works for me:
var stage: Stage = Stage {
width: 250
height: 250
scene: Scene {
content: [
text = Text {
layoutY: 30
opacity: 0.0
content: "Example transition"
Button {
layoutY: 70
text: "Click me"
action: function() {
FadeTransition {
node: text
fromValue: 0.0
toValue: 1.0
duration: 200ms
action: function() {
delete text from stage.scene.content;
}.play();
}Saa
Similar Messages
-
Adf valueChangeListener autosubmit=true, execute code after update model
Hello.
I'm working with the valueChangeListener and autosubmit="true". I'll try to explain my situation
with an example.
jsp:
<af:form>
<af:panelForm>
<af:inputText
id="value1"
label="Value1"
value="#{index.myObject.value1}"
autoSubmit="true"
valueChangeListener="#{index.changeListener1}"/>
<af:inputText
id="value2"
label="Value2"
value="#{index.myObject.value2}"/>
</af:panelForm>
</af:form>
backing:
public class Index {
private MyObject myObject;
public Index() {
myObject = new MyObject();
public void changeListener1(ValueChangeEvent valueChangeEvent){
doSomethingWithMyObject(myObject);
// ... get/set of myObject
MyObject:
public class MyObject {
private String value1;
private String value2;
public MyObject() {}
//getters/setters...
}In the line doSomethingWithMyObject(myObject) i need myObject with the actual values in the user form.
in the example above, the first time the page is rendered and shows the inputs
if the user captures something in the 1st input and then hits the tab to go to the other input
the valueChangeEvent is fired, and the code in "index.changeListener1" executed, but at this moment
the model (myObject) hasn't been updated with the data that the user entered (Validation Phase).
So i need a way to execute my code called from the "valueChangeEvent" but after the model has been updated
Some notes about my problem:
- The doSomethingWithMyObject(myObject) could update data in myObject
- About binding="#{x.y}":
I know i can use the binding attribute in the tag <af:inputText binding="#{x.y}"> and then in the code of
the changelistener the binded component always have the most recent value from the user,
but i cant' use that, the method needs a MyObject instance.
- I don't think create a new instance of MyObject and populate it every time the event fires is a good way
- doSomethingWithMyObject" is a black box, so i don't know what is going to do with myObject
- In my problem there are more than 2 inputs there will be N components M listeners.
What I'm trying:
PhaseListener:
I have been implementing a solution with a PhaseListener like
public void afterPhase(PhaseEvent phaseEvent) {
// just after UPDATE_MODEL_VALUES phase
FacesContext f = FacesContext.getCurrentInstance();
Index i = (Index) f.getApplication().createValueBinding("#{index}").getValue(f);
// at this point the model is updated
doSomethingWithMyObject(i.getMyObject);
public PhaseId getPhaseId() {
return PhaseId.UPDATE_MODEL_VALUES;
this works but i don't know if this is the answer according to this post (unanswered at this time):
http://forums.oracle.com/forums/thread.jspa?threadID=611643
says something about that PhaseListener is not thread safe and blocks the application with more
than 1 user.
A wrapper:
using the controls binded to the backing
public class Index {
private MyObject myObject;
private CoreInputText inputValue1;
private CoreInputText inputValue2;
//listener
//getters/setters
} make a wraper like
public class MyObjectW {
private Index index; // wrap the backing index
public MyObjectW(Index index) {
this.index = index;
public String getValue1(){
return (String) index.getInputValue1().getValue();
public String getValue2(){
return (String) index.getInputValue2().getValue();
public void setValue1(Object v){
index.getInputValue1().setValue(v);
public void setValue2(Object v){
index.getInputValue2().setValue(v);
}and then call in the index backing:
doSomethingWithMyObject( new MyObjectW(this)); so it will access to the most actual values from user at the valueChangeEvent
But i really would like some way to execute my code called from the "valueChangeEvent" but after the model has been updated
so i dont need to wrap or implement PhaseListener
what do you think, what do you suggest, have any solution or a way to do what I'm trying?
thank you for your help...
Message was edited by:
akanewstedHello Frank, thanks for the response.
When you say
"If you need an updated object in this listener then you can update it from the value change listener as well"
you mean i can update the object by myself with the value from getNewValue()? or is there another way
to call to update the models at this time ?
I know i have the methods "getOldValue()" and "getNewValue()" in the "ValueChangeEvent" but what if i need
the actual value from the user in other control than the one that fires the event
example
Two inputs:
in the input1 the user enters some data
in the input2 when some data is entered it fires valueChangeListener (autosubmit=true)
in that case what if i need the value the user just entered in the input1 in the valueChangeListener of
the input2.
In general the app I'm working must do:
dynamically generate the controls in the form (inputs, selects etc)
Attach the control values to a model ( <af:inputText value=#{model.x}"/>
sometimes execute some script when a value change in a control (valueChangeListener)
those scripts uses the model (and needs to be an updated model)
script = " if (value2 = 'xyz') then value1='abc'; return true;";
if the model is not updated
the script will use old values and will be wrong
or if the script change some value in the model, when the update model phase occurs the value from
the script is lost.
that's why i need to work directly with the model and not the values in the ValueChangeEvent
Is there a way to use something like an action in the change of a control value?
that way the code will execute in the invoke application phase, can this be done ?
how i can execute code in the invoke application when a valueChangeEvent occurs ?
hope this help to explain more my situation.
Thank you for your help and time. -
(MCTE) .onRollOut after .onRollOver animation has finished
Hey, so I'm trying to build a website full of these flipping
movieclips that flip when you mouse-over them, and flip back when
you mouse out. Problem is, if you mouse out before the flip
animation has finished, the flipped side stays up, and you have to
return the cursor over the mc and mouse-out again. I am using
Jumpeye Components' MCTE V3 as well as the Flip pattern for this,
in AS2, but I think this is an AS thing not a MCTE problem. I've
attached the flipping code for one of the movie clips.
Any help is greatly appreciated.
Thanks,
Matt
Code:You can do this by calling up the different edge Animate composition html pages using buttons and an iframe:
To get a general idea, put this in the body of an html page and insert your own URLs where indicated
<iframe id="iframeID" src="yourFirstURL" width="640" height="480">
<p>Your browser does not support iframes.</p>
</iframe>
<button onclick='loadIframe("iframeID", "firstAnimURL")'>First Animation</button>
<button onclick='loadIframe("iframeID", "secondAnimURL")'>Second Animation</button>
<button onclick='loadIframe("iframeID", "thirdAnimURL")'>Third Animation</button>
<script>
function loadIframe(iframeID,url) {
//alert("Hello");
document.getElementById("iframeID").src = url;
</script>
Peter Small -
Execute code after show() in a Modal JDialog
Is there any way of executing a piece of code after a Modal JDialog's show() method ? I tried to run the code using SwingUtilities.invokeLater to no use. Any ideas ?
Thanks !Thanks Jamie !
Adding a new thread wasn't required. I found the solution in some forum. The main issue was to get focus to a textfield in JDialog along with displaying a JPopupMenu against it. I could get the focus in but the popup wasn't showing. In brief this is what solved it.
Assuming JTextField is testField. I add this listener to the textField just before calling JDialog.show().
<code>
private FocusListener fListen = new FocusListener()
public void focusGained(FocusEvent e)
// showPop() logic
public void focusLost(FocusEvent e)
testField.removeFocusListener(fListen);
testField.requestFocus();
</code> -
How to execute code after JSF startup?
Hello,
I need to execute some initialization code after JSF startup, so I cannot do the usual ServletContextListener trick, as that runs before JSF is completely initialized. Any ideas?
Kind regards,
UlrichI can think of one way to do this (which might be a bit cumbersome for what you are trying to do) : use the Spring framework's web integration classes.
You can specifiy a context listener in your web.xml :
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
That way, Spring will load an ApplicationContext, and in that context you can specify a Spring bean that will be instantiated at application startup, which will perform whatever logic you need to do.
More info here :
http://static.springframework.org/spring/docs/2.0.x/reference/webintegration.html -
Stopping after each song has finished
Is it possible to set up the iPod shuffle so that when a song has finished playing it stops/pauses. Instead of continuing to the next song?
Haven't tried it on a shuffle, but here is an idea.
In iTunes, set up a playlist of the stuff you want on the shuffle. Now UNCHECK all the boxes in front of those songs. Also select all then do a get info and check the box to "skip when shuffling". I am not sure if that setting will effect how the songs play on the shuffle or not, but worth a try. If the shuffle does use that setting, then when you play a track, it should stop after that track since all the songs on the shuffle are unchecked and will be skipped.
Patrick -
Execute code when task flow is finished
I have two task flows: TFBrowseRecs and TFUploadFile.
I initiate calling of TFUploadFile from view (by af:button) inside TFBrowseRecs.
TFUploadFile has return-value-definition which is is used to return value which is created in TFUploadFile.
TFUploadFile is opened as new transaction as Dialog and has two task-flow-return activites, one as <commit/> and other for <rollback/>.
When <commit/> activity occurs I can pass return value back to TFBrowseRecs successfully.
I want also to execute some code/action in TFBrowseRecs immediately when TFUploadFile is finished (insert new record into VO).
I think, I can define EL for method call inside <after-listener> which is defined inside TFBrowseRecs, but I can't find any useful example for this approach.
Btw, I could execute this code/action inside TFUploadFile but I want that TFUploadFile is black box for TFBrowseRecs and other TFs.
1. Is this approach OK?
2. Can you show some example how such a method should look like
Regards,
Sašo
Edited by: Sašo C. on 29.9.2011 0:36I doubt finalizer is right place regarding my requirements:
I want called TF (TFUploadFile) to be black box for calling TF (TFBrowseRecs). In TFUploadFile I just insert row in one VO and return ID of inserted row to TFBrowseRecs.
What do you think?
Regards,
Sašo -
Execute code after Spry region redrawn / added to DOM
Hi,
I'm integrating my Spry event data with a YUI calendar.
Everything is working and event dates are highlighted on the YUI calendar. There is one last thing I wish to do which is to update the YUI calendar with a Spry Tooltip. The div regions for the tooltip text are generated dynamically by via a Spry repeating region. What I am failing to do is attach the tooltips to the YUI calendar after the Spry repeating region has been added to the docuement DOM. So the Spry Tooltip function cannot find the ID of the tooltips.
I have a dataset observer "onpostload" which seems to fire when the data is loaded but before the document dom has been updated by Spry. How can I ensure I wait for Spry to update the region and hence DOM with the new data before triggering the tooltip code?
Cheers
PhilYou got different kind of observers in Spry Data.
- Dataset observers:
datasetname.addObserver( observer )
- Spry Region Observers:
Spry.Data.Region.addObserver( 'region-id', observer );
The dataset observers send out notifications when there is a event happening inside the Spry Data Sets. The one you mentioned is part of this (onPostLoad). These are great to monitor your data changes, but in your case. You don't want to use these.
The Spry region observers respond to events that are happening in side the region. For example onPreUpdate, this event is called when the region is about to generate / insert new markup in to your region. But you also got the onPostUpdate. This is the observer you are looking for, it gets called once the region has re-generated its code / html. It gets fired directly after the new HTML has been inserted.
Small note about the region observers, these require a id= attribute. This id attribute must be placed on the same element as the spry:region. To learn, and read more about the observers i would like to referrer you to this article:
Data Set and Region Overview
Its rather large, but using the browser build in find function you should be able to locate the sections about the observers
Hopes this helps, -
How to crosscheck backup after Netbackup backup has finished
Hello,
I would like some help with the following issue.
We make database backups with Netbackup, using the rman catalog during the backup.
I want to do a crosscheck after the backup finished.
What is the method of implementing this in Netbackup?
Can this be done, or do i need to schedule separate scripts myself?
Any help is appreciated.
Regards,
HarryWith "crosscheck" i mean running the following RMAN commands
allocate channel for maintenance device type 'SBT_TAPE';
crosscheck archivelog all;
crosscheck backup;
delete noprompt expired archivelog all device type 'SBT_TAPE';
delete noprompt expired backup device type 'SBT_TAPE';
release channel;
You run these commands to remove old records out of the rman catalog
I want to run these commands after the regular backup is finished by de Netbackup job.
regards,
Harry
Edited by: 947596 on 22-aug-2012 6:23 -
How to trigger an action after a FLV has finished playing
I have a FLV file that I am pulling into my SWF and I want to
go to the next scene in the SWF once the video clip is finished
playing... Because it's externally loaded I haven't been able to
figure out how to do this. I tried just importing the FLV to the
stage and putting it in the timeline, but that makes the SWF huge
and the video playback is much slower for some reason.
Does anyone know how to do this?Read in the duration metadata from the FLV so you know how
long the video clip is, then just check to see if the movie's
current time is >= to the total time. Don't use the prebult
media player components, write your own player. Check out
www.gotoandlearn.com for some great easy tutorials on this. -
If you buy the 4S on contract for AT&T, pay the early term fee and want to go to sprint with your 4S, is this possible?
No. It's not up to Apple. It's up to the carrier it is locked to. Regulations vary from country to country as to whether carriers are required to unlock phones. In the U.S. carriers are NOT legally required to unlock phones, therefore, they will not.
-
IPhoto keeps crashing after 'repair' has finished
iPhoto 11 9.2.1 consistently crashes even after the 'repair' has finished
HELP!!
Never had a problem with iPhoto10Same thing is happening to me. I upgraded last night and it worked fine. I marked some "Faces" and all was well. I turned on Photo Stream and it's crashed consistently every time since. Here is the error code. I hope I kept it close to 50 lines.
Process: iPhoto [4552]
Path: /Applications/iPhoto.app/Contents/MacOS/iPhoto
Identifier: com.apple.iPhoto
Version: 9.2.1 (9.2.1)
Build Info: iPhotoProject-628000000000000~1
App Item ID: 408981381
App External ID: 4641130
Code Type: X86 (Native)
Parent Process: launchd [222]
Date/Time: 2012-02-20 11:37:28.924 -0500
OS Version: Mac OS X 10.7.3 (11D50b)
Report Version: 9
Interval Since Last Report: 22961 sec
Crashes Since Last Report: 6
Per-App Interval Since Last Report: 5505 sec
Per-App Crashes Since Last Report: 6
Anonymous UUID: 08841BF0-1204-404D-8E20-3F6B7B501A42
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
VM Regions Near 0:
--> __PAGEZERO 0000000000000000-0000000000001000 [ 4K] ---/--- SM=NUL /Applications/iPhoto.app/Contents/MacOS/iPhoto
__TEXT 0000000000001000-0000000000d1b000 [ 13.1M] r-x/rwx SM=COW /Applications/iPhoto.app/Contents/MacOS/iPhoto
Application Specific Information:
objc[4552]: garbage collection is OFF
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.iPhoto 0x00824501 0x1000 + 8533249
1 com.apple.iPhoto 0x001678d6 0x1000 + 1468630
2 com.apple.Foundation 0x9ca86e25 __-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_1 + 49
3 com.apple.CoreFoundation 0x98ed3cb3 ___CFXNotificationPost_block_invoke_1 + 275
4 com.apple.CoreFoundation 0x98e9ea38 _CFXNotificationPost + 2776
5 com.apple.Foundation 0x9ca72012 -[NSNotificationCenter postNotificationName:object:userInfo:] + 92
6 com.apple.Foundation 0x9ca872a6 -[NSNotificationCenter postNotificationName:object:] + 55
7 com.apple.iPhoto 0x0016716a 0x1000 + 1466730
8 com.apple.iPhoto 0x00167111 0x1000 + 1466641
9 com.apple.iPhoto 0x0015c6f4 0x1000 + 1423092
10 com.apple.CoreFoundation 0x98eebb6d __invoking___ + 29
11 com.apple.CoreFoundation 0x98eebaa9 -[NSInvocation invoke] + 137
12 com.apple.RedRock 0x01d59e61 -[RKInvoker _invokeTarget:] + 33
13 com.apple.CoreFoundation 0x98ee8de1 -[NSObject performSelector:withObject:] + 65
14 com.apple.Foundation 0x9cac3e40 __NSThreadPerformPerform + 503
15 com.apple.CoreFoundation 0x98e603df __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 com.apple.CoreFoundation 0x98e5fd96 __CFRunLoopDoSources0 + 246
17 com.apple.CoreFoundation 0x98e89c68 __CFRunLoopRun + 1112
18 com.apple.CoreFoundation 0x98e8947c CFRunLoopRunSpecific + 332
19 com.apple.CoreFoundation 0x98e89328 CFRunLoopRunInMode + 120
20 com.apple.HIToolbox 0x921e417f RunCurrentEventLoopInMode + 318
21 com.apple.HIToolbox 0x921eb412 ReceiveNextEventCommon + 168
22 com.apple.HIToolbox 0x921eb356 BlockUntilNextEventMatchingListInMode + 88
23 com.apple.AppKit 0x904a7a9c _DPSNextEvent + 678
24 com.apple.AppKit 0x904a7306 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 113
25 com.apple.AppKit 0x904a3675 -[NSApplication run] + 911
26 com.apple.AppKit 0x90737261 NSApplicationMain + 1054
27 com.apple.iPhoto 0x0001159a 0x1000 + 66970
28 com.apple.iPhoto 0x00010a29 0x1000 + 64041 -
Time taken to execute code vs time taken to render to screen....
Hello Experts,
I noticed something strange while debugging some of my code.
I have a for loop in which I'm creating and adding node elements. Above the for loop I'm creating a modal window, and after the for loop I'm destroying the modal window. In the modal window I have a timedtrigger element with a delay of one second.
Here is the pseudocode:
createModalWindow();
for(int i=0; i<200; i++)
// create and add node elements
destroyModalWindow();
Inside the modal windows wdDoInit() method I enable the timedTrigger, inside the wdDoExit() method, I disable the timedTrigger.
When I execute this code I get a null pointer exception because the application is trying to destroy a window instance that doesn't exist!!! ie the modal window. When I comment out the destroyModalWindow() line, I noticed that the modal window get rendered after the loop has finished its processing not before like I'd expect. Could this mean the line destroyModalWindow(); is being called too early? Once the loop has processed there might be some clinet / server delay?? Another thing I noticed was the timed trigger event, even though its set to a 1 second delay, takes about 6 seconds on a round trip from the client to Web Application Server!!!! So even though on the WAS its processing it every second, it takes almost 6-7 seconds for it to render on the client browser!
Has anyone else noticed this delay in rendering to code execution? Is it possible the Web Dynpro may terminate earlier than expected or sometimes we might not even see the results because time taken to render is slower than time taken to process request?
What are peoples' thoughts?
MMSorry if I misinterpret your question...
Remember Web Dynpro is server side technology. So no actual rendering happens at all until all code has been executed, then wdDoModify is called, and then output is generated and sent to the browser for rendering. Of course I can't see your code in it's completion, but the modal window should never display under any circumstances, as the call to create() and then destroy() happen within the same execution cycle, from what I can tell of your snippet. -
Running jquery code after button submits successfully.
All,
I need help with running a jquery code after submit button has successfully completed, how do i integrate these 2 events ? clicking the submit button and if submits successfully execute the small jquery code based on the same submit button,
thanks & regardsHi,
It seems you have not done to example what I did propose.
Create new hidden item to your page e.g. P15_PROMT.
Create process that fires on submit after validations and sets item P15_PROMT value to "Y".
Create on dynamic action that fires on event page load. That dynamic action should execute your jQuery code.
Set dynamic action conditionally by P15_PROMT value "Y".
You need also clear item P15_PROMT value, so that dynamic action do not fire every time when you access to page.
Regards,
Jari
My Blog: http://dbswh.webhop.net/htmldb/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai
Edited by: jarola on Jan 28, 2013 6:52 AM -
[SOLVED]start a service *AFTER another one has executed completely
How can i make "test.service" to start after "customstartup.service" has been fully executed?
As you can see, even if test.service Requires customstartup and customstartup.service is "oneshot", test.service is started while customstartup is still starting!
The following is in a linux container:
[root@archiso ~]# cat /etc/systemd/system/customstartup.service
[Unit]
Description=customstartup
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/sleep 100
[Install]
WantedBy=multi-user.target
[root@archiso ~]# cat /etc/systemd/system/test.service
[Unit]
Description=test
Requires=customstartup.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/sh -c "echo hi all"
[Install]
WantedBy=multi-user.target
# systemctl status customstartup
● customstartup.service - customstartup
Loaded: loaded (/etc/systemd/system/customstartup.service; enabled)
Active: activating (start) since gio 2014-07-03 16:30:10 CEST; 12s ago
Main PID: 32 (sleep)
CGroup: /machine.slice/machine-root\x2dimage.scope/system.slice/customstartup.service
└─32 /usr/bin/sleep 100
[root@archiso ~]# systemctl status test
● test.service - test
Loaded: loaded (/etc/systemd/system/test.service; enabled)
Active: active (exited) since gio 2014-07-03 16:30:10 CEST; 23s ago
Process: 26 ExecStart=/usr/bin/sh -c echo hi all (code=exited, status=0/SUCCESS)
Main PID: 26 (code=exited, status=0/SUCCESS)
CGroup: /machine.slice/machine-root\x2dimage.scope/system.slice/test.service
lug 03 16:30:10 archiso sh[26]: hi all
lug 03 16:30:10 archiso systemd[1]: Started test.
Any hints? Is there a way to enforce the wait?
Thanks.
Last edited by kokoko3k (2014-07-03 15:59:37)From systemd.unit:
Requires=
Configures requirement dependencies on other units. If this unit gets activated, the
units listed here will be activated as well. If one of the other units gets
deactivated or its activation fails, this unit will be deactivated. This option may be
specified more than once or multiple space-separated units may be specified in one
option in which case requirement dependencies for all listed names will be created.
Note that requirement dependencies do not influence the order in which services are
started or stopped. This has to be configured independently with the After= or Before=
options. If a unit foo.service requires a unit bar.service as configured with
Requires= and no ordering is configured with After= or Before=, then both units will
be started simultaneously and without any delay between them if foo.service is
activated. Often it is a better choice to use Wants= instead of Requires= in order to
achieve a system that is more robust when dealing with failing services.
Maybe you are looking for
-
I have two Domain Controllers Main ( Main DC ) and Second DC. the date of some policies is not out of date.... please check these files to know the problem. dcdiag.txt output: Directory Server Diagnosis Performing initial setup: Trying to find hom
-
1099 payments are not combined for same vendor payments
Hi All I have a question on 1099 reporting. My issue is that we are running the report in transaction code s_p00_07000134 separately by company code because all these company codes have separate tax ids except few of them which have same tax ids. M
-
Global rules are not working after installing CS10gR35CoreUpdate component
Hi, I am facing a problem in content server with Global rules. They are working fine previously but after installing CS10gR35CoreUpdate in content server they stop working. Got No errors in logs, And now if i try to uninstall this component then cont
-
How to validate BC forms to stop spam
I'm having a problem on a couple of my sites - even though we have standard BC validation and captcha's in place my forms are being propogated by spammers. http://tasbus.com.au/member-application.htm - on this site the spammers are completing the com
-
How do i bring an image into photoshop?
how do i bring an image into photoshop?