I’m trying to work on a novel approach to a long-winded functional need I have, and the method I’m trying is doing “too much” than I want.
Example code I’m working with:
$testEntity = Express::getObjectByHandle('express_object_here');
$listTest = new Concrete\Core\Express\EntryList($testEntity);
$testResults = $listTest->getResults();
foreach($testResults as $testResult) {
?>
<p><br>Start of debug
<?php echo sprintf('Current User Selected: %s', $testResult->getUserSelectedAttribute());
?><p>Click on this button to modify entry
<p><input type="submit" name="submit">
<?php if(isset($_POST["submit"])) {
$testResult->setAttribute("test_boolean_attribute", "True");
}
?>
<form method="post">
<button name="second">Second Test</button>
</form>
<?php
if(isset($_POST['second'])) {
$testResult->setAttribute("test_boolean_attribute", "True");
}
?>
<?php
}
In this very rough PoC I’m trying to have it generate a button (I’m using two buttons just for method testing, second button works, first doesn’t) for each Entry in the Express Entity list. And the intent is to have the boolean attribute for JUST ONE Express Entry be set from False to True.
However, when I click on any of the “second test” buttons, it sets that Attribute to True for… ALL of the Entries. And again I just want it to set to True for that specific entry.
I’m not yet seeing what I’m doing wrong here. And I’m trying to build a self-serve interface here without $endUser using the dashboard interface, as I have a lot less presentation control over that and it doesn’t work for the UX I’m trying to build.
Anyone have any ideas what I can do about this? Thanks!