PDA

View Full Version : DF4WP - Can't show single view



Ianv
15-Aug-2017, 12:06 AM
I've installed DF4WP in accordance with Mike's excellent instructions and am able to show and use the 18.2 WebOrder Example with shortcode of:


<div style="padding:2em">
[df4wp-webapp height="800"]
</div>

Then I created a page to show only one view with:

<div style="padding:2em">
[df4wp-webapp view="oCustomer" height="800"]
</div>

Here is the declaration line for oCustomer

Object oCustomer is a cWPWebView

When I go to the page for the Customer view, it still shows the Orders page which is the default view for the whole App. I know the correct shortcode is being executed because if I change the height this page responds. What am I missing here?

Ian

Mike Peat
16-Aug-2017, 03:49 AM
Ian

You can only do clever stuff like showing a single view if:



The DF application has been modified to use the cWPxxxxxxx classes (for the WebApp, the views and ideally any modal dialogs)
You have set the psWPEncryptSecret to whatever the plugin has for that in its settings page


So if you are just using the unmodified Order Entry sample (or any other unmodified program), displaying the whole program is the only option, since the plugin can't communicate with the DataFlex program to tell it to do anything else. You can't just modify the class for one view, because the rest of the DF4WP DataFlex-side functionality (which is mostly in cWPWebApp BTW) isn't there to support it.

If you modify the oWebApp to be based on cWPWebApp and just one view to be based on cWPWebView - and set the psWPEncryptSecret of the oWebApp - it will probably work, but that is not recommended and your lookup lists will probably go wonky (a technical term, known to but a few :)). Best to get the entire app "DF4WP-ised" - it really only takes a few minutes and should not change any functionality outside of WorsPress.

Mike

Ianv
16-Aug-2017, 04:27 AM
Thanks Mike,
I've done most of that but I suspect not setting the psWPEncrypt. I'll check that later. That would explain why there is nothing coming through in GetWPInfo (I've been doing a bit of debugging). This is the first step in getting DF to work in conjunction with our own php/angularjs web-site rather than for using Wordpress. You are to be congratulated on the great job you have done on this and I think the information we need is in df4wp-page.php. I'll let you know how we go.
Ian

Ianv
16-Aug-2017, 09:52 PM
Thanks Mike,
It was in fact because we hadn't set psWPEncryptSecret. Now that's done Views work fine and all the WPinfo data comes through.

Ian

Mike Peat
17-Aug-2017, 02:32 AM
Ian

Glad to hear it! :)

Mike