Highlighted

Making hidden subforms visible on radion button click

SciMax

05-02-2009

I have a very complex form where initially the user has 4 options to choose from. When the user selections an option the applicable HIDDEN subform is made visible. (Please note: Once an option is made and data has been entered, the user cannot select another option.)



When the user has completed the necessary fields they click on a submit button that attaches the completed PDF to an e-mail message (in our case OUTLOOK). This PDF is then sent to their management.



What has happened is that when the manager opens the PDF the subform is again HIDDEN. It is also possible for the manager to change the option that the user had initially selected.



This scenario repeats again when the manager sends the PDF onto the IS group for processing. The subform becomes HIDDEN again.



PLEASE.... does anyone know what I've missed? I can send a copy of the PDF if you'd like.



Thanks in advance.

Replies

Highlighted

Avatar

Guest

23-03-2009

Through trial and error and a bit of thought I've found the following to work...



First you must understand that when the email attachment of your pdf is formed, it is formed as if you were opening another copy of the form and then just adding the data you've entered. So the "hidden" presence is not carried over because the original property boxes for the object specify "visible"



To get it to do so, instead of making an area hidden by clicking a button, make the button set the value of a hidden number field (to 2 for example). (before doing this... place a number field on your form design and then set its presence to hidden. )



Then in the layout: ready event of the object add your code, for example



if (yourhiddentnumericalfield.rawValue == 2)

yourobject.presence = "hidden";



look up process events in the designer help files to see why this works, i.e. how the pdf is actually rendered.



don't forget to reset the value of the hidden number field after the email event if you want to continue to use the document (not the emailed one)



I may not be explaining this as clearly as I could, and there may be a better way to do so, but this is working for me and this is how i interpret the process . Comments welcome
Highlighted

Rien_vd_Voorden

17-04-2009

A very easy way to get these things (opening subforms through clicking etc.) working is to use the folowing code in the Ready-form event:

if(this.rawValue)

{

     this.execEvent("click");

}

Its click in your case, i would rather use the code for opening subforms in the change-event(with radiobuttons or dropddown's).

if(this.rawValue)

{

     this.execEvent("change");

}

Hope this helps.