我正在准备JavaScript中的一些变量(在我的具体情况下,我想获得GPS位置):
function getVars() {
// ...
var x = locationInfo.lng;
var y = locationInfo.lat;
}
Run Code Online (Sandbox Code Playgroud)
我想通过以下命令按钮将它们发送到我的托管bean:
<h:commandButton value="submit" onclick="getVars()" action="#{bean.submit(x,y)}" />
Run Code Online (Sandbox Code Playgroud)
public void submit(int x, int y) {
// ...
}
Run Code Online (Sandbox Code Playgroud)
如何将JavaScript x和y变量从JavaScript 发送到JSF托管bean操作方法?
我订了一个计时器
DispatcherTimer messageTimer = new DispatcherTimer();
messageTimer.Tick += new EventHandler(messageTimer_Tick);
messageTimer.Interval = new TimeSpan(0, 0, 1);
Run Code Online (Sandbox Code Playgroud)
还有一个
<Label Name="time" Grid.Column="5" Grid.Row="1" />
Run Code Online (Sandbox Code Playgroud)
如何计算运行时间并在标签中显示?
我创建一个矩形
public void Set(Rectangle maps, int y, int x) {
Map.Children.Add(maps);
maps.SetValue(Grid.RowProperty, x);
maps.SetValue(Grid.ColumnProperty, y);
}
Run Code Online (Sandbox Code Playgroud)
但如何用"Resources/1.jpg"改变背景?
我想根据以下属性对Array进行排序:
[
{num:5},{num:3},{num:6},{num:9}
]
Run Code Online (Sandbox Code Playgroud)
排序后,我想得到
[
{num:3},{num:5},{num:6},{num:9}
]
Run Code Online (Sandbox Code Playgroud)
如何在JavaScript中执行此操作?
c# ×2
javascript ×2
arrays ×1
background ×1
jsf ×1
json ×1
managed-bean ×1
sorting ×1
timer ×1
wpf ×1