FAQ
Hi All,

I trying to build a small App with a few hundred records. They want
the ability to add multiple records from myApp into another DB using
CGI key/value pairs. I am looking for suggestions on the best way to
do it. I am using FormFu. I am considering using a onload action to go
with the Controller and View but I can't help thinking there might be
a more elegant way to do what I want.

My current method involves displaying a list of records, each with
it's own Add button. The Add process opens a record in edit mode,
using FormFu to vailidate it, if it passes change the form->action.
There doesn't seem to be a submit method in FormFu or
Plugin::FillnForm so I am reduced to using an javascript onload
form.submit to submit it. So my current method, apart from being a bit
cumbersome (if you not careful you can end up with the page constantly
reloading on a failed validation) only supports single record
enteries.

Is there a better way?
Thanx,
Dp.

Search Discussions

  • Ali Mesdaq at Jul 9, 2008 at 10:03 pm
    Just to better understand what your trying to do. Are you saying you
    want to display records and only the records that are selected you want
    to be passed to the other db?

    Thanks,
    ------------------------------------------
    Ali Mesdaq (CISSP, GIAC-GREM)
    Security Researcher II
    Websense Security Labs
    http://www.WebsenseSecurityLabs.com
    ------------------------------------------

    -----Original Message-----
    From: Dermot
    Sent: Wednesday, July 09, 2008 11:04 AM
    To: The elegant MVC web framework
    Subject: [Catalyst] method to repeatedly submit form

    Hi All,

    I trying to build a small App with a few hundred records. They want
    the ability to add multiple records from myApp into another DB using
    CGI key/value pairs. I am looking for suggestions on the best way to
    do it. I am using FormFu. I am considering using a onload action to go
    with the Controller and View but I can't help thinking there might be
    a more elegant way to do what I want.

    My current method involves displaying a list of records, each with
    it's own Add button. The Add process opens a record in edit mode,
    using FormFu to vailidate it, if it passes change the form->action.
    There doesn't seem to be a submit method in FormFu or
    Plugin::FillnForm so I am reduced to using an javascript onload
    form.submit to submit it. So my current method, apart from being a bit
    cumbersome (if you not careful you can end up with the page constantly
    reloading on a failed validation) only supports single record
    enteries.

    Is there a better way?
    Thanx,
    Dp.

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/





    Protected by Websense Messaging Security -- www.websense.com
  • Dermot at Jul 10, 2008 at 8:46 am

    2008/7/9 Mesdaq, Ali <amesdaq@websense.com>:
    Just to better understand what your trying to do. Are you saying you
    want to display records and only the records that are selected you want
    to be passed to the other db?

    Yes in part that correct. However up to that point there wouldn't have
    been any validation on the records (there are imported from csv). I
    had thought that I should, for each record, open it in a FormFu, do
    the validation, if ok send it, if not halt and prompt the user.

    Perhaps I should try a different approach, like validating the data at
    the import stage. I had thought about using Chain also.
    Thanx,
    Dp.
  • Wade Stuart at Jul 10, 2008 at 4:42 pm

    Dermot wrote on 07/10/2008 02:46:33 AM:

    2008/7/9 Mesdaq, Ali <amesdaq@websense.com>:
    Just to better understand what your trying to do. Are you saying you
    want to display records and only the records that are selected you want
    to be passed to the other db?

    Yes in part that correct. However up to that point there wouldn't have
    been any validation on the records (there are imported from csv). I
    had thought that I should, for each record, open it in a FormFu, do
    the validation, if ok send it, if not halt and prompt the user.

    Perhaps I should try a different approach, like validating the data at
    the import stage. I had thought about using Chain also.
    Thanx,
    Dp.
    I must be misunderstanding what you are trying to do. I read it as
    you have a few hundred records in your cat app that you wish to be able to
    present to a user and have them submit them in such a way that a cgi post
    happens to a non related cgi app (that controls another database). Is this
    correct? If so, I do not know why you would not just show the records
    (not in html forms, but as an informational view) with an ability to select
    records. these selected records posted via a submit to your app, can cause
    your app to validate (why are they not validated on import of the csv btw?)
    and submit to the external app via LWP server side (not via some client
    side javascript hack).

    -Wade
  • Ali Mesdaq at Jul 10, 2008 at 8:39 pm
    Ok so the flow would be read cvs file (lets assume its submitted by the
    user) then you want all validated (whatever that may be) records to
    automatically be inserted to that other db then only the records that
    were not validated would be presented to the user so they could correct
    it or deselect it from being inserted right?

    Well I would create a validation method in your controller and not use
    FormFu. Call that method for each record and if it fails just push the
    record on to an array for presentation to the user. Then when they
    resubmit just call that method again for each submitted record and get
    rid of the non submitted records.

    All validated records should be inserted into db directly if you can but
    if you can't have direct access do a post of serialized json data or
    name value pairs for each record.

    Thanks,
    ------------------------------------------
    Ali Mesdaq (CISSP, GIAC-GREM)
    Security Researcher II
    Websense Security Labs
    http://www.WebsenseSecurityLabs.com
    ------------------------------------------

    -----Original Message-----
    From: Dermot
    Sent: Thursday, July 10, 2008 12:47 AM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] method to repeatedly submit form

    2008/7/9 Mesdaq, Ali <amesdaq@websense.com>:
    Just to better understand what your trying to do. Are you saying you
    want to display records and only the records that are selected you want
    to be passed to the other db?

    Yes in part that correct. However up to that point there wouldn't have
    been any validation on the records (there are imported from csv). I
    had thought that I should, for each record, open it in a FormFu, do
    the validation, if ok send it, if not halt and prompt the user.

    Perhaps I should try a different approach, like validating the data at
    the import stage. I had thought about using Chain also.
    Thanx,
    Dp.

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/





    Protected by Websense Messaging Security -- www.websense.com
  • Dermot at Jul 11, 2008 at 6:14 pm
    I think there is something I can take from each of these. 1) only
    allow validating records to be allowed to be selected for inserting
    into other DB. 2) Use LWP.

    Thanx,
    Dp.




    2008/7/10 Mesdaq, Ali <amesdaq@websense.com>:
    Ok so the flow would be read cvs file (lets assume its submitted by the
    user) then you want all validated (whatever that may be) records to
    automatically be inserted to that other db then only the records that
    were not validated would be presented to the user so they could correct
    it or deselect it from being inserted right?

    Well I would create a validation method in your controller and not use
    FormFu. Call that method for each record and if it fails just push the
    record on to an array for presentation to the user. Then when they
    resubmit just call that method again for each submitted record and get
    rid of the non submitted records.

    All validated records should be inserted into db directly if you can but
    if you can't have direct access do a post of serialized json data or
    name value pairs for each record.

    -----Original Message-----
    From: Dermot
    Sent: Thursday, July 10, 2008 12:47 AM
    To: The elegant MVC web framework
    Subject: Re: [Catalyst] method to repeatedly submit form

    2008/7/9 Mesdaq, Ali <amesdaq@websense.com>:
    Just to better understand what your trying to do. Are you saying you
    want to display records and only the records that are selected you want
    to be passed to the other db?

    Yes in part that correct. However up to that point there wouldn't have
    been any validation on the records (there are imported from csv). I
    had thought that I should, for each record, open it in a FormFu, do
    the validation, if ok send it, if not halt and prompt the user.

    Perhaps I should try a different approach, like validating the data at
    the import stage. I had thought about using Chain also.
    Thanx,
    Dp.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedJul 9, '08 at 7:03p
activeJul 11, '08 at 6:14p
posts6
users3
websitecatalystframework.org
irc#catalyst

3 users in discussion

Dermot: 3 posts Ali Mesdaq: 2 posts Wade Stuart: 1 post

People

Translate

site design / logo © 2022 Grokbase