我在jQuery UI中收到一个错误,当我尝试在删除它后销毁一个draggable.我正在使用jQuery 1.9.1和jQuery UI 1.10.0.
脚本
$(".drag").draggable({
revert: "invalid",
helper: "clone"
});
$(".drop").droppable({
accept: ".drag",
drop: function(event,ui){
ui.helper.remove();
$(this).append(ui.draggable);
$(ui.draggable).draggable("destroy");
}
});
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="drag">Draggable</div>
<div class="drop">Droppable</div>
Run Code Online (Sandbox Code Playgroud)
示例: http ://jsfiddle.net/feDME/
收到错误
TypeError:$(...).data(...)未定义
过去几个小时我一直没有运气.我发现了一个不含分辨率的类似帖子.有人可以帮我从这里出去吗?谢谢!
假设一个方法返回Iterable<Type>. 有没有比我现在所做的更优雅、更有效的方法来检查返回的内容是否为空(或某个给定的大小)?
int i = 0;
for (Type dummy : method)
i++;
if (i == 0)
...
Run Code Online (Sandbox Code Playgroud) 我正在研究的Web应用程序的一个设计建议使用javascript生成所有html内容.基本上,要在应用程序中创建页面,您将使用自制的JavaScript框架在页面上构建动态html.这个网页的页面非常复杂,所有的html标记都是通过javascript使用我们自定义构建的框架生成的.框架本质上需要一种方法来创建您想要生成的页面上的每个元素.
这种方法有哪些优点和缺点?
我正在使用映射到Oracle DB-Tables的一些实体.对于ID-Generation,我使用的注释序列生成器如下:
@Id
@SequenceGenerator(name = "SEQ_RULES", sequenceName = "SEQUENZ_RULES")
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_RULES")
@Column(name = "SERIALNO")
protected Long serialno;
Run Code Online (Sandbox Code Playgroud)
在程序执行期间,我从我的实体创建一个新实例,并希望保留这个生成的实例.重新启动数据库后,我通过JPA-EclipseLink获得了错误的序列号,但没有直接通过数据库上的控制台.
我在persistence.xml中启用了以下属性,以获取生成的语句中使用的绑定参数.
<properties>
<property name="eclipselink.logging.level" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
</properties>
Run Code Online (Sandbox Code Playgroud)
例如:如果我生成一个我的实体的新实例并希望保留这个实例,那么我将获得2717 for serialNo并且如果我执行
SELECT SEQUENZ_RULES.NEXTVAL FROM DUAL
Run Code Online (Sandbox Code Playgroud)
我得到2767作为nextval.问题是JPA生成的serialNo必须是唯一的,现在我仍然有一些带有这个serialNo的数据集.我得到一个例外:
java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (JASON.SYS_C0084866) violated
Run Code Online (Sandbox Code Playgroud)
非是否有任何缓存通过eclipse影响序列生成或可能是什么错误?
使用的组件:
GlassFish 3.1.1
EclipseLink 2.3.0.v20110604-r9504
数据库:Oracle版本:Oracle Database 11g 11.1.0.7.0版 - 64位
驱动程序:Oracle JDBC驱动程序版本:11.2.0.1.0
提前致谢
阿德姆
我在使用:last-child伪选择器时遇到了问题.
我有以下标记:
<div class="apply_container">
<form class="margin">
<div class="apply_inn border">
<span>Tell me why you want the job?</span>
</div>
<div class="apply_inn">
<span>Some other details</span>
</div>
<div class="apply_inn location">
<span>Apply at a particular location</span>
</div>
<div class="form-actions">
<button type="submit" class="pull-right btn btn-info">
Submit
</button>
</div>
</form>
</div>
Run Code Online (Sandbox Code Playgroud)
并应用这些样式:
.apply_container .apply_inn {
border-bottom: 1px dashed #E6E6E6;
margin: auto;
padding: 18px 0;
width: 790px;
}
.apply_container .apply_inn:last-child {
border:none;
}
Run Code Online (Sandbox Code Playgroud)
我的目标是防止最后div.apply_inn一个bottom-border像其他的div.apply_inns 样式.这种风格似乎没有得到应用.任何人都可以解释发生了什么?
是否可以CASE WHEN ... END在 Hibernate @OrderBy 注释中使用甚至本机 SQL?如何?
例如(Child对象有一个type属性):
@OneToMany
@OrderBy("CASE WHEN type='GIRL' THEN 1 WHEN type='BOY' THEN 2 ELSE 3 END ASC")
private List<Child> children;
Run Code Online (Sandbox Code Playgroud) [
{
"url": "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
"commit": {
"url": "https://api.github.com/repos/octocat/Hello-World/git/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"author": {
"name": "Monalisa Octocat",
"email": "support@github.com",
"date": "2011-04-14T16:00:49Z"
},
"committer": {
"name": "Monalisa Octocat",
"email": "support@github.com",
"date": "2011-04-14T16:00:49Z"
},
"message": "Fix all the bugs",
"tree": {
"url": "https://api.github.com/repos/octocat/Hello-World/tree/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e"
}
},
"author": {
"login": "octocat",
"id": 1,
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"gravatar_id": "somehexcode",
"url": "https://api.github.com/users/octocat",
"html_url": "https://github.com/octocat",
"followers_url": "https://api.github.com/users/octocat/followers",
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
"organizations_url": "https://api.github.com/users/octocat/orgs",
"repos_url": "https://api.github.com/users/octocat/repos",
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
"received_events_url": "https://api.github.com/users/octocat/received_events",
"type": "User",
"site_admin": false
}, …Run Code Online (Sandbox Code Playgroud) 我必须遗漏一些简单的东西,但是我无法将一个Autowired属性分配给bean.这里发布的所有类似答案似乎围绕三种解决方案中的一种:
我尝试制作一个简约bean来代表我的DAO并将其注入Web服务.
DAO界面:
package wb;
public interface FooDAO {
public String doNothing();
}
Run Code Online (Sandbox Code Playgroud)
DAO实施:
package wb;
import org.springframework.stereotype.Component;
@Component
public class FooDAOImpl implements FooDAO {
public FooDAOImpl() {
System.out.println("FooDAOImpl: Instantiated " + this);
}
@Override
public String doNothing() {
System.out.println("FooDAOImpl: doNothing() called");
return "Did nothing!";
}
}
Run Code Online (Sandbox Code Playgroud)
注入Web服务:
package ws;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.context.support.SpringBeanAutowiringSupport;
import wb.FooDAO;
@WebService(serviceName = "WS")
public class WS extends SpringBeanAutowiringSupport {
@Autowired(required = true) …Run Code Online (Sandbox Code Playgroud) init;
while (test) {
statements;
step;
}
Run Code Online (Sandbox Code Playgroud)
我有一个关于上述while循环中步骤位置的问题.写步骤的位置是否重要?换句话说,如果将步骤写为第一个语句或者在中间或末尾的某个位置,它是否会更改while循环中的任何值?如果确实如此,您可以提供一个简短的例子来说明这种效果.
如何在Spring MVC 3的控制器中将多个对象添加到ModelAndView中?那可能吗?
java ×5
html ×2
javascript ×2
jpa ×2
spring ×2
autowired ×1
controller ×1
css ×1
eclipselink ×1
generics ×1
git ×1
github ×1
github-api ×1
hibernate ×1
iterable ×1
java-ee ×1
jpa-2.0 ×1
jquery ×1
jquery-ui ×1
loops ×1
model ×1
sequence ×1
spring-mvc ×1
validation ×1