ivosturm / EditableByCondition

Manage Dataview editability based on a boolean attribute or microflow output.
0 stars 0 forks source link

Element with a visibility set already is ignored #5

Open khazaddoom opened 6 years ago

khazaddoom commented 6 years ago

If elements within the dataview already has visibility properties set, then this wrapper Editable/Non-Editable cascade from the widget overwrites them all! Can you do a fix for this? Like add an ignore child visibility properties if set already? [I have a valid use case for this in a client I am working for]

ivosturm commented 6 years ago

Hi Ganesh,

There is no way to see whether conditional visibility from the Mendix Modeler was already applied on the dataview for a specific element. In principle the widget always runs AFTER all visibility from the Modeler is set. Is your use case that some item is by conditional visibility set to visible, but the widget is setting all attributes to non-visible?

khazaddoom commented 6 years ago

Hi Ivo,

Oh ok I get it(sort of!) I am taking here about "Editability" not "Visibility". Thats what your widget does isnt it? In my use case, your widget was used to display a dataview(and its elements) as ReadOnly on VIEW scenario and on NEW/EDIT scenario Editable. In the NEW/EDIT scenario, there is 1 field which based on another field will have to be ReadOnly! However the widget renders everything as EDITABLE, there by overriding the "Editability" Why this use case: We are using the same page for EDIT and VIEW modes.

ivosturm commented 6 years ago

Hi Ganesh,

My mistake, of course we are talking about editability! What could be an option is that you add a CSS Class to your specific attribute you do not want to be affected by the widget. I read this CSS Class into the widget (by adding a setting) and will make sure in the javascript that I omit changing the editability for all fields having that CSS class.

Would this work?

Van: Ganesh S Acharya notifications@github.com Verzonden: dinsdag 12 juni 2018 13:57 Aan: ivosturm/EditableByCondition EditableByCondition@noreply.github.com CC: Ivo Sturm ivo.sturm@firstconsulting.nl; Comment comment@noreply.github.com Onderwerp: Re: [ivosturm/EditableByCondition] Element with a visibility set already is ignored (#5)

Hi Ivo,

Oh ok I get it(sort of!) I am taking here about "Editability" not "Visibility". Thats what your widget does isnt it? In my use case, your widget was used to display a dataview(and its elements) as ReadOnly on VIEW scenario and on NEW/EDIT scenario Editable. In the NEW/EDIT scenario, there is 1 field which based on another field will have to be ReadOnly! However the widget renders everything as EDITABLE, there by overriding the "Editability" Why this use case: We are using the same page for EDIT and VIEW modes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ivosturm/EditableByCondition/issues/5#issuecomment-396563529, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANZk2uw14hMbZD-EazuxkGtVpET2dZxnks5t76xwgaJpZM4UjrZ8.

khazaddoom commented 6 years ago

Hi Ivo, this would work indeed! But do you think you can find a more generic approach? or is this already generic? Also lets say if this is what we agree then do you think you can do this soon? Because I was thinking of forking this and making a pull request later to get your say on this. Additional question: I am still in 6.10.12 so do you think you will do this for Version 6 or latest Modeler version? Let me know.

ivosturm commented 6 years ago

I would say this is as generic as it gets if we can’t read the conditional visibility from the Modeler. Sure, build it yourself and send me a pull request later on. I will have time maybe next week for this. Let me know!

Van: Ganesh S Acharya notifications@github.com Verzonden: dinsdag 12 juni 2018 20:24 Aan: ivosturm/EditableByCondition EditableByCondition@noreply.github.com CC: Ivo Sturm ivo.sturm@firstconsulting.nl; Comment comment@noreply.github.com Onderwerp: Re: [ivosturm/EditableByCondition] Element with a visibility set already is ignored (#5)

Hi Ivo, this would work indeed! But do you think you can find a more generic approach? or is this already generic? Also lets say if this is what we agree then do you think you can do this soon? Because I was thinking of forking this and making a pull request later to get your say on this. Additional question: I am still in 6.10.12 so do you think you will do this for Version 6 or latest Modeler version? Let me know.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ivosturm/EditableByCondition/issues/5#issuecomment-396687441, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ANZk2oFYmLSgFoES7R6FfFZoaZofZg-yks5t8AcogaJpZM4UjrZ8.

khazaddoom commented 6 years ago

Sure Ivo, I will see that this week I find time to attend this. I will come back to you. (Slightly unsure about making this for the version that I want! Modeler 6.10.12)