How to achieve the same function as hidden input

I want to achieve a function , as html tag ’ ’ ,how do.


Could you please describe your task in more detail? For now, it’s unclear what you’re trying to achieve.


thanks !
Maybe I lost some info when I was writing.
My question is below:
For example , textfield component corresponding to html tag " < input type=‘text’ > " .
What is the component which is corresponding to html tag " < input type=‘hidden’ > " ?
or how to achieve the similar function?

There is no built-in component that corresponds to <input type="hidden">, but you can create one with the help of Generic JavaScriptComponent.

  1. Create a JS connector file in the VAADIN directory (which must be created manually if not exists), e.g.: hidden-input-connector.js with the following content:
com_company_demo_component_HiddenInput = function () {
    let connector = this;
    let element = connector.getElement();
    element.innerHTML = "<input type=\"hidden\"/>";
  1. Add jsComponent to a screen, with the following definition:
<jsComponent initFunctionName="com_company_demo_component_HiddenInput">
        <dependency path="vaadin://component/hiddeninput/hidden-input-connector.js"/>

Demo project that demonstrates the above: (83.3 KB). Take a look at user-browse.xml and hidden-input-connector.js


1 Like