Modify Display Height of Read Only HTML Variable on Catalog Item

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2014 04:44 PM
What is the recommended way to modify the height of the box of a read-only HTML variable on the Catalog Item form? I would like to avoid having to create tons of UI Macros just to add a single line of rich text in the middle of forms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 04:52 AM
It seems to be this particular piece of code the is causing the issue in IE and Chrome.
$(g_form.getControl(myReadonlyHTMLVariable).id + '_readOnlyDiv').style.height = '20';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 09:20 AM
I don't know why this isn't working, but I have to ask why you want to do it this way rather than the nobody role method described above? It works across browsers and is a lot less likely to break in the future.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 09:36 AM
I didn't fully understand it and the code just seemed easer. I got it to not thought the error by adding the following code before the line $(g_form.getControl(myReadonlyHTMLVariable).id + '_readOnlyDiv').style.height = '20';.
if (typeof myReadonlyHTMLVariable.style === "undefined"){
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 09:57 AM
Mark Stanger: For others' edification and to check my work, this is the script on the sys_user_role read ACL that I'm using. Is this similar to what yours looks like to allow the admin to set the nobody role?
if(current.name == 'admin' && !gs.hasRole('admin'))
answer = false;
else if (current.name == 'maint' && !gs.hasRole('maint'))
answer = false;
// Allow admin to add "nobody" role
else if (current.name == 'nobody' && !gs.hasRole('admin'))
answer = false;
else
answer = true;
I'm hoping that this helps others who come across this figure out all the pieces a little easier.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2014 10:02 AM
I don't see any reason for restricting access to the 'admin' or 'nobody' roles at all. My row-level read ACL for the 'sys_user_role' table looks like this...
if ((current.name == 'maint') && !gs.hasRole('maint'))
answer = false;
else
answer = true;