How to extend/add additional functionality (to) an InDesign class like Cell

Hello,
I am trying to add some extra functionality to every instance of e.g. the Cell 'class' of InDesign using Javascript. I started doing something like this:
Cell.prototype.newFunction = function() { ....... }
which works fine: it is now possible to call newFunction() on every instance of Cell.
But now I would like to let this function (that I've added to the prototype chain of Cell like shown above and thus is also available for an 'instance' of Cell) use a 'variable' that is specific for every Cell instance, e.g.:
Cell.prototype.getSuperValue = function ()
if (this._cachedValue === undefined)
this._cachedValue = 3; // doing some incredible calculations that take some time
return this._cachedValue;
The this._cachedValue should be a attribute of the Cell instance. So if I take to cells from a Table and I call getSuperValue() on them I can get two different values that are specific for every instance of Cell.
Thanks a lot in advance!
P.S. although I am quite new to Javascript I know there are no classes in Javascript and that Cell is an object. But I thought explaining it like this would make it more clear?

Hi John, Harbs and Marc,
Thanks a lot for the helpful information!
One of the things I was trying to do is give the 'instance of Cell' extra functionality like obtaining geometric information of that cell, e.g. getInsideArea which would return a rectangle containing the position and size of that cell. I wanted to give the cell a reference to an Javascript object that contained geometric information of the Table the cell is in. This geometric information is used by me to obtain the cell geometric information.
Again thanks a lot!

Similar Messages

  • How do I add a functional "submit button" to a pdf form in Adobe Acrobat Pro XI ? I created the pdf form in Adobe Forms Central.

    How do I add a functional "submit button" to a pdf form in Adobe Acrobat Pro XI ? I created the pdf form in Adobe Forms Central. It's for an online Diet Questionnaire. After people complete the form I'd like them to click "SUBMIT" and the completed form will be emailed to me.

    This can be a bit confusing because Acrobat 11 comes with the desktop app that allows you to create simple PDF forms without having a FormsCentral account. Some people find this helpful, but you need to understand that when you generate the PDF form, it is Reader-enabled by Acrobat. In order to edit the form further in Acrobat, you have to create a non-enabled copy of the form. You do this in Acrobat by opening the form and selecting: File > Save a Copy
    and opening the copy. It is not opened automatically.
    You can now add a button and set it up to submit by email, either using a "Submit a form" action or the submitForm JavaScript method. You can set it up to include just the form data or the entire PDF, and will want to use a mailto type URL. Submitting the form to the FormsCentral server has a number of important advantages over email (much more reliable, more secure, etc.), so you might want to consider it.
    If the form needs to be saved with Reader versions prior to 11, then you will need to Reader-enable the document. In Acrobat 11 you do this by selecting: File > Save As Other > Reader Extended PDF > Enable More Tools

  • How do I add additional pages to a book?

    How do I add additional pages to a book?

    Just below the thumbnails of the existing book pages is a + button. Press this and the pop-up menu "speaks for itself".

  • How do you add additional fields in infotypes?i want to leave blank space

    how do you add additional fields in infotypes?i want to leave blank space in front of the field?

    Hi,
    To add new fields go to PM01 and select Enhance Infotype option and then follow the steps in sequence.
    I am not getting blank space in front of the field. please elaborate it.
    Regards,
    Raja.D

  • How can we add additional fields to the BP Search RESULT screen?

    Dear Experts,
    How can we add additional fields to the BP Search RESULT screen so that the BP's being displayed in a search result show maintained values for the particular column/field?
    Thanks!!!

    Hi Laxman,
                           I got same requirement for ibase hierarchy.I want to add new fields in Ibase hierarchy AB.Do you have any idea regarding this.My requirement is that ,i want to dispaly a fields as a check box which display that this component is in under warranty or not by checking the box.Plz tell ,how can i add a new field in tree type context node.I add a new fields using AET ,but that is not available in that AB.
    Thanks
    Vishwas Sahu
    Edited by: vishwas sahu on Nov 17, 2009 1:51 PM
    Edited by: vishwas sahu on Nov 18, 2009 5:22 AM

  • How do I add URI web link with custom tooltip like "CLICK HERE TO UPDATE" instead of URI web link in tooltip.

    How do I add URI web link with custom tooltip like "CLICK HERE TO UPDATE" instead of URI web link in tooltip.

    You've probably found an answer to this by now, but I think this has been addressed in another forum -- The link below suggested using a button and adding the tooltip to the button. 
    https://forums.adobe.com/thread/304974?start=0&tstart=0
    Sounds like it would work but I haven't actually tried it. 
    Good luck~!

  • How can i add custom attributes to a new Class Object using the API ?

    Hello everyone,
    Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
    // doc is an instance of Document
    ClassObject co = doc.getClassObject();
    ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
    cod.setSuperclass(co);
    cod.setSuperclassName(co.getName());
    cod.setName("MYDocument");
    ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
    Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
    AttributeDefinition value = new AttributeDefinition(ifsSession);
    value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
    c.addAttribute(value);
    But i got the following error message :
    oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
    java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
    oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
    void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
    So, what am i doing wrong ?
    More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
    Any help would be appreciated. Thanks in advance.
    Guillaume
    PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
    null

    Hi Guillaume,
    you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
    is used to check for erronous cases only
    and it shouldn't be used otherwise.
    Creating your own objects could be simply done via
    ClassObject ifsClassObject;
    DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
    // get class object for my very own document
    ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
    // set the class for the document i'd like to create
    ifsDocDef.setClassObject(ifsClassObject);
    // set attributes and content for the document...
    ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
    ifsDocDef.setContent("This is the content of my document");
    // create the document...
    PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
    null

  • How to use Add Shipments functionality in Shipment document creation

    Dear All,
    We wanted to use the Add Shipments functionality in the Shipment document creation / change.
    We have two different shipment types.
    I want to add shipments of one shipment type in to Shipment document of anohter shipment type.
    I am not able to do it now as system is saying in the selection log that the shipment types are not same.
    Please let me know what are the pre requisite configurations to enable us to add shipments in to another shipment.
    Please let me tknow he standard functionality of "Add Shipments option" and how to use it to add shipments in a Shipment
    Regards
    Venkat

    Hi Venkat,
    The option "find shipments" is provided to select the shipments to reassign or deassign the deiveries etc in VT01n or VT02n
    transaction planning screen. Basically you can play around to assign and reassign the deliveries to different shipments
    This option is not creating the shipment within shipment. It is just selection of shipments for planning purposes
    Hope this helps.
    Regards,
    Ramana

  • How do you add a function to an existing Rules Dictionary via the SDK?

    The how to SDK describes creating a new dictionary and adding functions and other items. However, in reading the Java API docs, it is not apparent how one would add a new function to an existing dictionary.
    Once you have a reference to the RuleDictionary, there is a getDataModel method, but it returns a oracle.rules.sdk.datamodel.DataModel instead of the oracle.rules.sdk.editor.datamodel.DataModel. It appears that this DataMode class is different than the DataModel class in the editor sub-package. Further this DataModel class is not described in the API docs.
    There is an addFunction method, but I do not see how to create an instance of the Function class.
    Thanks,
    Bret

    Look at the oracle.rules.sdk.editor.datamodel.DataModel Constructor:
    Constructor Summary
    DataModel(RuleDictionary dict)
    Constructor used to edit a datamodel.
    So, the call would look something like:
    RuleDictionary dict = ...;
    oracle.rules.sdk.editor.datamodel.DataModel dm = new oracle.rules.sdk.editor.datamodel.DataModel(dict);

  • How to Implement Add User Functionality in ADF

    Hi,
    I already setup my web app to use ADF security and the sample user's and groups that I have created in jazn-data.xml is already
    functioning as expected.
    I just need to add the functionality on how to programmmaically add user in my weblogic internal LDAP realm
    and assign them to the currently configured user groups.
    This would be available to Admin Level user.
    Anybody has good site or link on how to accomplish this in my ADF Web Application?
    Thanks
    JDEV 11G PS3

    Hi Arun,
    Jdev Version 11.1.1.6.0
    I have one table already created in a hosted db.It has some columns namely Component,Manager,%CodeCoverage,TotalLines,Covered Lines.One manager has 5-6 components under him.
    What I want is to have a table having manager name and if I click on manager,it should show components under him with all the details mentioned above.
    I wanted to achieve it through tree table but don't know how to proceed

  • How can I add additional submenu items to Spry Menu Bar?

    The drop down header only allows for for 2 submenus - ie. child and grandchild pages
    How can I add a third or fourth submenu - ie great grandchild and great great grandchild pages?

    Its OK! I've just found an answer:
    http://forums.adobe.com/message/1049136#1049136
    PS. I did searching before I posted - but I didn't spot this till afterward

  • How can i add a function to the Home button?

    I'm developing an app and in order to make it work, i need to add a function to the Home button when the user is in a specific screen.

    I would not say "impossible", but certainly not an app that would ever be available via the iTunes App Store.

  • Outlook 2013 - How to extend/add new meeting in recurrent meeting inside SharePoint site ?

    I have created a recurrence meeting but now it is exired, how to extend ? Please advise

    Hi,
    Please check the link below
    https://support.office.com/en-us/article/Create-link-to-or-update-Meeting-Workspaces-98834566-4750-45e9-bb71-fe4acb26f170?ui=en-US&rs=en-US&ad=US#BM2
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/01054bef-1cb0-4401-88c9-e4593ab4b806/how-to-extend-date-in-recurring-meeting-workspace-in-sharepoint-site?forum=sharepointgenerallegacy
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How do you add additional pages in Pages 09 visual report

    I'm trying to create a report in Pages 09 using the Visual Report template.  I have over 150 photos to include in the report - 4 to a page.  I have two questions. The first one is how do I add pages beyond the 2 on the template.  Secondly, is there a way to group all 150 pictures and have them inserted into the document all at once or do I have to drag each one over individually?

    If you want more photo pages, select the appropriate template master from the Sections icon on the Toolbar.
    You can drag multiple images onto your .pages template but they will come in in a clump.
    The whole point of the template is the neat formatted style of the image and you get that by dragging photos individually onto the image placeholders.
    Are you using:
    Menu > View > Show Media Browser
    to drag in your photos? Or are you going straight from the Desktop? Either method works.
    In the Desktop you can arrange your images in Icon view and make them large enough to identify and rearrange them into the order you want to bring them in. Line up your .pages template with the open icon view window next to it then just drag over the images into the template with a simple click > slide > drop.
    Peter

  • HT4436 How do I add additional email addresses to my account?

    I want to add an additional email to my account for my little girl. How do I do that?

    You can create an email alias at the mail feature at iCloud.com

Maybe you are looking for

  • Is there a way to delete Windows files on reboot?

    I'm interested in creating an installer similar to apt-get on Linux. The idea is it will update packages when new ones become available, resolve dependecies, etc. The problem is under Windows if a file is locked in memory you can't touch it so I woul

  • I podcast artwork is not showing up for my show "Leaders in the Trenches"

    I got accepted about a week ago, March 3rd, 2014.  It is frustrating that my podcast is not published yet with the right artwork. The size for the file is 1400x1400 and 34kb.  Here is the page: https://itunes.apple.com/us/podcast/leaders-in-trenches-

  • Love LOVE LOVE the new highlights treatment tool! But I do have a suggestion!

    I have been using plugs to get the kind of treatment I now see in Lightroom4!!! Love LOVE LOVE the new treatment panel! It really makes it much easier and significantly quicker to edit all the photos of a weding, etc. I was able to use the sync funct

  • Does a 3G iPhone need a service provider/SIM card to access the internet?

    We have an old iPhone 3G that is no longer on a Bell contract.  We have installed Apps on the iphone through the computer but I cannot get the the wifi to work on it.  Does it need to be under contract with a carrier or have a SIM card in order for w

  • How to get current assigned participant id?

    Hi mates, This might be a basic questions, but useful for me :) How to get current assigned participant id from screenflow? Or How to pass it as an argument from interactive activity? Below is what I tried. Participant.id or Instance.participant.id -