Select Single Problem and a date question

geronimo

New member
Hello everyone!

I am new here and hopefully my question/problem haven't been asked yet (and I just failed to find them with the search function).
I am running dadabik 4.2 and php 5.3

The first one is a problem with the "select single" feature.
I have a table with a "field1" (in phpmyadmin defined as varchar(25) - of course I have other fields, too, for id as primary key, but they make no problem).
In dadabik admin after installing the table I switched the field type for 'field1' to 'select_single' and "other choices allowed" to 'y'. All other values I kept as default (content type = alphanumeric, options separator = '~' and so on).

When I now in the user area try to insert a new data set, I open the dropdown of field one, select "other" and in the text field next to it I type "www1" and save the data set successfully.
Now I insert a second data set. But when I open the dropdown for 'field1', the value of the first data set ("www1") is not displayed. And having a look in the admin area, in the field configuration of 'field1' "www1" appears not in "option to include".
Only when I edit the first dataset and enter the value "www1" for a second time and save it, it afterwards appears for new datasets in the dropdown menu.
But if it is the very first value for this field, afterwards the first letter of the value is missing because in the admin area I see that the first option separator"~" that has to be before the first value in "options to include" is there.

Any Idea what goes wrong?



The second one is a question concerning dates.
I have a field 'date1' (date type, format YYYY-MM-DD in sql). Now I have some german users who are not very familiar with working with computers and I want to try the following:
The user can insert the date in the german way (DD.MM.YYYY), but it is inserted in the sql way (YYYY-MM-DD).
I know a little php and so how to switch in php between the two formats.
But I really don't know where in the dadabik code to change what php code to make this possible.

Has anyone ever tried out this or has any idea how to manage this problem?


Hopefully this was not too much (and too often asked) and everybody understands what I am talking about as my "computer english" is not the best.
 

DebbieS

DaDaBIK Guru
For the date stuff ... look in /include/general_functions.php - all the date functions are in there. You can re-order the selects for the date if that makes it easier. There is a tutorial on adding a date picker to DaDaBIK that may be useful - http://www.dadabik.org/forum/read.php?1,14819,14819#msg-14819.

For the select single, what values do you have in the following fields (in admin.php >> interface configurator):
Primary key field
Primary key table
Linked fields
Order by

I tested this on a local install and other works if I have only one field listed in the linked fields field. When I have more than one field in the linked fields, it tries to insert the new value using the first field (before the ~ separator).

The options to include is used if you are not driving your values from another table.
 

geronimo

New member
Hello Debbie!

Thanks for you reply.
I will try your hint with the date picker.
Let's see if I manage to get it work properly. :)

Concerning the "select single"-problem:
I have no values in the fields mentioned by you because the table is not connected with another table.
 

peartaa

New member
Re: select_single:

If you want to allow other choices, you need to create a table that is just a list of your current choices. You also need to put the name of the table with the list in the field 'primary key table', and the field name in 'primary key field', and 'linked fields'. the drop-down menu for that field will show first the items in your 'option to include', and then the contents of the list table.

Selecting 'other' and typing in the text field will add your entry to the table and it will show up the next time you insert.

I'm having an issue with this as well: everything I just described works fine, except when I use 'other..' i get '0' or another number for the value instead of what I typed. It shows up on the drop-down menu the next time, but I always get the number the first time i insert a value.
 

eugenio

Administrator
Staff member
The number is usually what you actually insert, but in the listbox you see the description. I am not sure I have understand your question because it seems to me the normal behavior. Is there a public URL where I can see your application?
 
Top