tag:blogger.com,1999:blog-34020393.post5752405218176279914..comments2024-03-15T08:31:05.506-07:00Comments on Jim's PeopleSoft Journal: Changing the Search Page OperatorJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-34020393.post-38744911440178982162014-02-26T13:25:27.269-08:002014-02-26T13:25:27.269-08:00@jb, no, unfortunately, it is not possible to chan...@jb, no, unfortunately, it is not possible to change the search page operator using PeopleCode. You can only do this through JavaScript.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-22868539819112315832014-02-26T08:22:58.706-08:002014-02-26T08:22:58.706-08:00Jim, can this be done in a PeopleCode event just b...Jim, can this be done in a PeopleCode event just before I call a DoModalComponent function?<br /><br />I want to change the operator to 'in' so I can pass a list of possible values to search for.<br /><br />Joe B.jbhttps://www.blogger.com/profile/17592234246746572388noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-26586648780058605452012-03-05T08:47:38.810-08:002012-03-05T08:47:38.810-08:00@Leandro, that may be caused by a difference betwe...@Leandro, that may be caused by a difference between PT 8.49 and 8.50+. 8.49 performed full page refreshes when loading pages. 8.50+ systems use Ajax. document.write called after $(document).ready will overwrite the entire page. That is why you receive the warning. I will make note of this for the next version of the book.<br /><br />In the code, you will notice that the import script function uses document.write until a certain point, and then changes the definition of the import script function to one that creates a script node. Given 8.50+'s Ajax design, document.write should no longer be the default. Instead, it should be replaced with a check to see if the page is loaded. If it is, then use the script node variety. Otherwise, use document.write.<br /><br />I am surprised it is working with document.write.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-9079119234478134442012-03-05T08:31:06.065-08:002012-03-05T08:31:06.065-08:00Jim, after implementing a slightly different versi...Jim, after implementing a slightly different version of the "configurable user interface" functionality described in chapter 7 of your book, I noticed in the browser's JavaScript console that I keep getting the following warning (always twice in a row):<br /><br /><b>Warning: A call to document.write() from an asynchronously-loaded external script was ignored.</b><br /><b>Source File: [URL of currently-displayed PeopleSoft content]</b><br /><b>Line: 0</b><br /><br />Despite this warning, everything seems to work relatively well. Any idea how I can debug this?Leandrohttps://www.blogger.com/profile/02824144205368440595noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-24632593435492687212012-03-02T10:44:59.573-08:002012-03-02T10:44:59.573-08:00@Jim Oh, no problem there at all - I've been m...@Jim Oh, no problem there at all - I've been meaning to buy it anyway, and if it saves me an hour of work on this issue I'll have already paid for it. You provided plenty of free advice in your reply - knowing the destination I need to reach, I'm happy to buy the ticket!-)Paulhttps://www.blogger.com/profile/17302579043720126040noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-9136672078392129302012-03-02T10:40:49.668-08:002012-03-02T10:40:49.668-08:00@Paul, Sorry, I didn't mean to push the book s...@Paul, Sorry, I didn't mean to push the book so hard in my response. I just assumed everyone already had it ;). And, I wanted to get you an answer rather than have you wait for me to write up a full response.<br /><br />The book is available through <a href="http://www.safaribooksonline.com" rel="nofollow">Safari Books Online</a>, and several other online media, so if you already have a subscription somewhere, then you should have access.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-10075165104910459842012-03-02T10:36:36.773-08:002012-03-02T10:36:36.773-08:00Thanks for the detailed response, Jim! We will buy...Thanks for the detailed response, Jim! We will buy your book and try it out, and let you know how it goes.Paulhttps://www.blogger.com/profile/17302579043720126040noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-19622255255454995072012-03-02T08:32:49.284-08:002012-03-02T08:32:49.284-08:00@Paul, that is a great use case. As you know, ther...@Paul, that is a great use case. As you know, there is no design mode for search pages, so it is not possible to modify them directly. You can, however, modify them from JavaScript. The trick will be executing the JavaScript so that it imports your CSS before the page is fully displayed. Otherwise your page might look a little funny.<br /><br />In my book I show how to add JavaScript to PT_COPYURL. I used PT_COPYURL in my book because PT 8.49 had a size limit. As of 8.50, that is no longer the case, so you can now use PT_PAGESCRIPT, etc. Once you pick a JavaScript HTML definition, add some JavaScript to make an Ajax call to an iScript. That iScript will read the database to determine the page's stylesheet and will write back %Response.GetStylesheetURL. You will want your Ajax to be synchronous (blocking) and you will want to use document.write to create the stylesheet link in your search page.<br /><br />Making a blocking ajax call on load will have an impact on performance. If you don't mind the screen flicker of loading up a new stylesheet after the page is loaded, then you can go with non blocking and import the stylesheet using the technique mentioned in my <a href="http://jjmpsj.blogspot.com/2007/01/importing-custom-stylesheets-into.html" rel="nofollow">Importing Custom Stylesheets</a> post.<br /><br />In my book, I show how to add approximately 10 lines of JavaScript to PT_COPYURL, and that 10 lines imports jQuery and then runs an iScript to determine additional content to add to the page (search pages included). It is non-blocking, so CSS imports may look a little funny.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-4564332228941449972012-02-25T16:25:03.754-08:002012-02-25T16:25:03.754-08:00Hi Jim, thanks for so much spectacular content! I ...Hi Jim, thanks for so much spectacular content! I wonder if you have a suggestion for approaching this requirement. I'd like to make PeopleSoft search pages default to the stylesheet of the first page in the component they are hanging from - of course in the least-invasive way possible.<br /><br />Thanks in advance for any help you can give.Paulhttps://www.blogger.com/profile/17302579043720126040noreply@blogger.com