[SOLVED] My default Image is getting deleted.

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

[SOLVED] My default Image is getting deleted.

Post by Jaymer »

STORING IMAGE IN FILE SYSTEM, build 8.1 2477

When I create a new BO, I need a user to fill in 4 images.
I'm using Mobile (but thats not the issue) - point is, don't try and change what I'm doing - same thing happens on desktop.

When I create the parent record, I'm creating 6 records in a child table.
I pre-name the images "front, rear, left, right" so the user knows which image to put into each record - its to prompt him.

You can see the default image thats assigned here:
Screen Shot 2018-11-28 at 11.22.47 PM.png
Screen Shot 2018-11-28 at 11.22.47 PM.png (82.47 KiB) Viewed 2815 times
Each record points to that "tap here.png" physical file.

PROBLEM IS that when I tap on the thumbnail and it goes to the Edit form where I can Select a File to upload, Aware DELETES the "tap here.png" file and then uploads the user's image - a RULE kicks in to MAKE DIRECTORY if its not found, and set the path to store this uploaded doc.

Obviously, I can't have my default image disappear.
At create time, instead of setting an Initial value to point to my 'tap here' file, I guess I could copy that 6 times into the images directory for this Parent, but that seems overkill - its only a 2k file though so it wouldn't be that terrible.

Am I missing something with the way Aware handle's these images?
Is there another strategy to point to a common image file and not have it be deleted?

thx
jaymer...

PS _ here's a completed image on a phone screen with 6 images uploaded.
Screen Shot 2018-11-28 at 11.21.34 PM.png
Screen Shot 2018-11-28 at 11.21.34 PM.png (219.94 KiB) Viewed 2815 times
Last edited by Jaymer on Thu Nov 29, 2018 9:22 pm, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2450
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: My default Image is getting deleted. I'm missing somethi

Post by Jaymer »

My solution was to use CSS.

1) In the Custom Query Template:
<div class="pic-group">
<div class="pic-heading">{PicSection}</div>
# if(data["PicImage"] != undefined) { # <div class="pic-image">{PicImage}</div> #} #
# if(data["PicImage"] == undefined) { # <div class="pic-missing">&nbsp;</div> #} #
</div>

2) CSS
.pic-missing {
margin: 3px;
box-sizing: content-box;
width: 160px;
height: 160px;
border: none;
text-overflow: ellipsis;
background-repeat: no-repeat;
background-image: url("../../../images/AssignImage.png");
background-size: 160px 160px;
}

3) Result:
Screen Shot 2018-11-29 at 4.20.12 PM.png
Screen Shot 2018-11-29 at 4.20.12 PM.png (52.05 KiB) Viewed 2802 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply