This topic is locked

Do not display empty fields in details view

5/7/2008 10:52:13 PM
ASPRunnerPro General questions
G
guroos author

Is it possible to suppress empty fields in the details view?

J
Jane 5/8/2008

Hi,
edit your view page on the Visual Editor tab in the HTML mode for this purpose.

Here is a sample:

{if $show_FieldName!=""}

<TR><TD class=editshade_b style="PADDING-LEFT: 15px" width=150>FieldName</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px" width=250>{$show_FieldName}&nbsp;

</TD></TR>

{/if}

G
guroos author 5/11/2008

many thanks, works a treat!

C
Codea 5/27/2008

Hi,

edit your view page on the Visual Editor tab in the HTML mode for this purpose.

Here is a sample:


Hi Jane,

I am running ASPRunner 5.2 (Build 412). I have quite a few (up to 20) empty fields in a single cell and was wondering if there is a wildcard for the fieldname I can use for suppressing empty fields rather than adding this for each fieldnames in the HTML mode. Any suggestions would greatly be appreciated.

Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29706&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

J
Jane 5/27/2008

Tony,
tro hide all empty fiels add this changes to the source files (C:/Program Files/ASPRunnerPro5.2/templates/layouts/<your layout>/view.htm).

Please note these changes will be applied to all tables in this case.

C
Codea 5/27/2008

Tony,

tro hide all empty fiels add this changes to the source files (C:/Program Files/ASPRunnerPro5.2/templates/layouts/<your layout>/view.htm).

Please note these changes will be applied to all tables in this case.


Hi Jane, it didn't work. I copied the code word for word into the view.htm and it didn't work. I even tried entering it into the list.htm, after all its the list.htm that shows the data. Rather than going outside the ASPRunner program and manually editing these pages can't it be done in the program itself using the "Table List - Table Events - List Page" under one of 9 options? I tried the code above by adding the code as Custom Code into the "List Page: Before Display" option and it didn't work. Below is word for word what I entered but I think it may be incorrect or am I entering it on the wrong option. Can you have a look and advise?
'** Custom code ****

' Suppress Empty Fields

{if $show_FieldName!=""}

<TR><TD class=editshade_b style="PADDING-LEFT: 15px" width=150>FieldName</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px" width=250>{$show_FieldName}&nbsp;

</TD></TR>

{/if}
Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29734&image=1&table=forumreplies' class='bbcemoticon' alt='<<' />

J
Jane 5/28/2008

Tony,
first you need to edit your code on the Visual Editor tab in HTML mode. Don't add custom events.

The above code is just a sample.

C
Codea 5/30/2008

Thanks Jane. It would be great if we could suppress empty fields in the Visual Editor in normal mode by going to the fieldname's properties and selecting a check box. I don't know how helpful it may be for others but maybe you can add it as an Enhancement Request. I'm not much of a HTML person and in my case I have to modify over 20 fields which increases the possibilty of stuffing the HTML code and having to reset the page. Losing all the other changes you have made on the page.
ASPRunner is a product that I have found to be the best Value for Money piece of software that I have purchased in the last 2-3 years. It has saved me hours of work with its simplicity. Keep up the good work. Say G'Day to Sergey and the team. Once again thanks for your help so far.

Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29832&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

J
Jane 5/30/2008

Tony,
thank you for sharing your idea.

We'll add it to our suggestion list.

C
Codea 6/5/2008

Hi Jane,

Me again, I thought I list my question here as its related I think to the code you provided "guroos". I have one field called "Estimated_LiabilityincClaimant_CostsText" (code from the HTML page in Visual Editor) and another called "JMT___SETTLEMENT_Amountvalue". What I need to display on the list page is, if there is a value in field "JMTSETTLEMENT_Amount_value" (Not Null) suppress the Text in the field "Estimated_LiabilityincClaimant_Costs__Text".
Can you help me with the code?
Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30000&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

J
Jane 6/5/2008

Tony,
use custom format for Estimated_LiabilityincClaimant_Costs__Text field on the "View as" settings dialog on the Visual Editor tab.

Here is a sample:

if not isnull(rs("JMT___SETTLEMENT_Amount_value")) then

strValue = "text"

end of

C
Codea 6/5/2008

Hi Jane,

Love your Work! Thanks Guapa!! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30051&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />

Tony

C
Codea 6/18/2008

Hi Jane,

Me again. I'm trying to do the something similar to what we achieved above, but this time instead of the fieldname value being NOT NULL the value = "No". Below is the code I used in the Custom option on the View As tab in the fields properties window but this isn't working the page is falling over. I know its something simple. Can you take a look and let me know what I'm doin wrong.
if not (rs("Field_Name"))=No then

strValue = ""

end if
Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30357&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' />

J
Jane 6/18/2008

Tony,
try to use this code:

if rs("Field_Name")="No" then

strValue = ""

end if

C
Codea 6/18/2008

It Worked! Thanks again Jane.

Cheers

Tony <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=30415&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

G
guroos author 3/5/2009

Hi,

edit your view page on the Visual Editor tab in the HTML mode for this purpose.

Here is a sample:


I am trying to suppress fields on the view page that do not contain an image ie: just that broken link icon. I cannot find how I implemented the above code last year.

Where in the HTML do you place the code. Are we inserting or replacing for each field?
I see why I'm having trouble it's 'cause I'm using V6 now which has field blocks. Is the above code still relevant or do we need to do this another way?

J
Jane 3/5/2009

Hi,
use View page: Before display event on the Events tab for this purpose.

Here is a sample:

if values("FieldName")="" then

xt.assign "FieldName_fieldblock",false

end if

G
guroos author 3/5/2009

Hi,

use View page: Before display event on the Events tab for this purpose.

Here is a sample:


Sorry Jane,

This didn't work either, no errors or anything but still displayed the field when they contained no data.

I tried it on a normal text field as well as the image fields but made no difference.

J
Jane 3/6/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

G
guroos author 3/6/2009

It's difficult to tell you what's happening without seeing actual files.

Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.


I have published ok at:

http://demo.asprunner.net/mike_guroos_com/Project6/login.asp
But cannot open a ticket as it says my account has not been activated. This is strange because I remember publishing once before. Anyway tried to resend activation email but it is not arriving. Have checked spam folder and nothing so I hope it is okay to give you the info here.
Login as guest and click 'exhibitors' on menu and view any of the records in the list. You will see that the logo & map fields still show despite entering the code below in the 'view page:before display' as instructed.

if values("Logo")="" then

xt.assign "Logo_fieldblock",false

end if
if values("Map")="" then

xt.assign "Map_fieldblock",false

end if

J
Jane 3/6/2009

Hi,
try to use this one:

if values("Map")="" or isnull(values("Map")) then

xt.assign "Map_fieldblock",false

end if

G
guroos author 3/6/2009

Hi,

try to use this one:


Sorry to be a pain. This works fine when the field has never had an entry but if you add an image then later delete it the field still displays the original broken image icon.
Nevermind I think it is working, thanks

S
sergioi 6/24/2009

{if $show_FieldName!=""}

<TR><TD class=editshade_b style="PADDING-LEFT: 15px" width=150>FieldName</TD>

<TD class=editshade_lb style="PADDING-LEFT: 10px" width=250>{$show_FieldName}&nbsp;

</TD></TR>

{/if}


I am using ASPRunnerPRO 6.1. Can I use this conditional IF inside the Report Page to don't show a HTML block if the record is blank? I have changed the entire report so I don't have the FieldBlock to set. I've tried this conditonal block but it didn't work.
Thank in advance.
Regards,
Sergio

J
Jane 6/25/2009

Sergio,
unfortunately no.

I recommend you to publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with detailed description of what you want to achieve.

F
fbrashich 7/14/2009

Hi,

edit your view page on the Visual Editor tab in the HTML mode for this purpose.

Here is a sample:


Hi, Jane...
i'm triying... to do that... but don't work for me...

i've PHPR 5.0 b766
i need to remove the "edit" link on list page, when the record has a status 1.

what can i do... it need to be validated in an event or from html code inside...
here is the code i try to use.
[codebox]

{if ($show_status == "1")}

{$editlink_attrs}>Editar</A> {END edit_link}</TD>{/if}{END edit_column}

[/codebox]
tell me if there is any wrong...
Thanks in advance...

J
Jane 7/15/2009

Hi,
I recommend you to use List page: After record processed event for this purpose.

Hee is a sample:

if rs("show_status")=1 then

record("edit_link") = true

else

record("edit_link") = false

end if

F
fbrashich 7/15/2009

Hi,

I recommend you to use List page: After record processed event for this purpose.

Hee is a sample:


this is for ASP, right?
what is the right code for PHP Runner 5.0 b 766?
Thanks!!!

F
fbrashich 7/15/2009



this is for ASP, right?
what is the right code for PHP Runner 5.0 b 766?
Thanks!!!


SOLVED!!!!

For PHP R5.0
[codebox]global $record;
if ($data["status"] == 1) $record["edit_link"] = false;

else $record["edit_link"] = true;[/codebox]
Lot of thanks!!!
There is any way to get a full detail of varialbes for
$row

$col

$data

$record

J
Jane 7/16/2009