How to show all fields on view tab

A place for users and developers of the Xataface to discuss and receive support.

How to show all fields on view tab

Postby etsoft » Mon Aug 15, 2011 5:14 am

Hi,

not all fields are shown there, can i adjust that ??

it looks like those fields are not updating too.

Regards
Erwin
etsoft
 
Posts: 2
Joined: Mon Aug 15, 2011 4:58 am

Re: How to show all fields on view tab

Postby shannah » Mon Aug 15, 2011 11:52 am

Most fields will show up. It leaves off fields that are empty or null.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: How to show all fields on view tab

Postby christoph » Fri Oct 26, 2012 4:49 am

shannah wrote:Most fields will show up. It leaves off fields that are empty or null.

Sorry, an old thread, but I didn't find any other entry about this topic.
Question: Is there a way to force all fields to be shown in details view, also those that are empty or null? I find it more convenient/consistent if the user always sees the same set of field labels and fields, even if some of the fields are empty. Thanks in advance for any input.
christoph
 
Posts: 4
Joined: Fri Oct 26, 2012 4:41 am

Re: How to show all fields on view tab

Postby shannah » Fri Oct 26, 2012 9:30 am

This decision is made inside the Dataface/templates/Dataface_View_Record.html template with the line:
Code: Select all
{if $field.visibility.browse != 'hidden' and $record->htmlValue($field.name)}


Hence, you can fix this issue by either modifying the template (do this by copying it first into your application's templates directory and adding some other condition, or by making sure that htmlValue() always returns a non-empty value. (It can return "0", but not 0, or "").

There are a few ways to manipulate the output of htmlValue() to provide some output:
1. Implement the fieldname__htmlValue() method for each field that you want to modify.
2. Add a listener for the application's "Record::display" event which allows you to filter the output of the display() method for all records. (The display() method is used by htmlValue as a base value)..... However.. no docs on this yet and it is a 2.0 feature (not in 1.3.x).
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: How to show all fields on view tab

Postby christoph » Mon Oct 29, 2012 8:09 am

Hi Steve

I really appreciate your quick reply! Changing the template seems to be the most convenient and quickest way to achieve what I want. Just for completeness (or for others who want to do the same): The line of code that you indicated below didn't work for me, but it showed me the way. That particular line of code is within the 'dataface-sections-left-column' part of the template. In my installation (which has little to no customizations yet), the left-column part shows the related records. There is a similar decision {if $field_value} in the 'dataface-sections-main-column' part (line 183 of the current version). If I remove this condition (I simply changed it to {if 1}), then I get exactly what I wanted: All labels and fields are displayed in the main column, even if some of the fields are empty.

BTW: I'm just starting to explore Xataface, and I'm really impressed by your work and by the level of support you offer. Thanks a lot for making all this available!

Kind regards,
Christoph
christoph
 
Posts: 4
Joined: Fri Oct 26, 2012 4:41 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 17 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved