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?
MM
Sorry 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.
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. -
Executing code in NetBeans 3.5.1
Hi,
I've been using my own custom Ant scripts within NetBeans to compile code, generate various descriptors and create archive files. I really like using Ant; the only reason I even use an IDE is for editting--it's nice having its spell checking functionality, etc. However, to execute and debug code, I go straight to the command prompt to run my jar. But now I'd like to take the next step: execute and debug un-jarred code within NetBeans.
Executing code works fine within NB if I don't use packages. However, when I use packages, I get NoClassDefFoundErrors for dependencies. That is, my main class gets found, but its dependencies do not.
Can someone please show me how it's done in NB 3.5.1? Also, should I create an Ant task to execute my code from within the IDE?
D:\
----+com
--------+myco
------------+myapp
----------------+myMain.java /*this does get found*/
------------+mydep
----------------+myDependency.java /*this does not get found*/
I've searched the NB website, but there is just too much stuff to wade through. And of course, I've searched the forums here too. I'd appreciate any help! Thanks!
PGyntHi,
Thanks for replying!
the d:\ folder needs to be mounted as a filesystem.Please see expanded structure below.
All dependency classes need to be compiled
(add them to the project and build all).I'm using Ant to compile within NetBeans. It creates a build directory which mirrors the source code directory structure. Package names are same as directory structure. It all runs fine within a jar, but only outside of NB. Below is an expanded version of my structure. Maybe it will make things clearer.
If you like ANT, maybe you should
upgrade to netbeans 4.1 because it uses ANT as it's
build engine.Sounds good, but it's not in our budget for now. Changes always take so much time.
D:\
----+application/*this directory is mounted and added to project*/
--------+src /*this directory is mounted and added to project*/
------------+com
----------------+myco
--------------------+myapp
------------------------+myMain.java /*this does get found*/
--------------------+mydep
------------------------+myDependency.java /*this does not get found*/
--------+build
------------+com
----------------+myco
--------------------+myapp
------------------------+myMain.class /*this does get found*/
--------------------+mydep
------------------------+myDependency.class /*this does not get found*/
Is it necessary to add classes to a project for executing a program? Or is mounting the relevant directories enough?
Again, I'm used to using Ant directly, so I'm sorry if that sounds like a dumb question.
PG -
Execute code when IE Browser closes
Help! I'm trying to find a way to run a SQL statement when a user closes a IE window (X's out). I've found information on the onBeforeUnload event but I've been unsucessful at getting it to run.
Does anyone have another suggestion? Is it even possible to execute code upon closing a window?
Thanks!!!Thanks ilssac. I figured this was the case based on my research but I thought I'd present it to the Forum just to be sure.
Basically, I've been asked to limit the number of logins to a small Coldfusion application. I've coded it so that I increment a counter in the DB and I decrement it when the user logs out properly (by clicking a logout link). But if the user just closes the window then the decrement doesn't happen and this created problems.
If you have any suggestions I would really appreciate it.
Thanks for your time!!!! -
Restrict Time characteristic filter at selection screen
Hi,
I am trying to find out a solution for the below typical requirment which i have in my project.
The scenario is as follow:
I have a BEx report with many characteristics in the selection screen. There are three time characteristics in the selection screen based on which the report can be executed. The three time chars are CALDAY, CALMONTH and CALWEEK. Now the requirement is that we need to provide a functionality to the user to select only one of the three time char i.e. they can either input date filter or month filter or week filter.
If user tries to input filter on more than one time char then he shouldnt be able to execute the report and it should show some kind of message. Also if the user dosent select any one of them it should not run
the report.
Please provide any work around for the same.
Thanks,
VarunHi Varun,
Yes this can be acheived by coing the same in the CMOD. Please follow the steps as given below -
Please excuse me if I have done any typo errors -
Goto to CMOD and write a customer exit for i_step = 3 as given below -
IF i_step = 3.
data: count type n.
count = 0.
LOOP at i_t_var_range INTO l_s_var where vnam = 'date_var'
OR vnam = 'month_var'
OR vnam = 'week_var'.
count = count + 1.
ENDLOOP.
IF count > 2. "this is for multiple time range selection
CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
EXPORTING
I_CLASS = 'RSBBS'
I_TYPE = 'E'
I_NUMBER = '000'
I_MSGV1 = 'Please enter either of Date/Month/Week'.
raise again.
ELSEIF count = 0. "this is for no time range selection
CALL FUNCTION 'RRMS_MESSAGE_HANDLING'
EXPORTING
I_CLASS = 'RSBBS'
I_TYPE = 'E'
I_NUMBER = '000'
I_MSGV1 = 'Please enter at least Date/Month/Week'.
raise again.
ENDIF.
ENDIF.
Hope this helps.
Regards,
RashmiG -
I bought new Macbook Pro 13" around two months before .My Apple ID is working on all other things except app store . It is buffering for a lot of time and lastly coming on screen " can not connect to app store " Please help me
Have you tried repairing disk permissions : iTunes download error -45054
-
How do I add time/date stamp to my screen capture file names?
I'm on mac osx.
I'm trying to add time/date stamp to my screen capture file names. (at the moment it's just 'Picture 1' etc..)
I've tried the following command in terminal but have not had success. please help!!
defaults write com.apple.screencapture name "datestamp" at "timestamp"
killall SystemUIServerSurely someone else will provide a better solution. Meanwhile, however, you might want to try the following script. Copy and paste the script into the AppleScript Editor's window and save it as an application. Then drop your screen capture files on the droplet's Finder icon.
on open theDroppedFiles
tell application "Finder"
repeat with thisFile in theDroppedFiles
set theFileName to name of thisFile
if (word 1 of theFileName is "Picture") and ¬
(word 2 of theFileName = word -2 of theFileName) then
set theExtension to name extension of thisFile
set P to offset of theExtension in theFileName
set theCreationDate to creation date of thisFile
set dateStamp to short date string of theCreationDate
set timeStamp to time string of theCreationDate
set name of thisFile to "Screen Shot " & dateStamp ¬
& " at " & timeStamp & "." & theExtension
end if
end repeat
end tell
end open
Message was edited by: Pierre L. -
The request to execute code in the sandbox failed
I have developed a webpart for a client which is hosted on
O365.
While saving the webpart properties I am Getting the error"Web Part Error: The request to execute code in the sandbox failed."
The same web part works on a different O365 site perfectly fine.Try below article
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/70b13a7f-c9f8-4bf9-8229-670472959e60/web-part-error-sandboxed-code-execution-request-failed?forum=sharepointdevelopmentprevious -
When i up date my iphone 3G in itunes this time on my iphone 3G screen only USB cable & itunes name sceen & my phone in not working ple . send me what can i do ? thanks.
My mail ID is [email protected]
-
It is possible to programmatically disable the "Executing Code Modules in an External Instance of CVI" feature within a CVI project?
I know how to do it manually (Configure > Adapters... > Adapter Configuration).
Thanks in advance,
--MYes. TestStand 2.0 added the Engine.CVIAdapter_ExecuteStepsInCVI property.
-
Why has my back button disappeared, I have to exit each time I want a previous screen.
Why has my back button disappeared, I have to exit each time I want a previous screen
I noticed you have ''Freeze (dot) com Net Assistant'' installed. This is considered by most security software to be malware since it changes your user preferences and feeds you ads. See http://www.mywot.com/en/scorecard/www.freeze.com
Also, this Wikipedia article contains some info about it: http://en.wikipedia.org/wiki/W3i#History
You should be able to remove it by going to Add-ons, then Extensions. If it's not there, then the free edition of Malwarebytes from http://www.malwarebytes.org/products/malwarebytes_free should be able to get rid of it for you.
There are some screenshots of how you probably got it on your system here: http://www.emsisoft.com/en/malware/?Adware.Win32.Freeze.com+Toolbar
(no need to purchase the software to remove it because as mentioned already, Malwarebytes should be able to get rid of it for you). -
Time trigger for refreshing the screen
Hi all,
How to implement the time trigger for refreshing the screen after some time interval .
Thanks in advance .hello Naval ,
set the delay propert Eg : 10
in the on action of the Time trigger Ui
invalidate the node of table .
write the select query for retrivig the PO from table into Itab .
bind the internal table to the node ...
But for your requirement it will efficient if you implement POWL query .
[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60f1d5ee-84ab-2c10-ce97-97dfd89bc238?quicklink=index&overridelayout=true]
Regards
Chinnaiya P -
Executing code on EXIT_ON_CLOSE
I was wondering how you execute code when a JFrame closes using the X button (ie, without using a menu). Because you don't attach an ActionListener to it, I am unsure as to where I would place code that I would like to execute before the program exits.
Thanksadd a WindowListener to the JFrame; windowClosing() will be called when the X is clicked (setDefaultAction is more or less just a convenience method for this)
-
How can I set screen saver clock which show time and date when all screen is black. Other phones have this option but I didn't find on iphone. Pl guide.
HA! I figured the find my iphone out!!!!! You can have more than one icloud account in "Mail, Contacts and Calendars". So my husband's & kids' phone icloud account under "settings, icloud "is their individual @me.com account. Set it to everything you want EXCEPT Find My Iphone. Then under "settings, mail/contacts/calendars" you set up both accounts (your @me.com which may already be there), then add another with the main appleID and enable ONLY Find My Iphone. Now when any of us log into Find My Iphone from any device with our main apple ID for the app store, all the devices show up!!!! YIPPEE. I made my own day!
I think the message I got previously was because I hadn't disabled the find my iphone on the @me.com account first. -
Executing code in form of String object
hi to all,
I don't know if it's the right place to ask such a question, but at least, I can try my chance :)
Can I execute code originally written in a text area (JTextArea) (i.e. in form of a String object) as if it was code already embedded in the code flow ??There are several solutions.
As suggested above use Runtime.exec() to compile it. You can do this either by having the user enter the entire class or by having the enter only a portion which you then wrap (they write a method, or some rules in a method, etc.)
There is a VM/version specific interface that allows you to compile without Runtime.exec() . You can search the site for examples of this.
You can also use one of the java embeddable languages if you just what 'code' rather than supporting the entire java language.....search the following page for "Scripting"...
http://flp.cs.tu-berlin.de/~tolk/vmlanguages.html
Maybe you are looking for
-
I installed a new 'used' Logic board, im my macbook 13.3 and it turned right on!..( i was out of warrenty) Apple logo and spiing wheel, then turns off.. After reading several forums, I went into self mode, did the 2 checks within in and got an error
-
When I would download album artwork a popup msg would appear notifying me of all the albums that did not get album artwork. I checked the box the opted me to not see this notifcation msg again. Now I actually would like to see this notification. D
-
Downloading mavericks is taking forever
I have been trying to download os x mavericks onto my mac book pro and in 24 hrs it hasnt passed the 1/4 mark is this normal to take so long? What am i doing wrong?
-
Hi gurus, Is there any way to include further texts in the Info Record in addition to the 2 standard ones (Info record note and Purchase order text)? I need to add a new text, at plant level. Is this possible? If yes, how can it be done? Many thanks,
-
Information broadcasting basics
Hi, I searched for Information Broadcasting in the forums.. they are talking about more about the issues. I am new to Broadcasting. Can you please provide me any good basic documents for my study Thanks in advance