Silverlight content is being displayed on top of HTML content - layout

I have an HTML table on a page that embeds a tiny Silverlight app to provide cross-browser "Copy to Clipboard" functionality. The entire "app" is a single button that copies a value to the clipboard from the row in which it is embedded. I am also using the jQueryUI Dialog widget for other areas of the page. When the dialog opens it is displayed on top of all other content on the page except those Silverlight buttons. For some reason I cannot get the modal dialog to sit on top of those buttons and it's obviously a big usability issue.
I've done quite a bit of research and have yet to find a solution that works. I'm sure this problem stems from my lack of in-depth understanding of Silverlight's relationship to the DOM and how it affects layout and and styling.
I've tried several things, including setting the "windowless" property to true and the background to "transparent", I've also played around with some styling workaround I found on blogs. Unfortunately nothing has worked.
Here's the code used to instantiate the Silverlight plugin for each row.
Silverlight.createObjectEx({
"source": src,
"parentElement": cell,
"id": String.format("pluginHost_{0}", id),
"properties": {
"height": "16",
"width": "16",
"background": "transparent",
"windowless": true,
"enableHtmlAccess": true,
"version": "4.0.50826.0"
},
"events": {
"onLoad": null,
"onError": null
},
"initParams": String.format("url={0}", item.Url),
"context": null
});
As I said before, it's just a small (16px) button that takes a URL from its associated data row as an initialization parameter and copies that to the clipboard whenever the button is pressed. Because data is loaded dynamically via an external web service, I am loading the plugin using the Silverlight.js library so that I can pass in data as the plugin is initialized on each row.
Can anyone tell me why the buttons in my table display on top of the modal dialog (and any other element I move on top of the table)?
Here's a screenshot of what I'm seeing.
Thanks!

I faced a similar problem where I was trying to display a gif progress image over a silverlight container. For this I had a pre-written javascript. It did not work as expected because silverlight always used to come on the top of other elements in the webpage.
I tried the following which worked for me:
add the following where you are creating silverlight object in your webpage:
<param name="windowless" value="true" />
Example:
<div id="silverlightControlHost">
<object id="SilverlightObject" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="800" height="500" style="z-index:1" >
<param name="source" value="ClientBin/GIF2.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="windowless" value="true" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
</div>
I also had to use the z-index property in addition to the above parameter.
To show one above another, I simply change their z-index using javascript, as required.
Example:
var divelement = document.getElementById("element_to_be_on_top");
divelement.style.zIndex = 999;
Reference:
http://weblogs.asp.net/dwahlin/archive/2010/05/10/integrating-html-into-silverlight-applications.aspx

Related

Azure AD B2C Sign-Up HTML Autofocus

I am using custom policies for our sign-up/sign-in etc user flows. When navigating to the sign-up form in Chrome & Edge, the form displays scrolled part-way down the screen. I believe this is because the lowest input field (a check-box) has an autofocus attribute, i.e.:
<input name="xxx" id="xxx" autofocus="" type="checkbox" value="True" />
I can verify that the lowest input (the checkbox) has focus as when I press the space-bar, it toggles.
It appears that Microsoft's javascript in the page is dynamically setting this autofocus attribute. Searching through the javascript it looks like every input has an AUTOFOCUS=True property:
{
"USER_INPUT_TYPE": "CheckboxMultiSelect",
"IS_TEXT": false,
"IS_EMAIL": false,
...
"OPTIONS": [{
"DISP": "I agree.",
"VAL": "True",
"PRESEL": false,
-->> "AUTOFOCUS": true <<--
}
]
}
Is there any way to change this autofocus behaviour? Currently it is very annoying as it means that Chrome users see the bottom half of the form when the page loads.
I think this is essentially answered as JavaScript is now available for use on custom pages.
https://azure.microsoft.com/en-au/resources/samples/active-directory-b2c-javascript-msal-singlepageapp/
I'd suggest using JQuery to deselect the input element or remove the tab index value after rendering, but there are a myriad of options now available.

How to get document datasource in another Custom Control?

I have an xPage with this content:
<div class="lotusFrame">
<xc:layoutCommonBanner />
<xp:callback facetName="facetTitleBar" id="callbackTitleBar" />
<xc:layoutDiscrepancyPlaceBar />
<div class="lotusMain">
<div class="lotusColLeft">
<xp:callback facetName="facetColLeft" id="callbackColLeft" />
</div>
<div class="lotusColRight">
<xp:callback facetName="facetColRight" id="callbackColRight" />
</div>
<div class="lotusContent">
<xp:callback facetName="facetContent" id="callbackContent" />
</div>
</div>
<xc:layoutCommonFooter />
<xc:layoutCommonLegal />
</div>
As you can see, there are several custom controls in it composing layout. In the facetContent, there is a document with document datasource. It's the only document in the page. I need to get this document somehow in the layoutDiscrepancyPlaceBar custom control.
I found some old articles on the web with undocumented feature called currentDocument. It should be on every page with document datasource. But it doesn's work. I have Domino 8.5.2 and currentDocument seems to be no longer supported.
Can you help me out? How can I get document datasource from one custom control in another custom control. Is it even possible?
Thanks in advance, Jiří
EDIT: OK, it is still supported, but it only works in custom control, that is included inside the one with document datasource. In the case scenario above it doesn't work.
Your best option is to hand over the binding name in a custom property. (lets call it bindto. Then you bind your field to
"${#{"+compositeData.bindto+"}}"
See details here (inside the prezi)
P.S. currentDocument is documented somewhere.
You can also pass a handle on the data source directly to the custom control, as well as the name of the item to bind to on the data source. Because EL supports array syntax as well as dot syntax, this allows you to define expressions like this:
#{compositeData.dsn[compositeData.fieldName]}
(where "dsn" is the property being passed the handle on the data source, and "fieldName" is the property being passed the name of the item to bind to on that data source.)
More details on this approach can be found here.

How to set <aui:button> icon in Liferay without using Javascript?

I'm trying to set icon to <aui:button> like on this tutorial.
But solution described there doesn't work well in my case, because I have a table and on each row I have a button with different resourceUrl. Like this:
<portlet:resourceURL id="saveReport" var="saveReportURL">
<portlet:param name="reportId" value="${report.reportId}" />
</portlet:resourceURL>
<aui:button onclick="location.href = '${saveReportURL}'">
Is it possible to set icon in <aui:button> without using JavaScript as described in tutorial?
Thanks
You can write this below code for setting icon in liferay alloy button
<aui:button type="cancel" cssClass="btn-info" icon="icon-upload-alt" iconAlign="right" value="upload" />
you need to use the icon attribute for this setting "Icon glyphs"
you need to use cssClass for adding extra design button class for the designing
you need to set iconAlign attribute for left or right side of the button text value
You should be able to add an icon to a button without using JavaScript by adding one of these Icon CSS classes to your button. For example, if you wanted to create a button with a calendar icon, your code should look something like this:
<aui:button class="icon-calendar" ... />

Flash security pop up (how to get it?)

I wrote a flash script that is embedded into an HTML page. The flash script (AS3), needs access to the users microphone and camera. I've seen on other websites when they want to use my camera/ microphone flash automatically pops up a box asking the user to permit.
In my case, even though in my global settings for my webpage it says "always ask" under permissions, flash doesn't ask me anything and just blocks the script from accessing the microphone. The script loads fine, just doesn't prompt for access and the user has to manually right click, and go to settings and put setting to "allow".
Searching for this topic on Google is rather difficult as there is too much irrelevant stuff with the same keywords. Thanks for your time.
Edit: This is how I embed just in case I'm not doing it right.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="200" height="20" id="myflash" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="/baseDir/myflash.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name=base VALUE="/baseDir/">
<embed src="/baseDir/myflash.swf" base="/baseDir/" quality="high" bgcolor="#ffffff" width="200" height="20" name="myflash" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
You can fix this by making your SWF's dimensions larger. Your embedded SWF must be at least so big for the security dialog to show up:
Important: Flash Player displays a
Privacy dialog box that lets the user
choose whether to allow or deny access
to the camera. Make sure your
application window size is at least
215 x 138 pixels; this is the minimum
size required to display the dialog
box.
via livedocs
is your swf at least 215 x 138 in size (minimum size to display the privacy box)?
is it an air app (in which case it doesn't show up)?
have you already given this permission? (i don't know if flash holds the previous choice or not - try clearing out your local shared objects and try again)
are you running this locally (in which case, if your folder is set to be always trusted - http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html, it won't ask)

How can I embed windows media player without the visualizations

I enjoyed the late 90s just as much as the last guy, but I'd like to be able to play an audio file on a web page without having to look at the cheesy geometric visualizations that wmp shows. Is there a good way of doing this? Here's my code:
<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="url" value="file.wav" />
<param name="autoStart" value="True" />
<embed type="application/x-mplayer2" src="file.wav" name="MediaPlayer">
</embed>
</object>
One temporary solution I've found is to set the height parameter to 45, which ends up showing just the controls at the bottom. As soon as Microsoft decides to change their layout though, this won't look right. Argh!

Resources