|
From: <sv...@de...> - 2005-06-16 22:09:15
|
Author: pcamacho
Date: 2005-06-16 18:09:15 -0400 (Thu, 16 Jun 2005)
New Revision: 1340
Modified:
humano2/trunk/web/builder/site/createreport.aspx.cs
humano2/trunk/web/builder/site/js/createinterfacetools.js
humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.j=
s
humano2/trunk/web/builder/site/xsl/createview.xsl
Log:
FIX: in creation of view/report the columns when updating were not displa=
yed according to user's order.
Modified: humano2/trunk/web/builder/site/createreport.aspx.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-16 21:18:=
20 UTC (rev 1339)
+++ humano2/trunk/web/builder/site/createreport.aspx.cs 2005-06-16 22:09:=
15 UTC (rev 1340)
@@ -69,8 +69,7 @@
}
=20
override protected string createXml()
- {
- =20
+ {=20
DataTable currReport =3D null;
Logger.Log("ReportMain: reportId =3D " + Convert.ToString(re=
portId),LogLevel.Trace);
if(reportId !=3D 0)
Modified: humano2/trunk/web/builder/site/js/createinterfacetools.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-16 =
21:18:20 UTC (rev 1339)
+++ humano2/trunk/web/builder/site/js/createinterfacetools.js 2005-06-16 =
22:09:15 UTC (rev 1340)
@@ -63,41 +63,44 @@
*/
function BuildPreselectedColumns(attribsArr,selectedColumnsArr)
{
- var j=3D0;
var i=3D0;
var leftAttribsArr =3D new Array();=20
var rightAttribsArr =3D new Array();
- //alert("size: " + sizeAttribsArr);
+ =20
+ //The left array first
for(i=3D0;i<sizeAttribsArr;i++)
{
var idAtt =3D attribsArr[i].GetValue();
- =20
if(IsInArray(idAtt,selectedColumnsArr) =3D=3D true)
{
- //The left array
var element =3D new ListElement( attribsArr[i].GetName(),
attribsArr[i].GetValue(),
true);
- leftAttribsArr[i] =3D element; =20
- //The right array: the element
- //alert(attribsArr[i].GetName());
- var element =3D new ListElement( attribsArr[i].GetName(),
- attribsArr[i].GetValue(),
- false);
- rightAttribsArr[j++] =3D element; =20
+ =20
}
else
{
- //The left array
- //alert(attribsArr[i].GetName());
var element =3D new ListElement( attribsArr[i].GetName(),
attribsArr[i].GetValue(),
false);
- leftAttribsArr[i] =3D element; =20
- //The right array: nothing=20
}
+ leftAttribsArr[i] =3D element; =20
}
=20
+ //Now the right (has to be done "alone" to keep the order of columns
+ var sizeSelectedColumnsArr =3D selectedColumnsArr.length;
+ var j=3D0;
+ for(i=3D0;i<sizeSelectedColumnsArr;i++)
+ {
+ var idAtt =3D selectedColumnsArr[i];
+ if(idAtt!=3D0) //Report case: the id with 0 is always in tab
+ {
+ var element =3D LookForItem(idAtt,attribsArr);
+ rightAttribsArr[j++] =3D element;=20
+ }
+ //alert(element.GetName());
+ }
+ =20
var res =3D new Array();
res["left"] =3D leftAttribsArr;
res["right"] =3D rightAttribsArr;
@@ -105,6 +108,33 @@
return res;
}
=20
+
+/**
+ * Looks for the first element in an array of ListElement with a specifi=
ed value
+ * @param idAtt the value to find the item
+ * @param attribArr the array of ListItem
+ * @return the item if found, null else.
+ */
+function LookForItem(idAtt,attribsArr)
+{
+ var element; =20
+ var size =3D attribsArr.length;
+ var i=3D0;
+ for(i=3D0;i<size;i++)
+ {
+ var item =3D attribsArr[i];
+ //alert("itemValue =3D" + item.GetValue() + "\n" + "idAtt=3D" + =
idAtt);
+ if(item.GetValue() =3D=3D idAtt) =20
+ {
+ var element =3D new ListElement( item.GetName(),
+ item.GetValue(),
+ false); =20
+ return element;
+ }
+ }
+ return null;
+}
+
function OperatorsGetSelectArray()
{
var optionArray =3D new Array();
Modified: humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphica=
llist.js
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-16 21:18:20 UTC (rev 1339)
+++ humano2/trunk/web/builder/site/js/grafcomponents/sortedgraphicallist.=
js 2005-06-16 22:09:15 UTC (rev 1340)
@@ -184,17 +184,17 @@
innerHtml +=3D "<select size=3D\"10\" style=3D\"width:220px;\" clas=
s=3D\"drpdwn2\">";
for(var i=3D0; i<sizeList;i++)
{
- //alert(this.fSortedList.GetItem(i).GetName());
- var displayName =3D this.fSortedList.GetItem(i).GetName();
- var value =3D this.fSortedList.GetItem(i).GetValue();
- var disabled =3D this.fSortedList.GetItem(i).GetDisabled();
- =20
- var displayOption =3D "";
- if (disabled =3D=3D true)
- {
- displayOption =3D "style=3D\"color:gray;\"";
- }
- innerHtml +=3D "<option value=3D\"" + value + "\" " + displa=
yOption + ">" + displayName + "</option>";
+ //alert(this.fSortedList.GetItem(i).GetName());
+ var displayName =3D this.fSortedList.GetItem(i).GetName();
+ var value =3D this.fSortedList.GetItem(i).GetValue();
+ var disabled =3D this.fSortedList.GetItem(i).GetDisabled();
+ =20
+ var displayOption =3D "";
+ if (disabled =3D=3D true)
+ {
+ displayOption =3D "style=3D\"color:gray;\"";
+ }
+ innerHtml +=3D "<option value=3D\"" + value + "\" " + displayOpt=
ion + ">" + displayName + "</option>";
}
innerHtml +=3D"</select>";
this.listBoxElement.innerHTML =3D innerHtml;
Modified: humano2/trunk/web/builder/site/xsl/createview.xsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-16 21:18:20=
UTC (rev 1339)
+++ humano2/trunk/web/builder/site/xsl/createview.xsl 2005-06-16 22:09:15=
UTC (rev 1340)
@@ -467,9 +467,6 @@
}
var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW", infosToSubmit);
</xsl:if>
- <xsl:if test=3D"/view/viewDatas/classId!=3D''">
- var Form =3D new Form(<xsl:value-of select=3D=
"/view/viewDatas/classId" />,"VIEW");
- </xsl:if>
</script>
</form>
</body>
|