on 11-11-2008 9:05 AM
Hello, gurus.
....is it possible to set the position for an IMAGE (X & Y) dynamicly ?
How ?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
Solved it!
Of course the sequence of the images in the Hierarchy must be correct....hehe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.