Forum

HomeHomeCoreCoreGeneralGeneralclean viewstate: use query result outside detail templateclean viewstate: use query result outside detail template
Previous
 
Next
New Post
12/22/2014 10:03 AM
 

Hi,


to create some clean viewstate code, I always used IIF tags inside the detail template until now. I was wondering if something like this would be possible, in order to get cleaner code:


QUERY template ()

HEADER template ( SELECT record_id, ...)

if [Edit,Viewstate]=[record_id]

DETAIL template (1: EDIT viewstate)

else

DETAIL template (2: normal viewstate)

FOOTER template


To be able to do this, the [record_id] from the QUERY needs to be retrieved outside the DETAIL template. Is this possible?

When looking in the eventlog, I'm afraid the answer is no because the if action "[Edit,Viewstate]=[record_id]" is not repeated for each query result. Or is there another trick?


Thanks!

Ken

New Post
12/22/2014 10:51 PM
 
Hi Ken,

First let me say yes it is :)

I do that the following way:
Assign your templates to action variables outside your query template and assign a new sql query variable.
Then Build your if conditions and assign the predefined actions to a new Action variable lets call TemplateVariable.

Now use the TemplateVariable in your detail Template.


Sorry for some mistakes here, i am typing with my ipad :)
If necessary, i can provide working code for a better understanding.

Richard
Previous
 
Next
HomeHomeCoreCoreGeneralGeneralclean viewstate: use query result outside detail templateclean viewstate: use query result outside detail template


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share