# |
Mar 18th 2018, 09:49 |
loginews |
I will struggle with it. |
# |
Mar 18th 2018, 09:49 |
loginews |
you are very kind. |
# |
Mar 18th 2018, 09:49 |
loginews |
I believe there must have been something wrong with the table structure |
# |
Mar 18th 2018, 09:49 |
loginews |
thanks a lot |
# |
Mar 18th 2018, 09:49 |
loginews |
when I replaced the data, now it does not work on both |
# |
Mar 18th 2018, 09:48 |
loginews |
actually, as I told you it was working on Unix not on Windows |
# |
Mar 18th 2018, 09:48 |
loginews |
it does :( |
# |
Mar 18th 2018, 09:48 |
turkles |
providing 'NATU' exists in $data |
# |
Mar 18th 2018, 09:48 |
turkles |
which would also be fine |
# |
Mar 18th 2018, 09:48 |
loginews |
okay, for me it is something like 'NATU' that is a string |
# |
Mar 18th 2018, 09:47 |
turkles |
if 1 is the key to your desired default |
# |
Mar 18th 2018, 09:47 |
turkles |
echo $this->Form->select('VENDID',$data,['onchange'=>'updvendid()','id'=>'vendid','default' => 1]); |
# |
Mar 18th 2018, 09:45 |
loginews |
File uploaded https://cakesf.slack.com/files/U435V89H8/F9R771S0Z/-.txt / https://slack-files.com/T053DPNCM-F9R771S0Z-d6e6e62382 - Where should I add the default option? |
# |
Mar 18th 2018, 09:44 |
turkles |
The ['default' => 'm'] would work fine, providing of course that 'm' is your index to what you want as default - not the value you want to show |
# |
Mar 18th 2018, 09:42 |
loginews |
Let me show you the actual cakephp code. Maybe there is a missing [ or something else. |
# |
Mar 18th 2018, 09:40 |
loginews |
I also tried 'selected'=>'m' and 'value'=>'m' .... in all cases, the generated html code does not contain anything which would allow the select command to display a default option. |
# |
Mar 18th 2018, 09:38 |
loginews |
yes, I tried that too. When I look at the generated code, it is no different than before. |
# |
Mar 18th 2018, 09:36 |
turkles |
You mean: echo $this->Form->select('size', $sizes, ['default' => 'm']); |
# |
Mar 18th 2018, 09:35 |
loginews |
Would there be some additional code I must add in Cake3 for the select('VENDID',$data) to display the default value which is already in the VENDID field? |
# |
Mar 18th 2018, 08:32 |
loginews |
I have just copied the data from windows to unix. Now the latter does not show the default value either !!! :( |
# |
Mar 18th 2018, 08:20 |
loginews |
well, no. Maybe I should use that as a hint. |
# |
Mar 18th 2018, 08:16 |
turkles |
can you confirm $data contains the same data on both? |
# |
Mar 18th 2018, 08:10 |
loginews |
otherwise the dropdown works fine and saves properly. |
# |
Mar 18th 2018, 08:10 |
loginews |
merely CHAR(10) |
# |
Mar 18th 2018, 08:08 |
turkles |
windows does odd stuff to me because php can't handle larger than INT |
# |
Mar 18th 2018, 08:08 |
turkles |
how big is the value |
# |
Mar 18th 2018, 08:02 |
loginews |
File uploaded https://cakesf.slack.com/files/U435V89H8/F9RLB37FD/default_selected_value.txt / https://slack-files.com/T053DPNCM-F9RLB37FD-a2c4ef1351 - $data contains the keyfield and the keyvalue from a "find list". On one server (unix), the default value contained in the field VENDID is shown. On another server (windows), the display value stays blank. Both are cakephp 3. Can anyone give me a fix ? |
# |
Mar 18th 2018, 07:15 |
turkles |
what is it called when I want to have an index which is the combination of two fields, and is it easily possible in cake |
# |
Mar 18th 2018, 07:11 |
Sigfried84 |
thanks |
# |
Mar 18th 2018, 06:53 |
admad |
basic PHP, nothing cake specific |
# |
Mar 18th 2018, 06:53 |
admad |
someMethod($optional = null, $opt2 = [], $opt3 = 'default') |
# |
Mar 18th 2018, 06:23 |
Sigfried84 |
anybody awake? |
# |
Mar 18th 2018, 06:20 |
Sigfried84 |
Good morning! I am creating a custom helper...how can I set optional arguments and avoid warnings in case an argument is missing? |
# |
Mar 18th 2018, 00:48 |
turkles |
answer: ->indexBy() |
# |
Mar 18th 2018, 00:40 |
turkles |
how to I get my result set keys to be a specific field? |
# |
Mar 17th 2018, 20:46 |
richellyitalo |
Hello. How can i do the cake rest make most fast? |
# |
Mar 17th 2018, 18:55 |
dereuromark |
well, if you google it, you will find a lot of references on that one, but you could look into https://stackoverflow.com/questions/27983/sql-group-by-with-an-order-by (also found via google) |
# |
Mar 17th 2018, 18:55 |
joopm |
do you have any hint for me please |
# |
Mar 17th 2018, 18:55 |
joopm |
haha |
# |
Mar 17th 2018, 18:55 |
joopm |
this does not help me |
# |
Mar 17th 2018, 18:55 |
dereuromark |
yeah that doesnt work :slightly_smiling_face: |