Welcome close

We've made some changes!

As you may have noticed, we've made some changes to the DevCenter to include the new Exchange site, a code community for Ektron developers. You may use the same username and password to login for both the Exchange and DevCenter. Your DevCenter profile has moved over to the Exchange site. You also may notice we have removed some profile functionality in favor of new functionality, including Activity Streams. We welcome your feedback about the site on the Exchange forum.

SEARCH : searchSite
This SectionSite Wide
API

RSS Feed Print Category View
Accessing Dropdown from smartform
Steven F
Posted: Monday, February 8, 2010 4:23 AM
Joined: 8/10/2009
Posts: 74


Hey I would like to retrieve the elements of a dropdown which is set up in the work area.

 

What I would like to do using I guess smart form API is access the dropdown by its name and go through the contents of it.

 

Is this possible ?


Steven F
Posted: Monday, February 8, 2010 5:59 AM
Joined: 8/10/2009
Posts: 74


Update I was trying the following :

 

xml_config_data = m_refContentApi.getXMLConfiguration(16)

 

Where 16 is my smartform Id

 

Response.Write(xml_config_data.PackageDisplayXslt)

 

When I view the print out the dropdown I want is included but the other elements of the smart form aswell. I just want to access the dropdown

 

i.e "Department"

 

So I can populate a dropdown on my site with the select values from this dropdown.

 

Any Help would be greatly appreciated


Ektron Doug D
Posted: Monday, February 8, 2010 7:44 AM
Joined: 6/22/2006
Posts: 1833


Define the list outside the smart form, then have the smart form and your other code access it.

 

One of these KB articles should help.

 

How to populate a select list in a Smart Form or HTML form from an external data source (eWebEdit400)

http://dev.ektron.com/kb_article.aspx?id=29404

 

List CMS folder contents in an HTML form or Smart Form Choices field with eWebEdit400

http://dev.ektron.com/kb_article.aspx?id=26936

 

Define data lists in content (eWebEdit400)

http://dev.ektron.com/kb_article.aspx?id=29147

 


Steven F
Posted: Monday, February 8, 2010 8:59 AM
Joined: 8/10/2009
Posts: 74


Hi Doug I was hoping to keep the set up as it is now.

 

Is there no way I can just read the drop down list values from the smart form itself ?

 

Like i can see the values in the .xslt values in the .xslt file in the XML Files folder


Ektron Doug D
Posted: Monday, February 8, 2010 9:22 AM
Joined: 6/22/2006
Posts: 1833


Once you have the package (which you have with the code example in your earlier post), transform the package with the DesignToFieldList.xslt (search the workarea code

editdesign.aspx.vb for an example) 

 

The field list is simple XML.

 

Alternately, you can use DesignToFieldListJS.xslt to get JavaScript instead of XML.


Steven F
Posted: Monday, February 8, 2010 9:50 AM
Joined: 8/10/2009
Posts: 74


Hey Doug thanks again for your reply

 

"transform the package with the DesignToFieldList.xslt"

 

What does this do exactly does it transform the entire xlst file is it ? or just the dropdown ?

 

The field list is simple XML.

 

And also if the above does transform the entire xslt file to XML how can I then access the node im looking for, do you have any sample code for that ? I.e root/department


Ektron Doug D
Posted: Monday, February 8, 2010 10:43 AM
Joined: 6/22/2006
Posts: 1833


This KB article may help.

 

Field List datatype and basetype attribute values in CMS400

http://dev.ektron.com/kb_article.aspx?id=29145


Steven F
Posted: Monday, February 8, 2010 11:34 AM
Joined: 8/10/2009
Posts: 74


Hey Doug.

 

Sorry that link wasn't really of to much Help. My query is really how can I access one of the Data items from all the data returned.

 

i.e. at the moment im trying

 

        xml_config_data = m_refContentApi.getXMLConfiguration(16)

        content_html = xml_config_data.PackageXslt '("PackageXslt")

 

        Response.Write(content_html)

 

        Now in this Content_html i can see the data I want but also a lot of other stuff im not interested in.

 

        So I think what you were saying was I need to turn content_html into XML ?

 

         I went to editdesign page like you said but couldn't really tell from there how that could be achieved.

 

Anymore help would be great, thanks for your help so far


Ektron Doug D
Posted: Monday, February 8, 2010 12:12 PM
Joined: 6/22/2006
Posts: 1833


strDesignPage = EkXml.XSLTransform(content_html, EkFunctions.QualifyURL( Your-Domain-Workarea, "ContentDesigner/unpackageDesign.xslt"), XsltAsFile:=True) 

 

strFieldList = EkXml.XSLTransform(strDesignPage, EkFunctions.QualifyURL( Your-Domain-Workarea, "ContentDesigner/DesignToFieldList.xslt"), XsltAsFile:=True)

 

XPath into the strFieldList xml.

 

BTW, this all assumes you are using version 8.0.


 

Jump to different Forum... 






Register for Synergy 2010

Articles
Design without Borders, yet with Structure
CMS400.NET and Adobe Flex
GeoMapping
EkML Ektron Markup Language
Taxonomy

[First] [Previous] [Next] [Last]


See All Articles