Naming an object - Simple?! - Javascript/Windows

Hey all!
And again I'm having trouble in a pretty simple thing. I searched for a code that searches the Paragraph Style that i want to, till here no problem. I fount the item, swap to selection tool so that it can change the selection to the text box instead of the text and then I want to name this object. Just that, but I just can't do it! hahahaha
Take a look:
// LOCALIZA O PARAGRAPH STYLE DA REFERÊNCIA
var oDoc = app.activeDocument;
//First loop through all stories then through all paragraphs in each story
for(n=0; n< oDoc.stories.length;n++){
    for(i=0;i<oDoc.stories[n].paragraphs.length;i++){
        // If paragraph style is "Silkeborg" then select paragraph and insert "S " before
        if  (oDoc.stories[n].paragraphs[i].appliedParagraphStyle.name == "referencia") {
            oDoc.stories[n].paragraphs[i].select();
// SELECIONA O BOX
app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;
// NOMEIA
app.activeDocument.selection.name= "Modelo";
It searches for it, if finds it, change to selection tool but just won't name the object. What am I doing wrong?
Here's some other script that i found that names the object by the same objects label:
var myDocItems = app.activeDocument.allPageItems;
for(var i = 0; i < myDocItems.length; i++)
  if(!myDocItems[i].name)
    myDocItems[i].name = myDocItems[i].label;
And this one works, but this object that searching at my script doesn't have a label, so I can't use it.
Any tips?!
Thanks guys! Cya!

"Selection" is always an array, so you can't use
..selection.name = ..
you must use
..selection[0].name = ...
Second, "has no label" is not a problem :-) All textframes have a label (and usually it's empty). I don't know whether you should be using "name" or "label" in this case -- I believe the advantage of "name" in CS5.5 is that it will showin the Layers panel.
Third (!), there is 1. no need to "switch to selection tool" to set a selection, and neither to use app.select.  Javascript allows instant access to everything, so you could simply set the name of any paragraph's outer frame using something like
oDoc.stories[i].paragraphs[n].parentTextFrames[0].name = ...
Note that a single paragraph may have more than a single "parent text frame" -- this paragraph maystart in one and end in another.

Similar Messages

  • Passing complex object from JavaScript to Flex

    Is it possible to call a Flex function (defined with ExternalInterface.addCallback) and pass a complex object from Javascript?  The properties of the object are all simple types, but the object itself is an array of objects.  For example:
    <script type="text/javascript">
    var arrayOfObj = [ { one: "one", two: 2, three: "blah" }, { one: "xyz", two: "abc", three: 3.141 } ];
    callSomeFunctionInFlex(arrayOfObj);
    </script>
    What would I do on the Flex side to make this happen?

    Complex object passing works as expected in Blazeds. 
    There are certain cases where you need to write custom bean proxy classes to marshall an object, but your case is very simple and will not require it.
    Make sure that you set the full java package and class name in your remote alias statement on your client value object.  The class has to be fully qualified.  The AS value object also needs the correct import of the nested value object or you will get a compile error.
    Make sure that the blazeds server has the full class path set to your java objects.
    To debug, you can turn on Blazeds logging in the services-config.xml file like this:
       <logging>
            <!-- You may also use flex.messaging.log.ServletLogTarget -->
            <target class="flex.messaging.log.ConsoleTarget" level="DEBUG">
                <properties>
                    <prefix>[BlazeDS]</prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>true</includeLevel>
                    <includeCategory>false</includeCategory>
                </properties>
            </target>
        </logging>

  • Javascript Issues with 'javascript:window.open'

    Hi guys,
    Really hoping someone can help out here. To set the scene I have detailed a similar example from the OEHR Schema based on the EMP table.
    I have a page defined with a classic report with all the contents of the EMP table, for example :
    HIREDATE | SAL | COMM | DEPTNO | MGR | JOB | ENAME | EMPNO |
    I have edited the column EMPNO report attribute so i can create a link from the EMPNO column, in the Column Link section i have defined the following attributes :
    Link Text : #EMPNO#
    Target : URL
    URL : javascript:window.open('f?p=&APP_ID.:28:&SESSION.::NO::P28_EMPNO:#EMPNO#');
    So in the URL i call the javascript function to open a new window, passing the Application ID, Page 28, Session ID and a parameter for the EMPNO.
    So far this all works fine, the new page opens which is also defined with a report region, however this time i pass the parameter item P28_EMPNO into the SQL to return just that row. I understand that from a security stand point this is probably bad practise however, at the moment this appears to be the only way i've managed to figure out how to create a pop up window passing parameters.
    The problem though is the original APEX page must be doing some sort of branch when the EMPNO link is passed, as the page refreshes with the following :
    The actual URL used is : javascript:window.open('f?p=101:28:2506768909457997::NO::P28_EMPNO:7369');
    and the page just displays : [object Window]
    Hope this makes sense.
    Thanks in advance

    Report your problem to Apple here: http://www.apple.com/feedback/ipad.html

  • Simple Javascript date() function not executing.

    If I open the javascript input window from a button and enter a simple js date function:
    vDate = new Date();
    alert(vDate();
    This code executes flawlessly when the button is clicked.
    However,  if I place the exact same code in the Execute Advacned Actions javascript window "on enter frame" Action, the alert popup code not exdecute/appear, it will fail silently.
    I'm simple trying to get a javascript funtion to execute on... the On Enter Action.
    Any suggestions?
    Thanks

    Hello,
    I just tried the scenario and I can see that JS code is executing properly. I used the same JS as you have given (just corrected the syntax in the second line). So, I create an Advanced action that has this JS, and I assigned that to "On Slide Enter" action of the slide. Other thing that I did is that I chose "current" as the window in the Execute Javascript options.
    Ashish

  • Trying to open a page in IE-tab using javascript, script type="text/javascript" window.location.href="chrome://coralietab/content/container.html?url=0,myurl" /script Error:Component returned failure code:0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]

    I am trying to open a page in IE-tab using javascript like this, <script type="text/javascript"> window.location.href = "chrome://coralietab/content/container.html?url=0,myurl" ;</script>.Error occured : [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::myurl :: load :: line 234" data: no] I have IE-Tab plug-in installed..when I open the same link manually in mozilla,it works fine and page gets opened in Ie-tab.

    The only way this might be possible is by using the HostContainer object
    to access the HTML page and do it from there.

  • Losing form elements and referer when opening in a javascript window

    I am submitting from a.cfm to b.cfm. b.cfm opens in a Javascript window. In b.cfm, the form elements from a.cfm are lost and cgi.referer returns nothing.
    When I don't open b.cfm in a Javascript window, everything is ok.
    What is this happening?

    Still getting the same thing.
    When sf is clicked in aaaa.cfm, bbbb.cfm does not see the variable named "a".
    When the link with the * is clicked, bbbb.cfm sees "a".
    What on earth am I doing wrong?
    This is aaaa.cfm.
    <html>
       <head>
          <script language="javascript">
             function f(nextpg_,nextwin_)
                var _attrs='';
                var _br=navigator.appName;
                document.forms[0].method="post";
                document.forms[0].action=nextpg_;
                if (_br=='Microsoft Internet Explorer')
                    _attrs='height='+screen.height+',width='+screen.width+'toolbar=0,menubar=0';
                    _attrs=_attrs+'top=0,left=0';
                    window.opener=null;
                    window.close();
                    window.open(nextpg_,nextwin_,_attrs)
                else
                  alert('Internet Explorer Please.')
             function g(nextpg_,nextwin_,val)
                var _attrs='';
                var _br=navigator.appName;
                document.forms[0].method="post";
                document.forms[0].action=nextpg_;
                if (_br=='Microsoft Internet Explorer')
                    _attrs='height='+screen.height+',width='+screen.width+'toolbar=0,menubar=0';
                    _attrs=_attrs+'top=0,left=0';
                    window.opener=null;
                    window.close();
                    window.open(nextpg_+'?a='+val,nextwin_,_attrs)
                else
                  alert('Internet Explorer Please.')
          </script>
          <title>
          </title>
       </head>
       <body>
          <form name="ff">
             <cfset a=0>
             <cfoutput>
                <input name="a" type="text" value="#a#">
             </cfoutput>
             <input name="sf" type="submit" value="*" onClick="f('bbbb.cfm','windowname')">
             <a href="javascript:g('bbbb.cfm','x','<cfoutput>#a#</cfoutput>')">
             </a>
          </form>
       </body>
    </html>
    This is bbbb.cfm
    <html>
       <head>
          <title>
          </title>
       </head>
       <body>
          <cfoutput>
             *#a#*#now()#*
          </cfoutput>
       </body>
    </html>

  • Getting Exception: @Scratchpad/1:1 exception while running simple javascript code in mozilla scrachpad

    getting Exception: "@Scratchpad/1:1 exception" while running simple javascript code in mozilla scrachpad

    Does this also happen if you run the code in the Web Console (Firefox/Tools > Web Developer)?
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
    *Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
    *Do NOT click the Reset button on the Safe Mode start window
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Change Titlebar for Warning Javascript Window: My Title

    Hi Everyone,
    Well...this question is either:
    1. Very easy, OR
    2. Impossible
    I have a smal ? button next to some of the fields on my form.
    I display a message box whenever the user clicks that button.
    The message box displays some sort of "help" for the field.
    Problem is, I do not want the titlebar of the message box to contain the words: Warning Javascript Window.
    How can I change this? I want the titlebar to say only what I want it to say.
    Many Thanks,
    Joe

    Hi,
    The simple answer is that you cannot change that as it is there to warn the user that this is not a Acrobat/Reader dialogue box and has been shown by the form.
    The complex answer is that as I understand it if the document was certified and the user had installed and trusted the certificate of the PDF document then the dialogue may not show that message ( I believe this is dependent of the version of Acrobat/Reader that the user is using)
    Regards
    Malcolm

  • RE: Named anchored objects

    Albert,
    In my case I was using a named anchored object to get a handle to an actual
    service object. My named object that I registered in the name service was
    an intermediary to which I did not maintain a connection. So I have not
    explicitly tested what you are asking.
    However, I too was not using a hard coded reference to the SO, and fail over
    and load balancing worked fine. The functions of fail over and load
    balancing are not done by the service object but by the name service, proxy
    and router. Since you are getting a proxy back any time you do a lookup in
    the name service I would think that fail over should work with any anchored
    object that is registered in the name service. When you do a RegisterObject
    call you will notice that one of the arguments is the session duration,
    which implies to me that fail over will be handled the same as for service
    objects.
    Load balancing adds another wrinkle. Load balancing is handled by a router.
    You must get a proxy to the router and not a proxy to an instance of the
    object that the router is doing the load balancing for. In the latter
    scenario you will be bypassing the router. If you are creating, anchoring
    and registering your objects dynamically you will not have a router so you
    will not be able to load balance! This applies even if the objects are
    instantiated within partitions that are load balanced because you will still
    be getting proxies back to a particular instance of the anchored objects.
    There are ways to accomplish load balancing between objects that you
    register yourself. However, the best solution will vary depending on the
    actual problem trying to be solved. If you would like to discuss this
    further, include a little more detail about the scenario you need to
    implement and I will give you what I know.
    BTY what I have outlined above also applies to getting references via a
    system agent.
    Sean
    Cornice Consulting, Inc.
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of Albert Dijk
    Sent: Friday, July 03, 1998 11:01 AM
    To: [email protected]
    Subject:
    Alex, David, Jez, Sean,...
    My question about both solutions (using Nameservice and agents) is:
    If I reach a remote service object using either a BindObject or an agent, do
    fail-over and load-balancing work the same way as they normally do when
    using a hard coded reference to the SO.
    Albert Dijk
    From: Sean Brown[SMTP:[email protected]]
    Reply To: [email protected]
    Sent: Thursday, June 25, 1998 6:55 AM
    To: Ananiev, Alex; [email protected]
    Subject: RE: multiple named objects with the same name and
    interface
    Alexander,
    I can not comment on the speed difference because I never tested it.
    But, I
    will say that we looked at the agent solution at a client sight
    before. I
    will give the same warning I gave them. If you go the agent direction
    you
    are now using agents for a purpose that they were not intended. Even
    though
    it technically works, as soon as you start using a piece of
    functionality in
    a way the developer did not intend it to be used you run the risk of
    forward
    compatibility problems. By this I mean, since agents were not
    originally
    intended to be used to look up service / anchored object references,
    it may
    not work in the future because it is not likely to be given
    consideration in
    any future design.
    As we all know, programmers are always stretching the bounds of the
    tools
    they use and you may have a good reason (i.e. performance). I just
    wanted to
    let you know the possible risk.
    One final note on a limitation of using system agents to obtain
    references
    to anchored objects. You can not access agents across environments.
    So, if
    you have connected environments and need to get references to services
    in
    another environment for fail-over or whatever, you will not be able to
    do it
    with agents.
    Just some thoughts!
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]]On">mailto:[email protected]]On</a> Behalf Of Ananiev, Alex
    Sent: Wednesday, June 24, 1998 12:14 PM
    To: '[email protected]'
    Subject: RE: multiple named objects with the same name and interface
    David,
    The problem with dynamic binding is that in this case you have to keep
    the reference to the service object somewhere. You don't want to call
    "bindObject" every time you need to use this service object, "bind" is
    a
    time-consuming operation, even on the same partition. Keeping
    reference
    could be undesirable if your object could be moved across partitions
    (e.g. business object).
    The alternative solution is to use agents. You can create custom
    agent,
    make it a subagent of an active partition agent and use it as a
    placeholder for whatever service you need. "FindSubAgent" works much
    faster than "bindObject", we verified that and agent is "user-visible"
    by its nature.
    Alexander
    From: "Sean Brown" <[email protected]>
    Date: Wed, 24 Jun 1998 09:12:55 -0500
    Subject: RE: multiple named objects with the same name and interface
    David,
    I actually determined it through testing. In my case I did not want
    this to
    happen and was trying to determine why it was happing. It makes sense
    if
    you think about it. Forte is trying to avoid making a remote method
    invocation if it can.
    Now, for anything more complex than looking locally first and if none
    is
    found give me any remote instance you can find, you will need to do
    more
    work. Using a naming scheme like Jez suggests below works well.
    Sean
    - -----Original Message-----
    From: Jez Sygrove [<a href="mailto:[email protected]">mailto:[email protected]</a>]
    Sent: Wednesday, June 24, 1998 4:34 AM
    To: [email protected]; 'David Foote'
    Cc: [email protected]
    Subject: RE: multiple named objects with the same name and interface
    David,
    there's a mechanism used within SCAFFOLDS that allows the
    location of the 'nearest' SO when more than one is available.
    It involves registering each duplicated SO under three dynamically
    built
    names. The names include the partition, the node or the environment
    name.
    When wishing to locate the nearest SO the BO builds a SO name using
    its
    own partition and asks the name service for that.
    If there is an SO registered under that name then it must be in the
    same
    partition and all is well. No cross partition calls.
    If not, then the BO builds the name using its node and asks the name
    service for that.
    This means that if there is an SO outside the BO partition but still
    on
    the same node then this can be used. Again, relatively 'local'.
    If neither of these work then the BO has to resort to an environment
    wide search.
    It may be that this approach could be adapted / adopted; I like it's
    ingenuity.
    Cheers,
    Jez
    From: David Foote[SMTP:[email protected]]
    Reply To: David Foote
    Sent: 24 June 1998 03:17
    To: [email protected]
    Cc: [email protected]
    Subject: RE: multiple named objects with the same name and
    interface
    Sean,
    First, thank you for your response. I have wondered about this fora
    long time.
    I looked at the documentation for ObjectLocationManager and on page
    327
    of the Framework Library and AppletSupport Library Guide indescribing
    the BindObject method Forte says:
    "The name service allows more than one anchored object (from
    different
    partitions) to be registered in the name service under the same
    registration name. When you invoke the BindObject method with a
    request
    for a name that has duplicate registration entries, the BindObject
    method finds an entry corresponding to an active partition, skipping
    any
    entries that do not. If no such active partition is found, or if the
    requested name is not found in the name service registry, a
    RemoteAccessException will be raised when the BindObject method is
    invoked."
    My question is: How did you discover that in the case of duplicate
    registrations the naming service will return the local object if one
    exists? This is not apparent from the documentation I have quoted.
    Is
    it documented elsewhere? Or did you determine it empirically?
    David N. Foote,
    Consultant
    ----Original Message Follows----
    David,
    First I will start by saying that this can be done by using named
    anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get mostof
    the
    behavior you desire. When you do a lookup in the name service
    (BindObject
    method) it will first look in the local partition and see if thereis
    a
    local copy and give you that copy. By anchoring the object and
    manually
    registering it in the name service you are programmatically creating
    your
    own SO without defining it as such in the development environment.
    BTW
    in
    response to your item number 1. This should be the case there as
    well.
    If
    your "mobile" object is in the same partition where the serviceobject
    he is
    calling resides, you should get a handle to the local instance ofthe
    service object.
    Here is the catch, if you make a bind object call and there is no
    local
    copy
    you will get a handle to a remote copy but you can not be sure which
    one!
    It end ups as more or less a random selection. Off the top of myhead
    and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href=
    "mailto:[email protected]]On">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There aretwo
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value
    to
    remote objects), cannot safely reference a Service Object unless it
    has
    environment visibility, but this forces the overhead of a remote
    method
    call when it might not otherwise be necessary. If it were possibleto
    place a copy of the same Service Object (with user visibility) ineach
    partition, the overhead of a remote method call could be avoided.
    This
    would only be useful for a service object whose state could besafely
    replicated.
    2) My second scenario also involves mobile objects referencing a
    Service
    Object, but this time I would like the behavior of the calledService
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same
    name
    and the same interface in each partition, but varying the
    implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thingor
    a
    bad thing?
    David N. Foote
    Consultant
    Alexander Ananiev
    Claremont Technology Group
    916-558-4127
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:<a href="http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >
    >
    >
    Alexander Ananiev
    Claremont Technology Group
    916-558-4127
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

    Albert,
    In my case I was using a named anchored object to get a handle to an actual
    service object. My named object that I registered in the name service was
    an intermediary to which I did not maintain a connection. So I have not
    explicitly tested what you are asking.
    However, I too was not using a hard coded reference to the SO, and fail over
    and load balancing worked fine. The functions of fail over and load
    balancing are not done by the service object but by the name service, proxy
    and router. Since you are getting a proxy back any time you do a lookup in
    the name service I would think that fail over should work with any anchored
    object that is registered in the name service. When you do a RegisterObject
    call you will notice that one of the arguments is the session duration,
    which implies to me that fail over will be handled the same as for service
    objects.
    Load balancing adds another wrinkle. Load balancing is handled by a router.
    You must get a proxy to the router and not a proxy to an instance of the
    object that the router is doing the load balancing for. In the latter
    scenario you will be bypassing the router. If you are creating, anchoring
    and registering your objects dynamically you will not have a router so you
    will not be able to load balance! This applies even if the objects are
    instantiated within partitions that are load balanced because you will still
    be getting proxies back to a particular instance of the anchored objects.
    There are ways to accomplish load balancing between objects that you
    register yourself. However, the best solution will vary depending on the
    actual problem trying to be solved. If you would like to discuss this
    further, include a little more detail about the scenario you need to
    implement and I will give you what I know.
    BTY what I have outlined above also applies to getting references via a
    system agent.
    Sean
    Cornice Consulting, Inc.
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]">mailto:[email protected]]On</a> Behalf Of Albert Dijk
    Sent: Friday, July 03, 1998 11:01 AM
    To: [email protected]
    Subject:
    Alex, David, Jez, Sean,...
    My question about both solutions (using Nameservice and agents) is:
    If I reach a remote service object using either a BindObject or an agent, do
    fail-over and load-balancing work the same way as they normally do when
    using a hard coded reference to the SO.
    Albert Dijk
    From: Sean Brown[SMTP:[email protected]]
    Reply To: [email protected]
    Sent: Thursday, June 25, 1998 6:55 AM
    To: Ananiev, Alex; [email protected]
    Subject: RE: multiple named objects with the same name and
    interface
    Alexander,
    I can not comment on the speed difference because I never tested it.
    But, I
    will say that we looked at the agent solution at a client sight
    before. I
    will give the same warning I gave them. If you go the agent direction
    you
    are now using agents for a purpose that they were not intended. Even
    though
    it technically works, as soon as you start using a piece of
    functionality in
    a way the developer did not intend it to be used you run the risk of
    forward
    compatibility problems. By this I mean, since agents were not
    originally
    intended to be used to look up service / anchored object references,
    it may
    not work in the future because it is not likely to be given
    consideration in
    any future design.
    As we all know, programmers are always stretching the bounds of the
    tools
    they use and you may have a good reason (i.e. performance). I just
    wanted to
    let you know the possible risk.
    One final note on a limitation of using system agents to obtain
    references
    to anchored objects. You can not access agents across environments.
    So, if
    you have connected environments and need to get references to services
    in
    another environment for fail-over or whatever, you will not be able to
    do it
    with agents.
    Just some thoughts!
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href="mailto:[email protected]]On">mailto:[email protected]]On</a> Behalf Of Ananiev, Alex
    Sent: Wednesday, June 24, 1998 12:14 PM
    To: '[email protected]'
    Subject: RE: multiple named objects with the same name and interface
    David,
    The problem with dynamic binding is that in this case you have to keep
    the reference to the service object somewhere. You don't want to call
    "bindObject" every time you need to use this service object, "bind" is
    a
    time-consuming operation, even on the same partition. Keeping
    reference
    could be undesirable if your object could be moved across partitions
    (e.g. business object).
    The alternative solution is to use agents. You can create custom
    agent,
    make it a subagent of an active partition agent and use it as a
    placeholder for whatever service you need. "FindSubAgent" works much
    faster than "bindObject", we verified that and agent is "user-visible"
    by its nature.
    Alexander
    From: "Sean Brown" <[email protected]>
    Date: Wed, 24 Jun 1998 09:12:55 -0500
    Subject: RE: multiple named objects with the same name and interface
    David,
    I actually determined it through testing. In my case I did not want
    this to
    happen and was trying to determine why it was happing. It makes sense
    if
    you think about it. Forte is trying to avoid making a remote method
    invocation if it can.
    Now, for anything more complex than looking locally first and if none
    is
    found give me any remote instance you can find, you will need to do
    more
    work. Using a naming scheme like Jez suggests below works well.
    Sean
    - -----Original Message-----
    From: Jez Sygrove [<a href="mailto:[email protected]">mailto:[email protected]</a>]
    Sent: Wednesday, June 24, 1998 4:34 AM
    To: [email protected]; 'David Foote'
    Cc: [email protected]
    Subject: RE: multiple named objects with the same name and interface
    David,
    there's a mechanism used within SCAFFOLDS that allows the
    location of the 'nearest' SO when more than one is available.
    It involves registering each duplicated SO under three dynamically
    built
    names. The names include the partition, the node or the environment
    name.
    When wishing to locate the nearest SO the BO builds a SO name using
    its
    own partition and asks the name service for that.
    If there is an SO registered under that name then it must be in the
    same
    partition and all is well. No cross partition calls.
    If not, then the BO builds the name using its node and asks the name
    service for that.
    This means that if there is an SO outside the BO partition but still
    on
    the same node then this can be used. Again, relatively 'local'.
    If neither of these work then the BO has to resort to an environment
    wide search.
    It may be that this approach could be adapted / adopted; I like it's
    ingenuity.
    Cheers,
    Jez
    From: David Foote[SMTP:[email protected]]
    Reply To: David Foote
    Sent: 24 June 1998 03:17
    To: [email protected]
    Cc: [email protected]
    Subject: RE: multiple named objects with the same name and
    interface
    Sean,
    First, thank you for your response. I have wondered about this fora
    long time.
    I looked at the documentation for ObjectLocationManager and on page
    327
    of the Framework Library and AppletSupport Library Guide indescribing
    the BindObject method Forte says:
    "The name service allows more than one anchored object (from
    different
    partitions) to be registered in the name service under the same
    registration name. When you invoke the BindObject method with a
    request
    for a name that has duplicate registration entries, the BindObject
    method finds an entry corresponding to an active partition, skipping
    any
    entries that do not. If no such active partition is found, or if the
    requested name is not found in the name service registry, a
    RemoteAccessException will be raised when the BindObject method is
    invoked."
    My question is: How did you discover that in the case of duplicate
    registrations the naming service will return the local object if one
    exists? This is not apparent from the documentation I have quoted.
    Is
    it documented elsewhere? Or did you determine it empirically?
    David N. Foote,
    Consultant
    ----Original Message Follows----
    David,
    First I will start by saying that this can be done by using named
    anchored
    objects and registering them yourself in the name service. There is
    documentation on how to do this. And by default you will get mostof
    the
    behavior you desire. When you do a lookup in the name service
    (BindObject
    method) it will first look in the local partition and see if thereis
    a
    local copy and give you that copy. By anchoring the object and
    manually
    registering it in the name service you are programmatically creating
    your
    own SO without defining it as such in the development environment.
    BTW
    in
    response to your item number 1. This should be the case there as
    well.
    If
    your "mobile" object is in the same partition where the serviceobject
    he is
    calling resides, you should get a handle to the local instance ofthe
    service object.
    Here is the catch, if you make a bind object call and there is no
    local
    copy
    you will get a handle to a remote copy but you can not be sure which
    one!
    It end ups as more or less a random selection. Off the top of myhead
    and
    without going to the doc, I am pretty sure that when you register an
    anchored object you can not limit it's visibility to "User".
    Sean
    -----Original Message-----
    From: [email protected]
    [<a href=
    "mailto:[email protected]]On">mailto:[email protected]]On</a> Behalf Of David Foote
    Sent: Monday, June 22, 1998 4:51 PM
    To: [email protected]
    Subject: multiple named objects with the same name and interface
    All,
    More than once, I have wished that Forte allowed you to place named
    objects with the same name in more than one partition. There aretwo
    situations in which this seems desirable:
    1) Objects that are not distributed, but are mobile (passed by value
    to
    remote objects), cannot safely reference a Service Object unless it
    has
    environment visibility, but this forces the overhead of a remote
    method
    call when it might not otherwise be necessary. If it were possibleto
    place a copy of the same Service Object (with user visibility) ineach
    partition, the overhead of a remote method call could be avoided.
    This
    would only be useful for a service object whose state could besafely
    replicated.
    2) My second scenario also involves mobile objects referencing a
    Service
    Object, but this time I would like the behavior of the calledService
    Object to differ with the partition from which it is called.
    This could be accomplished by placing Service Objects with the same
    name
    and the same interface in each partition, but varying the
    implementation
    with the partition.
    Does anyone have any thoughts about why this would be a good thingor
    a
    bad thing?
    David N. Foote
    Consultant
    Alexander Ananiev
    Claremont Technology Group
    916-558-4127
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:<a href="http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    >
    >
    >
    Alexander Ananiev
    Claremont Technology Group
    916-558-4127
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:<a href=
    "http://pinehurst.sageit.com/listarchive/">http://pinehurst.sageit.com/listarchive/</a>>

  • Javascript window on submitting PDF form

    Hi,
    I have a form designed in Livecycle ES3. When I go to submit the PDF form using Adobe Reader 8.0 to the specified email address I get the following javascript window:
    To:
    Subject:
    Attachment:
    From:
    Email Address:
    Full Name:
    Warning:Javascript Window
    When I select Send I then get another javascript window:
    Please indicate the option which best describes how you send mail:
    Desktop Email Application
    Internet Email
    When I click ok it works fine and attaches to an outlook email. However I don't want these windows to appear at all but for it just to send the pdf.
    Is there some setting I need to change when designing the form in Livecycle or a setting in Adobe Reader?
    Any help appreciated.
    Thanks,
    Deep.

    any ideas? still can't get rid of this window?

  • Unable to open a seperate java console window with javascript:window.open()

    Hi All,
    I am opening a new window using javascript:window.open() function by clicking an hyperlink in a html document. In this new windows I am trying to load an applet. Only for the first time a java console window is displayed in windows system tray . How can I open a different java console window each time I open a new window ? Basically I want to run each applet in its own JVM and it seems that each applet loaded in new window is using the same JVM and hence only one java console window is seen in my system tray.
    Please help ...
    Thanks & Regards,
    Ravi.

    Hi,
    We are currently facing this exact issue. Did you ever find a resolution?
    Any input would be appreciated.
    Thanks,

  • Show javascript window after closing

    Hi,
    how to show the "javascript window" with my custom buttons again after it has been closed? I have a submenu with menu item (supposed "Show Buttons"), which calls a function for generating of buttons. After this window has been closed, the customer would select again "Show Buttons" in order to see it again. It is not possible, as the buttons are actually initialized and cannot not be initialized again with the same name. How can solve this issue?
    regards,
    Alex

    There's nothing wrong with creating a document-only toolbar, you just have to add some error processing code if you ever need to display the toolbar after the user closes it. For example:
    try {
        // app.addToolButton code goes here
    } catch (e) {
       // app.removeToolButton code goes here
       // app.addToolButton code goes here
    It's easiest if you make the code that adds and removes the tool buttons into a function.

  • How to apply a simple javascript into JSF

    Hi everyone. This is my first time using JSF and i am abit confuse in applying some simple javascript into my JSF. Actually, i just want to add a simple function that is to disable user from input some certain textfield (h:inputText) based on the selection in the combo box (h:selectOneMenu).
    The javascipt that i would like to apply in the JSF coding is shown as below:-
    <HTML>
    <TITLE>Example of onChange Event Handler</TITLE>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function textField()
    if(document.myform.mcDonald.value=="disable")
    document.myform.data.disabled=true;
    if(document.myform.mcDonald.value=="enable")
    document.myform.data.disabled=false;
    </SCRIPT>
    </HEAD>
    <BODY>
    <H3>Example of onChange Event Handler</H3>
    <form name="myform">
    <SELECT NAME="mcDonald" onChange="textField()">
    <OPTION VALUE="enable">Enable
    <OPTION VALUE="disable">Disable
    </SELECT>
    <input type="text" name="data" value="10" size=10 disabled="true" >
    </form>
    </BODY>
    </HTML>

    You need to use the id's of the components in the hierarchy. This is actual working code:
    // Javascript
              function actionedStatus_onchange(formObj, fieldValue) {
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].disabled = (fieldValue != 'all');
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].checked = (fieldValue == 'all');
    // JSF
                   <x:selectOneMenu id="actionedStatus" styleClass="detailBondField" value="#{exceptionsBean.actionedStatus}"
                             onchange="actionedStatus_onchange(this.form, this.value)">
                        <f:selectItems value="#{lookupBean.actionedStatusList}"/>
                   </x:selectOneMenu>
    In this case, the root component form is 'foureye' (a subview), followed by 'tabExceptions' (a form), followed by a checkbox 'unresolvedOnly' that I want to manipulate. Here I am disabling the checkbox and setting the value dependent on the value of the selectOneMenu

  • How to change attributes of Objects of all windows in a MDI application

    Hi,
    I have a MDI application to draw Object. In these MDI windows I can modify attributes of Object like color, size... Now I want to create an option, when the user change or modifies attribute of Objects in a window, so it allow to change attributes of objects in all windows. I don't know how I can do it, please help me. Thanks

    Allow your objects to alias mutable attribute objects.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.*;
    import javax.swing.*;
    import java.util.List;
    public class Example extends JPanel {
        private List bangles = new ArrayList();
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D) g;
            for(Iterator j=bangles.iterator(); j.hasNext(); )
                ((Bangle)j.next()).paint(g2);
        public void addBangle(Bangle bangle) {
            bangles.add(bangle);
            repaint();
        public static void main(String[] args) {
            JFrame.setDefaultLookAndFeelDecorated(true);
            JDialog.setDefaultLookAndFeelDecorated(true);
            Example app = new Example();
            JFrame f = new JFrame("Example");
            Container cp = f.getContentPane();
            cp.add(app, BorderLayout.CENTER);
            cp.add(Controller.create(app), BorderLayout.NORTH);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setSize(800,600);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
    class Controller {
        private Shade shade1 = new Shade(Color.GREEN), shade2 = new Shade(Color.RED), currentShade=shade1;
        private Example modelView;
        public static JComponent create(Example modelView) {
            return new Controller(modelView).createUI();
        private Controller(final Example modelView) {
            this.modelView = modelView;
            modelView.addMouseListener(new MouseAdapter(){
                public void mousePressed(MouseEvent evt) {
                    Rectangle shape = new Rectangle(evt.getX(), evt.getY(), 20, 20);
                    modelView.addBangle(new Bangle(shape, currentShade));
        private JComponent createUI() {
            ButtonGroup bg = new ButtonGroup();
            final JToolBar tb = new JToolBar();
            final JRadioButton rb1 = createRadio("Shade 1", true,  shade1, bg, tb);
            final JRadioButton rb2 = createRadio("Shade 2", false, shade2, bg, tb);
            JButton btn = new JButton("Change color of selected shade");
            btn.setContentAreaFilled(false);
            btn.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent evt) {
                    Color newColor = JColorChooser.showDialog(tb, "Choose new color", currentShade.getColor());
                    if (newColor != null) {
                        currentShade.setColor(newColor);
                        if (currentShade == shade1)
                            rb1.setForeground(newColor);
                        else
                            rb2.setForeground(newColor);
            tb.add(btn);
            return tb;
        private JRadioButton createRadio(String text, boolean selected, final Shade shade, ButtonGroup bg, JToolBar tb) {
            JRadioButton rb = new JRadioButton(text, selected);
            rb.setContentAreaFilled(false);
            rb.setForeground(shade.getColor());
            rb.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent evt) {
                    currentShade = shade;
            tb.add(rb);
            return rb;
    class Bangle {
        private Shape shape;
        private Shade shade;
        public Bangle(Shape shape, Shade shade) {
            this.shape = shape;
            this.shade = shade;
        public void paint(Graphics2D g2) {
            g2.setColor(shade.getColor());
            g2.draw(shape);
    class Shade {
        private Color color;
        public Shade(Color color) {
            this.color = color;
        public Color getColor() {
            return color;
        public void setColor(Color color) {
            this.color = color;
    }

  • HTMLbeforeForm= SCRIPT LANGUAGE="JavaScript" window.opener = top; /SCRIPT

    I've found this line of code in my formsweb.cfg file, but to be honest I have no clue what it's doing.
    HTMLbeforeForm=<SCRIPT LANGUAGE="JavaScript">window.opener = top;</SCRIPT>
    Anyone know what this code might be responsible for?

    I have seen this sometimes used to prevent the user being asked if they want to close the window when a javascript command to close the window is issued. Not sure it always works with different browsers or versions.

Maybe you are looking for