Databasejoin render as Checkbox/Multiselect problem (view detail)

black.be3

Member
Hi Rob,
I have database databasejoin element rendered as Checkbox/Multiselect problem, when it Editable for public, I can see all selected values.
But when it editable for other ACL (custom/builtin), the element showing no value.. just empty... although i've loged as user using related ACL.
please help..
 
hi that sounds like something I fixed recently can you update from github and test please?
 
I've update to latest git. But still the same result....

Let me explain:

  1. I have table "A" with only 1 element (text)
  2. I copied table "A" to "A1", "A2"
  3. I create new databasejoin element "user pic" on table "A" with render join as dropdown and editable by public. This step automatically create new databasejoin element on "A1" and "A2" with the same setting on "A".
  4. I unliked databasejoin "user pic" on table A1. Then change to render with checkbox.
  5. I try to create new record on table "A1", check several value on "user pic". Then apply/save. On this step i can see that checked value recored and i can change selected checkbox.
  6. Then on table "A1", i change databasejoin "user pic" editable by special.
after the last step, i expect "A1.user pic" element values that checked previously and i cannot change/edit it.
but all i see is only the label of "A1.user pic" element..
 
Hmmm. While the ACL issue is probably a bug, I think you've hit on a usage case which simply won't work.

Remember that copied lists sit on the same underlying MySQL table(s). When you change a join element from a single select option (like dropdown) to a multiselect one (like checkbox), this is actually making a significant change to the way the data is stored. In 'dropdown', we store a single FK value in your main table, pointing to the key you chose for the table you are joining to.

When you change the type to 'checkbox', we actually then create a many-to-many linkage table, between your main table and the joined table. We no longer store the selections in the element's main table field (as a single field obviously can't store multiple selected foreign keys to multiple related rows). Rather, we then start managing entries in the linkage table, with two FK's, pointing to the parent row in the main table, and the selected row in the joined table.

So ... you've ended up trying to use totally different ways of managing joined data, on the same underlying table. You've come up with a usage case we hadn't anticipated, and we'll have to add some defensive coding to prevent this.

But like I said, the checkbox vs dropdown issue is unrelated to the ACL issue you described, which I'll take a look at.

-- hugh
 
I think understand what your mean with that usage thing..
fortunately the checkbox rendered nicely on list view... all value that user select showed as list inside one column.

Can you suggest any other way to present multiple choices that use can select like this?
I've tried to use master-detail (repeat group) but it will show alot of add button beside repated element that will confuse user and i'm also having hard time just to make the layout look preety to the user (the distance between repeated element and the add button on its right getting bigger and bigger if user tried to add/select more than 5 repeated element) using standart joomla template and even non standart
 
Well, the problem I was describing will only be an issue if you have one copy of the element set to "dropdown" and one set to "checkbox".

If you set all instances of the element to be "checkbox", then you'll be fine.

So do you still have the issue you described in post #3?

-- hugh
 
yes, i still have that problem, although all instance of elemenet set to checkbox.

Just found out that if i open it on detail view, the checked value rendered correctly...
If i open it on form view (checkbox editable only by custom/builtin group), no value rendered
 
If i open it on form view (checkbox editable only by custom/builtin group), no value rendered

Is that when editing the record as a user who should have edit access, or shouldn't have edit access, or both?

-- hugh
 
OK, I confirmed this as an issue, working on it so if you have View but not Edit permission, it'll show a read-only view of the selections.

-- hugh
 
I've chased hugh regarding where he is with this one, he's off line at the moment, so it may be a while before he replies
 
First cut at a fix is in github. Haven't tested with all possible permutation of options.

Let me know if it works for you.

-- hugh
 
If you updated from github prior to this post, you should update again, as I fixed a potential gotcha my first fix introduced (it would delete read-only repeat element data on submit). That's now fixed.

-- hugh
 
thank you very much, it works :)
but i need help to remove big space at top of data (please see attachment)..
 

Attachments

  • 27-Feb-2012 11-09-18 AM.png
    27-Feb-2012 11-09-18 AM.png
    8.9 KB · Views: 139
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top