右对齐,我希望根据单击的选项卡获得部分视图.在网上找到一些示例代码让我开始,但我无法通过示例代码找出标签
的index.html
<!doctype html>
<html ng-app="mainApp">
<head>
</head>
<body>
<div ng-view>
</div>
<script src="scripts/lib/angular.min.js"></script>
<script src="scripts/lib/angular-route.min.js"></script>
<script src="scripts/lib/bootstrap.min.js"></script>
<script src="app.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
app.js:
var mainApp = angular.module('mainApp', ['ngRoute']);
mainApp.config(function($routeProvider){
$routeProvider.when('/', {
controller: 'SearchController',
templateUrl: 'search.html'
})
})
Run Code Online (Sandbox Code Playgroud)
Search.html
<div ng-controller="SearchController">
</div>
Run Code Online (Sandbox Code Playgroud)
SearchController:示例中的示例
angular.module('mainApp').controller('SearchController', function ($scope, $window) {
$scope.tabs = [
{ title:'Dynamic Title 1', content:'Dynamic content 1' },
{ title:'Dynamic Title 2', content:'Dynamic content 2', disabled: true }
];
$scope.alertMe = function() {
setTimeout(function() {
$window.alert('You\'ve selected the alert tab!'); …Run Code Online (Sandbox Code Playgroud) 我想在Play和Java中做类似的事情:
<select id="birthyear" name="birthyear">
<option value="2007">2007</option>
<option value="2006">2006</option>
<option value="2005">2005</option>
<option value="2004">2004</option>
<option value="2003">2003</option>
<option value="2002">2002</option>
<option value="2001">2001</option>
<option value="2000">2000</option>
<option value="1999">1999</option>
<option value="1998">1998</option>
<option value="1997">1997</option>
<option value="1996">1996</option>
</select>
Run Code Online (Sandbox Code Playgroud)
但是我希望能够给它一个开始年份和结束年份并动态构建选择列表.
我在这个,但在Scala和Play,但我不知道如何在Java/Play中实现这一目标?
更新:阅读答案中提供的文档,并检查随Play安装的示例项目并使用以下内容
<div>
Select birth year of
#{select 'yob', items:2012..1900, value:5, id:'select3' /}
</div>
Run Code Online (Sandbox Code Playgroud) 我已阅读以下两篇文章并尝试实现相同的内容。
我的代码是这样的,超时发生在这里
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
wr.ContentType = "multipart/form-data; boundary=" + boundary;
wr.Method = "POST";
wr.KeepAlive = false;
wr.CookieContainer = cookieJar;
wr.Proxy = null;
wr.ServicePoint.ConnectionLeaseTimeout = 5000;
Stream rs = wr.GetRequestStream(); // -> Time out error occurs here
Run Code Online (Sandbox Code Playgroud)
My code using that as a sample
HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(url);
wr.ContentType = "multipart/form-data; boundary=" + boundary;
wr.Method = "POST";
wr.KeepAlive = false;
wr.CookieContainer = cookieJar;
wr.Timeout = 5000;
wr.Proxy = null;
wr.ServicePoint.ConnectionLeaseTimeout = 5000;
wr.ServicePoint.MaxIdleTime = 5000;
Stream rs = …Run Code Online (Sandbox Code Playgroud) 这听起来很简单,但我的想法是空白
说我有这个
bool evaluator
for each form element{
if (element.name = 'fname')
{
perform some op
evaluator = true
}else evaluator false
if (element.name = 'city')
{
perform some op
evaluator true
}else evaluator false
if (element.name='shipcity')
{
perform some op
evaluator true
}else evaluator false
}
return evaluator
where evaluator :
if((t/f) && (t/f) && (t/f))
| | |-----------------evaluation of condition 3
| |-----------evaluation of condition 2
|--------------evaluation of condition 1
Run Code Online (Sandbox Code Playgroud)
所以最后我得到了3个条件的'&&'.或者java有一个内置的方法,它将为我这样做
这是我桌子的样本
CREATE TABLE elements (
elementname,
displaytext
)
Run Code Online (Sandbox Code Playgroud)
我如何使用jpa和填充hashmap,以便我可以将其传递给控制器查看
HashMap<String, String> hm = new HashMap<String, String>();
render(hm);
Run Code Online (Sandbox Code Playgroud)
并且在视图中我想迭代并获取基于元素名称的displaytext
不是100%确定这是否是一种矫枉过正或者是否存在更简单的方法.碰到这篇文章
更新1:播放框架工作1.2.4