Page List Request Multi Parameters

107 views
Skip to first unread message

Hannah J Swystun

unread,
Jun 25, 2016, 11:13:41 AM6/25/16
to play-framework
Hello,

Can someone help please!

Thank you.
Computer Database Sample.png

placebo...@gmail.com

unread,
Jun 26, 2016, 8:35:51 AM6/26/16
to play-framework
Im looking for the same example but no one helps!!!!

Hannah J Swystun

unread,
Jun 26, 2016, 6:04:08 PM6/26/16
to play-framework
Hi Placebo,

Did you find a solution please? you know, Play Framework Community isn't much prosper as other Frameworks.
Got to wait for a technical suggestion

Justin Nichols

unread,
Jun 26, 2016, 6:08:57 PM6/26/16
to play-framework
It's usually useful to ask an actual question instead of just posting a screenshot and saying "help".  We all have lives and our own work.  We try to help as able but impatience will not make anyone respond with help faster.  Note: I don't work for Lightbend, only try to provide what little help I can since I've been helped here before.

Thanks,

Justin

_____________________________
From: Hannah J Swystun <j2eea...@gmail.com>
Sent: Sunday, June 26, 2016 6:04 PM
Subject: [play-framework] Re: Page List Request Multi Parameters
To: play-framework <play-fr...@googlegroups.com>
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/6a99c3e9-7ee0-4cc9-800a-240e15edd844%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Hannah J Swystun

unread,
Jun 26, 2016, 6:21:31 PM6/26/16
to play-framework
Hi Justin,

Your feedback had helped me a lot.

are you kidding me ? My opinion is that "Play" documentation was written to experts only..what about beginners then!




Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Justin Nichols

unread,
Jun 26, 2016, 6:48:36 PM6/26/16
to play-framework
I agree that the documentation could use work, but the great thing about open source is that the documentation is open source, too :)

In my first reply I was referring to your original post that just had a screenshot and "Can someone help please!"  I'm not sure I can help, but it makes helping easier if you ask a question related to the screenshot.

So in the interest of moving things along, and I'm not saying it will be me that can specifically help, please ask your question on which you are looking for help. 

Thanks,

Justin

_____________________________
From: Hannah J Swystun <j2eea...@gmail.com>
Sent: Sunday, June 26, 2016 6:21 PM

Subject: [play-framework] Re: Page List Request Multi Parameters
To: play-framework <play-fr...@googlegroups.com>


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

Hannah J Swystun

unread,
Jun 26, 2016, 7:08:09 PM6/26/16
to play-framework
Hi,

I am asking Play Framework community if there is a bug or not about this :
https://www.playframework.com/documentation/2.5.x/JavaForms#Handling-a-form-that-is-not-related-to-a-Model

I did as specified in the documentation but i did not get checkbox values from page list of the sample : Computer Database! Do you think that it is clear now ? Thank you so much



Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Greg Methvin

unread,
Jun 26, 2016, 7:12:31 PM6/26/16
to play-framework
Hi Hannah,

Your question, which I assume is about this sample project, is more of a general HTML/JavaScript question than a Play question. Perhaps you could try something suggested on this stackoverflow post. Also keep in mind that while there are many sample projects out there for Play, it's unlikely most of the Play community will be deeply familiar with that project. You'll have better luck trying a few things and asking more specific questions when you get stuck.

I do think there's a lot we can improve in the documentation, and it should be accessible to beginners. It would be useful for you to describe what you find confusing or incomplete in the documentation to help us improve it.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.



--
Greg Methvin
Senior Software Engineer

Greg Methvin

unread,
Jun 26, 2016, 7:25:22 PM6/26/16
to play-framework
Hannah,

I'm still not clear on what the problem is. Can you show us the code that you're trying? My understanding is that you're trying to add a form with checkboxes to a specific sample project. I know there are multiple similar sample projects called "computer database" or similar, so it would be helpful to point us to the one you're starting with also.

Greg

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannah J Swystun

unread,
Jun 26, 2016, 7:33:03 PM6/26/16
to play-framework
Hi Greg,

During my various experiences, I worked on many private and robust Frameworks such as : Sage / SAP / LABVANTAGE...whatever...
I think that the minimum thing that should be well explained is the fact to give beginners or experts More Samples to help them to be familiar with the product.

As an IT consultant, I think that PLAY FRAMEWORK should offers easily the way to get : Input properties & Output Properties and I mean (select/deselect items in a page list), to add also first & second javascript or JQUERY validation because in the final stage, people needs to add Java  or Scala Actions for various needs..etc. & unfortunatly ! this is not well explained.

I tried hardly to get <<namessss>> separated by <<;>> in the page list of computer database sample by using this handler but it returns nothing in the final :

public Result hello()
{
   
    DynamicForm requestData = formFactory.form().bindFromRequest();
    String name = requestData.get("name");
    Logger.info("hello()"+  name);
    return GO_HOME;

          } 

Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Hannah J Swystun

unread,
Jun 26, 2016, 7:48:42 PM6/26/16
to play-framework
Hi Greg,

As you can see in the example showed below, it return all the time NULL values!!

Application.Java
public Result hello()
{
   
   
DynamicForm requestData = formFactory.form().bindFromRequest();

   
   
//Long id = requestData.get("id");

   
   
String name = requestData.get("name");

   
   
return ok("hello"+name);
}

Routes
GET    /hello            controllers.HomeController.hello()


list.scala.html  (the header button Add new computer is calling now    hello Action)
<a class="btn success" id="add" href="@routes.HomeController.hello()">Add a new computer</a>

& I added input checkbox in front of each row
 <td>                          
                                                   
                       
<input type="checkbox" name="@computer.name"/>

                       
</td>


Result :

It is returning only one value selected instead of multiple!!!! & this single value is all the time NULL










Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :
Auto Generated Inline Image 1

Greg Methvin

unread,
Jun 26, 2016, 8:20:09 PM6/26/16
to play-framework
Hi Hannah,

The "add a new computer" button is an HTML link, which I think originally was meant to render another page to enter in the info for the new item. The link doesn't put anything in the query string, so unless there is some JavaScript magic somewhere that does that, I would not expect anything in the form.

I suspect you want to make that POST an HTML form that submits the information in the body.

Greg

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannah J Swystun

unread,
Jun 26, 2016, 8:55:22 PM6/26/16
to play-framework
Hi Greg,


The "add a new computer" button is an HTML link, which I think originally was meant to render another page to enter in the info for the new item

I change the
controllers.HomeController.create()
to
controllers.HomeController.hello()
then  hello() action is calling a white page such as :

public Result hello()
{
   
   
DynamicForm requestData = formFactory.form().bindFromRequest();
   
   
//Long id = requestData.get("id");
   
   
String name = requestData.get("name");

   
Logger.info("coucou");
   
return ok("Hello white page  "+name);
}

and for you question :

I suspect you want to make that POST an HTML form that submits the information in the body.

I say No, I want to keep in the same page of computer database page list then get checkboxes selected ..to finally use ids+names+companies as parameters for my jasper report.

as shown below, checkboxes gets the right values in HTML, but there are not returned with :
DynamicForm






Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :
Auto Generated Inline Image 1

Greg Methvin

unread,
Jun 26, 2016, 9:26:06 PM6/26/16
to play-framework
You can keep it on the same page but it needs to be a form if you want to get all the checkbox values. I'm just suggesting wrapping the fields you want to send in a form and changing the link to a submit button. Maybe I'm misunderstanding your expectations, but you can't expect just clicking a link to send form data.

Also, you should generally not use GET requests for things that mutate state on the server. GET requests are supposed to be idempotent and safe. Browsers will take advantage of this assumption by doing things like prefetching links, which could result in your action being called before the user actually clicks the link. See https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Safe_methods for more explanation.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannah J Swystun

unread,
Jun 26, 2016, 9:38:47 PM6/26/16
to play-framework
Hi Greg,

You mean that it is possible to get Requestvalues from <form page> but not from a <list page> ?

I can go too far with "play framework" Because I Worked in various Many EARs (relatives to privates frameworks) and I can tell you That Many customers needs are:
Selecting items >> Execute Action (Such as a scheduled task / Generating Report XLS / PDF / changing a status .... activate a job..etc

I never been a good developer but my purpose is to explore this framework and I get really mad when the simplests things such as:
Input / Output items are difficulties to integrate with Play in page Lists...

Does someone else has an idea abt how to get one or multiple (ids like :  ids=500;501;503;504          names=Name500;Name501;Name503;Name504) in the sample : Computer Database please ?


Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Greg Methvin

unread,
Jun 27, 2016, 12:44:23 AM6/27/16
to play-framework
On Sun, Jun 26, 2016 at 8:38 PM, Hannah J Swystun <j2eea...@gmail.com> wrote:
Hi Greg,

You mean that it is possible to get Requestvalues from <form page> but not from a <list page> ?

I'm not sure what you mean. If you can link me to the code you're referring to that might help.

I can go too far with "play framework" Because I Worked in various Many EARs (relatives to privates frameworks) and I can tell you That Many customers needs are:
Selecting items >> Execute Action (Such as a scheduled task / Generating Report XLS / PDF / changing a status .... activate a job..etc

I never been a good developer but my purpose is to explore this framework and I get really mad when the simplests things such as:
Input / Output items are difficulties to integrate with Play in page Lists...

Well, the specifics are going to be different depending on what your application does. Play is a general-purpose web framework. There are a lot of examples out there but they're meant more as a demonstration of the features of Play. If you're writing your own app you're usually going to write your own HTML and CSS on top of that.
  
Does someone else has an idea abt how to get one or multiple (ids like :  ids=500;501;503;504          names=Name500;Name501;Name503;Name504) in the sample : Computer Database please ?

Maybe you'd have better luck asking on a more general forum (stackoverflow?) about how to do this in HTML/JS/CSS. The only thing that's really Play-specific is handling the form on the server side. If you're confused by the Twirl template helpers you can mostly avoid using them to begin with (or choose a different templating tool).
 
Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :
Hello,

Can someone help please!

Thank you.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Hannah J Swystun

unread,
Jun 27, 2016, 10:14:42 AM6/27/16
to play-framework
Hi Greg,

I think it is your camarade's code :
https://github.com/playframework/play-ebean-example


Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Hannah J Swystun

unread,
Jun 27, 2016, 11:13:32 PM6/27/16
to play-framework
Hello Greg,

have you already seen an example on github or lighbend offering javascript <before and after> a java play <action> please, for example:

in my case, I'm on the index page, I want to launch a javascript <1st alert before> and <2nd alert after> an action java in Application.Java! I think if I could make this exemple, may be I could even get request when a POST SAVE is done...

as the physicists say, nothing is more certain in theory if an experiment is carried out :)

thank you in advance.

Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Igmar Palsenberg

unread,
Jun 28, 2016, 3:25:03 AM6/28/16
to play-framework
During my various experiences, I worked on many private and robust Frameworks such as : Sage / SAP / LABVANTAGE...whatever...
I think that the minimum thing that should be well explained is the fact to give beginners or experts More Samples to help them to be familiar with the product.

As an IT consultant, I think that PLAY FRAMEWORK should offers easily the way to get : Input properties & Output Properties and I mean (select/deselect items in a page list), to add also first & second javascript or JQUERY validation because in the final stage, people needs to add Java  or Scala Actions for various needs..etc. & unfortunatly ! this is not well explained.

I tried hardly to get <<namessss>> separated by <<;>> in the page list of computer database sample by using this handler but it returns nothing in the final :

This all is hardly play related, this is more about the frontend part. We have a few pretty big Plays apps, and I haven't used any of this : We all do this in FE with Angular / JQuery / whatever, and we post / get the result to the Play backend.


Igmar 

Hannah J Swystun

unread,
Jun 28, 2016, 6:42:07 AM6/28/16
to play-framework
Hi,

My goal is to touch a concrete sample that illustrates the <Data Submitted to the server> from Javascript, jQuery, Angular or whatever ...

This is
a good example in HTML, JS that submitted checkedboxes list => However, i have no idea how to get them in my Application.java in the controller ???????
http://www.gyrocode.com/lab/articles/jquery-datatables-checkboxes/serverside.html

When You Said <We-have pretty big Plays A Few apps> ... can you please send me a link Of Those samples please?

Thank you in advance.

Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :

Christian Schmitt

unread,
Jun 29, 2016, 9:35:09 AM6/29/16
to play-framework
https://github.com/schmitch/computer-database it's a additional commit on top of the ebean example that should demonstrate what you want.

Igmar Palsenberg

unread,
Jun 29, 2016, 10:29:52 AM6/29/16
to play-framework
 
My goal is to touch a concrete sample that illustrates the <Data Submitted to the server> from Javascript, jQuery, Angular or whatever ...

This is
a good example in HTML, JS that submitted checkedboxes list => However, i have no idea how to get them in my Application.java in the controller ???????
http://www.gyrocode.com/lab/articles/jquery-datatables-checkboxes/serverside.html

When You Said <We-have pretty big Plays A Few apps> ... can you please send me a link Of Those samples please

The're not public. We use REST as a backend (Play), and AngularJS as the FE framework that talks to the BE. That also means that no page reloads are needed when content changes. It's also a lot faster to develop, since it doesn't need Play restarts if the FE code changes.



Igmar 
Message has been deleted

Hannah J Swystun

unread,
Jun 29, 2016, 9:06:50 PM6/29/16
to play-framework
Hello Sir Schmitt

I finally Generate my jasper reports PDF/HTML/XLS from the method of selection that you created, thank you very much for the technical support that you have been able to bring to this sample, and especially to me, however, I have some simple other questions if I may, because in the end, if we can coupled Business Intelligence + Play Framework...it is going to be the most wondeful sample in GitHub  ;)

For those who are unfamiliar with JASPER REPORT, If I may, Jasper is the best solution in the world for creating any kind of report which can be extracted dynamically or whatever...it uses: SQL / Java / Javascript / Groovy ..and all those languages could be mixed in one report ( sub reports + crosstabs + frames + chartes ...)

Thank you very much Mr Schmitt and I'll be waiting your returns in order to make the application Computer Database the best example in the world based on Play Framework.

Here are some Technical suggestions & issues described on the one attached image, thank you once again.

The sample with JASPER report plugins/jars etc Updated    &     Some little more question are in the attached files below :
Thank you again.

Google Drive Project Updated with JASPER             >>     SBT RUN        >>     https://drive.google.com/file/d/0B97fo89guk_nQkFsZ2VnZmxRUUk/view?usp=sharing




Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :
Auto Generated Inline Image 1
Message has been deleted

Christian Schmitt

unread,
Jun 30, 2016, 2:23:46 AM6/30/16
to play-framework
You can set a Content-Disposition Header:
response().setHeader(Http.HeaderNames.CONTENT_DISPOSITION, "inline; filename=my.pdf");
But that will only work if the browser of the person allows it. 

Hannah J Swystun

unread,
Jun 30, 2016, 7:46:07 AM6/30/16
to play-framework
Hello Schmitt,

Did you try the new App with SBT RUN (Reports in HTML/PDF/XLS) ?

I added the line below to my Application.java and the PDF file is now downloaded to the browser with another different extension....So I removed that line
response().setHeader(Http.HeaderNames.CONTENT_DISPOSITION, "inline; filename=my.pdf");
Do I Have to duplicate many times the same form for each new button please ? or there is another option for the other new Button without duplicating !!!!

Thank you .




Le samedi 25 juin 2016 15:13:41 UTC, Hannah J Swystun a écrit :
Auto Generated Inline Image 1

Christian Schmitt

unread,
Jun 30, 2016, 7:59:53 AM6/30/16
to play-framework
Actually these questions are too general, you should consider reading some books about programming / web standards before proceeding. It's not even related to play, more to a general understanding of Java / Http Headers / Html.

I also don't download anything from other persons in the net that is shared with a shared host / google drive / dropbox / etc...

Hannah J Swystun

unread,
Jun 30, 2016, 8:17:37 AM6/30/16
to play-framework
Hi,

You are right, I have to read some programming books especially on HTML/JAVA/JS...and add them to my expertise in business intelligence.

However
, I maintain to have an answer to my last question for this specific sample, can you please tell me how I can add more button referring to the same  HTML  form / table of computer DB ?


Thank you so much for your helps.
Ticket solved By Schmitt.
Reply all
Reply to author
Forward
0 new messages