SPONSORS:






User Tag List

Results 1 to 7 of 7
  1. #1
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Any way to \"Get\" that tag for nearest prior text?

    I have to have a way to go through a web portal app and make a list of the portlets in it, and a list of the html links that go with them. The way the page displays, you see however many portlets there are, and on each portlet is what looks like a title bar, and at the left end of that "bar" is a link that serves as the "name" of the portlet, and it's a real link, so it shows as an HtmlLink object. However, there's no real relationship between the portlet and the link put there, that is no object relationship, so I can't code it so that Silk just gets told to go get the ID of the portlet, and at the same time fetch the link that goes with it. They don't "go with" each other, except that there is a definite proximity relationship. I've spent a very interesting couple of hours figuring out that I could do a GetRect() on each portlet, and use its xPos and yPos coordinates to use as a comparison to the x and y of every link on the page, and any link within 10 pixels x and y must be the one I want. Well, it finally works, but I just realized that there's a tag - "nearest prior text" - which in fact indicates the link I want, apparently without fail. The way the portal is built, the link I want is going to always be that nearest prior text. It would be so easy to make my function if I could get that value.

    But I can't find a method anywhere that does a GetNearestPriorText or something like that.

    Anyone know?

    ------------------

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Any way to \"Get\" that tag for nearest prior text?

    GetPriorStatic() ?


    ------------------

  3. #3
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Any way to \"Get\" that tag for nearest prior text?

    Hard to understand 2 things -

    1. How could I have missed that one in the 4test Language Reference? I really did poke around, sure that there HAD to be a method for it.

    2. Why does SilkTest tell me that the method is not defined for the portlets?

    I made up a little testcase:

    Portlets are seen as being of class BrowserChild, and the Library Browser says that GetPriorStatic() is good for BrowserChild, so why does it tell me when I run it:

    Function GetPriorStatic is not defined for window Portlet.

    If I change the testcase to read:

    the testcase will run and return the caption of the portlet (unfortunately the caption is not the string I want).

    I also rewrote the testcase to read

    This asks for the prior static and the caption of an ordinary Html link on the same page. It correctly returns strings for both.

    So I'm stumped - why does Silk say it has no definition for GetPriorStatic in BrowserChild?

    ------------------

  4. #4
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Any way to \"Get\" that tag for nearest prior text?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by felecha:

    Portlets are seen as being of class BrowserChild, and the Library Browser says that GetPriorStatic() is good for BrowserChild
    <HR></BLOCKQUOTE>

    Actually GetPriorStatic is a method of the control class which derives from anywin. (Uncheck the "include all" checkbox?)

    Try Portlet.GetLocation() instead.

    John



    ------------------

  5. #5
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Any way to \"Get\" that tag for nearest prior text?

    Sure enough. I guess I was looking at Include All. Take it away, and GetPriorStatic is gone.

    So I guess I'm back to what I used before. It looks, by the way, as if GetLocation is user-defined. I saw that yesterday and thought I could write something that would get locations of the portlet and the very-close-to-it link. Then comparing EVERY link's position to the portlet would find the one that's within a certain small number of pixels. It works, but I've had so many instances of writing algorithms that are somewhat contorted, and then in the development of the product I find one day that a beloved idea doesn't work any more. So I was very interested in finding the link I wanted with something as direct as GetPriorStatic(). Hard to imagine the developers changing things in any way that would change the proximity that would make that work.

    No way of stealing a copy of GetPriorStatic out of the Control class, I guess.

    Thanks a lot, John

    ------------------

  6. #6
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Any way to \"Get\" that tag for nearest prior text?

    Here's another thought. Match the tags from a GetChildren() call with the Portlet tag you're interested in, then use the one immediately before it in the children list.

    John


    ------------------

  7. #7
    Senior Member
    Join Date
    Jun 2002
    Posts
    119
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Any way to \"Get\" that tag for nearest prior text?

    Bingo!

    Thanks so much. The algorithm is so simple compared to what I was doing. Actually I've used GetContents(), and can pick the name of the link off the LIST of String returned from that. Both work, but this one takes maybe 3 seconds, and the old one I was using takes on average about 3 minutes while Silk finds everybody and their GetRect and does calculations.

    I'm going to collapse the old one and comment it out and leave it tucked away at the end of the function, though. I never know when something will change, and 2 working algorithms are better than 1.

    Wow!

    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:35 AM.

Copyright BetaSoft Inc.