Get List Row ID

Incremental

Member
Hi after reading forums about this subject, I tried to implement it in my Fabrik.
I have a list, and when I click on a checkbox row, I have a Edit or View tooltip.
When I click Edit or View, a popup opens with the edit row.
In the form plugin, I put a PHP onBeforeLoad() with
PHP:
$ids = JRequest::getVar('ids', array());
echo "rowid : ".'{rowid}'."<br />";
echo "ids : ";
var_dump($ids);

'{rowid}' returns the correct ID of the clicked row (OK)
but "var_dump($ids);" displays :
ids : array(0) { }

Normally $ids should return a collection of clicked rows instead of {rowid}.
Why is it empty ?
What did I missed ?
Can be see on my test site : Registered user / Liste Contacts / Edit item
Thanks for help !
 
You can't edit or view multiple records, you'll get the one you have clicked.
It's a bit confusing because if list view/edit buttons are displayed "floating" they are displayed the same way as Delete, Php or Email buttons, which can handle multiple records .

$ids = JRequest::getVar('ids', array()); can be used in list php plugin to get the checked records.
 
hmm no thats not right - JRequest::getVar is deprecated, you shouldn't be using it now, the existing example on the form is the correct one.
This page is related to the php list plugin so I don't see how it can produce anything other than an array of ids, either as a single value in an array or as a series of values in an array.
I'm really not clear why the content regarding edit/view is on this page, its not applicable as far as I can see.
Could you explain your reasoning behind the information here? To my mind its just muddying the waters, providing information which is not relevant to the page being viewed.

Again JRequest is deprecated, it should be replace with $app->input->get(), and why talk about what shouldn't be done. On the list plugin page we are dealing with accessing an array of posted ids, in the form plugin page we are talking about accessing the rowid variable located in the querystring. Perhaps adding that to the wiki would be clearer than just saying what shouldn't be done, when there's no context given as to why you would be attempting to do it like that in the first place?
 
Hi Rob,
now how could I in my PHP load a specific Form, to work on the selected ID ?
and return to my list after edition ?
Thanks a lot ! I will add this sample to the Wiki
Regards
 
I use this to get the form ID
PHP:
$app  = JFactory::getApplication();
$formId = $app->input->getInt( 'formid', 0 );
 
Thanks jfquestiaux
I have noted your code, but my question was probably not clear.
I would like in a List PHP Plugin (rendered as a button), to call a Form for the checked ID.
How could I invoke a specific Form with the checked ID ?
 
There must be a logic that links the checked record to the form called (otherwise you have to explain better what you are trying to do), so use this logic to build the link to the appropriate link and set a redirect in your PHP list plugin to open the correct form.
 
Hi,
I'm trying to design a contact Form, with the ability for the Administrator to :
- Edit / View --> same form as the public one in frontend
- Reply to the contact --> specific form with an answer field sent to the contact mail when clicking on a 'Reply' button AND stored in the List.

I try to use 'regular' buttons for Edit/View/Delete and an additionnal PHP List plugin for 'Reply' button.
I'm wondering how to call my form with this PHP button.
Thanks for advices.
 
I was thinking of having something like that, to have some sort of CRM functionnality within fabrik, but did not come up with a actual solution.
I think probably the best solution would be to modify the list email plugin so the message written gets stored in the list's table. If you have the PHP knowledge, you might try.

In the meantime, the way I would do it with what's there is :
  1. Add a "reply" field in the contact form, with its access level set to be visible only by Administor (so it is hidden for the user filling the form)
  2. Use a email form plugin, set to be fired ONLY on "Edit", using a template that has only the reply field in it (+ any other field/information necessary, like the original message of the user), sending the mail to the user when the Administrator submit the edited contact (be sure to include a "Go back" button so he can exit the form easily without sending anything).
 
Thanks for your clues !
Why modifying list email plugin as you can have an element "Answer" in your list, which could be stored and send by mail when the administrator fill in the Form (PHP & Receipt plugins) ?
My idea is to work from the list having 3 buttons per row : View / Delete / Answer
==> my post is relating to : is it possible to call a specific Form with the Answer button (PHP List plugin) ?

2) do you mean that in a template you can choose the elements to display or not ?
(in a more elegant way than comparing names one by ones)
or it is through the elements publication of the Form ?
 
There is an access level for each element, so you can choose who can see an element and/or edit one in form view.
 
1) Any idea for calling a specific Form from the button ?

2) I understand : duplicate the Public List (used in the contact Form) to create an Admin List/Form/Elements and set Elements ACL on this different Form.
Right ?
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top