Hello, I am trying to build a restdatasource as I slowly get the hang of this. One problem I have right now is GETPARAMS and POSTPARAMS. I wanted to use POST so I could get the info via the PHP script, but when I do, I only seem to be able to retrieve the data using the $_GET global. I dont seem to get anything when changing it to $_POST.
RestDataSource noteAddDS = new RestDataSource();
noteAddDS.setDataURL("noteadd.php");
OperationBinding add = new OperationBinding();
add.setOperationType(DSOperationType.ADD);
add.setDataProtocol(DSProtocol.POSTPARAMS);
noteAddDS.setOperationBindings(add);
DataSourceTextField addNote = new DataSourceTextField("text", "text");
TextAreaItem noteArea = new TextAreaItem("text","Enter Notes and Click Submit");
noteAddDS.setFields(addNote);
final DynamicForm notesAddForm = new DynamicForm();
notesAddForm.setDataSource(noteAddDS);
notesAddForm.setFields(noteArea);
Button noteSubmit = new Button("Add Note");
noteSubmit.setAlign(Alignment.CENTER);
noteSubmit.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
notesAddForm.submit();
}
});
$_GET[text] works fine but $_POST[text] doesnt seem to pull in anything.
What am I doing wrong here?
RestDataSource noteAddDS = new RestDataSource();
noteAddDS.setDataURL("noteadd.php");
OperationBinding add = new OperationBinding();
add.setOperationType(DSOperationType.ADD);
add.setDataProtocol(DSProtocol.POSTPARAMS);
noteAddDS.setOperationBindings(add);
DataSourceTextField addNote = new DataSourceTextField("text", "text");
TextAreaItem noteArea = new TextAreaItem("text","Enter Notes and Click Submit");
noteAddDS.setFields(addNote);
final DynamicForm notesAddForm = new DynamicForm();
notesAddForm.setDataSource(noteAddDS);
notesAddForm.setFields(noteArea);
Button noteSubmit = new Button("Add Note");
noteSubmit.setAlign(Alignment.CENTER);
noteSubmit.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
notesAddForm.submit();
}
});
$_GET[text] works fine but $_POST[text] doesnt seem to pull in anything.
What am I doing wrong here?
Comment