Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
Madasamy P
alert message not displayed in ajax
December 29, 2016 11:12 PM

Madasamy P

Rank: Junior Member

Posts: 90

Join Date: July 27, 2016

Recent Posts

This is my script

function submitForm(){
type : "GET",
url: "renderURL.toString()",
dataType : 'json',

success : function(){


And my class

public void doView(RenderRequest renderRequest,
RenderResponse renderResponse) throws IOException, PortletException {
// TODO Auto-generated method stub
super.doView(renderRequest, renderResponse);

public void generateTreeViewFromSourceFile(RenderRequest renderRequest,
RenderResponse renderResponse){
long parentFolderId = 0;
List<TreeView> treeViewList = new ArrayList<TreeView>();

ThemeDisplay themeDisplay = (ThemeDisplay)renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
long groupId = themeDisplay.getLayout().getGroupId();
int fileEntryStatus = WorkflowConstants.STATUS_APPROVED;

try {
DLFolder folder = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, PRODUCTION_FOLDER_NAME);

// Fetching all source xhtml files from xhtml folder
List<DLFileEntry> dlFileEntries = DLFileEntryLocalServiceUtil.getFileEntries(groupId, parentFolderId, fileEntryStatus, -1, -1, null);

for(DLFileEntry dlFileEntry : dlFileEntries){

FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(dlFileEntry.getFileEntryId());
FileVersion fileVersion = fileEntry.getFileVersion();

String url = DLUtil.getPreviewURL(fileEntry, fileVersion, themeDisplay, "");
String title = dlFileEntry.getTitle();
String treeId = title.replaceAll(" ", "_").toLowerCase();
treeId = treeId.replaceAll("\\.","_");

// Creating TreeView model for each tree
TreeView treeView = new TreeView();

// If file name matches with 'destination', it will be treated as a destination tree source file
} else{
renderRequest.setAttribute("destTreeView", treeView);


List<String> styleNodeNameList = getListOfStyleName();
renderRequest.setAttribute("styleNameList", styleNodeNameList);
renderRequest.setAttribute("treeViewList", treeViewList);

} catch (PortalException | SystemException e) {


The ajax URL directly calls the generateTreeViewFromSourceFile method and it completely executed
But on success function in ajax not displays the alert('TreeView') message .

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!