Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot seem to force to POST... #2585

Open
carlbeechvuw opened this issue Nov 17, 2024 Discussed in #2568 · 2 comments
Open

Cannot seem to force to POST... #2585

carlbeechvuw opened this issue Nov 17, 2024 Discussed in #2568 · 2 comments

Comments

@carlbeechvuw
Copy link

Discussed in #2568

Originally posted by carlbeechvuw October 3, 2024
Hi
Working with V2 - on both Grid and Form objects, I always get GET style data rather than POST... I'm using php with a front end web page which uses w2ui - and the PHP always reports comms as being GET. (As its the receiving PHP, I can't do a jsfiddle to demonstrate I'm afraid...)

Here's the front end code:

<script type="module">
import { w2layout, w2grid, w2toolbar, w2alert,w2form,w2utils,w2ui } from 'https://rawgit.com/vitmalina/w2ui/master/dist/w2ui.es6.min.js'
let config = {
    layout: {
        name: 'layout',
        padding: 4,
        panels: [
            { type: 'main', size: '25%', resizable: true  }
        ]
    },
	PtchGrpDates: {
		name: 'PtchGrpDates',
		method: 'POST',
		url: 'retrievedata.php?datatype=PtchGrpDates&ObjType=GRID',
		show: {
			toolbar: true,
			footer: true ,
			toolbarAdd: true ,
			toolbarSave: true 
			},
		columns: 
			[
			{ field : 'PatchingGroup', text: 'Group', size: '200px', sortable: true, hidden: 0, editable: { type: 'text' }  },
			{ field : 'PatchingDate', text: 'Patching date', size: '100px', sortable: true, hidden: 0, editable: { type: 'text' }  }
			],
		postData: {
			datatype : 'PtchGrpDates',
			ObjType : 'GRID'
			},
		onSubmit(event) {
			   event.detail.httpMethod = 'POST'
			}
		}
	}
let layout = new w2layout( config.layout )
let PtchGrpDates = new w2grid( config.PtchGrpDates )
layout.render('#PATCHGRPDT')
layout.html('main',PtchGrpDates)
</script>

When I make a change and click save, I've got PHP sending information to a log file - here's the relevant part:

2024-10-03 07:33:46 ConsolidateInputs:POST variables:
2024-10-03 07:33:46 ConsolidateInputs:GET variables:
2024-10-03 07:33:46 GET variable:datatype=PtchGrpDates
2024-10-03 07:33:46 GET variable:ObjType=GRID
2024-10-03 07:33:46 GET variable:request={"datatype":"PtchGrpDates","ObjType":"GRID","changes":[{"recid":"1000024","PatchingDate":"2024-09-23"}],"action":"save"}

As you can see in the code, I've tried to set the sending method to be POST, but it doesnt appear to work... as mentioned, its the same with FORMS as well...

I know I'm missing something - but after 2-3 weeks of not being able to work it out - I thought I'd raise this as a query...

Addendum - forgot to include that I'd made a simple HTML form, using POST and this came through correctly as POST variables as expected.

Hope you're able to help

Thanks
Carl.

@carlbeechvuw
Copy link
Author

Submitting as issue as there was no comment in discussion board...

@carlbeechvuw
Copy link
Author

Addendum - forgot to include that I'd made a simple HTML form, using POST, which sent data through to the PHP and this came through correctly as POST variables as expected - so I know that the PHP is working correctly - which demonstrates the issue is with the html/w2ui...
Hope that clarifies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant