Foreign key by id

  • Thread starter Vincent Roussillat
  • Start date
V

Vincent Roussillat

Guest
Hello,

First, I want to say "Bravo" to DaDaBik's author. His script is really great, easy to set-up and configure and provides a wonderful service.

I have one question, for which I find no answer. I am using version 2.2.1 of DaDaBik.

Assuming I have two SQL tables :
- table1 : including id, title, description, type
- table2 : including id, name
- I want table1.type to be filled with any table2.id value

I succeed in creating a form for table1 insertion/update that shows a list of table2.id or a list of "table2.id - table2.name" for type field but with the same value parameter in the <option> tag, but I would like to do the following : the type field should be presented as a list of "table2.name" but with a value of "table2.id" in the <option> tag
So, table1.type field would contain only table2.ids and no table2.name, which may change in the future.

Is this possible in DaDaBik or is it a new feature ?

If it's a new feature, I may be able to propose it. How should I perform this ?
 
E

Emanuele Regalini

Guest
I have exactly the same problem and I fear this problem could make the difference between being able and not being able to use Dadabik for my application.

Please help! Thank you a lot.
 
V

Vincent Roussillat

Guest
Hello,

I have seen that a patch called 'TWO: patch' exists, found it in SourceForge.Net and tried it.

But if it does fix my insertion problem, it doesn't fix the display problem, as the foreign key related field is still displayed with the direct key value, instead of the correspondent key name.

And it seems that this patch doesn't apply to 2.2.1 version, but to an earlier one. :-(

Anyone has a solution ?

 
V

Vincent Roussillat

Guest
Hello,

I have modified business_logic.php (version 2.2.1) :
- including previous "TWO:" patch for all the <select> function (Thanks to the authors of this patch ;-))
- adding the necessary improvment to display a foreign key related field by its value rather than by its key

It works with the TWO: syntax, but I didn't test with the SQL: syntax

How can I make it available to others.

 
P

PLMresearch

Guest
I would suggest posting it in this forum, but perhaps there's a better place Eugenio?
 
E

Eugenio

Guest
PLMresearch wrote:

> I would suggest posting it in this forum, but perhaps there's
> a better place Eugenio?

Hi all,
version 3.0 will include this feature so the patch is not needed anymore.
Thank to the author, anyway!



(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
M

Michael K.

Guest
I have stumbled upon the same problem, and I think it very seriously limits Dadabiks (otherwise great) usefulness, because in the current state of affairs it essentially prevents me from using a normalized db design, and this is bad. Any news on a new Dadabik version?
 
E

Eugenio

Guest
Michael K. wrote:

> I have stumbled upon the same problem, and I think it very
> seriously limits Dadabiks (otherwise great) usefulness, because
> in the current state of affairs it essentially prevents me from
> using a normalized db design, and this is bad. Any news on a
> new Dadabik version?

Look at the post above yours, DaDaBIK 3.0 will be available soon.



(Latest version of DaDaBIK when this message was posted: 2.2.1)
 
M

Michael K.

Guest
OK, looking forward to it! And many thanks again for your great work, Eugenio!
 
L

luca

Guest
I hope that new DADABIK will have the possibility to update the scripts from an older version...!

and I hope it will be free/freeware ...

thanks

Luca
 
Top