In ES9 I created a form using the Action Builder feature where the first line is two radio buttons for the user to select which of our two companies they work for. Depending on their selection, the corresponding company logo is changed from invisible to visible on the Master Page. This works fine but when a second page is generated dynamically, the logo is only displayed on page one. How do I get to display on all subsequent pages generated?
Solved! Go to Solution.
Views
Replies
Total Likes
Hi Don,
Basic error on my part. I like using the docReady event because it fires only once, as the form is initially rendered. However that is the problem here. When a new page is rendered, the docReady event does not fire, so the new instance of the ImageField is open.
Simple solution is to move the script from the docReady event to the initialize event of the ImageField. I have amended the sample, same link (http://assure.ly/sUcrHx).
Niall
Views
Replies
Total Likes
Hi,
Try changing it to an ImageField instead of an image object and set its binding to Global (see Object > Binding palette).
If that works you will need a small script in the ImageField's docReady event:
this.access = "readOnly";
Niall
Views
Replies
Total Likes
I changed both logos to image fields on Master page 1 and set the binding to global. When I click in the company radio bullet, the corresponding logo appears in the header. When a second page is dynamically generated, the logo does not appear on page two and disappears on page one.
I tried creating a Master page 2 and the same thing happens.
I went back to my original design (logos are image fields) and noticed that when a second page is generated, the logo disappears from page one, why?
Views
Replies
Total Likes
Hi,
I believe what is happening is that when a new page is being rendered, it reverts the image objects to their default/initial state (in your case probably hidden).
Have a look at this example: http://assure.ly/mcFrC6. In particular the script on page 1. This demonstrates how you can assign the rawValue of an ImageField to any existing Image object. While the example is on the Design pages, the same approach would be used on a Master page.
I can confirm that this will work, but can't share an example.
Niall
Views
Replies
Total Likes
Hi Niall,
I am trying but not having much success. I don't know Java Script and have been using the Action Builder. I tried using the, "Set the value of a field" choice in the Action Builder but the image field and image objects do not appear in the pop-up select window.
I looked at the script in the example you sent:
var vImage = this.name.toString();
displayImage.rawValue = xfa.resolveNode("Imag" + vImage).value.image.value;
but I can't figure out how to set it up so when the user clicks the radio button, the rawValue of the logo1 image object is displayed.
I went into the Click event of the radio button and added the script above. What does the script need to say to have the logo image field display the rawValue of logo1 image object?
Do I add the two image objects (logos) to the Master page or Design page?
Thanks so much for your help!
Views
Replies
Total Likes
I'm using the following script but this still does not work. My Image object is named "ImageYF" and is hidden on the Master page. My image field is named, "displayImage" and I put the script in the Click event of the radio button.
Do I need to somehow refer to the Master page since the radio buttons are on the design page?
var vImage = this.name.toString();
displayImage.rawValue = xfa.resolveNode("Image" + vImage).value.image.value;
Views
Replies
Total Likes
Okay, I have done up a new example, specifically focusing on your requirements: http://assure.ly/sUcrHx.
Hope that helps,
Niall
Views
Replies
Total Likes
Niall,
Yes, that absolutely helped!
Thank you so very much for all your help.
-Don
Views
Replies
Total Likes
Niall,
One problem. When the next page is created dynamically, the logo is not "Read-Only" and you can click to change the image. Any way to fix this?
Thanks again.
-Don
Views
Replies
Total Likes
Hi Don,
Basic error on my part. I like using the docReady event because it fires only once, as the form is initially rendered. However that is the problem here. When a new page is rendered, the docReady event does not fire, so the new instance of the ImageField is open.
Simple solution is to move the script from the docReady event to the initialize event of the ImageField. I have amended the sample, same link (http://assure.ly/sUcrHx).
Niall
Views
Replies
Total Likes
Niall,
Yes - that fixed it.
Thank you!
-Don
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies