I'm having a problem with my application and #Max constraint annotation.
My controller method is defined like this:
public static void save(#Required #Max(255) String content)
Later in my code I have error check:
if (Validation.hasErrors()) {
render("Foo/bar.html", content);
}
The thing is, no matter what I post in the form (if it violates or not the constraint) I'm always getting error message that Cannot be greater than 255.
This is the text I'm, using for testing, 119 characters long:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ipsum enim, rhoncus eget volutpat at, posuere non eros.
Anyone had similar problem and knows how to solve it?
It sounds like you actually wanted to use #MaxSize to ensure that the length of the input was no more than 255.
Right now you're using #Max, which tries to convert the argument to a number to make sure it's numerically less than or equal to the given value. Your text can't be converted to a number, so the validation always fails in that case.
Related
I am using gravity forms and an addon called gravity PDF from Gravity Wiz. It allows to create PDF based on form entries. It allows 2 level of nested conditional tags, such as:
img1
I use a trick here. The tags are not the same (gravityform vs gravityforms). This trick allows 2 level of nested tags. I need 3 levels or more. Such as:
img2
But this doesn't work:
img3
The closing tags got issues.
FYI :
https://docs.gravityforms.com/conditional-shortcode/
https://gravitywiz.com/gravity-forms-conditional-shortcode/
The support said me they are not going to add this feature so I need to find a workaround.
I read the post from Dave here: Gravity Forms - Conditional merge tags - MULTIPLE Values in a single tag
Looking into this filter may be the solution:
add_filter('gform_shortcode_conditional', function ($result, $atts, $content)
What would be the easiest solution? adding a custom tag (gravityform2) or comparing 2 values into one single tag?
[gravityforms action="conditional" relation="all"
value="{Occupation du logement:114}" operator="is" compare="était occupé à titre payant et que le précédent locataire l’a quitté depuis moins de 18 mois"
value2="{Dernier loyer du logement:115}" operator2="is" compare2="ce nouveau loyer est identique au précédent ou seulement révisé"]
You're the perfect age.
[/gravityforms]
Someone can help?
Thanks!
I'm running a static site on Hugo, with some posts containing over 100+ footnotes [legal blog posts]. If I want to edit and add a footnote in the middle of the passage, right now, I have to renumber every single footnote.
Is there a Hugo [or Grunt] extension that allows me to assign "placeholders" for footnotes, and have them automatically change into numbers and place them in the right order upon build?
For example, I want to be able to write something like:
The quick brown fox[^foxes] jumped over the lazy dog[^dogs].
[^dogs]: Here is some dog info.
[^foxes]: Here is some fox info.
and have it automatically turned into
The quick brown fox[^1] jumped over the lazy dog[^2].
[^1]: Here is some fox info.
[^2]: Here is some dog info.
when I build the site. Note how it reordered the footnotes to match the order of appearance within the text, and also changed them to numbers.
Normally, I run hugo; grunt to build the site and it's hosted on Netlify.
If you use Blackfriday as the Markdown rendering engine (Goldmark replaced Blackfriday as the default rendering engine in Hugo release 0.60.0), then you can write your post like this:
Lorem ipsum[^foo] dolor sit amet[^bar], consectetur adipiscing elit[^3].
[^bar]: second footnote
[^3]: third footnote
[^foo]: first footnote
And it will turn into this:
Lorem ipsum[1] dolor sit amet[2], consectetur adipiscing elit[3].
1. first footnote ↑
2. second footnote ↑
3. third footnote ↑
Notice that you can use names instead of numbers when referencing footnotes, and that they will be displayed in the order of which they appear in the text, not in the order of the definitions.
Untitled Documenthtml,body{margin:0;padding:0}table{height:100%;width:100%;border-collapse:collapse}table td{vertical-align:top}.footer{position:fixed;height:100px;background:red;bottom:0;width:100%}tbody td{padding-bottom:100px}Header Lorem Ipsumis simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.content 1content 2content 3content 4content 5content 6content 7content 8content 9content 10content 11content 12content 13content 14content 15content 16content 17content 18content 19content 20content 21content 22content 23content 24content 25content 26content 27content 28content 29content 30content 31content 32content 33content 34content 35content 36content 37content 38content 39content 40content 41content 42content 43content 44content 45content 46content 47content 48content 49content 50content - lastFooter Lorem Ipsumis simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Try to apply position: fixed; rule to header and footer elements.
I'm trying to multiply the sum of a calculation performed in a function but I get the following error:
"Undefined operation: "pxToRem(4) times 3"
Whilst I could use rems directly it's a lot easier for me to work in pixels. Can anyone tell me why I'm getting this error and if there's a way to solve it? I'm not trying to multiply a string and I'm not multiplying a unit by a unit so I don't understand where the problem is.
// Declare px to rem function
$browser-context: 16;
#function pxToRem($pixels, $context: $browser-context) {
#return ($pixels / $context) * 1rem;
}
// Call the px to rem function
$column-unit: pxToRem(4);
// Multiply sum of px to rem function
$column-span: $column-unit * 3;
Thanks for any help.
If you want a convenient to think in rem, use body {font-size:62.5%;}. The rem will be as quick easily associated with px. E.g. 1.4rem=14px. It's an easier and more elegant method I feel.
https://www.sitepoint.com/understanding-and-using-rem-units-in-css/
As indicated in the comments #disinfor solved the problem. The code I posted was working but on my development server I was importing the function from another file that wasn't being referenced correctly. The lesson I learnt is to import all your files into one main.scss as normal and don't try to cross import them.
In handlebars, I have this code
<p>
{{A}}
{{B}}
</p>
and then I compile with
{"A" : "test"}
However the end result is
<p>
test
</p>
But what I really want is:
<p>
test
{{B}}
</p>
Since B was not defined in the object, I want the variable text to remain. Is there a flag I can pass to the compile or some function to specify this behavior?
Thanks