How to fix 'blank' iframe in Classic - salesforce

I placed the VF page with commandButton in Layout.
After pressing this button the frame with VF page become blank.
Here is console log state after button pressing:

Have you tried this: https://developer.salesforce.com/forums/?id=9060G0000005SQwQAM
You may also what to want to try to add this line to your code:
add_header Content-Security-Policy "frame-src 'self' https://salesforce.com;"

Related

switchto.defaultcontent() method not working with chromedriver 99.0.434

Problem: On a web page> + icon>clicking on it>opens a small widget on same page. it has iframe to access the fields, so switch to iframe. after this need to click on a button which does not come under any iframe. So I was trying to come out of iframe by switchto().defaultcontent() but this is not working. And as a result that button is not found.
I can confirm that with Selenium.WebDriver.ChromeDriver v99 switchTo().DefaultContent() is not working, once you selected a new frame switchTo.Frame(1)

mPDF - Show background only on odd pages

Using mPDF, I'm trying to apply a background image only on odd pages.
This works (only odd pages will be red):
$pdf->SetDefaultBodyCSS('background', 'red');
$pdf->WriteHTML('test');
$pdf->SetDefaultBodyCSS('background', 'white');
$pdf->AddPage();
$pdf->WriteHTML('test');
But this does not work (background is showing on both page 1 and 2):
$pdf->SetDefaultBodyCSS('background', 'url(\'./pdf-bg.png\')');
$pdf->WriteHTML('test');
$pdf->SetDefaultBodyCSS('background', 'none');
$pdf->AddPage();
$pdf->WriteHTML('test');
What I tried so far:
Using named pages (e.g. #page oddpage), it completely changed the page parameters and broke the layout
Using #page :first, I can't use :first as I need every odd page to have a background, not only the first one
Any clue? Thank you in advance!
I eventually found a workaround, not my favorite solution but it does the job!
$pdf->SetDefaultBodyCSS('background-image', 'pdf-bg.png');
$pdf->SetDefaultBodyCSS('background-image-resize', 6);
$pdf->SetDefaultBodyCSS('background-image-resolution', '300dpi');
$pdf->WriteHTML('test');
$pdf->SetDefaultBodyCSS('background-image', 'pdf-bg-white.png'); // Reset background to a blank page
$pdf->AddPage();
$pdf->WriteHTML('test');
So basically using the background-image CSS property instead of background and resetting the background with a full-white background to emulate a blank page.

Angular Js + Rest API + Sharepoint List - Validation and Edit not working

I am having 2 problems in below code.
// http://jsfiddle.net/Jfw9R/7/
Validation is not working when i try to run the application as main page - applicationpage.aspx page. but when i use any html page for main page validation is working fine.
when i click on edit at list.html page. it is redirecting me to edit.html page. that is ok. but data is not coming for the employee for whom i want to edit. data only coming when i change some text in any input control. i don't why ?
Thanks
1 now this is done as i have to provide there ng-form tag instead of form in child page. which is edit.html –

Error when clicking Add-button in CRUD

When a form or an add-button returns to a page, it throws an error or shows wrong output on the page, if there is js or other kinds of output on the page. Here is an example:
$tabs->addTab('Skoler')->add('CRUD')->setModel('School');
$crud=$tabs->addTab('Elever')->add('CRUD');
$crud->setModel($student);
if($crud->grid){
$crud->grid->addButton('addStudents')->set('Importer elever')->js('click',$this->js()->univ()
->dialogURL('Importer elever',$this->api->url('importusers&usertype=student'))
->execute());;
$crud->grid->js(true)->addClass('reloadstudent');
$crud->grid->js('.reloadstudent')->reload();
}
When clicking on "Add School" This outputs
$('#barometeradmin_mgr').univ().dialogURL('Importer elever','/redskab/barometer/admin/?page=importusers\x26usertype=student\x26barometeradmin_mgr_tabs_view_htmlelement_crud_virtualpage=add')
in the dialogurl created by the button.
Is there a way to check if the page is loaded for the second time (that is, by the button).
Thanks!
Jeppe
I think all you need to do is leave out the '->execute()'?

Jquery mobile ui-btn-active in navbar

I've been trying to get this to work for 4 days now, with no luck.
I have a very simple jquery mobile app.
The app has a header, content and footer.
The footer is being generated dynamically on the 'pagecreate' event because it is always the same and I don't want to have its HTML in every page.
So I do something like this:
$(document).delegate('[data-role="page"]', 'pagecreate', function (e) {
DrawHeader($(this));
DrawFooter($(this));
SetFooterEvents($(this));
SetActiveFooter($(this));
});
DrawHeader() and DrawFooter() simply prepent the header div to the page and append the footer div.
SetFooterEvents() sets the onclick events of the footer navbar buttons and SetActiveFooter() is SUPPOSED to set the ui-btn-active to the current active footer link.
To do this, I've added the data-active-footer attribute to the page div and the data-name attribute to the navbar elements. I'm searching for the current element according to the data-active-footer in the page and apply the ui-btn-active class.
function SetActiveFooter(page) {
page.children('div[data-role="footer"]')
.find('a[data-name="' + page
.attr("data-active-footer") + '"]').addClass("ui-btn-active");}
So far so good.
Now, say I've changed to a page and the navbar is lit (it has successfully recieved the ui-btn-active class), and I'm clicking on the previous page, the lit item in the navbar doesnt change back!
If i click on the the page again (ie: changed to second page [corrent lit], changed back to first page [second page is still lit], then clicked on first page again) it does light the navbar button.
What I found out was that jqm also changed the navbar of the previous page when I'm changing the navbar of the current page in the 'pagecreate' event.
I've tried to overwrite this behaviour using the 'pageshow' event, that is, trying to apply the ui-btn-active class to the current element in the navbar but the problem is that $(this) and e.currentTarget objects in the 'pageshow' event DO NOT CONTAIN THE FOOTER ELEMENT!!!
$(".ui-page").live('pageshow', function (e) {
alert($(this).children('div').length); // returns 2!
alert($(this).children('div[data-role="footer"]').length); //returns 0
alert($(e.currentTarget).children('div').length); // returns 2!
alert($(e.currentTarget).children('div[data-role="footer"]').length); //returns 0});
Any ideas?!
Thanks.
Before delving into more detail, please try adding .ui-state-persist together with .ui-btn-active
This makes sure active buttons stay active when you changePage and the footer is the same. Also make sure, all your footers have the same data-id attribute.
On a sidenote: check the latest blog post about upcoming features for jqm 1.1 - it will include a fetch link utility, which allows to ajax-update portions of a page. So you could use this functionality to grab and insert a footer on every page. I'm trying the same right now with a login form, which I need on every page.
Have you tried "ui-state-persist"?
<div data-role="navbar" data-iconpos="top">
<ul>
<li>Home</li>
<li>Favorite</li>
</ul>
</div>
I still dont know why but jqm moves the footer from page to page, eventhough I assign a new footer to each page.
Maybe because I set the same ID to all of them.
Anyhow, I used this workaround to solve the problem:
On the 'pagebeforeshow' event, I set the button I want active to all the footers in the documents. I've set a special data-name attribute to each navbar button, I give it the 'ui-btn-active' class after removing it from the rest of the items.
var $footers = $(document).find('div[data-role="footer"]');
$footers.find('a').removeClass("ui-btn-active");
$footers.find('a[data-name="' + page
.attr("data-active-footer") + '"]').addClass("ui-btn-active");

Resources