Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Reset button hides image box

Avatar

Level 2

I have a dynamic form where the users can import jpg images into the form.  This works just fine, but when they reset the form, the image box minimizes and the users are unable to re-use the box without exiting the program and re-entering.  Basically, my users are going to create a flowchart in Paint or Word, save the image as jpg and place it into the form.  They will be using Adobe Reader, so it appears the field needs to be an image field.  Is there any way I can make the field reset to it's starting size and position?  A copy of the form is attached.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I added...

DiagramText.rawValue = null;

DiagramText.h = "0.8782in";

Diagram.rawValue = null;

Diagram.h = "0.6813in";

to the reset button. Rev 1 attached.

Good luck,

Niall

View solution in original post

8 Replies

Avatar

Correct answer by
Level 10

Hi,

I added...

DiagramText.rawValue = null;

DiagramText.h = "0.8782in";

Diagram.rawValue = null;

Diagram.h = "0.6813in";

to the reset button. Rev 1 attached.

Good luck,

Niall

Avatar

Level 2

Outstanding!  Thank you very much!!

Avatar

Level 7

Hi Niall,

I downloaded mwfbi's sample and added the h values for the diagram fields to the reset button and it didn't work. Why is it that the rawValue has to be blanked first? This is just for my own edification, thanks in advance.

djaknow

Avatar

Level 2

I guess I responded too quickly.  Now, the image will show up, the box will expand, I can reset the form, and it looks good (as I wanted),  The problem is that the next image you try to place in the document, the image is smaller and the box will no longer expand to fit.  Also, I can't get the same formula to work in another image field.  Is there something else that you did?

Form is attached.

Avatar

Level 10

Hi,

A couple of things are going on here. When I used the ".h" property that overrode the expand to fit height. The trouble then was to change this to the ".minH" property; however when the imageField is null the min height went to zero.

Therefore I have left the script in the click event as it was (just the full reference for the exhibit imageField:

DiagramText.rawValue = null;

DiagramText.h = "0.8782in";

Diagram.rawValue = null;

Diagram.h = "0.6813in";

Exhibit.ExhibitBox.rawValue = null;

Exhibit.ExhibitBox.h = "0.6813in";

Then in the mouseUp event of each imageField I had the following which restored the "expand to fit height" functionality.

this.minH = "0.6813in";

Appears to work now. Good luck,

Niall 

Avatar

Level 2

You are awesome!!  Thank you!!

Avatar

Level 10

Hi djaknow,

Sorry for not getting back sooner. I suspect that if the .h value was greater than the current height it would have increased the height of the imageField. But with an image in the field, using the .h property set to a lesser value than the current would be a conflict and thus it leaves the imageField height alone.

Just guessing..

Niall