I am displaying data as per product specification or as per it's configuration.
Configuration display left side of page. When user select configuration the related data should be filtered.
I have made category of attribute like Screen Size, RAM, HDD, Color, Size, Processor, optical drive etc.
And under it I am displaying data like 2GB, 4GB, 2.2GHz, Blue, 320GB etc.
But My problem is All Category display, if it's sub data exist or not.
I don't want to display category if sub data not exist like Screen Size
is blank then it should not be display.
My JSP Code :
<%
List<String> attribNameList = (List<String>)request.getAttribute("attribName");
List<String> attribValueList = (List<String>)request.getAttribute("attribValue");
List<String> attribDataList = (List<String>)request.getAttribute("attribData");
List<Integer> acfIDList = (List<Integer>)request.getAttribute("attribacID");
List<Integer> acIDList = (List<Integer>)request.getAttribute("acID");
List<String> acNAMEList = (List<String>)request.getAttribute("acNAME");
String aname,aval,adata,acname;
Integer acfid,acid;
for( int i=0;i<acIDList.size();i++)
{
acid=acIDList.get(i);
acname=acNAMEList.get(i);
//Print Category
%>
<a style="color: black;"><%= acname %></a><br>
<%
for(int i1=0;i1<attribNameList.size();i1++)
{
aname = attribNameList.get(i1);
aval = attribValueList.get(i1);
adata = attribDataList.get(i1);
acfid = acfIDList.get(i1);
if(acid == acfid)
{
//Print Attribute
%><br>
<%-- <a><%= aname %></a> --%>
<a><%= aval %></a>
<%
if(adata == null)
{
}
else
{
%>
<a><%= adata %></a>
<%
}
}
}
%>
<br>
<%
}
%>
Here `acIDList` is a attribute category id and `acnameList` is category name list and `acfIDList` is a `foreign key` in attribute_master table so I have put a if condition that when `acID` and `acfID` matches it creates List and under it sub data display.
and aval
is attribute value that is 2,4,2.2, etc.
and adata is for GB, GHz, MP, etc.
So I want to remove acName
that is blank.
I dont want to display category name if data not exist so shall I have to put some condition on
<a style="color: black;"><%= acname %></a><br>
line. Any suggestion Please..