我正在使用<p:growl>PrimeFaces 3.2的组件来显示面部消息.我想自定义它的位置,使其显示在左侧而不是右侧.
我尝试了以下方法:
<h:head>
<title>Facelet Title</title>
<style type="text/css">
.ui-growl {
position:absolute;
top:20px;
left:20px;
width:301px;
z-index:9999;
}
</style>
</h:head>
<h:body>
<h:form id="frm">
<div id="add">
<p:growl id="growl" showDetail="true" sticky="true" autoUpdate="true"/>
<h:panelGrid columns="2" >
...
Run Code Online (Sandbox Code Playgroud)
但它没有用.我哪里错了?
我希望在angularjs中序列化表单数据.以下是控制器代码:
function SearchCtrl($scope, $element, $http) {
$scope.url = 'php/search.php';
$scope.submit = function() {
var elem = angular.element($element);
//var dt = $(elem.parent()).serialize();
console.log($(elem.parent()).serialize());
$http({
method: 'POST',
url: $scope.url,
data: 'first=hgf&last=ghfgh',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function(data, status) {
$scope.status = status;
$scope.data = data;
$scope.result = data; // Show result from server in our <pre></pre> element
//var elem = angular.element(e.srcElement);
//alert($(elem.parent()).serialize());
}).error(function(data, status) {
$scope.data = data || "Request failed";
$scope.status = status;
});
return false;
};
}
Run Code Online (Sandbox Code Playgroud)
编辑:
<!DOCTYPE html>
<html ng-app> …Run Code Online (Sandbox Code Playgroud) 我想将以下时区转换为设备本地时区:
2013-08-03T05:38:39.590Z
Run Code Online (Sandbox Code Playgroud)
请让我知道如何将其转换为本地时区.
我该怎么做?
在此链接之后,我尝试创建链接中给出的示例项目.
我创建了pod链接中给出的文件,但是当我安装pod时,出现以下错误:
[!] Error installing boost
[!] /usr/bin/tar xfz /Volumes/DATA/../cineio-broadcast/Pods/boost/file.tgz -C /Volumes/DATA/../cineio-broadcast/Pods/boost
tar: Unrecognized archive format
tar: Error exit delayed from previous errors.
Run Code Online (Sandbox Code Playgroud)
错误截图附于下方:

我哪里出错了?我该如何解决这个问题?
我试图使用primefaces 3.2的数据导出器控件.以下是代码:
<p:commandLink value="export" ajax="false">
<p:dataExporter type="xls" target="dtable" fileName="myfile" />
</p:commandLink>
<p:datatable id="dtable" ........../>
Run Code Online (Sandbox Code Playgroud)
当我点击导出链接时,我收到以下错误:
java.lang.NoClassDefFoundError: com/lowagie/text/phrase
Run Code Online (Sandbox Code Playgroud)
我下载了itext jar 5.2.1并将其包含在我的应用程序中,但我仍然得到相同的错误.我该如何解决?
我希望在angularjs中调用另一个函数内的函数.例如.我有一个从数据库中获取记录的功能,现在每次调用任何函数时我都需要从数据库中获取.控制器: -
function SearchCtrl($scope, $http, $element) {
// i wish to put this into a function and call it in every function like add,search,etc.
$http.get('php/products.php').success(function(data){
$scope.products = data;
});
$scope.search = function() {
var elem = angular.element($element);
var dt = $(elem).serialize();
dt = dt+"&action=index";
//alert(dt);
console.log($(elem).serialize());
$http({
method: 'POST',
url: 'php/products.php',
data: dt,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function(data, status) {
console.log(data);
$scope.products = data; // Show result from server in our <pre></pre> element
}).error(function(data, status) {
$scope.data = data || "Request …Run Code Online (Sandbox Code Playgroud) 我是iOS新手.我正在创建一个虚拟应用程序来从本地服务器上的iOS设备上传音频文件.所以我想知道是否有办法打开音频库并选择要上传的所需音频文件.与图库相似.
是否可以打开音频列表并选择必要的音频文件?如果没有,有什么替代方案?
我在我的java ee应用程序中使用现成的模板(带有css和j查询).除了primefaces 3.2的panelgrid控件之外,所有的primefaces组件都被正确呈现.它以边框显示.我希望它没有边界.我已从自定义现成模板的CSS中删除了所有表格样式.边界还在那边.当我删除现成的模板时,panelgrid完美呈现没有任何边框.我如何删除边框,这是什么原因造成的?
编辑: xhtml文件:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AP administration panel - A massive administration panel</title>
</h:head>
<h:body>
<div>
<h:form>
<p:panelGrid columns="2" style="border: none">
<h:outputText value="scrip symbol"/>
<p:inputText value=""/>
<p:commandButton value="submit"/>
</p:panelGrid>
</h:form>
</div>
</h:body>
</html>
Run Code Online (Sandbox Code Playgroud) 我有2个表student- studLoad两个都有2个字段studID和studName.我想将student表中的数据加载到stuLoad表中.如果studLoad表中已存在数据,则应更新它,否则应插入.以下是我的代码:
create or replace procedure studentLoad is
v_id student.studID%type;
v_name student.studName%type;
v_sn studLoad.studName%type;
cursor cur_load is
select * from student;
begin
open cur_load;
loop
fetch cur_load into v_id,v_name;
exit when cur_load%notfound;
select studName into v_sn from studLoad where studID = v_id;
if(v_sn!= v_name) then
update studLoad set studName= v_name where studID= v_id;
else
insert into studLoad values(v_id,v_name);
dbms_output.put_line(v_id || ' ' || v_name);
end if;
end …Run Code Online (Sandbox Code Playgroud) 我希望在iOS中为图像实现缓存功能.我希望为此创建一个示例应用程序,仅供我理解.
这是我想要做的:
从互联网获取高分辨率图像并缓存它,显示它.
现在,下次ViewController加载时,图像应该从缓存而不是从Internet加载.
我知道如何使用SDWebImage框架缓存图像.我希望尝试使用NSCache.
如何使用NSCache实现它?欢迎举例.
编辑:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSCache *cache = [self imageCache];
NSURL *url = [NSURL URLWithString:@"http://i1.ytimg.com/vi/YbT0xy_Jai0/maxresdefault.jpg"];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [[UIImage alloc] initWithData:data];
NSString *imagePath = @"http://i1.ytimg.com/vi/YbT0xy_Jai0/maxresdefault.jpg";
// UIImage *image;
if (!(image = [cache objectForKey:imagePath])) { // always goes inside condition
// Cache miss, recreate image
image = [[UIImage alloc] initWithData:data];
if (image) { // Insert image in …Run Code Online (Sandbox Code Playgroud) 我得到nil了一些值,而使用dateFromString在swift.我搜索了很多但是徒劳无功.
以下是我的代码:
let strDate = self.sortedDict.valueForKey("TIME").objectAtIndex(indexPath.row).objectAtIndex(0) as? String
print(strDate);
let st_date = frmt.dateFromString(strDate!)
let frmt1:NSDateFormatter = NSDateFormatter()
frmt1.locale = NSLocale(localeIdentifier: localeStr)
frmt1.dateFormat = "MMM, dd yyyy hh:mm a"
if st_date != nil {
print(st_date)
}
Run Code Online (Sandbox Code Playgroud)
输出控制台:
Optional("September, 20 2015 10:00:00")
Optional(2015-09-20 10:00:00 +0000)
Optional("October, 04 2015 10:00:00")
Optional(2015-10-04 10:00:00 +0000)
Optional("October, 04 2015 14:00:00") // nil
Optional("October, 18 2015 15:00:00") // nil
Optional("September, 20 2015 14:00:00") // nil
Optional("September, 27 2015 10:00:00")
Optional(2015-09-27 10:00:00 …Run Code Online (Sandbox Code Playgroud) 我已经构建了一个小型测试应用程序来在 UIButton 上应用平移手势。我成功应用了平移手势并成功移动了按钮。但问题是我什至可以在屏幕外移动按钮。如何将其绑定为仅在 iPhone 屏幕内移动?这是我的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(pan:)];
[panGesture setMinimumNumberOfTouches:1];
[_shareButton addGestureRecognizer:panGesture];
}
-(IBAction)pan:(UIPanGestureRecognizer *)recognizer
{
CGPoint trans =[recognizer translationInView:self.view];
recognizer.view.center = CGPointMake(recognizer.view.center.x+trans.x, recognizer.view.center.y+trans.y);
[recognizer setTranslation:CGPointMake(0, 0) inView:self.view];
}
Run Code Online (Sandbox Code Playgroud)
如何限制按钮移出屏幕?我使用的是 iOS 7,xcode 5.0。