Forums
This topic is locked
Conditional columns?
05 Sep 2005 03:01:13 Jon Moes posted:
Hello everyone. I have the following problem:I have a table with let's say 100 products in 20 categories of 5 products each. Every category has 3 fields that is different from the fields of any other category. So if you select the products from one category you have a lot of columns/fields that have null value.
When the visitor in the site selects one of the 20 categories in order to view the products belonging to it the details page brings a lot of columns that are not related to this category. So i used the conditional region extension in order to show only the columns that have a non null value. But the problem is that the colmns are there, they don't disappear - of course you don't see the heading of the column but you see a column with nothing in it. So the conditional region won't bring any null values to the page but the width of the not shown column remains in the page.
I hope i described the problem correctly. Any ideas on how to reslove this?
Thank you all.
Jon
Replies
Replied 05 Sep 2005 18:31:25
05 Sep 2005 18:31:25 Michael Behan replied:
sounds like you have some code that looks like this:
<td><% if (field != null) { %>
<%=recordset.fields.item("field"
.Value%>
<%} //end conditional region %>
</td>
chaning it to be like this might solve the problem:
<% if (field != null) { %>
<td>
<%=recordset.fields.item("field"
.Value
</td>
<%} //end conditional region %>
if this isn't it post your code in a reply and I'll have a look <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code>
Edited by - mbisme on 05 Sep 2005 18:31:43
<td><% if (field != null) { %>
<%=recordset.fields.item("field"

<%} //end conditional region %>
</td>
chaning it to be like this might solve the problem:
<% if (field != null) { %>
<td>
<%=recordset.fields.item("field"

</td>
<%} //end conditional region %>
if this isn't it post your code in a reply and I'll have a look <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code> <pre id=code><font face=courier size=2 id=code> </font id=code></pre id=code>
Edited by - mbisme on 05 Sep 2005 18:31:43
Replied 06 Sep 2005 10:41:20
06 Sep 2005 10:41:20 Jon Moes replied:
Well thank you Michael, you gave me an idea that solved the problem. I applied the conditional region to each cell separately and now the empty columns dissapearred. I applied it before on the whole column and the empty column stayed there. So, thank you again.
Jon
Jon