-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
55 lines (42 loc) · 1.63 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$(function (){
template = $("<h:outputText id='ejemploid' styleClass='nueva' value='Modelo:'></h:outputText>"+
"<h:inputText id='modelo' size='50' styleClass='nueva' value='#{coche.modelo}'></h:inputText>"+
"<h:outputText styleClass='nueva' value='Precio:'></h:outputText>"+
"<h:inputText id='precio' size='50' styleClass='nueva' value='#{coche.precio}'></h:inputText>"+
"<br/>"+
"<br/>"+
"<h:outputText styleClass='nueva' value='Ruedas:'></h:outputText>"+
"<h:inputText id='ruedas' styleClass='red' value='#{coche.ruedas.modelo}'></h:inputText>"+
"<br/>"+
"<br/>"+
"<h:commandButton value='Get' action='#{coche.cambiar}'></h:commandButton>"+
"<h:commandButton value='Post' action='#{coche.obtener}'></h:commandButton>");
/* $("#jsf").append(template);*/
$("#loading").hide();
var modelo = {
coche: {
modelo: "Ferrari F-50",
precio: 123000,
ruedas:{
modelo: "Michelin"
}
}
};
var action = { coche: {} };
action.coche.post = function(){
modelo = JsfScripting.get();
p = $("<p/>",{ text: "Post:{ modelo: " + modelo.coche.modelo +", precio:" + modelo.coche.precio + ", ruedas: " +modelo.coche.ruedas.modelo +"}" });
$("#jsf").append(p);
}
function online(){
$("#loading").show();
url = "http:https://genvirt.net84.net/getJsonp.php?nombre=fichero.xml";
JsfScripting.searchModelFromUrl(url, function ( data ){
JsfScripting.set(data);
$("#loading").hide();
});
}
action.coche.get = online;
JsfScripting.initJsfScripting(modelo, action);
JsfScripting.start();
});