Foren

how to include Jsp file in this Alloy Ui script

Bharani Ravi Kanth, geändert vor 12 Jahren.

how to include Jsp file in this Alloy Ui script

Junior Member Beiträge: 63 Beitrittsdatum: 20.01.12 Neueste Beiträge
Hello Guys

I am using this script

AUI().ready('aui-tabs',
function(A) {
var tabs = new A.TabView(
{
boundingBox: '#tabs',
items: [
{label: 'Employment Details',content: 'This my content 1'},
{label: 'Personal Details', content: 'This my content 2'},
{label: 'Family Details', content: 'This my content 3'}
]
}
).render();
});
for creating of tabs in my portlet and i have three JSP files emp.jsp,personal.jsp,family.jsp how should i include this jsp files in this script so that instead of "this is my content" it should display my content which is present in my JSP's.Please help me in sorting out this.

Regards
Bharani.
thumbnail
Mayur Patel, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Expert Beiträge: 358 Beitrittsdatum: 17.11.10 Neueste Beiträge
I don't have much idea on this but i think there is not having any way to include jsp inside aui:script,

you can try this way like to create three DIVs and each div is having content of included jsp and inside script you can access content of each DIV

If anyone can suggest here better solution.

Thanks
Bharani Ravi Kanth, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Junior Member Beiträge: 63 Beitrittsdatum: 20.01.12 Neueste Beiträge
Hey Mayur thank you for your immediate reply....Do you have any sample code based on the issue.
thumbnail
Mayur Patel, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Expert Beiträge: 358 Beitrittsdatum: 17.11.10 Neueste Beiträge
hey I've checked aui-tabs.js file and you can use the same like,

content: {
				lazyAdd: false,
				valueFn: function() {
					var instance = this;

					var value = '';
					var contentNode = instance.get(CONTENT_NODE);

					if (contentNode) {
						value = contentNode.html();
					}

					return value;
				}, 


Instead of CONTENT_NODE you have to pass DIV Id say #test and create div of name #test that will be having include stmt of jsp, this will fetch its content and store in variable,try it out emoticon
Bharani Ravi Kanth, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Junior Member Beiträge: 63 Beitrittsdatum: 20.01.12 Neueste Beiträge
should i include a jsp file inside the div tag?
<div id="test">
<jsp:include name="xyz.jsp">
</div> ?
Bharani Ravi Kanth, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Junior Member Beiträge: 63 Beitrittsdatum: 20.01.12 Neueste Beiträge
Hey mayur i have got the required solution i have changed the code to
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="javax.portlet.ResourceURL" %>
<%@ page import="javax.portlet.WindowState" %>
<portlet:defineObjects />

<html>
<body>
<script type="text/javascript">
AUI().ready('aui-tabs', function(A) {
var tabs1=new A.TabView({
boundingBox: '#tabs',
listNode: '#docs',
contentNode: '#docsContent'
});

tabs1.render();
});
</script>
<div id="tabs">
<ul class="aui-tabview-list aui-widget-hd" id="docs">
<li class="aui-tab">
<a class="aui-tab-label" href="javascript:;">Employee Details</a></li>
<li class="aui-tab">
<a class="aui-tab-label" href="javascript:;">Personal Details</a></li>
</ul>
<div class="aui-tabview-content aui-widget-bd" id="docsContent">
<div class="aui-tabview-content-item">
<jsp:include page="EmployementDetails.jsp"/></div>
<div class="aui-tabview-content-item">
<jsp:include page="PersonalDetails.jsp" flush="false" /> </div>
</div>
</div>
</body>
</html>

the above code. i could embed the jsp file into the tab.Thanks for your suggestions.emoticon
thumbnail
Mayur Patel, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Expert Beiträge: 358 Beitrittsdatum: 17.11.10 Neueste Beiträge
That's Fabulous Ravi Kanth emoticon This will be helpful for others. Happy Learning !!!
Bharani Ravi Kanth, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Junior Member Beiträge: 63 Beitrittsdatum: 20.01.12 Neueste Beiträge
Mayur i need to how to add users programatically...do you have sample code based on this issue.
thumbnail
Mayur Patel, geändert vor 12 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Expert Beiträge: 358 Beitrittsdatum: 17.11.10 Neueste Beiträge
thumbnail
Zeeshan Khan, geändert vor 11 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Expert Beiträge: 349 Beitrittsdatum: 21.07.11 Neueste Beiträge
Hi Mayur n Ravi,

What if I want to change the colour look n feel of these tabs ?? What I need to do in this case.....

Thanks !!
thumbnail
Zeeshan Khan, geändert vor 11 Jahren.

RE: how to include Jsp file in this Alloy Ui script

Expert Beiträge: 349 Beitrittsdatum: 21.07.11 Neueste Beiträge
Bharani Ravi Kanth:
Hey mayur i have got the required solution i have changed the code to
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui" %>
<%@ page import="com.liferay.portal.kernel.util.ParamUtil" %>
<%@ page import="javax.portlet.PortletURL" %>
<%@ page import="javax.portlet.ResourceURL" %>
<%@ page import="javax.portlet.WindowState" %>
<portlet:defineObjects />

<html>
<body>
<script type="text/javascript">
AUI().ready('aui-tabs', function(A) {
var tabs1=new A.TabView({
boundingBox: '#tabs',
listNode: '#docs',
contentNode: '#docsContent'
});

tabs1.render();
});
</script>
<div id="tabs">
<ul class="aui-tabview-list aui-widget-hd" id="docs">
<li class="aui-tab">
<a class="aui-tab-label" href="javascript:;">Employee Details</a></li>emoticon
<li class="aui-tab">
<a class="aui-tab-label" href="javascript:;">Personal Details</a></li>
</ul>
<div class="aui-tabview-content aui-widget-bd" id="docsContent">
<div class="aui-tabview-content-item">
<jsp:include page="EmployementDetails.jsp"/></div>
<div class="aui-tabview-content-item">
<jsp:include page="PersonalDetails.jsp" flush="false" /> </div>
</div>
</div>
</body>
</html>

the above code. i could embed the jsp file into the tab.Thanks for your suggestions.emoticon




well done Ravi n Mayur...... emoticon