Problem with Xataface Depselect

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

Problem with Xataface Depselect

Postby muzafar » Mon Apr 23, 2012 4:58 am

Greetings,

I am using the xataface depselect module. I have put the modules in my xataface directory which is outside my site directory i.e.

xampp/htdocs/sitename/xata/modules/depselect

I have added this in my conf.ini file as well.
[_modules]
modules_depselect=modules/depselect/depselect.php

I have created two tables namely, provinces, districts and i will extend to more if it works, the structure and it's dumb data is given below:

CREATE TABLE IF NOT EXISTS `provinces` (
`province_id` int(11) NOT NULL AUTO_INCREMENT,
`province_name` varchar(64) NOT NULL,
`province_code` varchar(32) DEFAULT NULL,
PRIMARY KEY (`province_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `provinces`
--

INSERT INTO `provinces` (`province_id`, `province_name`, `province_code`) VALUES
(1, 'Khyber Pakhtoonkhwa', 'KPK'),CREATE TABLE IF NOT EXISTS `provinces` (
`province_id` int(11) NOT NULL AUTO_INCREMENT,
`province_name` varchar(64) NOT NULL,
`province_code` varchar(32) DEFAULT NULL,
PRIMARY KEY (`province_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `provinces`
--

INSERT INTO `provinces` (`province_id`, `province_name`, `province_code`) VALUES
(1, 'Khyber Pakhtoonkhwa', 'KPK'),

And the districts table is:

CREATE TABLE IF NOT EXISTS `districts` (
`distt_id` int(11) NOT NULL AUTO_INCREMENT,
`province_id` int(11) DEFAULT NULL,
`distt_name` varchar(64) DEFAULT NULL,
`distt_code` varchar(32) DEFAULT NULL,
PRIMARY KEY (`distt_id`),
KEY `province_id` (`province_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

--
-- Dumping data for table `districts`
--

INSERT INTO `districts` (`distt_id`, `province_id`, `distt_name`, `distt_code`) VALUES
(1, 1, 'Peshawar', 'Pesh'),
(2, 1, 'Kohat', 'Ko'),
(3, 2, 'Lahore', 'Lh');

--
-- Constraints for dumped tables
--

--
-- Constraints for table `districts`
--
ALTER TABLE `districts`
ADD CONSTRAINT `districts_ibfk_1` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`province_id`);

but when I go to the browser and give the the following url: http://demo.cvp.org/grants/index.php?-a ... =provinces

it only shows the province table fields and not the districts table. you can see the form view in attached snapshot as well. my fields.ini file for provinces is like this.

[province_id]
widget:type=depselect
widget:table=provinces

[distt_id]
widget:type=depselect
widget:table=districts
widget:filters:province_id="$province_id"

I have created tables/provinces directory in tables directory with provinces.p not the tables/districts directory yet.
kindly lead me, and tell me what i am doing wrong.
looking forward for your reply.
Attachments
Untitled.jpg
Untitled.jpg (39.71 KiB) Viewed 8673 times
muzafar
 
Posts: 44
Joined: Mon Nov 28, 2011 9:25 pm

Re: Problem with Xataface Depselect

Postby Jean » Mon Apr 23, 2012 11:51 pm

Hello Muzafar,
Which Xataface version have you ?

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: Problem with Xataface Depselect

Postby simbioc » Tue Apr 24, 2012 1:48 am

Use another table and from there call these "child" tables.
It works
simbioc
 
Posts: 4
Joined: Fri Mar 16, 2012 3:03 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 12 guests

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