Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
Ramya Sree Kalagiri
cannot get aui input value in aui script
December 19, 2012 10:52 PM

Ramya Sree Kalagiri

Rank: New Member

Posts: 8

Join Date: December 19, 2012

Recent Posts

I'm using spring portlet MVC and liferay 6.1 CE. I'm using alloy UI in my jsp page. And the sample code goes like this I merged viewDetails, editDetails and addDetails in a single jsp file.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

<%@ taglib uri="" prefix="portlet" %>
<%@ taglib prefix="aui" uri="" %>
<portlet:defineObjects /><portlet:defineObjects/>
<%boolean disable=false;
AUI().use('aui-form-base', function(A) {
Object mode=renderRequest.getAttribute("mode");
if(mode!=null && ("editDetail".equals(mode.toString())||"viewDetail".equals(mode.toString())))

var name ='#name');
else if(mode!=null && "viewSoilProfile".equals(mode.toString()))
name: <aui:input type="text" name="name" id="name" <%if(disable){%>disabled="disabled"<%} %>/>

I'm stuck with the following problems:
1.I'm getting an exception "org.apache.jasper.JasperException: /html/details.jsp (line: 30, column: 52) Unterminated &lt;aui:input tag
2.if I remove the scriplet from aui:input tag then I'm getting script error that null is null or not an object because "name" retrieved in aui:script is null.

It is working properly if I use normal html form and input without aui prefix

name: <input type="text" name="name" id="name" <%if(disable){%>disabled="disabled"<%} %>/>

could anyone please help me in sorting out these 2 problems. Thanks in advance
Amos Fong
RE: cannot get aui input value in aui script
December 20, 2012 5:37 PM

Amos Fong


Rank: Liferay Legend

Posts: 1953

Join Date: October 7, 2008

Recent Posts


You cannot put a scriptlet within a tag library like that. You should initialize the variable before the taglib tag. Something like this:

 2String disabled = "";
 4if (disable) {
 5    disabled = "disabled";
 9<aui:input type="text" name="name" id="name" disabled="<%= disabled %>" />