Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

setItemState not consistent

Avatar

Former Community Member
Has anyone else had problems with the XML object property setItemState?



I created a small form with yes/no radio buttons on page one and page two. Using setItemState, I made the buttons on page two match whatever was selected on the first page.



Once I got that to work, I then applied it to my real form which is several pages, and it doesn't work. My code is the same yet it doesn't work.



Has anyone else use this property?
9 Replies

Avatar

Former Community Member
If you want to set the value of radio button programatically you should set the rawValue of the exclusion group.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
That's another method that works (and doesn't work) in the exact same cases that setItemState does (and doesn't).



Is there a limit to the number of fields or pages in a form? I can't think of any other reason why this doesn't always work.

Avatar

Former Community Member
No, there is no limit to the number of fields. Without knowing more I can't say why it's not working for you. If you want to make the form available on the web I'll try to find some time to take a look at it.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Thank you for offering to take a look at this.



http://64.71.48.149/financial_statement_2.pdf



When you open the PDF in Designer, you will see many pages. The orignal form occupies the last 6 pages (page names all begin with "subform..."). The client thought the form is too confusing with all of the sections, called schedules, appearing together so they wanted them to appear one at a time on the screen. So pages were inserted and the form schedules were duplicated one at a time on them (names all begin with "screen...").



On "screen_sched1" the last column has yes/no radio buttons. When a user clicks on a button, its corresponding radio button on the original form, page called "subform_page_2", should also be checked on (look at the first schedule in the upper-right corner of the page).



You will see that I attached the JavaScript to the exclusionary group on the "screen..." page (screen_sched1.sched1Restrict1).

Avatar

Former Community Member
The problem is that the exclusion group on subform_page_2 has items with values of 0 and 1 (which is the default). Whereas the exclusion group on screen_sched1 has radio buttons with values of "yes" and "no" (if you uncheck the specify item values choice it takes values from the captions).



If you check the "Specify item values" choice on the exclusion group on screen_sched1 your script should work fine.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
I tried your solution and it worked (thank you)...but it shouldn't be working.



I understand that item value choices come from the captions if I do not specify item values. That is why I did not specify item values for either of the exclusion groups. They were the same: yes and no.



Now that I specified the item value choices for the first exclusion group but not the second one, it works. That shouldn't be.



You mention that the second exclusion group (subform_page_2) has items with values of 0 and 1. I don't understand where you are getting that. I do not have Specify item values checked so they should be yes and no. (And the first exclusion group now has values of 1 and 2 and yet it works.)

Avatar

Former Community Member
> You mention that the second exclusion group (subform_page_2) has items > with values of 0 and 1. I don't understand where you are getting that.



I looked in the XML.



> I understand that item value choices come from the captions if I do

> not specify item values. That is why I did not specify item values for > either of the exclusion groups. They were the same: yes and no.



I saw that, and under normal circumstances you'd be right. But for some reason, and I'm not sure why, it's not the case here. Did you import this into designer from another application or a previous version? If so, maybe something went wrong in the import process. I suspect it may be the case that the old one were done in Designer 7.1 and then moved to Designer 8 and maybe something went wrong. But I tried a few tests and was never able to get that to happen.



All I can say for sure is what the state of the form was when I saw it and that that is why it wasn't working for you.



Chris

Adobe Enterprise Developer Support

Avatar

Former Community Member
Thank you again for all the help.



I did start to create this in Designer 7 and when version 8 became available I started to use that (the client wanted to make use of a new feature in 8).



I thought the problem was because I create one set of yes/no radio buttons and then copied and pasted it on to another page (with a different Master page). I thought something got messed up in the clipboard. Maybe it was the switch from Designer 7 to 8 all along.



You mentioned that you looked at the XML. How did you do that? Export the form as XML? Or is there an XML window that shows the code behind the PDF?

Avatar

Former Community Member
There's an XML Source tab. You may have to open it from the view menu the first time.



Chris

Adobe Enterprise Developer Support