Change database record link to different view mode?

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

Change database record link to different view mode?

Postby JSours » Tue Mar 01, 2011 8:48 am

When I click on the database record it goes to a view mode page. Instead of going into a view mode page I want it to directly go into the edit mode page. How would I do this?
JSours
 
Posts: 12
Joined: Tue Mar 01, 2011 8:45 am

Re: Change database record link to different view mode?

Postby shannah » Tue Mar 01, 2011 10:39 am

Add
Code: Select all
default_browse_action=edit


To the beginning of your conf.ini file

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Change database record link to different view mode?

Postby JSours » Tue Mar 01, 2011 11:05 am

I put default_browse_action=edit in the very beginning of the conf.ini file and nothing happens. It still directs to the view page
JSours
 
Posts: 12
Joined: Tue Mar 01, 2011 8:45 am

Re: Change database record link to different view mode?

Postby shannah » Tue Mar 01, 2011 11:18 am

This should work. It has been in there since version 0.6 and I'm successfully running this directive on dozens of installs. Double check to make sure you don't have a typo in the directive.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Change database record link to different view mode?

Postby JSours » Tue Mar 01, 2011 11:29 am

Okay i found out that one of the [_prefs] options was disabling this feature because when I took out all the lines under [_prefs] it worked. I just have to go line by line and find out which one.

Thank you
JSours
 
Posts: 12
Joined: Tue Mar 01, 2011 8:45 am

Re: Change database record link to different view mode?

Postby JSours » Tue Mar 01, 2011 12:00 pm

One more question, how do I hide the view tab itself?
JSours
 
Posts: 12
Joined: Tue Mar 01, 2011 8:45 am

Re: Change database record link to different view mode?

Postby shannah » Tue Mar 01, 2011 12:12 pm

Create an actions.ini file if you haven't already in the main app directory. Then override the "view" action and either set it's category to something else, change the condition to "0" of "false", or set the permission to something that your users dont have access to.

An example of doing it by setting the category is as follows:

Code: Select all
[view > view]
    category=""
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Change database record link to different view mode?

Postby JSours » Tue Mar 01, 2011 12:29 pm

Thank you!
JSours
 
Posts: 12
Joined: Tue Mar 01, 2011 8:45 am

Re: Change database record link to different view mode?

Postby ctripp » Mon Nov 14, 2011 11:10 pm

Hi there, It seems I am having a similar problem to the one described in the previous post.
Using default_browse_action=edit in the config.ini does not seem to have any effect.
However I do not have any [_prefs] in the config.ini

Code: Select all
;;Configuration settings for application
title="appletra_applestores"
default_browse_action=edit
hide_search=1
debug=0

[_database]
   host="localhost"
   name="appletra_applestores"
   user="appletra_atkuser"
   password="*******************"
   
[_tables]
STORE = "Store"
STOREDESIGN = "Design"
PROJECT = "Project"
EQUIPMENT = "Equipment"
NOTE = "Notes / History"
;SPKMETHOD = "Speaker Method"
;DESIGNTYPE = "Design Type"
;STATE = "State"
;COUNTRY = "Country"
;TYPE = "Type"
;LOCATION = "Location"
;PRODUCT = "Product"
;CATEGORY = "Category"


Also, I am not sure if this is related but in the tables actions.ini file, if I use
Code: Select all
[view > view]
    condition="false"

then it seems to remove BOTH the view and edit tabs.

Clayton
ctripp
 
Posts: 7
Joined: Mon Nov 14, 2011 8:50 pm

Re: Change database record link to different view mode?

Postby Tadas » Wed Jan 18, 2012 5:50 am

Hi, I have a question on relative matter.

In list view, when selecting a record, instead of default 'detail' view, is it possible to make an URL to that particular entry but in a different table.

In my case:
I have a table 'defektai' where the fields are populated from other tables, such as 'asmuo' (people) .
If i select a row with a particular persons name (under a column "Atsakingas asmuo"(responsible person)) and I press on the name, I need that it would go to another table and open that particular name details.
It would be perfect to set up such thing in this table, for a couple of columns.

I attach a screenshot (if its of any help):
http ://dl.dropbox.com/u/13952207/ss_xataface.png

Thanks!

Tadas
Tadas
 
Posts: 1
Joined: Wed Jan 18, 2012 5:15 am

Re: Change database record link to different view mode?

Postby shannah » Mon Jan 23, 2012 12:06 pm

You can always build a URL to go exactly where you want to go using Xataface URL conventions. E.g.
index.php?-table=people1&person_id=10
index.php?-table=people2&person_id=10

One would go to the record from table people1 where person_id is 10 and the other goes to table people2 where person_id is 10.

There are also convenience functions for generating URLs for you.
e.g.
Dataface_Application::url()
and
Dataface_Record::getURL()
e.g.

Code: Select all
$app = Dataface_Application::getInstance();
$url = $app->url('-table=people&person_id=10');
or
$url = $app->url(array('-table'=>'people', 'person_id'=>10));


-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


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