Page 1 of 1

Passing information from an object inside a Subform to a procedure

Posted: Wed Dec 15, 2021 12:59 pm
by marcus
Hello,
I have a subform which contains a button. I want to use the button to start a procedure, which contains a Query to UPDATE a table. This works flawlessly with nuRunPHPHidden();
But I want to pass on some object values of the subforms objects. (The User should be able to coose a specific entry and press the button in this subform row to write the entry ID and his USER_ID (which already works) into another table.)
nuSetProperty() unfortunatly isnt working for mi inside a subform.

Best regards
marcus

Re: Passing information from an object inside a Subform to a procedure

Posted: Wed Dec 15, 2021 1:15 pm
by kev1n
Hi,

I tested it and it works for me as follows:

This JS is in an object's onchange event:

Code: Select all

    
    var id = event.target.id;
    var entryId = nuSubformRowObject(id, 'entry_id').val(); // Get the value of the entry Id. Replace entry_id with your object id.
    nuSetProperty('test_param', entryId); 
    nuRunPHPHidden('test', 0);  // Run a Procedure "test"

Output the parameter "test_param" in the Procedure:

Code: Select all

nuDebug('#test_param#');

Re: Passing information from an object inside a Subform to a procedure

Posted: Wed Dec 15, 2021 1:42 pm
by marcus
that works for me, thank you very much!