My PHP controller calls a display file that has been converted to a Json file from a RPG rich display file. I have a submit button who's response property is bound to the BTNSUBMIT indicator. Upon click, this should return control back to the PHP and run the code in the else block...
//BTNSUBMIT will have a null value and the view will be assigned the initial input display file screen
if ($_POST['BTNSUBMIT'] != '1')
{
...initial code
}
//Submit click event... BTNSUBMIT should = 1 and pass user input to detail display file screen
else
{
...code to run after submit button click
}
Instead, nothing happens when I click the submit button. I've used this approach successfully, so I know it should work. There just seems to be some disconnect/bug when using an existing display file.
I'm new to ProfoundUI and PHP, and RPG for that matter. Hopefully my terminology is accurate.
Thanks in advance.
Unable to pass control back to PHP controller
-
- New User
- Posts: 5
- Joined: Tue Aug 12, 2014 5:31 pm
- First Name: Braxton
- Last Name: Goodman
- Company Name: BEPCO
- City: Fort Worth
- State / Province: Texas
- Zip / Postal Code: 76102
- Country: United States
- Contact:
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
PHP is very picky about case. Have you double-checked the case of the 'response' property of the button?
Glenn
Glenn
-
- New User
- Posts: 5
- Joined: Tue Aug 12, 2014 5:31 pm
- First Name: Braxton
- Last Name: Goodman
- Company Name: BEPCO
- City: Fort Worth
- State / Province: Texas
- Zip / Postal Code: 76102
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
Yes, it is all caps.
I also tried recreating my display file from scratch yesterday, incrementally adding the various elements from the original. I would test the button click and then add 1 or more elements, test again, etc... The button will work fine until I added some seemingly arbitrary element (simple layout, textbox, whatever) and then all the sudden it's done, button just quits working. I then removed the last elements added to no avail. Had to start over from scratch.
I also tried recreating my display file from scratch yesterday, incrementally adding the various elements from the original. I would test the button click and then add 1 or more elements, test again, etc... The button will work fine until I added some seemingly arbitrary element (simple layout, textbox, whatever) and then all the sudden it's done, button just quits working. I then removed the last elements added to no avail. Had to start over from scratch.
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
Could you attach a copy of your non-working display file? To do that, open up the display file in the designer, select the “Save As” option at the top of the designer, select the local tab, and save the file on your local machine. Then attach that file to a response.
Alternatively, you could contact our support line at support@profoundlogic.com. If you choose to do that, please attach the display file as above.
Glenn
Alternatively, you could contact our support line at support@profoundlogic.com. If you choose to do that, please attach the display file as above.
Glenn
-
- New User
- Posts: 5
- Joined: Tue Aug 12, 2014 5:31 pm
- First Name: Braxton
- Last Name: Goodman
- Company Name: BEPCO
- City: Fort Worth
- State / Province: Texas
- Zip / Postal Code: 76102
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
I just cracked the case. There was an output field on the display file that had a Data Type of "Use Reference Field" that was preventing the button from working. I figured that would have just caused the field not to populate since there was no reference to the physical file.
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
I'm glad you got it working, although it seems odd that a reference field would stop the button from working... I'll have to test that internally.
Glenn
Glenn
-
- Experienced User
- Posts: 2711
- Joined: Wed Aug 01, 2012 8:58 am
- First Name: Scott
- Last Name: Klement
- Company Name: Profound Logic
- City: Milwaukee
- State / Province: Wisconsin
Re: Unable to pass control back to PHP controller
Guys,
The way reference fields work.... when you compile a diplay file with the CRTDSPF command (or things like PDM, SDA or the Visual Designer, which all call CRTDSPF under the covers) the DDS compiler resolves the reference fields and puts the definitions into the display file object. When you use the open access handler, it uses an API to get those reference field definitions out of the display file object, and sends them on to the front-end when the record format is displayed.
They won't work in PHP because in PHP the display file is just a JSON file on disk, it's never compiled with CRTDSPF. And, there's no handler involved to get the references and send them to the front-end.
So, Braxton is absolutely right here... reference fields won't work in PHP. (At least, not the way things are set up right now.)
When you're changing your display files over from traditional RPG-based display files to PHP, you should change the reference fields into fields that are defined within the display file.
(Glenn, we should document this somewhere...)
Good luck!
The way reference fields work.... when you compile a diplay file with the CRTDSPF command (or things like PDM, SDA or the Visual Designer, which all call CRTDSPF under the covers) the DDS compiler resolves the reference fields and puts the definitions into the display file object. When you use the open access handler, it uses an API to get those reference field definitions out of the display file object, and sends them on to the front-end when the record format is displayed.
They won't work in PHP because in PHP the display file is just a JSON file on disk, it's never compiled with CRTDSPF. And, there's no handler involved to get the references and send them to the front-end.
So, Braxton is absolutely right here... reference fields won't work in PHP. (At least, not the way things are set up right now.)
When you're changing your display files over from traditional RPG-based display files to PHP, you should change the reference fields into fields that are defined within the display file.
(Glenn, we should document this somewhere...)
Good luck!
- Glenn
- Profound Logic Staff Member
- Posts: 124
- Joined: Mon Apr 14, 2014 4:08 pm
- First Name: Glenn
- Last Name: Hopwood
- Company Name: Profound Logic Software
- State / Province: Ohio
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
I understood that the reference field wouldn't work, but I assumed (Braxton correct me if I'm wrong) that the reference field in question had nothing to do with the BTNSUBMIT bound field. My assumption (I'm using the word a lot here...) would be that everything BUT fields defined with a reference should still work with PHP but apparently, that might not be true.
Glenn
Glenn
-
- New User
- Posts: 5
- Joined: Tue Aug 12, 2014 5:31 pm
- First Name: Braxton
- Last Name: Goodman
- Company Name: BEPCO
- City: Fort Worth
- State / Province: Texas
- Zip / Postal Code: 76102
- Country: United States
- Contact:
Re: Unable to pass control back to PHP controller
That's correct- the submit button was independent of the reference field. Thank you both for the quick responses and explanation.
Who is online
Users browsing this forum: No registered users and 5 guests