I'm trying to create a simple mobile xPage app and am getting the following error when attempting to open a document:
dojox.mobile.view#preformTransition: destination view not found: null
I'm using multiple application page controls inside a single page control and have verified no typos in the page name references.
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex">
<xe:singlePageApp id="singlePageApp1" selectedPageName="homePage">
<!-- Start of Home Page -->
<xe:appPage id="appPage0" pageName="homePage">
<xe:djxmHeading id="djxmHeading2" label="MOM Directory"></xe:djxmHeading>
<xe:djxmRoundRectList id="djxmRoundRectList1">
<xe:djxmLineItem id="djxmLineItem1" label="Everyone"
moveTo="#viewPageEveryone">
</xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem2" label="Lakeville"
moveTo="#viewPageLakeville">
</xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem3" label="Minneapolis"></xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem4" label="Northfield"></xe:djxmLineItem>
</xe:djxmRoundRectList>
</xe:appPage>
<!-- End of Home Page -->
<!-- Start of view Page Everyone -->
<xe:appPage id="appPage1" pageName="viewPageEveryone" resetContent="true">
<xe:djxmHeading id="djxmHeading1" label="Everyone View"></xe:djxmHeading>
<xe:dataView id="dataView1" openDocAsReadonly="true"
rows="9" pageName="#documentPage">
<xp:this.facets>
<xp:link escape="true" id="link1" xp:key="pagerBottomLeft"
text="More">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<xe:addRows for="dataView1" disableId="link1">
</xe:addRows>
</xp:this.script>
</xp:eventHandler>
</xp:link>
</xp:this.facets>
<xe:this.data>
<xp:dominoView var="view1" viewName="ALL">
</xp:dominoView>
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="last_name"></xe:viewSummaryColumn>
</xe:this.summaryColumn>
</xe:dataView>
</xe:appPage>
<!-- End of view Page everyone -->
<!-- Start of view Page Lakeville -->
<xe:appPage id="appPage3" pageName="viewPageLakeville" resetContent="true">
<xe:djxmHeading id="djxmHeading3" label="Lakeville View"></xe:djxmHeading>
<xe:dataView id="dataView2" openDocAsReadonly="true"
rows="9" pageName="#documentPage">
<xp:this.facets>
<xp:link escape="true" id="link2" xp:key="pagerBottomLeft"
text="More">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<xe:addRows for="dataView2" disableId="link2">
</xe:addRows>
</xp:this.script>
</xp:eventHandler>
</xp:link>
</xp:this.facets>
<xe:this.data>
<xp:dominoView var="view2" viewName="LKVL">
</xp:dominoView>
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="last_name"></xe:viewSummaryColumn>
</xe:this.summaryColumn>
</xe:dataView>
</xe:appPage>
<!-- End of view Page Lakeville -->
<!-- Start of Document Page -->
<xe:appPage id="appPage2" pageName="documentPage" resetContent="true" preload="true">
<xe:djxmHeading id="documentPageHeading" back="Back" label="Document" moveTo="homePage"></xe:djxmHeading>
<xp:panel>
<xp:this.data>
<xp:dominoDocument var="document1"
formName="frmBB">
</xp:dominoDocument>
</xp:this.data>
</xp:panel>
</xe:appPage>
<!-- End of Document Page -->
</xe:singlePageApp>
I've searched a lot and found several references to this error but nothing so far that helps. I'm running a 8.5.3 FP3 server with UP1 and Notes 9 Beta Designer client.
Thanks in advance.
I've tried this out on 9.0 and your markup Shean works fine. I had to point it to different data sources but all in all it works.
This is what I used...
<xe:singlePageApp id="singlePageApp1" selectedPageName="homePage">
<!-- Start of Home Page -->
<xe:appPage id="appPage0" pageName="homePage">
<xe:djxmHeading id="djxmHeading2" label="MOM Directory"></xe:djxmHeading>
<xe:djxmRoundRectList id="djxmRoundRectList1">
<xe:djxmLineItem id="djxmLineItem1" label="Everyone"
moveTo="#viewPageEveryone">
</xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem2" label="Lakeville">
</xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem3" label="Minneapolis"></xe:djxmLineItem>
<xe:djxmLineItem id="djxmLineItem4" label="Northfield"></xe:djxmLineItem>
</xe:djxmRoundRectList>
</xe:appPage>
<!-- End of Home Page -->
<!-- Start of view Page Everyone -->
<xe:appPage id="appPage1" pageName="viewPageEveryone" resetContent="true">
<xe:djxmHeading id="djxmHeading1" label="Everyone View"></xe:djxmHeading>
<xe:dataView id="dataView1" openDocAsReadonly="true"
rows="9" pageName="#documentPage">
<xp:this.facets>
<xp:link escape="true" id="link1" xp:key="pagerBottomLeft"
text="More">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<xe:addRows for="dataView1" disableId="link1">
</xe:addRows>
</xp:this.script>
</xp:eventHandler>
</xp:link>
</xp:this.facets>
<xe:this.data>
<xp:dominoView var="view1" viewName="v01">
</xp:dominoView>
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="subject"></xe:viewSummaryColumn>
</xe:this.summaryColumn>
</xe:dataView>
</xe:appPage>
<!-- End of view Page everyone -->
<!-- Start of view Page Lakeville -->
<xe:appPage id="appPage3" pageName="viewPageLakeville" resetContent="true">
<xe:djxmHeading id="djxmHeading3" label="Lakeville View"></xe:djxmHeading>
<xe:dataView id="dataView2" openDocAsReadonly="true"
rows="9" pageName="#documentPage">
<xp:this.facets>
<xp:link escape="true" id="link2" xp:key="pagerBottomLeft"
text="More">
<xp:eventHandler event="onclick" submit="false">
<xp:this.script>
<xe:addRows for="dataView2" disableId="link2">
</xe:addRows>
</xp:this.script>
</xp:eventHandler>
</xp:link>
</xp:this.facets>
<xe:this.data>
<xp:dominoView var="view2" viewName="LKVL">
</xp:dominoView>
</xe:this.data>
<xe:this.summaryColumn>
<xe:viewSummaryColumn columnName="last_name"></xe:viewSummaryColumn>
</xe:this.summaryColumn>
</xe:dataView>
</xe:appPage>
<!-- End of view Page Lakeville -->
<!-- Start of Document Page -->
<xe:appPage id="appPage2" pageName="documentPage"
resetContent="true" preload="true">
<xe:djxmHeading id="documentPageHeading" back="Back"
label="Document" moveTo="homePage">
</xe:djxmHeading>
<xp:panel>
<xp:this.data>
<xp:dominoDocument var="document1" formName="f01">
</xp:dominoDocument>
</xp:this.data>
<xe:formTable id="formTable1">
<xe:formRow id="formRow1" label="Subject: ">
<xp:inputText id="inputText1"
value="#{document1.subject}">
</xp:inputText>
</xe:formRow>
</xe:formTable>
</xp:panel>
</xe:appPage>
<!-- End of Document Page -->
Maybe there is something else going on with the app itself that is spoiling things for you.
You don't have your app set to a specific Dojo version? Or any other restriction like that?
Related
I have created this VoiceXML code to ask the user to fill in some data, which is then supposed to be stored in the database.
When I run the code through Postman to simulate the request, I don't get any errors back. But when I actually run and call my Python/Django voice application I get an 'internal error' back once my application reaches that part.
The VoiceXML output:
<?xml version="1.0" encoding="UTF-8"?>
<!--- <vxml version = "2.1" > -->
<!DOCTYPE vxml SYSTEM "http://www.w3.org/TR/voicexml21/vxml.dtd">
<vxml xmlns="http://www.w3.org/2001/vxml"
version="2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/2007/REC-voicexml21-20070619/vxml.xsd">
<!---<property name="inputmodes" value="dtmf" /> -->
<!-- Kasadaka VoiceXML File -->
<form id="input_form">
<property name="inputmodes" value="dtmf" />
<property name="interdigittimeout" value="2s"/>
<property name="timeout" value="4s"/>
<property name="termchar" value="#" />
<field name="DTMF_input" type="digits?maxlength=5">
<prompt>
<audio src="/uploads/petrichor_here_you_can_fill_in_your_farmer_id_en_QL7Xu6T.wav"/>
</prompt>
</field>
<block>
<prompt>
<audio src="/uploads/petrichor_thank_you_for_your_input_en_rFaZyF5.wav"/>
</prompt>
<filled namelist="DTMF_input">
<submit src=" /vxml/InputData/34/18" namelist="DTMF_input" method="post"/>
</filled>
</block>
</form>
</vxml>
And if needed, the code that is supposed to save the input:
def InputData(request, element_id, session_id):
input_element = get_object_or_404(InputData_model, pk=element_id)
voice_service = input_element.service
session = lookup_or_create_session(voice_service, session_id)
if request.method == "POST":
session = get_object_or_404(CallSession, pk=session_id)
value = 'DTMF_input'
result = UserInput()
result.session = session
result.category = input_element.input_category
result.save()
return redirect(request.POST['redirect'])
session.record_step(input_element)
context = input_generate_context(input_element, session)
context['url'] = request.get_full_path(False)
return render(request, 'input.xml', context, content_type='text/xml')
Is my VoiceXML code correct if I want the user to be able to fill in numbers through DTMF and then store that data into my model? Or am I missing something important for it to work?
EDIT: Error Logs:
============================================================
Error Summary
============================================================
An error occurred while executing the following dialog.
Initial URL1: http://petrichor-rain-system.herokuapp.com/vxml/start/3
Initial URL2: null
Initial URL3: null
Current URL: /vxml/choice/35/26
Calling Number (ANI): 447520631888
Called Number (DNIS): 9991494860
Redirecting Number (RDNIS): ""
State: hello-and-welcome
VoiceXML Browser Version: 16.0.25.88606
Date/Time: 2019/4/18 10:4:29.387
VoiceException:
error.badfetch
Could not compile document: http://petrichor-rain-system.herokuapp.com/vxml/InputData/33/26
Dialog stack trace:
State (Dialog) URL (Document)
-------------- ------------------------------
hello-and-welcome http://petrichor-rain-system.herokuapp.com/vxml/choice/35/26
============================================================
Current Document
============================================================
<?xml version="1.0" encoding="UTF-8"?>
<!--- <vxml version = "2.1" > -->
<!DOCTYPE vxml SYSTEM "http://www.w3.org/TR/voicexml21/vxml.dtd">
<vxml xmlns="http://www.w3.org/2001/vxml"
version="2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/2007/REC-voicexml21-20070619/vxml.xsd">
<meta name="maintainer" content="email" />
<property name="inputmodes" value="dtmf" />
<!-- Kasadaka VoiceXML File -->
<form id="hello-and-welcome">
<field name="choice">
<prompt>
<audio src="/uploads/petrichor_hello_welcome_en_AwoXmq3.wav"/>
<audio src="/uploads/pre_choice_option_en.wav"/>
<audio src="/uploads/petrichor_press_one_to_listen_to_explanation_en_L6iqUHW.wav"/>
<audio src="/uploads/post_choice_option_en.wav"/>
<audio src="/uploads/1_en.wav"/>
<audio src="/uploads/pre_choice_option_en.wav"/>
<audio src="/uploads/petrichor_press_two_to_fill_in_collected_data_en_zXRGSby.wav"/>
<audio src="/uploads/post_choice_option_en.wav"/>
<audio src="/uploads/2_en.wav"/>
<audio src="/uploads/pre_choice_option_en.wav"/>
<audio src="/uploads/petrichor_press_three_to_stop_the_call_en_bOL0PDC.wav"/>
<audio src="/uploads/post_choice_option_en.wav"/>
<audio src="/uploads/3_en.wav"/>
</prompt>
<grammar xml:lang="en-US" root = "MYRULE" mode="dtmf">
<rule id="MYRULE" scope = "public">
<one-of>
<item>1</item>
<item>2</item>
<item>3</item>
</one-of>
</rule>
</grammar>
<filled>
<if cond="choice == '1'">
<goto next="/vxml/message/18/26"/>
<elseif cond="choice == '2'" />
<goto next="/vxml/InputData/33/26"/>
<elseif cond="choice == '3'" />
<goto next="/vxml/choice/22/26"/>
<else/>
</if>
</filled>
</field>
</form>
</vxml>
To post the results back to the server, you need to use the submit element and not the goto element.
<submit src="/vxml/InputData/34/8" namelist="DTMF_input" method="post"/>
See details in the VoiceXML specification.
We have a site where Google Tag Manager seems to be blocking the saving of changes in the HTML Module. GTM is implemented to spec and otherwise functions the way we expect.
When Google Tag Manager is on the page HTML Module changes do not save. When it's removed changes save properly.
No javascript errors are being thrown. No DNN Admin Log errors are being recorded.
I am searching for answers and hoping someone else has seen this before.
To insert GTM I am using the following as my SiteAnalytics.config and GoogleAnalytics.config:
<!-- SiteAnalytics.config -->
<?xml version="1.0" encoding="utf-8" ?>
<AnalyticsEngineConfig>
<Engines>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
<ElementId>Head</ElementId>
<InjectTop>True</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','[TRACKING_ID]');</script>
<!-- End Google Tag Manager -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '[TRACKING_ID]');
</script>
]]>
</ScriptTemplate>
</AnalyticsEngine>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
<ElementId>Body</ElementId>
<InjectTop>True</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=[TRACKING_ID]"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
]]>
</ScriptTemplate>
</AnalyticsEngine>
</Engines>
</AnalyticsEngineConfig>
<!-- GoogleAnalytics.config -->
<?xml version="1.0" encoding="utf-8"?>
<AnalyticsConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Settings>
<AnalyticsSetting>
<SettingName>TrackingId</SettingName>
<SettingValue>GTM-CODEHERE</SettingValue>
</AnalyticsSetting>
<AnalyticsSetting>
<SettingName>UrlParameter</SettingName>
<SettingValue />
</AnalyticsSetting>
<AnalyticsSetting>
<SettingName>TrackForAdmin</SettingName>
<SettingValue>true</SettingValue>
</AnalyticsSetting>
</Settings>
</AnalyticsConfig>
So far I have tried:
removing all tags from GTM except Universal Analytics
setting the GTM code to .defer=true instead of .async=true (see Google Tag Manager delaying window.load?)
minimizing my theme (skin.ascx) by removing my custom javascript
loading GTM on DOMContentLoaded (see JavaScript that executes after page load)
Validating the skin template the W3C's HTML checker
Continuing on today.
This was a strange issue with a stranger solution, so strange that I should probably change the title of the question. Maybe the site with this issue was a one-off but just in case here is the answer.
I discovered that it wasn't Google Analytics code causing the issue but something in DNN that was conflicting between SiteAnalytics.config and the DNN HTML module. In the code snippet below (from SiteAnalytics.config) I was inserting the noscript tag for GTM using this XML:
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
<ElementId>Body</ElementId>
<InjectTop>True</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=[TRACKING_ID]"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
]]>
</ScriptTemplate>
</AnalyticsEngine>
I discovered by accident that my issue was resolved when I removed everything between the CDATA tags or the whole CDATA itself. Next I tried reinserting the noscript while changing InjectTop from True to False. That also solved my issue.
So what I know is that injecting anything at the top of the Body using SiteAnalytics.config caused a conflict with the DNN HTML module on this particular site. One would assume that this would be due to some bad HTML on the page or a custom script causing a conflict. However I validated the template through W3C's checker and there were no issues. I also removed all our custom scripts to no avail. So the exact mechanism of the original conflict is unknown but the issue is solved. Below is the updated code:
<!-- SiteAnalytics.config -->
<?xml version="1.0" encoding="utf-8" ?>
<AnalyticsEngineConfig>
<Engines>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
<ElementId>Head</ElementId>
<InjectTop>True</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','[TRACKING_ID]');</script>
<!-- End Google Tag Manager -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '[TRACKING_ID]');
</script>
]]>
</ScriptTemplate>
</AnalyticsEngine>
<AnalyticsEngine>
<EngineType>DotNetNuke.Services.Analytics.GoogleAnalyticsEngine, DotNetNuke</EngineType>
<ElementId>Body</ElementId>
<InjectTop>False</InjectTop>
<ScriptTemplate>
<![CDATA[
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=[TRACKING_ID]"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
]]>
</ScriptTemplate>
</AnalyticsEngine>
</Engines>
</AnalyticsEngineConfig>
<!-- GoogleAnalytics.config -->
<?xml version="1.0" encoding="utf-8"?>
<AnalyticsConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Settings>
<AnalyticsSetting>
<SettingName>TrackingId</SettingName>
<SettingValue>GTM-CODEHERE</SettingValue>
</AnalyticsSetting>
<AnalyticsSetting>
<SettingName>UrlParameter</SettingName>
<SettingValue />
</AnalyticsSetting>
<AnalyticsSetting>
<SettingName>TrackForAdmin</SettingName>
<SettingValue>true</SettingValue>
</AnalyticsSetting>
</Settings>
</AnalyticsConfig>
I want to add image in my extent report. I tried with the below code in my XML.
<?xml version="1.0" encoding="UTF-8"?>
<suite name="MYhoenixTestExecution" verbose="1" >
<!-- <listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter" />
<listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners> -->
<listeners>
<listener class-name="phoenix.report.ExtentReporterNG" />
</listeners>
<reportHeadline>Automation Report <image id="image-zoom">
<![CDATA[
<img src='C:\CATS\logo.png'/>
]]>
</image></reportHeadline>
<image id="image-zoom">
<![CDATA[
<img src='C:\CATS\logo.png'/>
]]>
</image>
<test name="Myphoenix_Login TC" >
<classes>
<class name="phoenix.testcases.Login_TC"/>
</classes>
</test>
But still unable to add logo. Please suggest.
I have successfully done that with ver3.1.2
This is my extent-config.xml below:
<?xml version="1.0" encoding="UTF-8"?>
<extentreports>
<configuration>
<!-- report theme -->
<!-- standard, dark -->
<theme>dark</theme>
<!-- document encoding -->
<!-- defaults to UTF-8 -->
<encoding>UTF-8</encoding>
<!-- protocol for script and stylesheets -->
<!-- defaults to https -->
<protocol>https</protocol>
<!-- title of the document -->
<documentTitle>TRAX</documentTitle>
<!-- report name - displayed at top-nav -->
<reportName>
<![CDATA[
<img src='.//myCompanyLogo.svg' />
]]>
</reportName>
<!-- location of charts in the test view -->
<!-- top, bottom -->
<testViewChartLocation>bottom</testViewChartLocation>
<!-- custom javascript -->
<scripts>
<![CDATA[
$(document).ready(function() {
});
]]>
</scripts>
<!-- custom styles -->
<styles>
<![CDATA[
.report-name { padding-left: 10px; } .report-name > img { float:
left;height: 90%;margin-left: 30px;margin-top: 2px;width: auto; }
]]>
</styles>
</configuration>
</extentreports>
Please note that you have to take care of the location of the image. I have put the company logo in the Logo folder and copy it in the Reports folder before populating the html.report.
I have made a lot of progress in converting my JSF applications to book-markable pages, but I am wondering if I am doing it the right way. One question is that is there a best-practice location for the f:metadata tags?
My typical Facelets client page looks like this:
<ui:composition template="./pattern.xhtml">
<ui:define name="content">
<f:metadata>
<f:viewParam name="userId" value="#{bean.userId}" />
<f:viewParam name="startRecord" value="#{bean.startRecord}" />
<f:viewParam name="pageSize" value="#{bean.pageSize}" />
<f:viewParam name="sort" value="#{bean.sort}" />
</f:metadata>
<h1>Data Table</h1>
etc
So the f:metadata and child f:viewParam tags are encountered in the body of my page. My pattern.xhtml template also has a section (named "header") that could put these tags in the header section. Should they be put there? Does it make a difference or am I set up for some side effect I haven't seen yet?
Technically, it doesn't matter where you declare the <f:metadata> in the view as long as it's in the top level view (so, when using templating, in the template client and thus not in the master template). When the view get built, the metadata is basically not part of the JSF component tree, but of the view root (which you can obtain on a per-view basis by ViewDeclarationLanguage#getViewMetadata()).
Most self-documenting would be to put the <f:metadata> in the top of the view, so that you can see any metadata at first glance without the need to scroll to halfway or bottom the view source code.
When using a plain page, just put it right before the <h:head>.
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<f:metadata>
<f:viewParam name="userId" value="#{bean.userId}" />
<f:viewParam name="startRecord" value="#{bean.startRecord}" />
<f:viewParam name="pageSize" value="#{bean.pageSize}" />
<f:viewParam name="sort" value="#{bean.sort}" />
</f:metadata>
<h:head>
...
</h:head>
<h:body>
...
</h:body>
</html>
When using templating, the recommended approach, as stated in the <f:metadata> tag documentation, would be to declare a separate <ui:insert name="metadata"> in the master template and let the client define the <f:metadata> in an <ui:define name="metadata">.
<ui:composition template="/WEB-INF/pattern.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<ui:define name="metadata">
<f:metadata>
<f:viewParam name="userId" value="#{bean.userId}" />
<f:viewParam name="startRecord" value="#{bean.startRecord}" />
<f:viewParam name="pageSize" value="#{bean.pageSize}" />
<f:viewParam name="sort" value="#{bean.sort}" />
</f:metadata>
</ui:define>
<ui:define name="content">
<h1>Data Table</h1>
...
</ui:define>
</ui:composition>
Base on example from richface showcase:
http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=popup&sample=simplePopup&skin=blueSky
When I call the popup using #{rich:component, nothing happen (ie. no popup):
<a4j:commandLink styleClass="no-decor" execute="#this"
oncomplete="#{rich:component('popup')}.show()">
However when I change to using rich:componentControl, popup appear
<a4j:commandLink styleClass="no-decor" execute="#this">
<rich:componentControl target="popup" operation="show" />
Note: Both work find from GAE when I run from my local notebook but problem happen when I deploy to GAE online (http://cloudenterpriseapps.appspot.com/public/test/testPopup.jsf)
Any help?
Just solved by adding
<a4j:status onstart="#{rich:component('statPane')}.show()"
onstop="#{rich:component('statPane')}.hide()" />
...
<rich:popupPanel id="statPane" autosized="true">
<h:graphicImage value="/images/common/ai.gif" alt="ai" />
Please wait...
</rich:popupPanel>
Here the complete code and now work fine.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<ui:composition>
<h:head>
<title>RichFaces Showcase</title>
</h:head>
<h:body>
<a4j:status onstart="#{rich:component('statPane')}.show()"
onstop="#{rich:component('statPane')}.hide()" />
<a4j:commandLink styleClass="no-decor" execute="#this" render="#none"
action="#{dummyBean.methodCall}"
oncomplete="#{rich:component('popup')}.show()">
<h:graphicImage value="/images/icons/common/edit.gif" alt="edit" />
</a4j:commandLink>
<h:form id="myform">
<rich:popupPanel id="popup" modal="false" autosized="true"
resizeable="false">
<f:facet name="header">
<h:outputText value="Simple popup panel" />
</f:facet>
<f:facet name="controls">
<h:outputLink value="#"
onclick="#{rich:component('popup')}.hide(); return false;">
X
</h:outputLink>
</f:facet>
<p>Any content might be inside this panel.</p>
<p>
The popup panel is open and closed from the javascript function of
component client side object. The following code <a href="#"
onclick="#{rich:component('popup')}.hide()">hide this panel</a>:
<f:verbatim>#</f:verbatim>
{rich:component('popup')}.hide()
</p>
<a4j:commandButton value="Close" styleClass="no-decor"
execute="#this" render="#none" action="#{dummyBean.methodCall2}"
oncomplete="#{rich:component('popup')}.hide()"/>
<br />
</rich:popupPanel>
</h:form>
<rich:popupPanel id="statPane" autosized="true">
<h:graphicImage value="/images/common/ai.gif" alt="ai" />
Please wait...
</rich:popupPanel>
</h:body>
</ui:composition>
</html>