0 0

[play framework]问题Compliation Error: Not Parsed? 求大牛指点30

@(sff: Form[SoftForm])

@import java.util._
@import helper._

@title = {
    Add a new ComputerRecord <small><a href="@routes.Application.manage">Or edit an existing ComputerRecord</a></small>
}

@main("System") {
    @helper.form(action = routes.Application.submitForm, 'id -> "form") {
    	<ul>
  			<li> @ssf.u.userName</li>
  			<li>
  				@inputText(
	                sff.c("name"), 
	                '_label -> "Computer Name"
            	)
  			</li>
		</ul>
    	<hr>
    	<fieldset>
    		<legend>系统</legend>
    		<table class="table table-striped">
    		@for (cs <-- sff.css) {
    			@if {cs.cstype == "OS") {
    				<tr>
    					<td>
    				            @checkbox(
						                cs("checked"), 
						                '_label -> None,
						                '_text -> cs.name,
						                '_showConstraints -> false
				    			)
				    	</td>
				    	<td>
				    			@select(
										 cs("ver"), 
										 options = options(Ver.getVerStrBySoft(cs.name)),
										 '_default -> "--- Choose a Version ---",
										 '_label -> "Version",
										 '_error -> cs("ComputerSoft.ver").error.map(_.withMessage("Please select specific version"))
								)
				    	</td>
				    <tr>
				}
    		}
    		</table>	
    	</fieldset>
}


package models.util;

import java.util.List;


import models.Computer;
import models.ComputerSoft;
import models.User;

public class SoftForm {

	public User u;
	
	public Computer c;
	
	public List<ComputerSoft> css;

	
}


@Entity
public class ComputerSoft {


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO, generator = "uuid")
	public Long id;
	
	@Required
	public String name;
	
	@Required
	public String cstype;

	@ManyToOne
	public Computer Computer;

	@Required
	public boolean checked;
	
	@Required
	public String ver;
	
	public ComputerSoft() {
		
	}
.......
}


  public static Result submit(String userNo) {

	User u = new User().GetUser(userNo);
	Computer c = new Computer("",u);
	SoftForm sf = new SoftForm();
	sf.u = u;
	sf.c = c;
	sf.css = ComputerSoft.GetOriginSoftList();
	sff.fill(sf);
	return ok(submit.render(sff));

  }



	public static List<String> getVerStrBySoft(Soft soft){
		List<Ver> vers = Ebean.find(Ver.class).where().eq("soft.id", soft.id).findList();
		List<String> str = new ArrayList();
		for( Ver v : vers) {
			str.add(v.name);
		}
		return str;
	}


问题补充: 
  static Form<User> userForm = form(User.class);
 

  static Form<SoftForm> sff = form(SoftForm.class);
2014年3月24日 03:26
目前还没有答案

相关推荐

    CVI使用软件10分钟后超时

    打开项目,点击Build-&gt;Mark Project for Compliation: 然后重新运行即可。 网上一般不好找解决方案,但可以参考网址:https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019OlmSAE&l=zh-CN 希望有所...

    webwizforums 7.7 SQL 版

    RTE_message_form_inc.asp - fixed compliation error that occured on some win2k3 servers 34. add_member.asp - new page to add a new member from the admin section 35. functions_format_post.asp -...

    Android Studio 修改应用包名实例详解

    这可以在`File` -&gt; `Project Structure` -&gt; `Modules` -&gt; `Properties` -&gt; `Java Compliation`下的`Compiler`设置中找到。取消该选项后,中间层的包名就可以单独修改了。 修改完成后,记得点击`Apply`或`OK`保存...

    网页到电子书:从网址列表创建EPUB。 站在Wget,Readability和Pandoc的肩膀上

    网页到电子书 从URL列表中创建一个EPUB。 站在肩膀上 →→ 创建自己的电子书 要求 Node.js NPM : wget必须在PATH 。 : pandoc必须位于PATH 。... node index.js your-created-definition.yml [optional-...

    LINUX内核有那几种锁详细介绍-综合文档

    7. **读完成队列锁(Read-Compliation-Queue Lock,简称RCQ Lock)** RCQ Lock是一种特殊的锁,用于解决多处理器系统中缓存一致性问题。它通过记录读取操作来避免不必要的缓存刷新,提高性能。 8. **futex(Fast ...

Global site tag (gtag.js) - Google Analytics