Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Bharani Ravi Kanth
how to include Jsp file in this Alloy Ui script
27. März 2012 23:36
Antwort

Bharani Ravi Kanth

Rang: Junior Member

Nachrichten: 63

Eintrittsdatum: 19. Januar 2012

Neue 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.
Mayur Patel
RE: how to include Jsp file in this Alloy Ui script
28. März 2012 03:22
Antwort

Mayur Patel

Rang: Expert

Nachrichten: 349

Eintrittsdatum: 17. November 2010

Neue 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
RE: how to include Jsp file in this Alloy Ui script
28. März 2012 04:18
Antwort

Bharani Ravi Kanth

Rang: Junior Member

Nachrichten: 63

Eintrittsdatum: 19. Januar 2012

Neue Beiträge

Hey Mayur thank you for your immediate reply....Do you have any sample code based on the issue.
Mayur Patel
RE: how to include Jsp file in this Alloy Ui script
28. März 2012 05:42
Antwort

Mayur Patel

Rang: Expert

Nachrichten: 349

Eintrittsdatum: 17. November 2010

Neue Beiträge

hey I've checked aui-tabs.js file and you can use the same like,
 1
 2content: {
 3                lazyAdd: false,
 4                valueFn: function() {
 5                    var instance = this;
 6
 7                    var value = '';
 8                    var contentNode = instance.get(CONTENT_NODE);
 9
10                    if (contentNode) {
11                        value = contentNode.html();
12                    }
13
14                    return value;
15                },


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
RE: how to include Jsp file in this Alloy Ui script
29. März 2012 01:38
Antwort

Bharani Ravi Kanth

Rang: Junior Member

Nachrichten: 63

Eintrittsdatum: 19. Januar 2012

Neue Beiträge

should i include a jsp file inside the div tag?
<div id="test">
<jsp:include name="xyz.jsp">
</div> ?
Bharani Ravi Kanth
RE: how to include Jsp file in this Alloy Ui script
29. März 2012 02:48
Antwort

Bharani Ravi Kanth

Rang: Junior Member

Nachrichten: 63

Eintrittsdatum: 19. Januar 2012

Neue 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
Mayur Patel
RE: how to include Jsp file in this Alloy Ui script
29. März 2012 05:34
Antwort

Mayur Patel

Rang: Expert

Nachrichten: 349

Eintrittsdatum: 17. November 2010

Neue Beiträge

That's Fabulous Ravi Kanth emoticon This will be helpful for others. Happy Learning !!!
Bharani Ravi Kanth
RE: how to include Jsp file in this Alloy Ui script
29. März 2012 06:02
Antwort

Bharani Ravi Kanth

Rang: Junior Member

Nachrichten: 63

Eintrittsdatum: 19. Januar 2012

Neue Beiträge

Mayur i need to how to add users programatically...do you have sample code based on this issue.
Mayur Patel
RE: how to include Jsp file in this Alloy Ui script
11. April 2013 06:50
Antwort

Mayur Patel

Rang: Expert

Nachrichten: 349

Eintrittsdatum: 17. November 2010

Neue Beiträge

Please create new thread for new question,

you can refer to following links for your problem,

http://www.liferay.com/community/forums/-/message_boards/message/10422104
http://www.liferay.com/community/forums/-/message_boards/message/10855080
Zeeshan Khan
RE: how to include Jsp file in this Alloy Ui script
28. Februar 2013 21:51
Antwort

Zeeshan Khan

Rang: Expert

Nachrichten: 349

Eintrittsdatum: 20. Juli 2011

Neue 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
Zeeshan Khan
RE: how to include Jsp file in this Alloy Ui script
1. März 2013 02:03
Antwort

Zeeshan Khan

Rang: Expert

Nachrichten: 349

Eintrittsdatum: 20. Juli 2011

Neue 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 !!