FAQ
Hello everybody,

i am not sure whether i have to ask this question in DBIx-Class/FormFu
mailing list.
I want to show all the items in a select box in alphabetical order.

I have written the below code for the same.
---
action:
auto_fieldset: 1
auto_id: '%f_%n'
elements:
- type: Select
name: user
label: 'Select user: '
model_config:
model: Database::Users
label_column: name
id_column: id
order_by:
'name': 'ASC'
constraints:
- Required
- type: Submit
value: Submit
name: submit

But this is not sorting the select box entries in ascending order.
could anybody please let me know how to provide order_by clause with
model_config?

thank you.

Best Regards,
Mohan
--
View this message in context: http://n2.nabble.com/using-order-by-with-model_config-tp2824641p2824641.html
Sent from the HTML-FormFu mailing list archive at Nabble.com.

Search Discussions

  • Mohanprasad at May 6, 2009 at 10:09 pm
    I achieved it by making use of order_by in attributes inside model_config as
    follows.
    changed code is as follows:

    - type: Select
    name: user
    label: 'Select user: '
    model_config:
    model: Database::Users
    label_column: name
    id_column: id
    attributes:
    order_by: 'name asc'

    thanks.
    Best Regards,
    Mohan

    mohanprasad wrote:
    Hello everybody,

    i am not sure whether i have to ask this question in DBIx-Class/FormFu
    mailing list.
    I want to show all the items in a select box in alphabetical order.

    I have written the below code for the same.
    ---
    action:
    auto_fieldset: 1
    auto_id: '%f_%n'
    elements:
    - type: Select
    name: user
    label: 'Select user: '
    model_config:
    model: Database::Users
    label_column: name
    id_column: id
    order_by:
    'name': 'ASC'
    constraints:
    - Required
    - type: Submit
    value: Submit
    name: submit

    But this is not sorting the select box entries in ascending order.
    could anybody please let me know how to provide order_by clause with
    model_config?

    thank you.

    Best Regards,
    Mohan
    --
    View this message in context: http://n2.nabble.com/using-order-by-with-model_config-tp2824641p2824741.html
    Sent from the HTML-FormFu mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouphtml-formfu @
categoriesperl, catalyst
postedMay 6, '09 at 9:48p
activeMay 6, '09 at 10:09p
posts2
users1
websitemetacpan.org...

1 user in discussion

Mohanprasad: 2 posts

People

Translate

site design / logo © 2022 Grokbase