Hello,
Using FS_REFERENCE name i have to get the name of the selected page.But it always shows undefined object?
Why this behavious is happening? I am working with FS4.2 version.
Error:
de.espirit.firstspirit.parser.eval.NullEnhancer$Null#getValue()
Form:
<FS_LIST name="stFilters" hFill="yes">
<DATASOURCE type="database" useLanguages="no">
<ACTIONS>
<ACTION name="ADD"/>
<ACTION name="NEW"/>
<ACTION name="REMOVE"/>
<ACTION name="UP"/>
<ACTION name="DOWN"/>
<ACTION name="COPY"/>
<ACTION name="DETACH"/>
<ACTION name="EDIT"/>
</ACTIONS>
<COLUMNS>
<COLUMN show="no">#identifier</COLUMN>
</COLUMNS>
<LAYOUT>
<ADD component="overview" constraint="center"/>
<ADD component="stackedview" constraint="bottom"/>
<ADD component="toolbar" constraint="top"/>
</LAYOUT>
<QUERY name="filter.filter_filter">
<PARAM name="clientID">bgn</PARAM>
<PARAM name="feedType">news</PARAM>
</QUERY>
<TABLE>filter.filter</TABLE>
</DATASOURCE>
<LANGINFOS>
<LANGINFO lang="*" label="verfügbare Filter"/>
<LANGINFO lang="EN" label="available Filters"/>
</LANGINFOS>
</FS_LIST>
<FS_REFERENCE name="stWCMSConfigurator" allowEmpty="no" hFill="yes" imagePreview="no" useLanguages="no">
<FILTER>
<ALLOW type="pageref"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="WCMS Configurator" description="TEXT"/>
<LANGINFO lang="DE" label="WCMS Konfigurator" description="TEXT"/>
</LANGINFOS>
<PROJECTS>
<LOCAL name=".">
<SOURCES>
<FOLDER name="root" store="sitestore"/>
</SOURCES>
</LOCAL>
</PROJECTS>
</FS_REFERENCE>
Template HTML Source:
$CMS_IF(!#global.preview)$
$-- get data from page --$
$CMS_SET(setPageData,stWCMSConfigurator.getPageRef().getPage().getFormData())$
$-- get wcms context --$
$CMS_SET(setContextRef,setPageData.get(#global.language,"ptWCMSContext").get())$
$CMS_SET(setContext,setContextRef.getValue().name)$
<span class="testing0" style="display:none">$CMS_VALUE(stWCMSConfigurator)$</span>
<span class="testing1" style="display:none">$CMS_VALUE(stWCMSConfigurator.getPageRef())$</span>
<span class="testing2" style="display:none">$CMS_VALUE(stWCMSConfigurator.getPageRef().getPage())$</span>
<span class="testing3" style="display:none">$CMS_VALUE(stWCMSConfigurator.getPageRef().getPage().getFormData())$</span>
<span class="testing4" style="display:none">$CMS_VALUE(setPageData.get(#global.language,"ptWCMSContext"))$</span>
<span class="testing5" style="display:none">$CMS_VALUE(setPageData.get(#global.language,"ptWCMSContext").get())$</span>
<span class="testing6" style="display:none">$CMS_VALUE(setPageData.get(#global.language,"ptWCMSContext").get().getValue())$</span>
<span class="lap_newsparams" style="display:none"></span>
<span class="lap_urlparams" style="display:none"></span>
<span class="lap_context" style="display:none">$CMS_VALUE(setContext,default:"news")$</span>
output:

Actual output value for lap_context is: news
Thank you.