I am trying to create a popup using aui script tag and i don't no why its not working
please have a look at the code
function popup(url){
AUI().use('aui-dialog', function(A){
var dialog = new A.Dialog({
title: 'Book Details',
centered: true,
modal: true,
width: 500,
height: 400
}).plug(A.Plugin.IO,{uri: url}).render();
});
}
Have a look into following links it may help you..
http://www.liferaysavvy.com/2013/11/working-with-liferay-alloy-ui-dialogs.html
http://www.liferaysavvy.com/2013/12/open-liferay-portlet-in-aui-dialogpopup.html
Related
When using Stripe elements, is there a way to not use the card element, but still get the auto brand icon show up somewhere (preferably in the cardNumber input field)?
In 2020+, you can use the showIcon option.
const cardNumber = elements.create('cardNumber', {
showIcon: true,
placeholder: 'Card Number',
});
At the moment, no, there isn't. But Elements is still a very new product and we're very open to feedback! Please write to Stripe support at https://support.stripe.com/email to request this feature -- I can't promise it'll be implemented, but it'll certainly be considered.
edit: There isn't an option to have the cardNumber field show the brand icon automatically, but it's possible to implement this yourself by using the brand attribute in the element's change event. Here's an example: https://jsfiddle.net/ywain/L96q8uj5/.
showIcon isn't a top level property - it's nested under options, so you'd have to do something like this:
const OPTIONS = {
showIcon: true,
};
return (
<div className="App">
<CardNumberElement options={OPTIONS} />
</div>
);
and it's only available for CardNumberElement, so you shouldn't be setting it for CardExpiryElement or CardCvcElement
Direct from Stripe Discord Moderators.
Just popping back in here. The appropriate option would be hideIcon as opposed to showIcon.
Stripe documents this in their JS Documentation: https://stripe.com/docs/js/elements_object/create_element?type=card#elements_create-options-hideIcon
hideIcon is an Options property to elements.create as the doc above shows. So, for example, you would use this snippet:
var card = elements.create('card', {
hidePostalCode: true,
hideIcon: true,
style: {
base: {
iconColor: '#F99A52',
color: '#32315E',
lineHeight: '48px',
fontWeight: 400,
fontFamily: '"Open Sans", "Helvetica Neue", "Helvetica", sans-serif',
fontSize: '15px',
'::placeholder': {
color: '#CFD7DF',
}
},
}
});
card.mount('#card-element');
You can see this in my Fiddle if you'd like: https://jsfiddle.net/fiddler05/4qzcdw1p/18/
I am opening SharePoint dialog using following code:
var options = {
title: dialogTitle,
width: 800,
height: 600,
url: uri
}
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
However, the dimensions are in pixels. Is there any way to make the Pop-up responsive?
I am facing issue with opening a custom portlet in popup window.
Below is the code of opening popup.
LiferayPortletURL documentLibURL = PortletURLFactoryUtil.create(request, "portlet name with WAR name", themeDisplay.getPlid(), PortletRequest.RENDER_PHASE);
documentLibURL.setWindowState(LiferayWindowState.POP_UP);
documentLibURL.setPortletMode(PortletMode.VIEW);
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {
var dialog = new A.Dialog({
width: 800,
height: 500,
title: 'Popup Title',
centered: true,
draggable: true,
modal: true
}).plug(A.Plugin.IO, {uri: '<%= documentLibURL.toString() %>'}).render();
dialog.show();
});
When my portlet is not having any call to local services, portlet is being rendered in popup. But after adding some complex code. Portlet is giving permission error.
"You do not have the roles required to access this portlet."
1) I have also added true in liferay-portlet.xml.
2) I have assigned permissions to guest user for view from control panel.
Please let me know if any changes requires.
Thanks in advance
Local service calls will never generate a permission exception (PrincipalException) but remove services will.
Audit your code that this URL will invoke and see if there are any remove service calls. They are easily distinguished. For example, if it is the User service you're working with a call to UserLocalServiceUtil will never throw a PrincipalException but a call to UserServiceUtil will. Check to see what calls you're making to *ServiceUtil and ensure the user performing the operation has sufficient access.
Which version of liferay your using.
The dialog will not work in liferay 6.2 and also maybe in 6.1, refer the below code.
function popup(url){
AUI().ready(function(A) {
AUI().use('aui-base', function(A) {
Liferay.Util.Window.getWindow(
{
title : "Popup Tile",
uri: url,
dialog: {
cache: false,
modal: true
}
}
).on('hide', function() {
console.log("Modal closed")});
});
});
}
if its correct dont forget to mark it as an answer
just add in your portal-ext.properties the following code and restart the server
layout.show.portlet.access.denied=false
I am using a jeasyui dialog box which opens when clicked on a form button. But even when the dialog is open I am able to change the form behind. I want that when the dialog box is opened it should be closed first before anything else in the background becomes editable/ clickable.
How do I achieve that?
make sure your dialog set modal:true like this
$("#dialog").dialog({
autoOpen: false,
width: 550,
modal: true,
hide: 'fade',
show: 'fade',
closeOnEscape: false,
draggable: true,
resizable: true,
title: 'My Dialog'
});
I have a JQuery Modal Form and when i add the submit event, it cannot display as dialog but rather than embedded into browser window. If I uncomment the click event below, it will embedded into browser window rather than show as dialog.
$(document).ready(function(){
//$("#moveTicketBtn").click() {
// $("#moveUnknownTicket").submit();
//};
$("#moveUnknownTicketDialog").dialog(
{
title: "Move Unknown Ticket",
autoOpen: true,
modal: true,
resizable: true,
stack: true,
width: 500,
height: 350
});
});
Does anyone have any idea why it is like this? Please help. Thanks.
EDIT Question:
I have a form inside this dialog and upon submission(onsubmit, onblur) the javascript is not called. What is the reason?
try
$("#moveTicketBtn").click(function() {
$("#moveUnknownTicket").submit();
});
you have to insert your function within the () of the click event.
more information here: http://api.jquery.com/click/
That should do the trick:
http://jsfiddle.net/uQCKJ/
As you can see the form is submitted, since the alert box is triggered
$("#moveTicketBtn").click(function() {
$("#moveUnknownTicket").submit();
});
I have put submit inside click function though works great.