Trapping parameters from a dynamic list of checkboxes.
I am trying to find a way to get values back from a dynamic list of checkboxes. Within my template I have figured out how to create the list of checkboxes based on values from a hash reference. Like so: <% FOREACH ID IN Accomps.keys %> <div> <label><input type="checkbox" name="<% Accomps.$ID.NAME %>" value="<% Accomps.$ID.ID %>"><% Accomps.$ID.NAME %> <% Accomps.$ID.descrip %></label> </div> <% END %> </div> However, I can't figure out how dancer would go about getting back the values from the list of checkboxes as each checkbox input's name is different. I normally get values back in Dancer with: like this: my $input_hash = { Tech => param('tech), Type => param('type'), } But I cannot figure out how to do it in this case since the name of the input type is based on the values in the has ref. I have tried to create them based on the values that are fed into the template from the SQL query like this: my $input_hash = { Tech => param('tech), Type => param('type'), while ($sth->fetch) { $ANAME => param($ANAME), } } But this causes plackup start to crash with: Error while loading /home/richard/Dancer2/MyApp/bin/app.psgi: syntax error at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 549, near "while" syntax error at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 555, near "}" So I am beginning to think that I am heading down the wrong path. Any help would be greatly appreciated. Thanks
2015-08-27 0:35 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
I am trying to find a way to get values back from a dynamic list of checkboxes.
# you need to get your list of checkbox fields, one way you query it from DB again: my $Accomps = $dbh->selectall_hashref( $q, 'ID' ); # Then: my $input_hash = { Tech => param('tech'), Type => param('type'), }; foreach my $key ( keys %$Accomps ) { if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; } } Wbr, -- Kõike hääd, Gunnar
Hi WK, Thanks for your reply. I am trying to get it to work. my $Accomps = $dbh->selectall_hashref( $q, 'ID' );
After figuring out how to accommodate my placeholder in selectall_hashref I did this: my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid ); Then as you suggested I do: # get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } } (just printing temporarily to see if it trapped the values) However, I get this error: Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557. Any idea what I am doing wrong?
# Then: my $input_hash = { Tech => param('tech'), Type => param('type'), };
foreach my $key ( keys %$Accomps ) { if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; } }
Wbr, -- Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
2015-08-27 17:28 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
After figuring out how to accommodate my placeholder in selectall_hashref I did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
If you need placeholder here, but you don't have need for any attributes, you may use `undef` here my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } }
(just printing temporarily to see if it trapped the values)
Here we actually don't need values of $Accomps-hashref, we just using it as list to check out form values, so depending of your futher needs, you may assign your specific value here, like, for example: $input_hash->{ $key } = 1;
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
What is on line 577 of your MyApp.pm? Wbr, -- Kõike hääd, Gunnar
Hi WK, Thanks for the reply. Line 577 is the print statement print $key $input_hash->{ $key } . "\n"; In the foreach. I know I shouldn't be printing here however, I just want to see what value comes across for for example $input_hash->{ '13' } before I create a DB record based on that value.So I guess I just need help figuring out how to see or get the value out of $input_hash->{ID NUMBER}. 2015-08-27 10:07 GMT-05:00 WK <wanradt@gmail.com>:
2015-08-27 17:28 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
After figuring out how to accommodate my placeholder in selectall_hashref I did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
If you need placeholder here, but you don't have need for any attributes, you may use `undef` here
my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } }
(just printing temporarily to see if it trapped the values)
Here we actually don't need values of $Accomps-hashref, we just using it as list to check out form values, so depending of your futher needs, you may assign your specific value here, like, for example:
$input_hash->{ $key } = 1;
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
What is on line 577 of your MyApp.pm?
Wbr, -- Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
The symbolic reference there is $key; you are (unintentionally, I'd guess) using print's: print FILEHANDLE LIST syntax, and it is trying to use $key as the filehandle. Maybe you meant: print $key, $input_hash->{ $key }, "\n" On Thu, Aug 27, 2015 at 8:42 AM, Richard Reina <gatorreina@gmail.com> wrote:
Hi WK,
Thanks for the reply. Line 577 is the print statement print $key $input_hash->{ $key } . "\n"; In the foreach. I know I shouldn't be printing here however, I just want to see what value comes across for for example $input_hash->{ '13' } before I create a DB record based on that value.So I guess I just need help figuring out how to see or get the value out of $input_hash->{ID NUMBER}.
2015-08-27 10:07 GMT-05:00 WK <wanradt@gmail.com>:
2015-08-27 17:28 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
After figuring out how to accommodate my placeholder in selectall_hashref I did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
If you need placeholder here, but you don't have need for any attributes, you may use `undef` here
my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } }
(just printing temporarily to see if it trapped the values)
Here we actually don't need values of $Accomps-hashref, we just using it as list to check out form values, so depending of your futher needs, you may assign your specific value here, like, for example:
$input_hash->{ $key } = 1;
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
What is on line 577 of your MyApp.pm?
Wbr, -- Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
That worked! Thank you very much. Interestingly though $input_hash->{ $key } appears as a hash ref "HASH(0xa1d2344)" which I was not able to dereference with %$input_hash->{key}. This doesn't bother me much because all I really need to know is that it has value -- that tells me the user checked the box for this option. So, instead of looking at the actual value I was just going to do: # get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { if ( param( $key ) ) { # paramter has value $input_hash->{ $key } = $Accomps->{ $key }; # user checked this box. Enter a record into TO_DO table } } Is that okay? Or would such an un-exact way of doing it have a downside? 2015-08-27 11:24 GMT-05:00 Yitzchak Scott-Thoennes <sthoenna@gmail.com>:
The symbolic reference there is $key; you are (unintentionally, I'd guess) using print's:
print FILEHANDLE LIST
syntax, and it is trying to use $key as the filehandle.
Maybe you meant:
print $key, $input_hash->{ $key }, "\n"
On Thu, Aug 27, 2015 at 8:42 AM, Richard Reina <gatorreina@gmail.com> wrote:
Hi WK,
Thanks for the reply. Line 577 is the print statement print $key $input_hash->{ $key } . "\n"; In the foreach. I know I shouldn't be printing here however, I just want to see what value comes across for for example $input_hash->{ '13' } before I create a DB record based on that value.So I guess I just need help figuring out how to see or get the value out of $input_hash->{ID NUMBER}.
2015-08-27 10:07 GMT-05:00 WK <wanradt@gmail.com>:
2015-08-27 17:28 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
After figuring out how to accommodate my placeholder in selectall_hashref I did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
If you need placeholder here, but you don't have need for any attributes, you may use `undef` here
my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } }
(just printing temporarily to see if it trapped the values)
Here we actually don't need values of $Accomps-hashref, we just using it as list to check out form values, so depending of your futher needs, you may assign your specific value here, like, for example:
$input_hash->{ $key } = 1;
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
What is on line 577 of your MyApp.pm?
Wbr, -- Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
2015-08-27 20:05 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
That worked! Thank you very much.
Yeah, Yitzchak seems have an eagle eye!
Interestingly though $input_hash->{ $key } appears as a hash ref "HASH(0xa1d2344)" which I was not able to dereference with %$input_hash->{key}.
When calling selectall_hashref, you end with multilevel hash-structure, like: $hashref = { 1 => { id => 1, name => "John", }, 7 => { id => 7, name => "Mary", }, }; So, when you need values of second level, you call like $hashref->{1}{id} or if you need to dereference the value (hashref), you must use curley brackets like %{ $hashref->{1} }
Is that okay? Or would such an un-exact way of doing it have a downside?
Yes, it is ok, because you don't need those values. You don't have to do any assignement here, because you got what you want: certainity that checkbox was checked. Wbr, -- Kõike hääd, Gunnar
Hi Richard, On Thu, Aug 27, 2015 at 8:05 PM, Richard Reina <gatorreina@gmail.com> wrote:
That worked! Thank you very much.
Interestingly though $input_hash->{ $key } appears as a hash ref "HASH(0xa1d2344)" which I was not able to dereference with %$input_hash->{key}. [KB] WK's answer is absolutely right. You can not use %$input_hash->{key}, you must use brackets : %{$input_hash->{key}}. This doesn't bother me much because all I really need to know is that it has value -- that tells me the user checked the box for this option.
So, instead of looking at the actual value I was just going to do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) {
if ( param( $key ) ) { # paramter has value $input_hash->{ $key } = $Accomps->{ $key };
# user checked this box. Enter a record into TO_DO table
} }
Is that okay? Or would such an un-exact way of doing it have a downside?
2015-08-27 11:24 GMT-05:00 Yitzchak Scott-Thoennes <sthoenna@gmail.com>:
The symbolic reference there is $key; you are (unintentionally, I'd guess) using print's:
print FILEHANDLE LIST
syntax, and it is trying to use $key as the filehandle.
Maybe you meant:
print $key, $input_hash->{ $key }, "\n"
On Thu, Aug 27, 2015 at 8:42 AM, Richard Reina <gatorreina@gmail.com> wrote:
Hi WK,
Thanks for the reply. Line 577 is the print statement print $key $input_hash->{ $key } . "\n"; In the foreach. I know I shouldn't be printing here however, I just want to see what value comes across for for example $input_hash->{ '13' } before I create a DB record based on that value.So I guess I just need help figuring out how to see or get the value out of $input_hash->{ID NUMBER}.
2015-08-27 10:07 GMT-05:00 WK <wanradt@gmail.com>:
2015-08-27 17:28 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
After figuring out how to accommodate my placeholder in selectall_hashref I did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
If you need placeholder here, but you don't have need for any attributes, you may use `undef` here
my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } }
(just printing temporarily to see if it trapped the values)
Here we actually don't need values of $Accomps-hashref, we just using it as list to check out form values, so depending of your futher needs, you may assign your specific value here, like, for example:
$input_hash->{ $key } = 1;
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
What is on line 577 of your MyApp.pm?
Wbr, -- Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00
Thank you all for the very sage replies. This was all so very instructive that I put the derefrencing syntax in the comments of my code in case I need in the future. 2015-08-28 1:31 GMT-05:00 Kadir Beyazlı <kadirbeyazli@gmail.com>:
Hi Richard,
On Thu, Aug 27, 2015 at 8:05 PM, Richard Reina <gatorreina@gmail.com> wrote:
That worked! Thank you very much.
Interestingly though $input_hash->{ $key } appears as a hash ref "HASH(0xa1d2344)" which I was not able to dereference with %$input_hash->{key}. [KB] WK's answer is absolutely right. You can not use %$input_hash->{key}, you must use brackets : %{$input_hash->{key}}. This doesn't bother me much because all I really need to know is that it has value -- that tells me the user checked the box for this option.
So, instead of looking at the actual value I was just going to do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) {
if ( param( $key ) ) { # paramter has value $input_hash->{ $key } = $Accomps->{ $key };
# user checked this box. Enter a record into TO_DO table
} }
Is that okay? Or would such an un-exact way of doing it have a downside?
2015-08-27 11:24 GMT-05:00 Yitzchak Scott-Thoennes <sthoenna@gmail.com>:
The symbolic reference there is $key; you are (unintentionally, I'd guess) using print's:
print FILEHANDLE LIST
syntax, and it is trying to use $key as the filehandle.
Maybe you meant:
print $key, $input_hash->{ $key }, "\n"
On Thu, Aug 27, 2015 at 8:42 AM, Richard Reina <gatorreina@gmail.com> wrote:
Hi WK,
Thanks for the reply. Line 577 is the print statement print $key $input_hash->{ $key } . "\n"; In the foreach. I know I shouldn't be printing here however, I just want to see what value comes across for for
example
$input_hash->{ '13' } before I create a DB record based on that value.So I guess I just need help figuring out how to see or get the value out of $input_hash->{ID NUMBER}.
2015-08-27 10:07 GMT-05:00 WK <wanradt@gmail.com>:
2015-08-27 17:28 GMT+03:00 Richard Reina <gatorreina@gmail.com>:
After figuring out how to accommodate my placeholder in selectall_hashref I did this:
my $Accomps = $dbh->selectall_hashref( $q, 'ID', \%attr, $Sid );
If you need placeholder here, but you don't have need for any attributes, you may use `undef` here
my $Accomps = $dbh->selectall_hashref( $q, 'ID', undef, $Sid );
Then as you suggested I do:
# get parameter for accomp type keys foreach my $key ( keys %$Accomps ) { print "Checking: " . $key . " for value.\n"; if ( param( $key ) ) { $input_hash->{ $key } = $Accomps->{ $key }; print $key $input_hash->{ $key } . "\n"; } }
(just printing temporarily to see if it trapped the values)
Here we actually don't need values of $Accomps-hashref, we just using it as list to check out form values, so depending of your futher needs, you may assign your specific value here, like, for example:
$input_hash->{ $key } = 1;
However, I get this error:
Route exception: Can't use string ("1") as a symbol ref while "strict refs" in use at /home/richard/Dancer2/MyApp/bin/../lib/MyApp.pm line 557.
Any idea what I am doing wrong?
What is on line 577 of your MyApp.pm?
Wbr, -- Kõike hääd,
Gunnar _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00 _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
"Richard" == Richard Reina <gatorreina@gmail.com> writes:
Richard> Thank you all for the very sage replies. This was all so very Richard> instructive that I put the derefrencing syntax in the Richard> comments of my code in case I need in the future. It would be great if you could write up your experience and document what you learned, as a tutorial for future learners of this framework. Personally, I'm interested in building apps to search databases (read only) and present the results in a nice manner, with paging and good performance. My latest search form is really nice, because it's quite short. But the integration with a nice CSS framework (like bootstrap which I keep looking at...) and some core Javascript is the stumbling block. While I love and know perl well, I'm starting to think that doing ALL the work in one language makes more sense. So learning node.js for both the front end and backend drops complexity. But Javascript is ugly to my eyes... just like I'm sure Perl is ugly to Javascript guys. My age is showing. Heh. In any case, my core comment is that having a documented and basic example application with lots of stuff already done is a great resource and way to get people upto speed using Dancer to make great apps. John
Hi John, Under an insane deadline right now but would be happy to do a write up in the future. Please send me a note with instructions on where to send it. 2015-08-28 9:06 GMT-05:00 John Stoffel <john@stoffel.org>:
"Richard" == Richard Reina <gatorreina@gmail.com> writes:
Richard> Thank you all for the very sage replies. This was all so very Richard> instructive that I put the derefrencing syntax in the Richard> comments of my code in case I need in the future.
It would be great if you could write up your experience and document what you learned, as a tutorial for future learners of this framework.
Personally, I'm interested in building apps to search databases (read only) and present the results in a nice manner, with paging and good performance. My latest search form is really nice, because it's quite short.
But the integration with a nice CSS framework (like bootstrap which I keep looking at...) and some core Javascript is the stumbling block. While I love and know perl well, I'm starting to think that doing ALL the work in one language makes more sense.
So learning node.js for both the front end and backend drops complexity. But Javascript is ugly to my eyes... just like I'm sure Perl is ugly to Javascript guys. My age is showing. Heh.
In any case, my core comment is that having a documented and basic example application with lots of stuff already done is a great resource and way to get people upto speed using Dancer to make great apps.
John _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
I've done a lot of work with datatables: https://www.datatables.net/ with Dancer if that's the sort of thing you're thinking of? On Fri, Aug 28, 2015 at 11:41 PM, Richard Reina <gatorreina@gmail.com> wrote:
Hi John,
Under an insane deadline right now but would be happy to do a write up in the future. Please send me a note with instructions on where to send it.
2015-08-28 9:06 GMT-05:00 John Stoffel <john@stoffel.org>:
> "Richard" == Richard Reina <gatorreina@gmail.com> writes:
Richard> Thank you all for the very sage replies. This was all so very Richard> instructive that I put the derefrencing syntax in the Richard> comments of my code in case I need in the future.
It would be great if you could write up your experience and document what you learned, as a tutorial for future learners of this framework.
Personally, I'm interested in building apps to search databases (read only) and present the results in a nice manner, with paging and good performance. My latest search form is really nice, because it's quite short.
But the integration with a nice CSS framework (like bootstrap which I keep looking at...) and some core Javascript is the stumbling block. While I love and know perl well, I'm starting to think that doing ALL the work in one language makes more sense.
So learning node.js for both the front end and backend drops complexity. But Javascript is ugly to my eyes... just like I'm sure Perl is ugly to Javascript guys. My age is showing. Heh.
In any case, my core comment is that having a documented and basic example application with lots of stuff already done is a great resource and way to get people upto speed using Dancer to make great apps.
John _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
I've looked at datatables in the past, but since my search interfaces are mostly for small collections at a a research library, it's not quite what the end customer wants. Basically, they want a paged output, with the results formatted as they like for each record. http://clarence.mwa.org/Carey is my initial Dancer implementation. Still needs work and skinning, which reflects my comment on bootstrap and client side javascript needs for better pagination. I've been trying to move away from PHP backend stuff, but this is all side projects when I get a chance, not my day to day job at all. David> I've done a lot of work with David> datatables: https://www.datatables.net/ with Dancer if that's David> the sort of thing you're thinking of? David> On Fri, Aug 28, 2015 at 11:41 PM, Richard Reina <gatorreina@gmail.com> wrote: David> Hi John, David> Under an insane deadline right now but would be happy to do a write up in the future. Please David> send me a note with instructions on where to send it. David> 2015-08-28 9:06 GMT-05:00 John Stoffel <john@stoffel.org>:
"Richard" == Richard Reina <gatorreina@gmail.com> writes:
Richard> Thank you all for the very sage replies. This was all so very Richard> instructive that I put the derefrencing syntax in the Richard> comments of my code in case I need in the future. David> It would be great if you could write up your experience and document David> what you learned, as a tutorial for future learners of this David> framework. David> Personally, I'm interested in building apps to search databases (read David> only) and present the results in a nice manner, with paging and good David> performance. My latest search form is really nice, because it's quite David> short. David> But the integration with a nice CSS framework (like bootstrap which I David> keep looking at...) and some core Javascript is the stumbling block. David> While I love and know perl well, I'm starting to think that doing ALL David> the work in one language makes more sense. David> So learning node.js for both the front end and backend drops David> complexity. But Javascript is ugly to my eyes... just like I'm sure David> Perl is ugly to Javascript guys. My age is showing. Heh. David> In any case, my core comment is that having a documented and basic David> example application with lots of stuff already done is a great David> resource and way to get people upto speed using Dancer to make great David> apps. David> John David> _______________________________________________ David> dancer-users mailing list David> dancer-users@dancer.pm David> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users David> _______________________________________________ David> dancer-users mailing list David> dancer-users@dancer.pm David> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users David> _______________________________________________ David> dancer-users mailing list David> dancer-users@dancer.pm David> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
And I just looked at it again, and it's still not what I want. Basically I don't need tables of results... or actually that's not what the customer wants returned. It does look really really slick... but not for my needs. Oh well... Thanks for the reminder. Now back to our regular dancer questions.... Such as what's the best way to paginate results nicely? Ideally using server side searching... and search forms with multiple search boxes. The single box google style search isn't what we need. More something like the Newegg search term search, where you can add/delete stuff on the fly. John> I've looked at datatables in the past, but since my search interfaces are John> mostly for small collections at a a research library, it's not quite John> what the end customer wants. John> Basically, they want a paged output, with the results formatted as John> they like for each record. John> http://clarence.mwa.org/Carey John> is my initial Dancer implementation. Still needs work and skinning, John> which reflects my comment on bootstrap and client side javascript John> needs for better pagination. John> I've been trying to move away from PHP backend stuff, but this is all John> side projects when I get a chance, not my day to day job at all. David> I've done a lot of work with David> datatables: https://www.datatables.net/ with Dancer if that's David> the sort of thing you're thinking of? David> On Fri, Aug 28, 2015 at 11:41 PM, Richard Reina <gatorreina@gmail.com> wrote: David> Hi John, David> Under an insane deadline right now but would be happy to do a write up in the future. Please David> send me a note with instructions on where to send it. David> 2015-08-28 9:06 GMT-05:00 John Stoffel <john@stoffel.org>:
> "Richard" == Richard Reina <gatorreina@gmail.com> writes:
Richard> Thank you all for the very sage replies. This was all so very Richard> instructive that I put the derefrencing syntax in the Richard> comments of my code in case I need in the future. David> It would be great if you could write up your experience and document David> what you learned, as a tutorial for future learners of this David> framework. David> Personally, I'm interested in building apps to search databases (read David> only) and present the results in a nice manner, with paging and good David> performance. My latest search form is really nice, because it's quite David> short. David> But the integration with a nice CSS framework (like bootstrap which I David> keep looking at...) and some core Javascript is the stumbling block. David> While I love and know perl well, I'm starting to think that doing ALL David> the work in one language makes more sense. David> So learning node.js for both the front end and backend drops David> complexity. But Javascript is ugly to my eyes... just like I'm sure David> Perl is ugly to Javascript guys. My age is showing. Heh. David> In any case, my core comment is that having a documented and basic David> example application with lots of stuff already done is a great David> resource and way to get people upto speed using Dancer to make great David> apps. David> John David> _______________________________________________ David> dancer-users mailing list David> dancer-users@dancer.pm David> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users David> _______________________________________________ David> dancer-users mailing list David> dancer-users@dancer.pm David> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users David> _______________________________________________ David> dancer-users mailing list David> dancer-users@dancer.pm David> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users John> _______________________________________________ John> dancer-users mailing list John> dancer-users@dancer.pm John> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
For the searching with boxes I did an HTML table with the checkbox parameters (date, keys, etc) and submitted it to Dancer when one clicked the submit button. I serialized the results and sent them as: mysite.com/search/2015-9-1/2015-9-15/A|B|C where A, B and C were the values from the checkboxes and the dates were start and end dates. Adding a text field would be easy. Template Toolkit has a pagination plugin. --john On 8/28/2015 12:46 PM, John Stoffel wrote:
Such as what's the best way to paginate results nicely? Ideally using server side searching... and search forms with multiple search boxes.
The single box google style search isn't what we need. More something like the Newegg search term search, where you can add/delete stuff on the fly.
-- John J. McDermott, CPLP
participants (7)
-
David H -
John J. McDermott, CPLP -
John Stoffel -
Kadir Beyazlı -
Richard Reina -
WK -
Yitzchak Scott-Thoennes