How to get the active Paragraph?

I have following TLF XML:
private var text:XML =
<flow:TextFlow fontSize="20" paddingRight="50" paddingBottom="50" paddingTop="50" paddingLeft="50" whiteSpaceCollapse="preserve" xmlns:flow="http://ns.adobe.com/textLayout/2008">
        <flow:p>
                 <flow:span>Hallo liebers Programmili... du tust schon langsam meinem koepchen weh</flow:span>
        </flow:p>
</flow:TextFlow>;
I try to get the Paragraph for a selection inside the text using following Methodes:
var index:int = tf.interactionManager.anchorPosition; // i get 29 here
var child:FlowElement = tf.getChildAtIndex(index); // undefined - it should be the flowElement containing the text... <flow:span></flow:span>
var para:ParagraphElement = test.getParagraph();//undefined - it should be the paragraph
I really started to enjoy the new framework... but now i am getting really mad
Can anybody imagine what i am doing wrong? The undefined itself makes me suspicious... shouldn't it be null?
Help would be much appriciated!

You are confusing index and position.
What you want is:
var position:int = tf.interactionManager.anchorPosition;     // this is a position not an index
var leaf:FlowLeafElement = tf.findLeaf(position);     // maps a position to a leaf
var para:ParagraphElement = leaf.getParagraph();     // find the leaf element's owning paragraph
Also consider whether you want the anchorPosition or the activePosition.  In a point selection they are the same.  In a block selection the anchor is where the block began and the active is the end being modified by the UI (mouse dragging and keys).
Hope that helps,
RIchard

Similar Messages

  • How to get the active application users IP address in R12 by sql command

    Hi ,
    I need to know how to get the active application users IP in R12 by sql command
    in order to kill any session by the IP address ?
    Am working on 12.1.3 Application
    And 11.2.0.3 Oracle Database
    Thanks

    936921 wrote:
    Am still couldn't found the IP address for the connected Application users.
    If there any select statement can help me with that?
    Really? Then how do you explain me finding the following docs from the links I referenced above?
    How To Find The IP Address Of The Client Machine From Where A Particular Forms User Is Connected ? (Doc ID 879092.1)
    How to Track IP Address of the Form Session in Oracle application 11i (Doc ID 878931.1)
    Where to find the Client IP Address for a Client in E-Business Suite? (Doc ID 1258415.1)
    How To Get The terminal ID For The Machine From Which A User Is Logged To E-Business Suite Applications (Doc ID 751658.1)
    Thanks,
    Hussein

  • RRB-How to get the activity description instead of WBS element in the bill

    Dear All,
    I am using RRB DIP profile to do my Resource related billing
    RRB-How to get the activity description instead of WBS element in the billing
    document.Now  iam able to get the cost and the quantity used as line items but instead of getting the respective line items in the invoice iam still getting the WBS
    element description for all the activities.Can some body guide me to overcome this problem.
    Assured reward points for your suggestions and help.
    Thanking you,
    Best regards,
    R.Srinivasan

    Dear All,
    Please can any body help me for the same.IT is urgent.I will award you points.
    thankyou,
    Best regards,
    R.Srinivasan

  • I am getting ready to wipe a PC clean but wanted to know how to get the activation code for the Version of Adobe reader that is currently installed on the PC?

    I do not have the activation code for this PC and need to know how to get the software loaded back on it after a clean install of the OS and other programs.

    If you use any additional subscription services to Adobe Reader, they are activated with your Adobe ID & password.

  • How to get the activity of a user?

    Hi Experts,
    How can we get the activity of a user i.e. Which transaction a particular user has gone or some activity log on a particular date? Any table, FM or Tcode. I have already checked the STAD and SM20 transactions. Some authorization problem. So anything except these Tcodes would be helpful. Thanks in advance.
    Regards,
    Prashant.

    >
    santhosh kumar wrote:
    > Hi,
    >
    > I guess if it is not updated or traced under STAD means, i.e. related to authorization failures etc.. kind of stuff will be saved at runtime only in the SAP memory.
    >
    > As it is stored in the buffer, can not be traced in any of the transaction.
    > You should request the user to save and send the screen shot of the SU53 of the user whenever he gets some authorization issue.
    >
    > Based on that, by looking into the SUIM transaction, it can be known whether he is authorized or not, which roles have been assigned etc.. kind of details.
    >
    > Regards,
    > Santhosh.
    Hi Santosh,
    Actually I am doing a root cause analysis for which I need to know whether a particular user has used a particular TCode. I guess the STAD will display only the current data, is there a TCode to display historical data related to user accessing a particular data. Note: I don't have basis authorization.
    Regards,
    Prashant

  • How to get the activity instance id and process id

    Dear All,
    For my case, my boss require the workflow program processor can be runtime assigned . After research, I found the coding example like below:
    // dynamically assign a user to a role
    rtm.addRuntimeDefinedUserToRole(
                      // process instance
                      prInstance,
                      // role name
                      "Processor",
                      // user that is assigned (IUser)
                      user,
                      // user context (IGPUserContext)
                      userContext);
    // dynamically change the user assigned to a role for a particular task
    String prInstanceID = prInstance.getID();
    rtm.changeTaskProcessor(
                      // process instance ID
                      prInstanceID,
                      // activity instance ID
                      activityInstanceID,
                      // current user (IGPUserContext)
                      currentProcessorContext,
                      // new user (IGPUserContext)
                      newProcessorContext);
    But I don't know how to get the process instance ID and activity instance ID before I can apply this api in my webdynpro application.
    Any gentllement can give me an idea.
    Thank you.
    Regards
    Eric

    process =  GPProcessFactory.getDesigntimeManager().getActiveTemplate(
                                  // by specifying its ID "CCD2C3F1BED111DD9DFA005056A9416C",/
                                                 /* and the user accessing it */ userContext);
         //          retrieve the Runtime Manager
         IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
         // create an empty role assignment list
         IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
         //Initialising the input params
         IGPStructure params =GPStructureFactory.getStructure(process.getInputParameters());
         params.setAttributeValue("Name",value);
         //Starting the process
         IGPProcessInstance prInstance = rtm.startProcess(process,"Process Name","Process name",user,roles,params,user);

  • Formatted Search: How 2 get the active value

    Hi ,
    I defined a simple FS to learn, but keep getting the same values for different codes.
    Shortly, I have 2 tables, first one (
    REASON) keeps ReasonID,Reason Description, etc.
    In the second one (MAIN) I enter other unrelated data and ReasonID.
    I wanna get Reason Description from REASON table into that MAIN table by the help of FS. So I defined something like that:
    SELECT T0.U_ReaDesc from .[@REASON]  T0 , .[@MAIN] T1 WHERE T0.U_ReasonID = T1.U_ReasonID</b> 
    When I use this query, I keep getting the same reason description for different reason codes, actually the description of the first data in the REASON table.
    Ouery settings : Search By Saved Query - Auto Refresh - When exiting altered column - Column "REASONID "- Refresh regularly
    I guess, I have to add or change something in the query, so that I can refer to the <u>activ ReasonID value</u> in the MAIN table and get the descr. for it.
    (Sorry if this subject is handled before but I couldn't find anything related in SDN.)

    Hi Gul,
    Why don´t you download the help files from the SBO marketplace?
    You can find a document about the FS under Service & Support SAP Business One  Knowledge & Services  Knowledge Base Customizing Formatted Searches.
    There it explains lot of things about them.
    The FieldId is the variable number seen when you are in debug mode. ColID is used only for matrix columns. And you could use 0 for the format is no formating is needed.
    Regards,
    Ibai Peñ

  • How to get the active document file name using illustrator CS2 plugin code?

    I wanna take file name from active document using illustrator plugin CS2. Plz anybody help me..
    Thanks in advance..

    AIDocumentSuite::GetDocumentFileSpecification() should get you that information. Note that it will only work properly if you've already saved the document (or opened it from a file). I'm not sure what the result looks like if you're calling that on a new, unsaved file.

  • [CS2 JS] Get the parent paragraph of a table

    Hi,
    Anybody here who knows how to get the parent paragraph of a selected table?
    var myTable = app.selection[0];
    var myStory = myTable.parent.paragraphs;
    The script above gives me all the paragraphs of the parent text frame. I want to know the index of the paragraph where my selected table is.
    Appreciate the help you can give. Thanks!

    from VB6 ObjectBrowser (PC):
    Property StoryOffset As InsertionPoint
    read-only
    Member of InDesign.Table
    The location of the Table in the parent story.
    so (VB6):
    myTable.StoryOffset.Paragraphs.Item(1)
    should give you paragraph
    robin
    www.adobescripts.com

  • How to obtain the active version of a contract?

    Function module BBP_PD_CTR_GETDETAIL and table CRMD_ORDERADM_H do not seem to filter the non-active contracts.
    How to get the active version only.

    It is at the item level. Refer to table BBP_PDIGP field ITM_RELEASED

  • How do I get the activity window in safari 6.0.2?

    How do I get the activity window in safari 6.0.2?

    Safari 6
    Activity Window is no more available in Safari 6.
    Apple removed that feature.
    Best.

  • I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I've gotten a little further on this. The dynamic select is
    working fine. It's the "a href" code that isn't. I'm wondering if
    someone can look at this line and tell me if it's okay to build the
    query string this way. The storeid comes through fine but I'm still
    not getting the employeeid value to pass. Here's line that's not
    working:
    td><a href="registerStoreCust.php?storeid=<?php echo
    $row_storeRS['storeid']; echo "&employeeid="; echo
    $_GET['employeeLM']; ?>">Register
    Customer</a></td>

  • How to get the current running activity , suspend it and then restart it?

    hi everybody,
    i'm new in the Bpel world so please try to help me ...
    So my question is how, while a bpel process is running, can i get the activity currently running...and if there is a problem while the execution i can get where exactly did the process stopped and i could restart it?
    i know these are lot of questions but any thing could help....
    thanks in advance

    i already tried JAVA BPEL PM API i wrote the code but i didn't test it yet...
    since i don't know yet how to write a hole project running in the oracle server i couldn't konw if my code is running or not???
    Locator locator = new Locator("default","bpel");
    WhereCondition where = WhereConditionHelper.whereActivitiesOpen();
    IActivityHandle[] activityHandles=locator.listActivities(where);     
    System.out.println("state of an activity "+ activityHandles[2].getState()+ " " +activityHandles[2].getLabel());
    but to know which activity was running when a problem occured...i'll give a look to the file you gave me about bpel fault policies....
    but to restart the process with java code from specific activity...i didn't find in the API something to do this..
    so may be you could help in this point???
    thanks in advance

  • How to get the list of active devices in current wifi network?

    Hi All,
    I am going to a start a new Network based app. So please any one give me an idea on the below question.
    How to get the list of active devices in current wifi network?

    Nope I want the log-in user to retrieve its Group where he is belong. I have this following code
    strUsername = Request.getParameter("username").toLowerCase().trim()+"@dev.test.com.ph";
    strPassword = Request.getParameter("password").toLowerCase().trim();
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    env.put(Context.PROVIDER_URL, MY_HOST);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL,strUsername);
    env.put(Context.SECURITY_CREDENTIALS, strPassword);
    // enable tracing
    env.put("com.sun.naming.ldap.trace.ber", System.err);
    // Create the initial context
    DirContext initCtx = new InitialDirContext(env);
    // Get the target context
    DirContext targetCtx = (DirContext)initCtx.lookup("");
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    // Perform the search on the target context
    NamingEnumeration enum = targetCtx.search("","(userPrincipalName="+strUsername+")",constraints);
    javax.naming.directory.Attributes attrs;
    NameClassPair item;
    String[] attrIds = new String[]{"MemberOf"};
    // For each answer found, get its "Groups" attribute
    // If relative, resolve it relative to the target context
    // If not relative, resolve it relative to the initial context
    while (enum.hasMore()) {
    item = (NameClassPair)enum.next();
    Out.println(item);
    attrs = targetCtx.getAttributes(item.getName(), attrIds);
    Out.println(attrs + "<br>");
         initCtx.close();
    It returns all this string :
    {memberof=memberOf: CN=CMCanadaRD,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=iMngrCanadaRW,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=Domain Users,CN=Users,DC=dev,DC=test,DC=com,DC=ph, CN=Backup Operators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph, CN=Administrators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph}
    How can i retrieve the Group named CMCanadaRW and CMCanadaRD on the Attribute?
    Thanks

  • How to get the list of Group set in each Users in MS Active Directory

    Hi. I would like to know if you know how to get the set group of each user in Active Directory?
    We have this sample code
    String INITCTX ="com.sun.jndi.ldap.LdapCtxFactory";
    //String MY_HOST = "ldap://myserver/ou=dev,dc=test,dc=com,dc=ph";
    String MY_HOST ="ldap://myserver.dev.test.com.ph:389/dc=dev,dc=test,dc=com,dc=ph";
    String strUsername,strPassword;
    try
         strUsername = Request.getParameter("username").toLowerCase().trim();
         strPassword = Request.getParameter("password").toLowerCase().trim();
         Hashtable env = new Hashtable();
         env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
         env.put(Context.PROVIDER_URL, MY_HOST);
         env.put(Context.SECURITY_AUTHENTICATION, "simple");
         env.put(Context.SECURITY_PRINCIPAL,strUsername+"@dev.lst.com.ph");
         env.put(Context.SECURITY_CREDENTIALS, strPassword);
    After validating the User Name and Password the next task is to Retrieve the group list of the User.

    Nope I want the log-in user to retrieve its Group where he is belong. I have this following code
    strUsername = Request.getParameter("username").toLowerCase().trim()+"@dev.test.com.ph";
    strPassword = Request.getParameter("password").toLowerCase().trim();
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY, INITCTX);
    env.put(Context.PROVIDER_URL, MY_HOST);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL,strUsername);
    env.put(Context.SECURITY_CREDENTIALS, strPassword);
    // enable tracing
    env.put("com.sun.naming.ldap.trace.ber", System.err);
    // Create the initial context
    DirContext initCtx = new InitialDirContext(env);
    // Get the target context
    DirContext targetCtx = (DirContext)initCtx.lookup("");
    SearchControls constraints = new SearchControls();
    constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
    // Perform the search on the target context
    NamingEnumeration enum = targetCtx.search("","(userPrincipalName="+strUsername+")",constraints);
    javax.naming.directory.Attributes attrs;
    NameClassPair item;
    String[] attrIds = new String[]{"MemberOf"};
    // For each answer found, get its "Groups" attribute
    // If relative, resolve it relative to the target context
    // If not relative, resolve it relative to the initial context
    while (enum.hasMore()) {
    item = (NameClassPair)enum.next();
    Out.println(item);
    attrs = targetCtx.getAttributes(item.getName(), attrIds);
    Out.println(attrs + "<br>");
         initCtx.close();
    It returns all this string :
    {memberof=memberOf: CN=CMCanadaRD,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=iMngrCanadaRW,OU=Groups / Teams,DC=dev,DC=test,DC=com,DC=ph, CN=Domain Users,CN=Users,DC=dev,DC=test,DC=com,DC=ph, CN=Backup Operators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph, CN=Administrators,CN=Builtin,DC=dev,DC=test,DC=com,DC=ph}
    How can i retrieve the Group named CMCanadaRW and CMCanadaRD on the Attribute?
    Thanks

Maybe you are looking for

  • LR 5.3 bug: local adjustments not saved in XMP

    Hi, I'm seeing the following bad bug on my mac, with LR5.3 If I save metadata to disk and immediately reload, I lose some adjustments, like brushes, tone curves, etc. I compared some old .xmp and the .xmp saved by LR5.3 and indeed there are some sect

  • I've lost alll my bookmarks..how do I get these back? Theres two problems now.. facebook crashes & I have lost my bookmarks?Help!'''

    '''I updated to 7.0.1 however facebook was not showing pictures etc. Not being the best computer geek I have made things worse going to firefoxs troublshooting to resetting localstore.rdf? I've lost alll my bookmarks..how do I get these back? Theres

  • Validating a xml schema (xsd file)

    Hi, I was wondering - my program should accept schema files and before doing whatever it does with them I want to put them through a validation and present errors if any. I wasn't sure what is the right way to go about this - I know how to set up a v

  • Cannot create connection to DBMS - UOM Manager

    Hi All, I am getting the following error while connecting to MDM UOM Manager(MDM repsoitory). "Cannot create connection to DBMS, Check DMBS details" UOM Manager : 7.1.3.62 MDM : 7.1.03.44 Do i need to have local DBMS installation to get this work?? l

  • Can't Turn Off Display Completely in XP

    Hi, My MacBook Pro screen does not turn off after idling in XP. I'd to be able to turn the display off (even manually) without putting the computer completely to sleep. When I dim the screen all the way down in XP, the lowest setting is not off, just