Search button does not search INT field

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

Search button does not search INT field

Postby rleyba » Tue May 31, 2011 5:21 am

Hi Steve,

One of my Xataface tables has the schema below. Everything seems to work except that when I click the search button on the page, it does NOT seem to search the VlanID field which is integer. The FIND button finds it though. Example, if I type 465 in the Search button and click Submit....nothing shows up...but if I go to FIND....then under VLANID type in 465, then it shows the relevant rows. How do we change the behaviour of the Search bar so it can search integers too?

I have the same experience with the Mask field, which is also an integer.

Thanks very much.

Code: Select all
CREATE TABLE IF NOT EXISTS `FIREWALL_INTERFACES` (
  `Firewall_Name` varchar(15) NOT NULL,
  `Logical_Interface` varchar(15) NOT NULL,
  `VlanID` int(4) NOT NULL,
  `Active` char(3) NOT NULL,
  `link_avail` varchar(7) NOT NULL,
  `Type` varchar(22) NOT NULL,
  `IP_Address` char(15) NOT NULL,
  `Mask` int(3) NOT NULL,
  PRIMARY KEY  (`Firewall_Name`,`Logical_Interface`,`VlanID`,`Active`,`link_avail`,`Type`,`IP_Address`,`Mask`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
rleyba
 
Posts: 53
Joined: Sat Dec 04, 2010 3:50 pm

Re: Search button does not search INT field

Postby shannah » Tue May 31, 2011 9:17 am

Yes. The search in the upper right produces the -search GET parameter. This matches only char, varchar, and text fields. The find form allows more precise searches on particular fields.

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

Re: Search button does not search INT field

Postby rleyba » Wed Jun 01, 2011 1:33 am

Ok, thanks....will change the field type.
rleyba
 
Posts: 53
Joined: Sat Dec 04, 2010 3:50 pm

Re: Search button does not search INT field

Postby shannah » Mon Jun 06, 2011 1:37 pm

An alternative to changing the field type is to add a grafted field that is searchable. Sometimes I'll create a concatenated field on a table for the sole purpose of searching ... then I hide the field from all of my views.

E.g. fields.ini
Code: Select all
__sql__ = "select a.*, concat(a.field1,' ',a.field2,' ',a.field3) as search_field from atable a"

[search_field]
    visibility:list=hidden
    visibility:browse=hidden
    visibility:find=hidden
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 19 guests

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