tag « playframework « Java Enterprise Q&A

1. Custom tag that creates select element from enum    stackoverflow.com

How can I make a tag that makes a select field out of a Java enum for the Play! framework? I've tried to see how the CRUD module does it ...

2. Why would I want to use Fast Tags over Groovy Tags in Play    stackoverflow.com

What is the advantage of fast tags over groovy tags in Play? I have seen a lot of things happening recently with it, but am not quite sure what the point ...

3. : jsRoute tag not found    stackoverflow.com

Code: var showBookPagination = #{jsRoute @Controller.methodName(':id')/}; Error thrown: Template not found (In /app/views/ReaderController/browse.html around line 56) The template tags/jsRoute.html or tags/jsRoute.tag does not exist. Any idea on this?

4. Play! How to retrieve field value in a template tag having entity and the field name passed separately as parameters?    stackoverflow.com

I wanted to create a tag like:

#{some_tag entity:user, field:'name'}
and expect it to produce some output with the user name in it by using expression like:
I know it doesn't work but that's ...

5. Using variables for start/end with the list template tag    stackoverflow.com

I'm using the Play Framework and have a question about templates: I want to use list as a for loop with from and to variables:

#{list pages:results.startPage..results.endPage, as:'page'} 
Both results.startPage ...

6. PlayFrameWork: passing variables to a tag call    stackoverflow.com

is it somehow possible to pass variables to a tag call: I mean something like this:


7. Using template tag to open link in new window    stackoverflow.com

I am using the following template tag in the Play framework to create an anchor tag:

#{a @Application.foo( bar )} foobar #{/a}
Does anyone know how this can be modified to open the ...

8.  tag analog in Play framework    stackoverflow.com

Is there any analog of jstl url tag, which can be used to generate valid URL, independently of current template location or application location. For example, #{a @Application.logout()}Disconnect#{/a} simply generate /application/logout URL. ...

9. Play 1.2.2 - are tags inside tags no longer allowed?    stackoverflow.com

I am developing an application in play and in my selenium tests I use several tags for repetitive tasks. Two tags are: app/views/tags/loginAs.html

*{ Tag for running selenium tests when being logged in ...

10. How can I use custom template tags inside javascript in the Play! framework?    stackoverflow.com

How can I use a custom tag inside my javascript code? For example:

function toHTML(message){
    return #{customTag message:message /};
does not work.. Thanks! //Some clarification I am retrieving a list of messages using ...

11. Script groovy tag not working properly in Play    stackoverflow.com

Hey guys I am using the script tag. %{..}% When I do multiplication it seems to work.

up = wrapBenchmark * upperLimit;
But if I do this.
up = wrapBenchmark + upperLimit;
It seems to add the ...

12. Can this Play template code be simplified (avoid if/else tag)?    stackoverflow.com

I have the following html code:

#{if title == 'Subnet' }
    <li><a href="@{SubnetController.list}" class="selected">&{'subnet'}</a></li>
    <li><a href="@{SubnetController.list}">&{'subnet'}</a></li>
Is it possible to do that with less code, maybe using ...

13. Using variables in #{select} tag attributes    stackoverflow.com

I have a page in my app with a dynamically-generated form, in which I need a number of <select> elements. Since I don't know in advance how many there will ...

14. How do I use the field tag in a user defined tag with the Play! Framework?    stackoverflow.com

Right now I have a view like this that works.

#{form @UserCreate.create()}
    #{field 'user.email'}
        #{text field /}
With a ...

15. Play framework: passing parameter to custom tag    stackoverflow.com

I want to pass the name of a field as a parameter to a custom Play! framework tag:

  #{ifError ${_field}}
    <ul class="err">

16. play framework tags: foreach passed argument    stackoverflow.com

I have an applet tag which I'm using like this:

#{applet steps: 250, "world": "tutorials/level1.world", "req_onetime": "red_ant,5,8&red_ant,6,6&red_ant,5,4&red_ant,3,4&red_ant,2,6&red_ant,3,8"}
and the applet.html file is apart from html etc:
<applet ...>
#{if _steps}<param name="steps" value="${_steps}">#{/if}
Can I have something ...