Foros de discusión

How to bring sign-in portlet as pop-up

thumbnail
Aritra Ghosh, modificado hace 12 años.

How to bring sign-in portlet as pop-up

Junior Member Mensajes: 62 Fecha de incorporación: 8/11/11 Mensajes recientes
Hi all,
I am trying to make the liferay's in-built portlet as pop-up while logging.I am using Liferay 6.0.6.To do this I added javascript function in portla-normal.vm as

<script type="text/javascript" charset="utf-8">

function showPopup() {
AUI().use('aui-dialog', 'aui-io', 'event-custom', 'io-form', function(A) {
window.instance = new A.Dialog({
centered: true,
constrain2view: true,
destroyOnClose: true,
draggable: true,
height: 500,
resizable: false,
modal: true,
stack: true,
title: 'Authentification',
width: 1000
}).plug(A.Plugin.IO, {uri: '$my_url'}).render();
});
}
</script>


And try to set render URL as
#set ($my_url = $portletURLFactory.create($request, "58", $getterUtil.getLong($plid), "RENDER_PHASE"))
$my_url.setParameter("p_p_state", "exclusive")


And call the javascript function as
#if(!$is_signed_in)
<a href="$my_url" id="sign-in" rel="nofollow" onclick="showPopup();">$sign_in_text</a>


<!-- <a href="$my_url" id="sign-in" rel="nofollow" onclick="showPopup()">$sign_in_text</a> -->
#end


But,after clicking sign-in link I am getting a broken page.Is there any suggesstion????
thumbnail
Aritra Ghosh, modificado hace 12 años.

RE: How to bring sign-in portlet as pop-up

Junior Member Mensajes: 62 Fecha de incorporación: 8/11/11 Mensajes recientes
Hi all,
I got the solution...emoticon
Now pop-up is coming in proper way.I just change the calling as
<a href="#" id="sign-in" rel="nofollow" onclick="showPopup();">$sign_in_text</a>


But,new problem is,the validation is not working properly.If I click on sign-in button leaving the inputs blank,it takes me into some blank page.
Any solution????

Thanks.

Archivos adjuntos:

Himanshu Modi, modificado hace 12 años.

RE: How to bring sign-in portlet as pop-up

New Member Mensajes: 13 Fecha de incorporación: 27/07/11 Mensajes recientes
Hi Aritra,

Did you get answer to your query, please let me know if any.
Also, could you let me know how to remove the header(title bar) of dialog box.


Thanks,
Himanshu Modi
thumbnail
Aritra Ghosh, modificado hace 12 años.

RE: How to bring sign-in portlet as pop-up

Junior Member Mensajes: 62 Fecha de incorporación: 8/11/11 Mensajes recientes
Himanshu Modi:
Hi Aritra,

Did you get answer to your query, please let me know if any.
Also, could you let me know how to remove the header(title bar) of dialog box.


Thanks,
Himanshu Modi


Hi Himanshu,
making windowstate as normal in login.jsp in login portlet gives a partal solution.You can try it as
portlet:actionURL secure="<%= PropsValues.COMPANY_SECURITY_AUTH_REQUIRES_HTTPS || request.isSecure() %>" windowState="<%= LiferayWindowState.NORMAL.toString() %>" var="loginURL">


And set ttle nothig within aui dialog to remove the title bar.
Thanks.

Aritra
thumbnail
Bikash Ghibila, modificado hace 11 años.

RE: How to bring sign-in portlet as pop-up

Junior Member Mensajes: 60 Fecha de incorporación: 31/03/11 Mensajes recientes
Hi Aritra,


set ttle nothig within aui dialog to remove the title bar is not working for me.it just remove the title name.


Thanks


Bikash
thumbnail
devaraj s, modificado hace 11 años.

RE: How to bring sign-in portlet as pop-up

Regular Member Mensajes: 228 Fecha de incorporación: 21/05/12 Mensajes recientes
Aritra Ghosh:
Hi all,
I got the solution...emoticon
Now pop-up is coming in proper way.I just change the calling as
<a href="#" id="sign-in" rel="nofollow" onclick="showPopup();">$sign_in_text</a>


But,new problem is,the validation is not working properly.If I click on sign-in button leaving the inputs blank,it takes me into some blank page.
Any solution????

Thanks.




Hi Aritra,

I followed your way to implement popup window for sign in portlet.. But after clicking sign in getting error in window like failed to retrieve content.

please can you let me know where i am making mistake.

Archivos adjuntos:

Brijesh Desai, modificado hace 11 años.

RE: How to bring sign-in portlet as pop-up

New Member Mensajes: 6 Fecha de incorporación: 13/04/11 Mensajes recientes
Any body got the solution for validation in pop up / aui dialog?
I have same kind of implementation on user registration.
I have already done for the pop up of user registration page, it works for if all fields filled out and save.
But if any one blank and if it is mandatory, then on click of save, it lands me on plain white (without any css) page and losing the pop up state.
Looking to validate registration fields on pop up or in aui dialog.

Regards,
Brijesh
thumbnail
Amruta Naidu, modificado hace 10 años.

RE: How to bring sign-in portlet as pop-up

New Member Mensajes: 12 Fecha de incorporación: 24/04/13 Mensajes recientes
Hi all..........

Instead of sign in portlet as pop up, i want web form portlet in pop up window.
the web form portlet id is 1_WAR_webformportlet (non-instanceable).

Then where should i keep this id and what url will i set in $my_url?

please help........

Thanks......
Brijesh Desai, modificado hace 10 años.

RE: How to bring sign-in portlet as pop-up

New Member Mensajes: 6 Fecha de incorporación: 13/04/11 Mensajes recientes
you can use following script code on view.jsp.

<script type="text/javascript">
function showPopup() {
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {

var dialog = new A.Dialog({
title: 'Register an Account',
height:650,
width:700,
urlData: { winowState : 'LiferayWindowState.EXCLUSIVE'}
}).plug(A.Plugin.IO, {uri: '<%= userExclusiveCreateURL %>'}).render();

dialog.show();
dialog.set('centered', true);
});
}
</script>

and call showPopup() from either button as <input type="submit" onclick="showPopup()" value=" " id="regNow"/>
or <c:if test="<%= showCreateAccountIcon %>">
<liferay-ui:icon
image="add_user"
message="create-account"
url="javascript: showPopup();"
/>
</c:if>

you have to set portlet mode exclusive on renderURL by p_p_state=exclusive

Hope this code will be helpful to you.
Let me know if you need more help.
thumbnail
Amruta Naidu, modificado hace 10 años.

RE: How to bring sign-in portlet as pop-up

New Member Mensajes: 12 Fecha de incorporación: 24/04/13 Mensajes recientes
Brijesh Desai:
you can use following script code on view.jsp.

<script type="text/javascript">
function showPopup() {
AUI().use('aui-dialog', 'aui-io', 'event', 'event-custom', function(A) {

var dialog = new A.Dialog({
title: 'Register an Account',
height:650,
width:700,
urlData: { winowState : 'LiferayWindowState.EXCLUSIVE'}
}).plug(A.Plugin.IO, {uri: '<%= userExclusiveCreateURL %>'}).render();

dialog.show();
dialog.set('centered', true);
});
}
</script>

and call showPopup() from either button as <input type="submit" onclick="showPopup()" value=" " id="regNow"/>
or <c:if test="<%= showCreateAccountIcon %>">
<liferay-ui:icon
image="add_user"
message="create-account"
url="javascript: showPopup();"
/>
</c:if>

you have to set portlet mode exclusive on renderURL by p_p_state=exclusive

Hope this code will be helpful to you.
Let me know if you need more help.


Hi Brijesh.....

thanks a lot for replying......

i tried the above solution.... its working but some problems are still there.

I kept hte above script in Portlet-normal.vm file, and kept portlet id as "1_WAR_webformportlet."
Now on click the pop up comes , but only one field is displayed with a sent button, instead of complete web form. emoticon

and if there is already a web form on a page and i apply my theme to that page then the pop up shows complete web form.

Please help me regarding this...... "Web form displays on pop up only when there is already a web form present on that page"

plus if i fill and submit the popped up web form it lands to page with only web form with success message WITHOUT CSS.... emoticon

please share if u have any idea regarding these issues.....

thanks......
thumbnail
Bikash Ghibila, modificado hace 10 años.

RE: How to bring sign-in portlet as pop-up

Junior Member Mensajes: 60 Fecha de incorporación: 31/03/11 Mensajes recientes
HI,

For the sign in portlet the best way is jquery.

You should use jquery for this issue
Brijesh Desai, modificado hace 10 años.

RE: How to bring sign-in portlet as pop-up

New Member Mensajes: 6 Fecha de incorporación: 13/04/11 Mensajes recientes
"Web form displays on pop up only when there is already a web form present on that page"


I doubt, this is because of pop up rendering url looking for the default view.jsp from web form portlet. and if it's not on the whole web page, it might fail to load the pop up, this could be reason it is not opening up the pop up if the web form portlet is not added on liferay page.

I am not sure, but there should be some way to include the the web form portlet by ID from the theme portal_normal.vm and by this way web page would always include the default view.jsp on all pages.

If this is failing, another you can try is, add web form portlet on all site pages, and put css display : none on div id of this portlet by code, and when you call pop up, put css display : block on the div id.

Hope this hint will help.

Let me know if it works or not.

Regards.
Ngocha Haobam, modificado hace 8 años.

RE: How to bring sign-in portlet as pop-up

Junior Member Mensajes: 87 Fecha de incorporación: 30/01/15 Mensajes recientes
Aritra Ghosh:
Hi all,
I got the solution...emoticon
Now pop-up is coming in proper way.I just change the calling as
<a href="#" id="sign-in" rel="nofollow" onclick="showPopup();">$sign_in_text</a>


But,new problem is,the validation is not working properly.If I click on sign-in button leaving the inputs blank,it takes me into some blank page.
Any solution????

Thanks.



Did you find the solution which it takes to some blank page if it has any error?