Gossamer Forum
Home : Products : Gossamer Links : Discussions :

how to have a editable field which column has been defined as primary key

Quote Reply
how to have a editable field which column has been defined as primary key
  



i have use below code to setup a new table.

#use lib '/path/to/admin'; ##
use Links qw/$DB/;
my $c = $DB->creator('list');
$c->cols([
date => { type => 'datetime'},
username1 => { type => 'varchar', size => 18 },
status => { type => 'varchar', size => 30 },
tel => { type => 'varchar', size => 38 },
]);
$c->pk('username1'); # Set primary key
$c->index({
tel_ndx => ['tel'],
}); # Setup indexes for faster searches
$c->create or die "Create failed: $GT::SQL::error";

Then edit the db_nav.html template so that new table shows up in the editor (in order to manage things and add/remove item).

The problem is when i try to update or modify username field in admin editor panel, it did not return me a editbale text field. actually it is non editable in the admin editor panel.
i have saw the similar table called glink_users table, i wonder if i could create a similar table so i could edit the username with primary key flaged.


thank in advance
Quote Reply
Re: [courierb] how to have a editable field which column has been defined as primary key In reply to
  

what i really want to do is create a table similar to glink_Users,
its primary key is Username, however in edit , we could modify this field value.

when i create a new table. its field of primary key is non editable. could any one help me out
how to create a similar table like glink_Users?


Thanks in advance
Quote Reply
Re: [courierb] how to have a editable field which column has been defined as primary key In reply to
Mmm- I could be wrong, but I'm not sure you can do it (I believe there is something in GT::SQL that lets then show the "Username" field as a Primary Key, but also let you edit it - unlike custom ones.

Maybe someone at GT could comment more on this.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] how to have a editable field which column has been defined as primary key In reply to
Hi andy.

it is nice to see you here again.


yes. i believe there is a way to acomplish that. just i do not know how .


anyway that for the reply.
Quote Reply
Re: [courierb] how to have a editable field which column has been defined as primary key In reply to
oh .it seems that GT staffs are busy these days. i try to PM them for the answer.