[jifty-devel] Jifty Actions, Radio Buttons

Jesse Vincent jesse at bestpractical.com
Fri Apr 28 12:31:30 EDT 2006


I think the problem you may be running into is at least partially that
Jifty takes care of the "id" column for you entirely. 

I think it would help a lot if you can describe your application's data
model in a bit more detail. Don't worry so much about the exact names of
things, but what are the kinds of things you want to keep track of? How
do they relate to each other?

Jesse

On Thu, Apr 27, 2006 at 09:25:37AM -0700, Mat Brletic wrote:
> I have a couple of models, listed below.
> 
> I want to be able to pass in a ticket number from RT, and write it directly to
> the next available Census.ticket slot, adding the next available id to
> Census.id. At the same time, I want to write the Census.id value to a number of
> Answer.survey fields for any number of survey questions, with the answer.id
> fields populated by a sequence of next available ids.
> 
> I know how to pass in the ticket value and get the next available ids. I am
> trying to figure out how to create a page with several radio buttons that all
> write to Answer.id,survey, question and answer  in sequence upon clicking one
> submit button. From what I understand so far, it looks like I will need to have
> an action based on CreateAnswer and CreateSurvey, and call them in sequence for
> whatever number of questions are on the page.
> 
> I could use an example of a radio button being used in a form.
> 
> 
> Any help would be appreciated.
> 
> Thanks,
> 
> Mat
> 
> ------------------------------------------
> package Survey::Model::Answer::Schema;
> use Jifty::DBI::Schema;
> 
> # Your column definitions go here. See L<Jifty::DBI::Schema> for
> # documentation about how to write column definitions.
> 
> column id =>
> type is 'text',
> label is 'id';
> column survey =>
> type is 'text',
> label is 'survey';
> column question =>
> type is 'text',
> label is 'question';
> column answer =>
> type is 'text',
> label is 'answer';
> column answercode =>
> type is 'text',
> label is 'answercode';
> 
> package Survey::Model::Answer;
> use base qw/Survey::Record/;
> 
> # Your model-specific methods go here.
> 
> 1;
> 
> package Survey::Model::Census::Schema;
> use Jifty::DBI::Schema;
> 
> # Your column definitions go here. See L<Jifty::DBI::Schema> for
> # documentation about how to write column definitions.
> 
> column id =>
> type is 'text',
> label is 'id';
> 
> column ticket =>
> type is 'text',
> label is 'ticket';
> 
> package Survey::Model::Census;
> use base qw/Survey::Record/;
> 
> # Your model-specific methods go here.
> 
> 1;
> 
> Alex Vandiver wrote:
> 
>     On Mon, 2006-04-24 at 15:45 -0700, M Brletic wrote:
> 
> 
>         Provide a screen with radio button questions that can take the input
>         from the form and write the ID, Question and Answer to consecutive
>         entries in one table. I also want to be able to read an existing table
>         containing "index" numbers and write to the next available record,
>         without any user input.
> 
> 
> 
>     The examples in the weblog tutorial were mostly oriented about the
>     automatically generated Create, Update, Delete actions for each model --
>     but you can absolutely write arbitrary actions that manipulate their
>     arguments however you want, doing arbitrary database access.  I'm afraid
>     I don't really understand what you're trying to do, though, so I can't
>     really give you any useful concrete examples.
>      - Alex
>     _______________________________________________
>     jifty-devel mailing list
>     jifty-devel at lists.jifty.org
>     http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel
> 
> 
> 
> 

> _______________________________________________
> jifty-devel mailing list
> jifty-devel at lists.jifty.org
> http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel


-- 


More information about the jifty-devel mailing list