typo3 double quotes in hash __trustedProperties 'The HMAC of the form could not be validated.' - typo3-11.x

thank you for your support.
I created a form with select options. The fields are filled with arrays provided with the settings variable.
The field in __trustedProperties quoted with the "-sign. This results in "{" as hash.
[__trustedProperties]" value="{"newRfichip":{"id":1,"status":1,"location":1,"personid":1}}2ec7e718db7f0844040e31baaa69a8452a650302" />
Normaly there should be & quot; instead the "-sign.
[__trustedProperties]" value="{& quot;newRfichip& quot;:{& quot;id& quot;:1,& quot;status& quot;:1,& quot;location& quot;:1,& quot;personid& quot;:1}}2ec7e718db7f0844040e31baaa69a8452a650302" />
I get always an exception 'The HMAC of the form could not be validated.'
I'm grateful for every hint, how i can solve this problem
FormFields.html
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<label for="id">
<f:translate key="tx_bbaorfichip_domain_model_rfichip.id" />
</label><br />
<f:form.textfield property="id" id="id" /><br />
<br\>
<f:debug>{_all}</f:debug>
<f:debug>{__trustedProperties}</f:debug>
<br\>
<label for="status">
<f:translate key="tx_bbaorfichip_domain_model_rfichip.status" />
</label><br />
<f:form.select property="status" id="status"
options="{settings.stati}"
value="4"
optionValueField="status"
optionLabelField="status" />
<br />
<label for="location">
<f:translate key="tx_bbaorfichip_domain_model_rfichip.location" />
</label><br />
<f:form.select property="location" id="location"
options="{settings.location}"
value="4"
optionValueField="location"
optionLabelField="location" />
<br />
<label for="personid">
<f:translate key="tx_bbaorfichip_domain_model_rfichip.personid" />
</label><br />
<f:form.select property="personid" id="personid"
options="{settings.personid}"
optionValueField="personid"
optionLabelField="personid" />
<br />
</html>

Related

How do I bind a model propery to table row selector in SAPUI5?

I'm using a Sap.M.Table, which should have a column of checkboxes bound to data. The Checkbox that shows up with MultiToggle selection seems to be a prettier solution all around, but how do I bind that particular checkbox (i.e. the 'row is selected' property) to my boolean property in my model?
I can't find any information about this seemingly simple thing anywhere.
My table is currently setup with a rows aggregation, and Column definitions that contain templates. I did try changing the rows aggregation to an items aggregation and then moved the content of my templates to the cells aggregation from the Items element in the xml, but as soon as I included the Items element, I got the 404 on sap.m.Items.js
<tab:Table
rows="{
path: '/Items'
}"
selectionMode="None"
visibleRowCountMode="Auto"
class="sapUiNoMargin"
>
<tab:columns>
<tab:Column width="4rem" sortProperty="StatusBool">
<Label text="Book" />
<tab:template>
<Checkbox selected="{Selected}" enabled="{StatusBool}" select="OnBookSelect" />
</tab:template>
</tab:Column>
<tab:Column width="6rem" sortProperty="ProdOrder">
<Label text="Production Order" />
<tab:template>
<Button text="{ProdOrder}" icon="sap-icon://inspection" width="100%" visible="{=!!${ProdOrder}}" press="OnProdOrderPress" />
</tab:template>
</tab:Column>
<tab:Column width="14rem" sortProperty="ItemCode">
<Label text="Item Code" />
<tab:template>
<Label text="{ItemCode}" />
</tab:template>
</tab:Column>
<tab:Column width="10rem" sortProperty="Op">
<Label text="Op" />
<tab:template>
<Label text="{Op}" />
</tab:template>
</tab:Column>
<tab:Column width="8rem" sortProperty="PlanQty">
<Label text="Planned Time" />
<tab:template>
<Label text="{PlanQty}" />
</tab:template>
</tab:Column>
</tab:Columns>
</tab:Table>

<p:schedule> doesn't display in the presence of jquery

I'm trying to display a primefaces schedule on a xhtml page but this doesn't work.
As said in this question, i eliminated Components which uses Ajax and i noticed that
when i commented the link referencing the jquery file the schedual is displayed and it works fine but of course other jquery stop to work and i also got the following JS error :
TypeError: b3 is undefined # http://localhost:8080/theprojectname/javax.faces.resource/jquery/jquery.js.xhtml?ln=primefaces:14
When i uncomment the link for the jquery reference file the schedual isn't displayed and i got 2 JS errors :
TypeError: this.jq.mask is not a function # http://localhost:8080/theprojectname/javax.faces.resource/primefaces.js.xhtml?ln=primefaces:16
and :
TypeError: this.jqc.fullCalendar is not a function # http://localhost:8080/theprojectname/javax.faces.resource/schedule/schedule.js.xhtml?ln=primefaces:1
This have happened with the PF version 4.3.1 and the 5.3.
This is my index.xhtml :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html>
<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:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="CSS/general.css" type="text/css" />
<link rel="stylesheet" href="CSS/jquery-ui-1.10.0.custom.min.css"
type="text/css" />
<!-- This is the jquery file reference link i've commented : -->
<!-- <script src="JS/jquery-1.8.3.js" /> -->
<script src="JS/jquery-ui-1.10.0.custom.js" />
<script src="JS/jquery.flip.js" />
<script src="JS/jquerygen.js" />
<title>my app</title>
<script>
//<![CDATA[
//]]>
</script>
</h:head>
<body>
<f:view>
<h:form id="form1">
<h:panelGroup id="windsarea" layout="block">
<h:panelGroup id="gesevntsincl" layout="block">
<p:growl id="messages" showDetail="true" />
<p:schedule id="schedule" value="#{scheduleController.eventModel}"
widgetVar="myschedule">
<p:ajax event="dateSelect"
listener="#{scheduleController.onDateSelect}"
update="eventDetails" oncomplete="eventDialog.show()" />
<p:ajax event="eventSelect"
listener="#{scheduleController.onEventSelect}"
update="eventDetails" oncomplete="eventDialog.show()" />
<p:ajax event="eventMove"
listener="#{scheduleController.onEventMove}" update="messages" />
<p:ajax event="eventResize"
listener="#{scheduleController.onEventResize}" update="messages" />
</p:schedule>
<p:dialog widgetVar="eventDialog" header="Event Details"
showEffect="clip" hideEffect="clip">
<h:panelGrid id="eventDetails" columns="2">
<h:outputLabel for="title" value="Title:" />
<p:inputText id="title" value="#{scheduleController.event.title}"
required="true" />
<h:outputLabel for="from" value="From:" />
<p:inputMask id="from"
value="#{scheduleController.event.startDate}" mask="99/99/9999">
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:inputMask>
<h:outputLabel for="to" value="To:" />
<p:inputMask id="to" value="#{scheduleController.event.endDate}"
mask="99/99/9999">
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:inputMask>
<h:outputLabel for="allDay" value="All Day:" />
<h:selectBooleanCheckbox id="allDay"
value="#{scheduleController.event.allDay}" />
<p:commandButton type="reset" value="Reset" />
<p:commandButton id="addButton" value="Save"
actionListener="#{scheduleController.addEvent}"
oncomplete="myschedule.update();eventDialog.hide();" />
</h:panelGrid>
</p:dialog>
</h:panelGroup>
</h:panelGroup>
<div id="tasksbar" />
<div id="startbutn" />
<h:panelGroup id="startmenudiv">
<h:panelGroup id="substartmenudiv" />
</h:panelGroup>
<div style="visibility: hidden;">
<BR />
<BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR />
<BR />
</div>
<div id="loginbackground" />
<div id="logindivflip">
<div id="logindiv">
<br />
<div class="hidden" style="font-weight: 900;">Welcome,please
authentificate :</div>
<br />
<div class="hidden">
<h:outputText value="login :" />
<h:inputText class="rounded" value="#{userBean.login}" />
</div>
<br /> <br />
<div class="hidden">
<h:outputText value="password :" />
<h:inputText class="rounded" value="#{userBean.pwd}" />
</div>
<br /> <br />
<div class="hidden">
<span class="ebbtn"> <a id="logsubmitbtn" href=""
title="Reset" onclick="">Submit <f:ajax event="click"
execute="#this" listener="#{userBean.verifierUserDsLdap}" />
</a> <a id="resetbtn" href="" title="Reset" onclick="">Reset</a>
</span>
</div>
</div>
<div id="loginphoto" />
</div>
<p:remoteCommand name="addNewWindow"
actionListener="#{userBean.addNewWindow}">
<f:param name="windowname" />
</p:remoteCommand>
<p:remoteCommand name="updatewinstylprops"
actionListener="#{userBean.updatewinstylprops}">
<f:param name="windowid" />
<f:param name="top" />
<f:param name="left" />
<f:param name="width" />
<f:param name="height" />
</p:remoteCommand>
</h:form>
</f:view>
</body>
</html>
Does someone have a clue please?
You should not include additionals jquerys into your pages, cause its already bundled with primefcaes...
Also , use h:outputScript instead of <script and h:outputStylesheet instead of link
So your js include should look like this (notice that I first included explicitly the jquery bundled with primefaces
<h:head>
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:outputScript name="JS/jquery.flip.js" target="head" />
<h:outputScript name="JS/jquerygen.js" target="head" />
place you JS folder under the resources folder in your WebContent folder
You should also read this What is the JSF resource library for and how should it be used?

Components with <f:ajax> do not work when a <p:schedual> exists on the same page in JSF2

As said in this question's answer :
"Components which uses Ajax. If you don't need it, disable Ajax"
a p:schedual isn't displayed if there are others components with an f:ajax in the same page.
i noticed that if these components are written in the code after the schedual, the latter can be displayed but these components do not respond to user interactions anymore (I've an example of code in a previous question i've asked).
So, what if i "need them to work" ? is the schedual designed to work only alone and disable other components to share the ajax functionalities with it ?!
This the code in which i used the schedual :
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html>
<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:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="CSS/general.css" type="text/css" />
<link rel="stylesheet" href="CSS/jquery-ui-1.10.0.custom.min.css"
type="text/css" />
<script src="JS/jquery-ui-1.10.0.custom.js" />
<script src="JS/jquery.flip.js" />
<script src="JS/jquerygen.js" />
<title>my app</title>
</h:head>
<body>
<f:view>
<h:form id="form1">
<h:panelGroup id="windsarea" layout="block">
<h:panelGroup id="gesevntsincl" layout="block">
<p:growl id="messages" showDetail="true" />
<p:schedule id="schedule" value="#{scheduleController.eventModel}"
widgetVar="myschedule">
<p:ajax event="dateSelect"
listener="#{scheduleController.onDateSelect}"
update="eventDetails" oncomplete="eventDialog.show()" />
<p:ajax event="eventSelect"
listener="#{scheduleController.onEventSelect}"
update="eventDetails" oncomplete="eventDialog.show()" />
<p:ajax event="eventMove"
listener="#{scheduleController.onEventMove}" update="messages" />
<p:ajax event="eventResize"
listener="#{scheduleController.onEventResize}" update="messages" />
</p:schedule>
<p:dialog widgetVar="eventDialog" header="Event Details"
showEffect="clip" hideEffect="clip">
<h:panelGrid id="eventDetails" columns="2">
<h:outputLabel for="title" value="Title:" />
<p:inputText id="title" value="#{scheduleController.event.title}"
required="true" />
<h:outputLabel for="from" value="From:" />
<p:inputMask id="from"
value="#{scheduleController.event.startDate}" mask="99/99/9999">
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:inputMask>
<h:outputLabel for="to" value="To:" />
<p:inputMask id="to" value="#{scheduleController.event.endDate}"
mask="99/99/9999">
<f:convertDateTime pattern="dd/MM/yyyy" />
</p:inputMask>
<h:outputLabel for="allDay" value="All Day:" />
<h:selectBooleanCheckbox id="allDay"
value="#{scheduleController.event.allDay}" />
<p:commandButton type="reset" value="Reset" />
<p:commandButton id="addButton" value="Save"
actionListener="#{scheduleController.addEvent}"
oncomplete="myschedule.update();eventDialog.hide();" />
</h:panelGrid>
</p:dialog>
</h:panelGroup>
</h:panelGroup>
<div id="tasksbar" />
<div id="startbutn" />
<h:panelGroup id="startmenudiv">
<h:panelGroup id="substartmenudiv" />
</h:panelGroup>
<div style="visibility: hidden;">
<BR />
<BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR /> <BR />
<BR /> <BR /> <BR />
<BR />
</div>
<div id="loginbackground" />
<div id="logindivflip">
<div id="logindiv">
<br />
<div class="hidden" style="font-weight: 900;">Welcome,please
authentificate :</div>
<br />
<div class="hidden">
<h:outputText value="login :" />
<h:inputText class="rounded" value="#{userBean.login}" />
</div>
<br /> <br />
<div class="hidden">
<h:outputText value="password :" />
<h:inputText class="rounded" value="#{userBean.pwd}" />
</div>
<br /> <br />
<div class="hidden">
<span class="ebbtn"> <a id="logsubmitbtn" href=""
title="Reset" onclick="">Submit <f:ajax event="click"
execute="#this" listener="#{userBean.verifierUserDsLdap}" />
</a> <a id="resetbtn" href="" title="Reset" onclick="">Reset</a>
</span>
</div>
</div>
<div id="loginphoto" />
</div>
<p:remoteCommand name="addNewWindow"
actionListener="#{userBean.addNewWindow}">
<f:param name="windowname" />
</p:remoteCommand>
<p:remoteCommand name="updatewinstylprops"
actionListener="#{userBean.updatewinstylprops}">
<f:param name="windowid" />
<f:param name="top" />
<f:param name="left" />
<f:param name="width" />
<f:param name="height" />
</p:remoteCommand>
</h:form>
</f:view>
</body>
</html>
THanks for help!

Unable to pass a variable parameter to jasper report

So, I have created a simple CRUD app using groovy on grails and I want to use jasper reporting plugin to get some simple reports on the database. I have set up a simple G:select to pick from a drop down list, and hitting the PDF icon I am bringing back a blank page. gsp is below
<div id="page-body" role="main">
<p>Please select one of the following options</p>
<div>
<g:select optionKey="id"
optionValue="artist"
name="artist"
id="MusicCatalogue"
value="${artist}"
from="${multicatalogue.MusicCatalogue.list()}">
</g:select>
</div>
<div> <g:jasperReport jasper="report1" format="PDF" name="Music Catalogue" />
<input type="hidden" name="artist" value="${artist}" />
</div>
</div>
and then the jrxml looks like the below
<parameter name="artist" isForPrompting="true" class="java.lang.String">
<defaultValueExpression><![CDATA["<parameter error>"]]></defaultValueExpression>
</parameter>
<queryString language="SQL">
<![CDATA[SELECT *
FROM
MusicCatalogue where ARTIST = $P{artist}]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="ALBUM" class="java.lang.String"/>
<field name="ARTIST" class="java.lang.String"/>
<field name="TRACK" class="java.lang.String"/>
<group name="ARTIST">
ideas????
Try replace
<g:jasperReport jasper="report1" format="PDF" name="Music Catalogue" />
<input type="hidden" name="artist" value="${artist}" />
With
<g:jasperReport jasper="report1" format="PDF" name="Music Catalogue">
<input type="hidden" name="artist" value="${artist}" />
</g:jasperReport>
Also, make sure that ${artist} returns a string value, else the report will use the defaultValue of artist parameter that might ruin your query.

Grails Jasper hidden parameter

I am creating a basic report wherein I could pass the domain model passed by the controller to the view and use that instance as a parameter for the report.
Here the part of the <g:jasperReport> in the view[.gsp]
Note: ${user} is an instance of User inside the domain classes having those string properties: lastName, firstName, middleName
<g:jasperReport
jasper="reportByUser"
format="pdf, html">
<input type="hidden" name="u_lastName" value="${user.lastName}" />
<input type="hidden" name="u_firstName" value="${user.firstName}" />
<input type="hidden" name="u_middleName" value="${user.middleName}" />
</g:jasperReport>
Here the part of the xml code inside the reportByUser.jrxml
<parameter name="user_lastName" class="java.lang.String" />
<parameter name="user_firstName" class="java.lang.String" />
<parameter name="user_middleName" class="java.lang.String" />
The problem is when I run the report on the grails, either format return a blank page.
In:
<g:jasperReport
jasper="reportByUser"
format="pdf, html">
<input type="hidden" name="u_lastName" value="${user.lastName}" />
<input type="hidden" name="u_firstName" value="${user.firstName}" />
<input type="hidden" name="u_middleName" value="${user.middleName}" />
</g:jasperReport>
You are passing: name="u_lastName"
But in the jasper file is specting: name="user_lastName"
Check it...

Resources