open new windows with php result

Dear all,
i need to open a new windows with the result of a php plugin.

i show in this thread http://fabrikar.com/forums/index.php?threads/php-list-plugin.40144/ i have to create a list_X.js file whit this event handling
JavaScript:
Fabrik.addEvent('fabrik.list.submit.ajax.complete', function(list, json) {
  window.open();
});

but i would like to know how can i put the content of my php function as the html of the new page i'll open; or at least access php variables or output.

thanks
alberto
 
Well ... as that thread explains, the PHP list plugin doesn't "return" anything. It can set a status msg which our list JS will put up an alert for. But all that gets returned is a JSON structure with the list row data in it, which we re-build the list display with, and (if you set $statusMsg in your code) a status message we pop up.

Like any other list plugin, the PHP plugin just allows you to "do things" on the server side (like send mail) based on which rows were selected on the page. Then the list data is rebuilt and returned as a JSON data structure, and we redisplay the list.

So you can't just return HTML from you plugin and render it.

If you explain what you are trying to achieve maybe we can help.

-- hugh
 
Hi Hugh, thanks for your replay.
what i need to do is create a new page, with a quite static header and footer (and a couple of checks), and only the item from the list that i have selected with the checkboxes.
maybe i can populate another list with the php plugin, and with the js open a new windows showing that list, with some filters like the last n entry inserted?
can i achive it in a better way?

thanks
alberto
 
What you could maybe do is add a 'selected' field to your table, in your PHP make sure only the selected row has that set, and in your event code do the window.open to a copy of the list with a pre-filter ('selected = 1')

-- hugh
 
Hi hugh,
thanks for you reply. Your solution could work, but i have no idea how to refresh the list view settings, adding the pre-filtering condition. Can you please explain? I can't just add that prefilter in the list definition, or i have to find a way to delete the selected page after it has been shown and printed.
Is there any way i can also temporary add an header at the page?

regards
alberto
 
So use your original plan of a JS event on complete to open the new window.

Note that this won't work very well if you have lots of people browsing the list at the same time.

-- hugh
 
Note that this won't work very well if you have lots of people browsing the list at the same time.
Yup.
A "clean" solution would be to create a session variable with the checked ids in the list php and create a prefilter (type=eval) to get the ids from the session.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top