Testing global objects for undefined
I have two forms that ask for similar information. I have set up global objects so when form #2 is opened, it will grab the info from form #1.
But if form #1 is not opened (and therefore the global object is not created) I just want the fields in form #2 to be blank rather than display "Empty" for text fields and zeros for numeric fields.
I tried testing for undefined the following way but it is not working.
if (typeof global.testtext.rawValue != "undefined") {
this.rawValue = global.testtext;
In the above case, the condition always tests as false so the global variable is never set, even when it exists.
Found a solution. I don't test for undefined. I go ahead and set the field to the global variable and then test for "Empty" if it's a text field and 0 if it is a nummeric field. If the global variable doesn't yet exist, the fields are left blank rather than displaying "Empty" or a zero.
// For Text Field
this.rawValue = global.TextField1;
if (this.rawValue == "Empty") {
this.rawValue = "";
// For Numeric Field
this.rawValue = global.NumericField1;
if (this.rawValue == 0) {
this.rawValue = "";
Similar Messages
-
How to create global object for a number of views?
Hello,
Let's say I have 5 different views in a certain component.
I would like to open a connection to a DB and share this connection between all views.
Can somone please show/explain me where do I do it on the component and how do I access this connection from the views?Hi Roy,
For getting the connection, you can create the datasource in the "Visual Administrator" and you can get the connection from the datasource. By doing this, you can retrive the connection from the connection pool.
Refer the link to create the datasource and accessing it from the java code.
http://help.sap.com/saphelp_nw04/helpdata/en/82/fdbf2085f65f43a71e755fc904478d/frameset.htm
"How to Use SAP J2EE Database Pooling Service"
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/stu/use sap j2ee database pooling service
If you need any further clarification let me know.
Regards,
Santhosh.C -
Global Object Access Auditing test question
Hello!
There's a test question (N4) I'd like to have clearified:
http://exam.test4actual.com/70-411.pdf
Yes, D and F will enable auditing with no extra replication traffic, but enabling Global Object Acces Auditing will lead to auditing not only SYSVOL shares but to any others as well (http://blogs.technet.com/b/askds/archive/2011/03/10/global-object-access-auditing-is-magic.aspx)
- is this replication traffic worth it???
Thank you in advance,
MichaelHi,
For this question, the correct answer is DF, but we do not need to use Global Object Acces Auditing policy to audit SYSVOL shares.
About the replication traffic, please refer to:
http://technet.microsoft.com/en-us/library/bb742457.aspx
Meanwhile, any changes made to SYSVOL are automatically replicated to the other domain controllers in the domain. If the files stored in SYSVOL change frequently, the replication increases the input and output for the volume where SYSVOL is located. For
example, editing a GPO can potentially force a GPO-level replication. If the volume is also host to other system files, such as the directory database or the pagefile, then the increased input and output for the volume can impact the performance of the server.
More detail information:
Introduction to Administering SYSVOL
http://technet.microsoft.com/en-us/library/cc778037(v=WS.10).aspx
Regards. -
Global object Services ( GOS ) for service users
Hi,
It is possible to have GOS ( Global object services ) ability for Service user type?
As far as I know only Dialog users has that ability.
Thanks,
Krishna.it is not possible for service-users. never was.
-
Global object visible for all sessions in WebDynpro application
Hello everybody,
in a normal java web application you have the possibility
to put an object into the servlet context.
This object is visible for all sessions(e.g. some configurations or global settings for the
web application).
Now my question:
Is there a possibility in a WebDynpro application to put such an object into a "global context" visible for all sessions?
So I am looking for a container in WebDynpro which has
the same behaviour like the servlet context in a web application.
Thank you for your ideas an suggestions.
Greetings
AntonHi Anton,
To make an Variable Global ,you have define variable at various levels based on Usage.
1)Ex: If you want to define Variable between two different Components . when A component is embedded into B Component then you have to define at Component Interface level and Mapping has to be Defined.
2) If you want to make Variable to be used within the component among the Iviews ,then you can define at Component Controller or Custom Controller and Mapping has to be defined at Iview Level.
3) If you want to use Variable between two Webdynpro Iviews then you have define the eventing mechanism to pass the values among the EP Webdynpro Iviews.
Hope this answer helps you.
Thanks
Madhan -
Why does diadem intellisense not work when using scriptinclude or for global object
I have a script with a different classes in it (scripted 1). When I create an object of a class in the script 1 intellisense works. Intellisense is when you type name of the object created from a class it shows all the possible variables and functions contained in that object. But when I write another script and use scriptinclude(scripted 1) the intellisense does not work. I also tried a global object and intesllisense does not work. Is there a way to get intellisense to work when using scriptinclude? I am working with version 2012.
Here is more information on the issue.
I have a script with a different classes in it (scripted 1). When I create an object of a class in the script 1 intellisense works. Intellisense is when you type name of the object created from a class it shows all the possible variables and functions contained in that object. But when I write another script and use scriptinclude(scripted 1) the intellisense does not work. I also tried a global object and intesllisense does not work. Is there a way to get intellisense to work when using scriptinclude? I am working with version 2012.
'Test.vbs
class test
public function test1()
msgbox("test1")
end function
public function test2()
msgbox("test2")
end function
end class
'now create a object of the class
dim oTest
set oTest=new Test
'now when you type oTest. you get the following functions to choose from
oTest.test1
.test2
Now if you remove the object from Test.vbs and create a main program with scriptinclude(Test.vbs) it will not show the two functions
'Main.vbs
Option Explicit 'Forces the explicit declaration of all the variables in a script.
call scriptinclude("c:\1atmp\Test.vbs")
dim oTest
set oTest=new test
'now when you type oTest. it shows none of the functions in the object oTest
oTest. -
CompareTo(Object) is undefined for Object
I'm getting an error -The method compareTo(Object) is undefined for the type Object- with this code:
public static Object getMinimum (Object[] array)
Object min = array[0];
for (int i = 1; i < array.length; i++) {
if (min.compareTo(array) > 0) {
min = array[i];
return min;
The objects in the array will always implement the Cloneable interface, but they can't use it, as they are treated as Object instances, not as instances of their own class. How can I fix this without using a Comparator?
Thanks in advanceOr to be most generic
public static <T extends Comparable<T>> T getMinimum(T[] array) {
T min = array[0];
for (int i = 1; i < array.length; i++) {
if (min.compareTo(array) > 0) {
min = array[i];
return min;
Of course, the forum software mucks that up,
it should be
<T extends Comparable<T>>
Message was edited by:
IanSchneider -
Authorization object for the "global settings" of a workbook of BW 7.0
Hi colleagues,
I search for a authorization object for the "global settings" of a workbook in the analyzer of BW 7.0.
The normal user should not have the authorization to change the "default workbook" .Hello Hans-Dieter,
have you solved the issue? I think it is not clearly defined and needs to be enhanced even Note 332738 has been applied. S_RS_TOOLS is not working, that's my opinion.
I opened a customer message in Marketplace to become a solution.
May be you have a solution already done?
I would appreciate this very much.
Best regards
André
Edited by: Andre Brachert on Apr 14, 2009 1:42 PM -
Revision: 1433
Author: [email protected]
Date: 2008-04-28 13:13:12 -0700 (Mon, 28 Apr 2008)
Log Message:
adding 'console' security constraint to MBeanServerGateway remote object for MBean tests and ds-console, used when running on Websphere with administrative security enabled. Should call setCredentials("bob","bob1") to use this RO.
Modified Paths:
blazeds/branches/3.0.x/qa/apps/qa-regress/WEB-INF/flex/remoting-config.mods.xml
blazeds/branches/3.0.x/qa/apps/qa-regress/WEB-INF/flex/services-config.mods.xmlHi,
It seems that you were using Hyper-V Remote Management Configuration Utility from the link
http://code.msdn.microsoft.com/HVRemote, if so, you can refer to the following link.
Configure Hyper-V Remote Management in seconds
http://blogs.technet.com/jhoward/archive/2008/11/14/configure-hyper-v-remote-management-in-seconds.aspx
By the way, if you want to perform the further research about Hyper-V Remote Management Configuration Utility, it is recommend that you to get further
support in the corresponding community so that you can get the most qualified pool of respondents. Thanks for your understanding.
For your convenience, I have list the related link as followed.
Discussions for Hyper-V Remote Management Configuration Utility
http://code.msdn.microsoft.com/HVRemote/Thread/List.aspx
Best Regards,
Vincent Hu -
Using ecat for uploading HCM objects for testing
Hi,
Can anybody help me out with the steps using ecat to upload the HCM objects for testing.
I could do tcd recording and download the file.
Regards,
Mukta MHi,
I have been using Oracle Flashback Database for a long time in our test environments. As you already said, I recommend that you create Guaranteed Restore Points rather than rely on db_flashback_retention_target. If you are planning to use Guaranteed Restore Points only, then you don't need to turn on flashback. If flashback database is not enabled, then the database must be mounted, not open, when creating the first guaranteed restore point (or if all previously created guaranteed restore points have been dropped).
My Answers:
1) I don't think so. Flashback database is faster compared to RMAN restore/recover operations.
2) Create a backup ins not mandatory, but is a good practice.
3) I created a Nagios plugin that take this work for me, but you can check the v$recovery_file_dest view from time to time.
4) If you take a backup then I don't see a problem, but take care that flashback database relies not only on flashback log files but also in archive redo log files. I recommend you to delete archivelogs (from RMAN) after you drop the restore point.
5) Flashback log files are automatically deleted after the Guaranteed restore points are deleted.
6) Read documentation, make more tests. In 2011 I wrote an article (Brazilian Portuguese) about Flashback Database. Maybe you can take a look ;-)
Cheers
Legatti -
RE: Global Object -- the last word
Chris,
You are correct. My apologies for not testing my reply sooner. The
OLM.RegisterObject method does touch the NameService, but OLM caches
registrations and therefor OLM.BindObject is a local call. So there is one
network call, but that's all (unless the cache entries are aged out).
Andrew,
After testing all of the proposed solutions, using task.part.apptitle seems
the easiest one to implement. Subclass from TextNullable and add an
attribute to hold the reference to LocalCache. Remember, TextNullable can
not be anchored.
Caveat, you are relying on a Forte feature which may not be guaranteed to
work the same way in the future.
At 01:59 PM 10/17/97 -0500, you wrote:
Where would the network traffic come in? The object location manager
is local, and if you assume the cache object is also local (there is
one on each partition), I don't see where the network hit would be.
Would you please enlighten me?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chris Johnson
BORN Information Services Group
Forte National Practice
Direct: 612-404-4409
Fax: 612-404-4441
http://www.born.com
mailto:[email protected]
From: David Vydra[SMTP:[email protected]]
Sent: Friday, October 17, 1997 12:42 PM
To: [email protected]
Subject: RE: Global Object
Guy,
At 11:35 AM 10/17/97 -0500, you wrote:
Another approach would be to use the partition's object locationmanager
(task.part.objectLocationMgr) to register the partition's local cachecontainer object (LOCache) under a name based on the
partition's name. Tasks needing the cache container can use the"bindObject" method to get the reference back.
I believe this would generate network traffic for each bind, and if
the
objects in need of the local service are transient the overhead may be
considerable.
========================================
David Vydra
Education Consultant
Forte Software, Inc.
[email protected]; phone: (510)986.3593Possible problems with using task.part.appTitle.
1) Isn't appTitle part of the task? If it is, what happens when the
task goes across a partition boundary? Does the appTitle get serialized
and deserialized by Forte? As long as the cache itself is anchored this
reference held in the appTitle is only a proxy. (But a TextNullable
cannot be anchored.) If the cache is not anchored, won't the entire
cache get serialized and deserialized at each partition boundary?
2) If the appTitle goes with the Task when it crosses a partition
boundary, what happens when some piece of code in the other partition
attempts to use the cache? If the cache was able to be anchored,
wouldn't there a network hit at this point? Also, haven't you just lost
the 'local'ness of the local cache.
3) What about serialization problems when you enter a partition that
does not know about the cache object. Won't you get a deserialization
error when you enter a non-application partition such as the Node
Manager or Forte's run-time compiler?
4) Version 3 provides appContext which can be used to hold any Object.
This should probably only be used for very small objects or anchored
object that are used infrequently on a different partition. Since
appTitle cannot be anchored, why would you use it rather than
appContext (Version 2 is a different story)? AppContext appears to be a
more generic solution to the global object problem, one that Forte will
support. Neither AppContext nor appTitle appear to be solutions to a
local cache problem.
John G. Bielejeski
Born Information Services Group (http://www.born.com)
Forte National Practice
Voice: (612) 404-4116
Fax: (612) 404-4440
mailto:[email protected]
From: David Vydra[SMTP:[email protected]]
Sent: Sunday, October 19, 1997 7:04 PM
To: [email protected]
Subject: RE: Global Object -- the last word
Chris,
You are correct. My apologies for not testing my reply sooner. The
OLM.RegisterObject method does touch the NameService, but OLM caches
registrations and therefor OLM.BindObject is a local call. So there is
one
network call, but that's all (unless the cache entries are aged out).
Andrew,
After testing all of the proposed solutions, using task.part.apptitle
seems
the easiest one to implement. Subclass from TextNullable and add an
attribute to hold the reference to LocalCache. Remember, TextNullable
can
not be anchored.
Caveat, you are relying on a Forte feature which may not be guaranteed
to
work the same way in the future.
At 01:59 PM 10/17/97 -0500, you wrote:
Where would the network traffic come in? The object locationmanager
is local, and if you assume the cache object is also local (thereis
one on each partition), I don't see where the network hit would be.
Would you please enlighten me?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chris Johnson
BORN Information Services Group
Forte National Practice
Direct: 612-404-4409
Fax: 612-404-4441
http://www.born.com
mailto:[email protected]
From: David Vydra[SMTP:[email protected]]
Sent: Friday, October 17, 1997 12:42 PM
To: [email protected]
Subject: RE: Global Object
Guy,
At 11:35 AM 10/17/97 -0500, you wrote:
Another approach would be to use the partition's object locationmanager
(task.part.objectLocationMgr) to register the partition's local
cache
container object (LOCache) under a name based on the
partition's name. Tasks needing the cache container can use the"bindObject" method to get the reference back.
I believe this would generate network traffic for each bind, and if
the
objects in need of the local service are transient the overhead maybe
considerable.
========================================
David Vydra
Education Consultant
Forte Software, Inc.
[email protected]; phone: (510)986.3593 -
Need one global object constructed ahead of others
We are working on porting an application from a Lynx
environment to Solaris using the Forte 6 development
tools. We're having a problem when a constructor for
one object tries to use a global object created in a
library file. The application uses an SLogFile class
to write warning messages to a particular destination.
This is specified in a source file called config.cpp like
so:
SLogFile _slog(fileno(stderr), SLogFile::warn);
SLogFile &slog = _slog;
config.cpp is compiled into config.o, which is then
stored in libclass.a.
In program testprog.cpp, we define a new class
whose constructor wants to use slog to write
output. I think the following simplification explains
what the application is trying to do.
extern SLogFile &slog;
class test {
public:
test(int val);
~test();
private:
int prival;
test::test(int val)
prival=val;
slog << "Initial value set to " << prival << "\n";
test testcritter;
int main(int argc, char** argv)
slog << "Count of arguments to main = " << argc << "\n";
return 0;
Through dbx, I can stop the program when it enters
test::test. slog points to slog, but slog is not
initialized. According to the documentation, this
can be resolved in g++ by the use of the load command
to get config.o loaded first (apparently getting _slog
constructed). Is there anyway to get this to happen
in the Solaris/Forte C++ environment?
Any help would be appreciated...We are working on porting an application from a Lynx
environment to Solaris using the Forte 6 development
tools. We're having a problem when a constructor for
one object tries to use a global object created in a
library file. The application uses an SLogFile class
to write warning messages to a particular destination.
This is specified in a source file called config.cpp like
so:
SLogFile _slog(fileno(stderr), SLogFile::warn);
SLogFile &slog = _slog;
config.cpp is compiled into config.o, which is then
stored in libclass.a.
In program testprog.cpp, we define a new class
whose constructor wants to use slog to write
output. I think the following simplification explains
what the application is trying to do.
extern SLogFile &slog;
class test {
public:
test(int val);
~test();
private:
int prival;
test::test(int val)
prival=val;
slog << "Initial value set to " << prival << "\n";
test testcritter;
int main(int argc, char** argv)
slog << "Count of arguments to main = " << argc << "\n";
return 0;
Through dbx, I can stop the program when it enters
test::test. slog points to slog, but slog is not
initialized. According to the documentation, this
can be resolved in g++ by the use of the load command
to get config.o loaded first (apparently getting _slog
constructed). Is there anyway to get this to happen
in the Solaris/Forte C++ environment?
Any help would be appreciated... -
Setting a global margin for any documents to print
Hello,
On a Mac running OS X, I have a ruby/java script allowing me to open a Microsoft Word document and print it as a PDF (and extra stuffs, but that's not part of the problem). During the conversion from Word to PDF for most of my documents I get a dialog saying 'A footer of section X is outside of the printable area of the page...'. What I would like to do is not to write a script to click 'yes' when a dialog open but to try to set the default margin for printing to 0. In the 'page setup', there is an option to create customized 'paper size', with a giving width, height and margins (that I can set to 0). By default the paper size is selecting A4, but I would like to find a way to set this paper size as a default to my customized paper size for any document opened on Microsoft Word or printed as PDF! If I select manually the customized paper size after I open the document on Word, I can print it without having the dialog.
So my question is to know if there is a way to set a global margin for printing to 0 (let me know if I need to use Acrobat Pro, Distiller etc.), whatever the way is.
Thank you very much!
VincentAlan,
There is nothing specific with the SDK that you have to print a marketing document such as a Sales Order, PO, etc. What you may want to look at in the 2005A SDK is the "PrintEvent" object. This event lets you catch a print event in the SAP Business One application, get the relevant data that is sent to the printer and then edit it using a third-party editing tool such as Crystal Reports. The PrintEvent event provides an exit point that allows you to integrate third-party tools for reporting and document editing.
You can look at the sample code for the PrintEvent here ...
..\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB.NET\20.PrintEvent
HTH,
Eddy -
Cs3 bug - global objects and frame labels
Just found a bug that took me an hour to figure out.
A strange problem occurred when I had a global object and a
frame label named the same.
Example:
_global.discussion = new Object();
//lots of functions here
I was directing the timeline of a movieClip to the frame
label "discussion". On this frame there were a number of actions
involving the discussion object. However, flash was treating the
object as if it didn't exist. All variables / functions residing in
this object were completely gone. Has anyone seen this problem. If
not, watch out for it.
jamesthat's coder bug, not a flash bug.
-
How to create a file object for a file on Remote Server? UNIX
Hi all,
I am working on two servers A and B. BOTH ARE UNIX MACHINES. My java class exist on server A and executes on same server. The file that I need to process resides on server B. (Lets call it test.txt in MYTEST directory. So path will be /MYTEST/test.txt on server B) I need to do few things before I can process it:
1) Check if file exist
2) If it does FTP it to Server A. (I already know how to.)
For both of these tasks, I need a File object for that file.
My problem is that I am unable to set it up.
\\B\MYTEST\test.txt will not work on UNIX. I already tried that. (It only works on Windows)
I tried:
/B/MYTEST/test.txt ---- Does not work
B:/MYTEST/test.txt ---- Does not work
:B/MYTEST/test.txt ---- Does not work
B:MYTEST/test.txt ---- Does not work
All of these instances say the same thing: "File does not exist."
Any ideas? Please help!!!
-ChiragI by no means want to sound belittling... so don't take me that way..
You need to understand the basics of files, and networks. You can't check if a file exists on another machine if you don't have a network protocol to communicate with. The reason \\ works under windows is because you are using an invisible (to you) network protocol. You probably know it as windows sharing. If your file were not shared under it's own name, that method wouldn't work (I'm assuming your entire drive is shared without a password... a horrible security flaw...but one thing at a time)
You can use FTP protocol to check if a file exists. You can either send the raw text FTP commands through a socket connection in java, or you can use a freely available FTP java API to make it a bit more simple. You could also write a small java server on the other machine, and have it tell you what you need to know with a socket connection. In this way, you have created your very own network protocol.
Maybe you are looking for
-
How to terminate a java thread from c++ code?
Hi, I made a screensaver which loads a jvm, forks a thread running a java class, wait until user's action(i.e. mouse move/click keyboard input), then terminate the java thread. However, I met a problem, How to terminate a running java thread from c++
-
Type of Serialized Object for Entity Bean
Hi, I develop a container managed persistence entity bean. I want to persist an object that is serializable into a database column. My database column type is a Blob. I wonder what is the type of a field in my entity bean? Please help. Thanks in adva
-
Oracle DB Standard Edition One
Hello I need to download Oracle DB Standard Edition One. From where can I download this version odf Oracle software? Regards Tim
-
Can someone telll me how can I edit a hyperlink in a .pdf file?
-
NMH305: Data Not Showing
Installed my new NMH305 updated the firmware added a 500gig HDD so i have 930 odd available to use & its connected to my wireless Buffalo router, im running Vista 32. Right the problem is ive backed up much of my music catalogue pictures videos etc e