I have this code
public void onModuleLoad() {
...
.....
.......
PanelListenerAdapter escuchaPanel = new PanelListenerAdapter() {
public void onExpand(final Panel panel) {
ScriptTagProxy dataProxy = new ScriptTagProxy("http://localhost/
quienes/consulta.php?cat="+panel.getId()+"sec=biografia");
RecordDef rd = new RecordDef(
new FieldDef[] {
new
StringFieldDef("introtext")});
final JsonReader jsonReader = new
JsonReader(rd);
jsonReader.setRoot("item");
Store store = new Store(dataProxy,jsonReader);
store.addStoreListener(new StoreListenerAdapter(){
public void onLoad(Store store,
Record[] records) {
panel.setHtml(records[0].getAsString("introtext"));
}
// next redeninitions are only to see what
happens when changing the store adding manual record
public void onDataChanged(Store store) {
System.out.println("change");
}
public void onAdd(Store store, Record[]
records, int
index) {
System.out.println("add");
}
public void onUpdate(Store store,
Record record,
Record.Operation operation) {
System.out.println("pasa 4");
operation = record.COMMIT;
System.out.println("actualiza
"+operation.toString()+
" " + record.getAsString("introtext"));
}
});
store.load();
} // fin PanelListenerAdapter
} // onModuleLoad
on server side I have something like
<?php
header('Content-Type: text/html; charset=ISO-8859-1');
require_once("JSON.php");
$scriptTag = false;
$callback = getRequestValue('callback');
...
......
if ($scriptTag) {
echo $callback.'(';
}
$sqlQuery = "SELECT jcon.introtext as introtext FROM `jos_content`
jcon join jos_sections jsec on jsec.id=jcon.sectionid join
jos_categories jcat on jcat.id=jcon.catid WHERE jcat.title= '".
$_REQUEST['cat']."' and jsec.title = '". $_REQUEST['sec']."'";
while($row = mysql_fetch_array($dataReturned)){
$value{'item'}{$i}{'introtext'}=
htmlentities($row['introtext'],ENT_NOQUOTES);
$i++;
}
$json = new Services_JSON();
$output = html_entity_decode($json->encode($value));
print(html_entity_decode($output));
if ($scriptTag) {
echo ');'."\n";
}
---------------
So I think ScriptTagProxy is just to load data through cross domain
request , not for saving it.
I was trying another thing on server side like
if $_GET = 'guardarForm1' {
Insert into / Update
}
but don't know how to pass the data that will be inserted or updated
thanks for your help!
--
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en.