• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

embeding flex appllication in liferay portlet

 
vijay raghuvanshi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
sorry i was away for a long time.
I got a problem regarding portlet. Here i just explain my problem.

I created a generic portlet. Purpose of this portlet is to display any kind of graph like column, line etc. I used flex 3 for generating graph. when i create first instance of this portlet and set it's graph type say Column graph. And again if i create another instance of the same portlet on the same page both the graph work fine. But when i go to edit mode of the first portlet and change the graph type, change does not take effect. But when i change the graph type of second instance of the portlet it is refelected in both the portlet instance.
in short only the second instance type of graph is reflected in both the instaces of the portlet
here is the jsp in which i am embeding my flex project.





<script>

var varOtherInfo = [];
var varLineMeasureInfo= [];
var varColumnMeasureInfo = [];
var varBasicConfigInfo = [];
var arrYearList = [];
arrYearList.push("<%= mapYearList.get("minYear")%>");
arrYearList.push("<%= mapYearList.get("maxYear")%>");
var portletID="<portlet:namespace />";
//alert(portletID);
<%

GraphBean[] gb = (GraphBean[])list.get(0);
for(int i=0;i<gb.length;i++)
{

//gb = (GraphBean[])list.get(i);
%>
varOtherInfo.push("<%=gb[i].getStrName()%>");
//alert("hi");
<%
}

%>


<%
GraphBean gb1;
for(int i=1;i<7;i++)
{
gb1 = (GraphBean)list.get(i);
%>
varBasicConfigInfo.push("<%=gb1.getStrName()%>");
//alert(varBasicConfigInfo[0]);
<%
}

%>
<%
GraphBean[] str = (GraphBean[])list.get(7);
for(int i = 0;i<str.length;i++)
{
System.out.println("col mesr:"+str[i].getStrName());
%>
varColumnMeasureInfo.push("<%=str[i].getStrName()%>");
//alert(varColumnMeasureInfo[0]);
<%
}
%>

<%
GraphBean[] str1 = (GraphBean[])list.get(8);
for(int i = 0;i<str1.length;i++)

{
System.out.println("line mesu:"+str1[i].getStrName());
%>
varLineMeasureInfo.push("<%=str1[i].getStrName()%>");
//alert(varLineMeasureInfo[0]);
<%
}
%>
//alert(varBasicConfigInfo);
//alert(varColumnMeasureInfo);
//alert(varLineMeasureInfo);
//alert(varOtherInfo);

function makeAjaxCall(selectedYear)
{
//alert(selectedYear);
var varMsg="";
//alert("in ajax call");
<portlet:renderURL var="ajaxCall" windowState="<%= LiferayWindowState.EXCLUSIVE.toString() %>"><portlet:param name='action' value='getData' /></portlet:renderURL>

var url='${ajaxCall}';
url +="&selectedYear="+selectedYear;
//alert("ajax call");



jQuery.ajax
(
{
type: "POST",
url: url,
data: {},
success: function(msg)
{
//alert(msg);
varMsg=msg;
//alert("ajax success");
//updateJavaScript(msg);
//alert("in Ajax");
//setDataArray(dataArray);
//document.getElementById('updateit').innerHTML=msg;
// jQuery('.alertBox').html(msg);
//toCalculate();

},
error: function() {
alert(" error ");
//document.getElementById('updateit').innerHTML=msg;
},
async: false
}

);
return varMsg;

}


function getGraphConfigInfo()
{
var configArr = new Array();
//alert(varBasicConfigInfo);
//alert(varColumnMeasureInfo);
//alert(varLineMeasureInfo);
//alert(varOtherInfo);


configArr.push(varBasicConfigInfo);
configArr.push(varColumnMeasureInfo);
configArr.push(varLineMeasureInfo);
configArr.push(varOtherInfo);
configArr.push(arrYearList);
configArr.push(portletID);
//alert(arrYearList);
return configArr;
}

</script>
<div id="chart" style="height:440px;width:560px">
<object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
id="<portlet:namespace/>" width="100%" height="100%"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" >
<param name="movie" value="<%= request.getContextPath() %>/swf/VisualContract.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#869ca7" />
<param name="allowScriptAccess" value="always" />

<embed src="<%= request.getContextPath() %>/swf/VisualContract.swf" quality="high" bgcolor="#869ca7"
width="100%" height="100%" name="VisualContract" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</div>

friends suggest me a possible solution as soon as possible because i my deadline is just going to expire.




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic