Page 1 of 1

Profound UI API's

Posted: Wed Dec 18, 2013 6:14 pm
by DaveLClarkI
I don't know if I missed it in the documentation; but, I could wish that all of the Profound UI API's were also methods of the "pui" object. To me, this makes it self-documenting that a particular function is part of the Profound UI vs. a global browser DOM function.

For example... You have the get(...) and getObj(...) API's and you have the following:

pui.click();

So, I could wish that the following were also valid. Are they?

myval = pui.get(...);
myobj = pui.getObj(...);

Re: Profound UI API's

Posted: Wed Dec 18, 2013 7:23 pm
by Scott Klement
I agree with you. I wish that all of the APIs were part of the pui object as well. Unfortunately, when this stuff first started, they did not do things that way... When more recent APIs were added, they used the "pui" object, though.

I know that recently, we added pui.set as an alias for changeElementValue(), and pui.get() as an alias for get(). So, in this case you can use them with or without the pui prefix. However, I dont think we have added an alias for getObj...

Re: Profound UI API's

Posted: Thu Dec 19, 2013 11:48 am
by DaveLClarkI
OK, here's an "easy" suggestion to make all of the standalone API's also available as methods -- and which is completely backwards compatible... Using getObj() as an example, you have it defined somewhere as something similar to the following:

Code: Select all

function getObj(...)
{
  ...
}
For an enhancement, you can make that API available from the "pui" object, as a method, as follows:

Code: Select all

pui.getObj = getObj;
No muss, no fuss, and the same function becomes a method by the same name. I look forward to it. ;-)

Re: Profound UI API's

Posted: Thu Dec 19, 2013 12:03 pm
by David
This is exactly how the pui.set() / pui.get() aliases are done. We have on our 'to-do' list already (although it's not highly prioritized) to do this for ALL names that we define in the global scope. We will likely do this, rather than one or 2 APIs in a piecemeal fashion.

I would actually like to see it done in reverse manner, where all the names in the global scope 'go away' for good. For existing customers, we could perhaps define the old names in a 'backwards compat.' file that could be removed by customers who have adjusted all scripts to the new format. Or, left in place for those who have no time/desire to do it.

Re: Profound UI API's

Posted: Thu Dec 19, 2013 12:17 pm
by DaveLClarkI
David wrote:I would actually like to see it done in reverse manner, where all the names in the global scope 'go away' for good.
Ideally, yes, I agree; but, as you said, not backwards compatible by itself. ;-)

Re: Profound UI API's

Posted: Thu Dec 19, 2013 3:01 pm
by Scott Klement
We'll definitely add your vote to this feature request, then, Dave. With WinWholesale asking for it, perhaps we can convince "the powers" to bump up the priority on this item. (Which I'd like very much.)

Thanks!