cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamicly positioning....

Former Member
0 Kudos

Hello, gurus.

....is it possible to set the position for an IMAGE (X & Y) dynamicly ?

How ?

Accepted Solutions (1)

Accepted Solutions (1)

chintan_virani
Active Contributor
0 Kudos

Eric,

Can you please elaborate on what do you mean by dynamically, do you want to change image depending on some user input/event?

There are x and y property available for images and you can try setting them as shown below in JavaScript :-

StaticImage1.x = "0.1cm";
StaticImage1.y = "15.1cm";

Chintan

Former Member
0 Kudos

I have a background picture of a functional location. On top of that picture I have another picture - a "map marker" - that I want to move dynamicly to point on the actual equipment.

....so it is not possible to put a &X& (abap variabel) into the position field for X ?

chintan_virani
Active Contributor
0 Kudos

Erik,

By setting x and y, I meant you can change the image co-ordinates of that on the form. Lets assume you have embedded image element at a certain position while designing in LiveCycle Designer, then depending on user input if you want to move that then you set the properties again as I mentioned above.

I am little confused and amazed here. Are you doing this in Adobe Interactive Form?

Chintan

Former Member
0 Kudos

....in my ALV report I list equipments for a specific func.loc. When the end-user click on one equipment I want to preview the form (and now I need to move the "map marker" IMAGE based on X & Y stored in my Z-table)

chintan_virani
Active Contributor
0 Kudos

Erik,

I have a strong feeling that this is not related to Adobe Forms since "map marker" is NOT a control from Adobe library.

To me this looks to be Smartform you have developed, and so you should probably post the same question in ABAP or Form Printing forums.

Chintan

Former Member
0 Kudos

...my "map marker" is a standard "Image" object from the standard Library, and I want to use input abap variables for the position X & Y. But it seems like this is not possible in Adobe Forms.....

chintan_virani
Active Contributor
0 Kudos

Erik,

I hope I got you correctly, so basically you want a Google Map Marker like functionality in your Adobe Form

which has two images (Functional Location & Map Marker) and you want to somehow place the "Map Marker" Image on the "Functional Location" Map as per the X and Y values coming from the backend. Am I correct?

Chintan

Former Member
0 Kudos

Yes, I only want to move my "map marker" image based on input from abap interface.

chintan_virani
Active Contributor
0 Kudos

Erik,

If the X and Y you get from the Backend maps correctly to the X and Y position of the Fucntional Location Image on the form then the below solution should work.

1. Create two hidden Text Fields and bind them to the correct node from where you get the X & Y position data in Bindings tab.

For e.g. I have TextField1 and TextField2. Select it individually and then goto object palette and set the Presence property to Hidden(Exclude From Layout)

2. Instead of Image use ImageField elements in your form.

For e.g. I have taken ImageField1 (for Functional Location Image) and ImageField2 (for Map Marker Image). You can make the caption blank if you don't want.

3. In form:ready event of the main Subform write following code in JavaScript. If the binding is correctly done for the Text Fields you will get the X and Y values from backend as popup when the form is loaded.


// Alert to see if we get the X and Y Position data. If we don't get means the Binding is missing/incorrect or data is not maintained in the backend.
xfa.host.messageBox("X Pos : "+TextField1.rawValue); 
xfa.host.messageBox("Y Pos : "+TextField2.rawValue); 

ImageField1.access = "readOnly";
ImageField2.access = "readOnly";
ImageField2.x = TextField1.rawValue;
ImageField2.y = TextField2.rawValue;

Chintan

Answers (3)

Answers (3)

Former Member
0 Kudos

Solved it!

Of course the sequence of the images in the Hierarchy must be correct....hehe

chintan_virani
Active Contributor
0 Kudos

Erik,

Fantastic, I myself did not know that. That's beauty @ SDN....sharing your knowledge and learning at same time.

Chintan

Former Member
0 Kudos

I changed the preview type in...

1) Edit -> Form Properties

2) "Defaults" screen....

Preview Type: Interactive Form

Now, the "problem" is that ImageField1 (func loc) always will be layered on top-of ImageField2 (Equipment).

Former Member
0 Kudos

Thanks for your help, I truely appreciate it....

The popup works OK, but the ImageField2 will not move.

I can see from the popup that I receive the correct X & Y values.....but the ImageField2 position seems to be static !

Please advice....

Erik

chintan_virani
Active Contributor
0 Kudos

Erik,

The form needs to be Dynamic and Interactive in order for the field to move.

Are you using Print Form, if yes then I am afraid the solution won't be possible then

Chintan