Menu

#344 (in 2.5.3-rc2) relational insert: swap key and content

Next_minor_version
fixed
1
2013-06-11
2003-06-28
No

I have a relation defined and want to insert a new row. I
get a dropdown where I can select an ID based on the
content of the foreign table. The problem is, that the
values are "<ID> - <content>", but "<content> - <ID>"
would be easier to navigate through, as pressing any
letter will then make the browser jump to the first value
starting with that letter.

Discussion

  • Garvin Hicking

    Garvin Hicking - 2003-07-23
    • assigned_to: nobody --> garvinhicking
    • status: open --> open-accepted
     
  • Garvin Hicking

    Garvin Hicking - 2003-08-05
    • priority: 5 --> 1
    • summary: relational insert: swap key and content --> (in 2.5.3-rc2) relational insert: swap key and content
    • status: open-accepted --> open-fixed
     
  • Garvin Hicking

    Garvin Hicking - 2003-08-05

    Logged In: YES
    user_id=473563

    Alexander,

    I do think the same way. However, it could be that a primary
    key is not a INT/TINYINT and then somebody might miss the
    old order.

    What I did is this: The dropdown will now show both
    id-content and content-id associations below each other. So
    if you have a INT-TEXT association, you can use your access
    key for both numbers and text.

    Sample:

    3 - CGI
    1 - PHP
    2 - Python
    CGI - 3
    PHP - 1
    Python - 2

    So the old way is displayed in the first order. If you have
    a TEXT-TEXT relation, the accesskeys work like previously,
    as they select the first options first.

    I wanted to not integrate another config option or a button
    to the interface, so I think this is a good way.

    If a dropdown contains more than 100 items, the ID-CONTENT
    association is hidden, and only the new CONTENT-ID order is
    shown. I guess, the latter makes sense in most of the time.

    (implemented into CVS - please give it a try :-)

    Regards,
    Garvin.

     
  • Marc Delisle

    Marc Delisle - 2003-08-07

    Logged In: YES
    user_id=210714

    Ok I just saw this thread. Makes sense now, even if I regret
    losing half the space.

     
  • Garvin Hicking

    Garvin Hicking - 2003-08-07

    Logged In: YES
    user_id=473563

    lem9,

    yes - I also dislike losing the space. But I'm not sure,
    should we implement a config option for that?
    I have also thought about implementing TWO dropdowns, each
    depening on their sort order. And inserting a value only
    takes the dropdown into account where you chose a non-empty
    value...

    Regads,
    Garvin.

     
  • Marc Delisle

    Marc Delisle - 2003-08-07

    Logged In: YES
    user_id=210714

    I try to avoid adding new config options if possible. I also
    had the idea of 2 dropdowns but it would maybe confuse the
    users.
    For now, let's lose the space... but please sort each list
    on the left part.

    However, what could be done, to solve also the problem of
    how many values we display, is to use $cfg['MaxRows'] to
    limit the display, plus the same Page number feature we have
    on Browse page.

    Also don't forget tbl_select :)

     
  • Garvin Hicking

    Garvin Hicking - 2003-08-07

    Logged In: YES
    user_id=473563

    lem9,

    oh, you are right, I forgot sorting. Will take care of that.
    I will also look into tbl_select (have never used it nor
    have ever seen its code :-).

    But I don't understand what you mean by using the Page
    number feature? We would have to reload the INSERT-Secreen
    on every page select, to rebuild the dropdown data. If
    somebody already entered data into any of the other fields,
    they will be lost. And if you have more than one scrollable
    field, the values of the previous one will get lost. I don't
    see how this could work.

    What *could* work, however, is if we use JavaScript to fill
    the dropdowns. We could build an JS array of all possible
    options. Then use JS to fill in the first $cfg['MaxRows']
    values in the dropdown. The last dropdown entry will be
    something like '>>>' - if this option gets selected, we can
    take JS to fill the next values of the array in the dropdown.

    Of course this will need JS to work, without any
    alternative. We could maintain the old code and put the JS
    functionality on top of it, so it won't disturb Non-JS
    users. But Non-JS users can then not browse beyond the
    MaxRows entires in the dropdown (which they currently can't
    either :-)

    Regards,
    Garvin.

     
  • Garvin Hicking

    Garvin Hicking - 2003-08-07
    • priority: 1 --> 2
    • status: open-fixed --> open-remind
     
  • Marc Delisle

    Marc Delisle - 2003-08-07

    Logged In: YES
    user_id=210714

    Oops, forget about the non-js Page number idea...

     
  • Garvin Hicking

    Garvin Hicking - 2003-08-07

    Logged In: YES
    user_id=473563

    How about this, it's much easier:

    We generate dropdowns each with MaxRows options in it. The
    first one is shown, all other one's are hidden (CSS:
    display:none).

    Then we add that page number dropdown. Changing it hides the
    current dropdown and instead makes the corresponding
    dropdown visible.

    This way the JavaScript-part is very reduced. I currently
    don't know if it really works like I imagine, but I will try
    it out. :)

    regards,
    Garvin.

     
  • Marc Delisle

    Marc Delisle - 2003-08-07

    Logged In: YES
    user_id=210714

    Ok try it, however don't forget to avoid generating too
    heavy pages. The foreign table could be big...

     
  • Garvin Hicking

    Garvin Hicking - 2003-08-07

    Logged In: YES
    user_id=473563

    lem9,

    okay...but, compressing HTML using OBZip or mod_gzip is
    fairly easy and could compress a lot of output.

    How about spawning a popup for more than XXX rows: You have
    a plaintext input field, click on a link. A popup will open
    where you can see a page with all entries as links. Clicking
    on a link will enter the value in the parent window.

    The popup could have browsable pages, and could use the
    'multiple pages' JS dropdown.

    As I write of this, I really like the idea. I'll put this on
    my todo with high priority, let's see what I can do the next
    week. Currently the heat is taking on my brain :))

    (11:30pm and still about 29 degrees C in my room)

     
  • Marc Delisle

    Marc Delisle - 2003-08-08

    Logged In: YES
    user_id=210714

    Sounds good, but only for more that XXX rows.

     
  • Garvin Hicking

    Garvin Hicking - 2003-08-15

    Logged In: YES
    user_id=473563

    Please see patch #789367

     
  • Michal Čihař

    Michal Čihař - 2003-09-09
    • priority: 2 --> 1
    • status: open-remind --> closed-fixed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed-fixed --> fixed