如何在liferay中的aui popup中显示文本框值?

时间:2013-09-12 10:31:25

标签: liferay liferay-aui

在这个jsp中我显示了弹出窗口,当我点击按钮使用aui ..我想显示文本框值当我在弹出框上点击它可以任何人帮助我吗?。我不知道如何使用流行。

<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>

<div id="a">
    <aui:input lable="enter name" name="name" type="text"></aui:input>
</div>
<div id="b">
    <aui:button name="hello" value="click me" onclick='callPopup()'></aui:button>
</div>

<aui:script >

function callPopup(){

    AUI().ready('aui-dialog', 'aui-overlay-manager', 'dd-constrain', function(A) {
        alert('hai sudheer');
        var dialog = new A.Dialog({

            title: 'DISPLAY CONTENT',

            centered: true,

            modal: true,

            draggable:true,

            width: 300,

            height: 300,

            closeOnOutsideClick: true,

            bodyContent: "This is testing content inside the popup"

        }).render();

    });

}

</aui:script >

1 个答案:

答案 0 :(得分:0)

<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
<aui:input lable="enter name" name="name" type="text" id="b"></aui:input>
<div id="a">
<aui:button name="hello" value="click me" onclick='callPopup()'></aui:button>
</div>
<portlet:namespace/>
<aui:script >

function callPopup(){

AUI().ready('aui-dialog', 'aui-overlay-manager', 'dd-constrain', function(A) {
var name = document.getElementById("_popexample_WAR_popupexampleportlet_b").value;
var sudheer="hai"+name;
alert('hai sudheer'+name);
var dialog = new A.Dialog({

title: 'DISPLAY CONTENT',

centered: true,

modal: true,

draggable:true,

width: 300,

height: 300,

bodyContent: sudheer

}).render();

});

}

</aui:script >

它的工作正常......经过测试......谢谢