ADF partialSubmit lifecycle - oracle-adf

Does autosubmit and partialsubmit send an AJAX request or normal request to server? How do the components which has its partialTrigger property set get refreshed?

In addition to Shay's answer..
If you use a browser debugger like Firebug, you can tell how partial submits that cause PPR work by monitoring the RQ/RS data. PPR responses typically contain the following structure:
<?xml version="1.0" ?>
<?Adf-Rich-Response-Type ?>
<content action="/YOURAPPLICATION/faces/somthing/SomePage?_adf.ctrl-state=1d72fpsv6l_20">
<!-- zero to N fragments -->
<fragment>
<!--HTML content here which may include javascript as well -->
</fragment>
</content>
During a PPR's render phase, the renderer actually tries to render only those that are partial triggered but the whole component tree is still restored.

Related

SvelteKit loading indicator when a page load time threshold is exceeded

I am using SvelteKit for a website that is mainly server-side rendered pages. The client-side navigation on SvelteKit works beautifully and is super snappy. However, sometimes, when the backend server is called in the route load() function, the response is not instant and maybe several seconds because of the database long-tail latency.
What would be the best way to create a loading indicator that is only displayed if the loading time is not instant (sub 200ms)? I am aware of the generic navigating pattern, but I specifically hope to create a loading indicator that is not triggered unless the page load is not instant.
Sveltekit has a store variable called "navigating" which literally indicates if the client is in-between loading pages. From the Sveltekit docs:
navigating is a readable store. When navigating starts, its value is { from, to }, where from and to both mirror the page store value. When
navigating finishes, its value reverts to null.
Note, that if your page is pre-rendered, it should be "instant" and thus not show a loading indicator. If not, this "navigating" variable will be not null for as long as it takes for your content to be fetched and/or rendered. If you wanted to, you could make the "Spinner" component show nothing...until after 200ms (using a setTimout timer)...which it sounds like you do want.
Here's a sample implementation from a wrapper component I have used in the past (pardon the tailwindcss syntax...I copied and pasted it). You can customize this idea in __layout.svelte or wrap components or entire "pages" with this {#if $navigating} logic:
<script>
// USE THIS:
import { navigating } from '$app/stores'
// Example spinner/loading component is visible (when $navigating != null):
import Spinner from '$lib/design/Spinner.svelte'
...
</script>
<main class="py-4">
<div class="pagePaddingMain flex-col">
{#if title}
<h1 class="text-4xl text-center text-cText pb-4 sm:text-5xl">{title}</h1>
{/if}
{#if $navigating} <!-- LOOK HERE -->
<div class="m-8">
<Spinner />
<h1 class="ext-3xl text-center text-cText">Fetching {title}...</h1>
</div>
{:else}
<slot />
{/if}
</div>
</main>
That's it. Good luck!

Service Cloud Toolkit API cannot be used with your browser - salesforce

Salesforce interaction/console methods not executed after redirecting to other URL in CTI console softphone. I have mapped the CTI Adapter URL(for ex: http://domain1:port1/xyz/test.jsp) in softphone layouts of the call center, the interaction/console methods get executed on that particular page.
Method Like :
sforce.interaction.runApex(...);
On click event I redirect to some other URL (for ex: http://domain1:port2/abc/test1.jsp) on this page interaction/console methods not executed.
Methods Like :
sforce.console.setCustomConsoleComponentPopoutable(...);
sforce.interaction.runApex(...);
On console - "Service Cloud Toolkit API cannot be used with your browser" appears after page redirects.
Please help with the scenario
This error is caused by the validation of sfdcOriginIframe and nounce properties when sending out the window message to the top window.
Actually this two properties are populated from the window.location.search field once the softphone loaded.this search field goes like :
?sfdcIFrameOrigin=https%3A%2F%2Fap5.salesforce.com&nonce=3c1d1c360732e6754323247e711324b86d027c3c2809abb163754069d02365c5&isAdapterUrl=true&
I think they come from the src of the iframe tag
<iframe
id="SoftphoneIframe"
name="SoftphoneIframe"
allow="camera *; geolocation *; microphone *"
src="/loadSoftphone.html?sfdcIFrameOrigin=https%3A%2F%2Fap5.salesforce.com&nonce=3c1d1c360732e6754323247e711324b86d027c3c2809abb163754069d02365c5&isAdapterUrl=true"
style="display: block;"
width="100%"
height="650"
frameborder="0"
></iframe>
if you redirect the location of your softphone frame, the search field is gone, and you can't use any methodes in interaction.js anymore.
so maybe there are two approaches to resolve this problem:
retain your search field in a hidden field and bring it ot your next page as a searchQuery string;
refresh your top window just before you redirect your softphone
sforce.interaction.refreshPage();
Finally I used the second solution to fix my problem.
Code sample

Unescape and then sanitize data in Angular

The API I am using automatically escapes any strings from user inputs(as it should). I am having a real hard time finding the best way to unescape/sanitize the data to then use on my page. Is a directive a good route to go here?
Sample Response
<b>This is the response!</b><br><br><i>It comes in italic, too.</i>
Template
<div ng-bind-html="groupsDetailCtrl.group.information.text"></div>
<!-- Or pass in to directive? -->
<group-information content="groupsDetailCtrl.group.information.text"></group-information>
Currently Output on page is just something like this
<b>This is the response</b>
When of course it should be
This is the response

AngularJS Blocked loading resource

I am not sure why but I am trying to make an image button and the URL's come from getting a JSON object in my controller, but what ever the link is through an error, and if I change it to works fine!!!
Controller:
$scope.iconImage = 'http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png';
HTML:
<!-- Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. -->
<input type="image" ng-src="{{iconImage}}" />
<!-- This works fine -->
<img ng-src="{{iconImage}}" />
You might use the Strict Contextual Escaping (SCE) mode to marked the URL as a safe content source.
See trustAsResourceUrl(value);
Inject [$sce] in your controller and then use it like this:
$scope.iconImage = $sce.trustAsResourceUrl('http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png');
You can white list the URL using the $sceDelegateProvider. See here.

Loader/spinner animantion while route is changing

How can I show a spinner or loader gif animation while route is changing from one to another.
I am using ng view like as follows:
<div ng-view class="view-animate">
</div>
I am loading templates from server and also inline. While the HTTP request is pending I need to show the spinner/loader... any snippets?
You can show and hide the loader when location change starts and is completed, respectively.
Here is a plunkr that I have created for this situation. This uses ui-router and is taken from one of the apps that I have created, so it may not be useful as-is, but it will give you an idea on how to approach the problem.
HTML Code inserted below just to keep SO happy...
<ui-view class="view"></ui-view>
<div loader="" class="ng-hide"></div>
I hope it helps.
Abhi.

Resources