0

I am using Spring beans and PrimeFaces and I want to change the value of the property in one of my component classes to be the contents of an input text field from the .xhmtl page.

So I want to find out how to pass a parameter inside the method called from the input text field, or how to pass input text and call the controller.updateMessage("STRING-PARAM"). Then I will update the value on the view when I click a button

Thank you.

<h3>Floating Label</h3>
<span class="ui-float-label">
    <p:inputText id="float-input" value="#{controller.updateMessage("STRING-PARAM")}" />
    <p:outputLabel for="@previous" value="Username" />
</span>
C96
  • 477
  • 8
  • 33
  • Are you using a tutorial? If not, try to find a basic JSF 2.2+ one. – Kukeltje Aug 04 '20 at 12:18
  • This is not a tutorial. I am trying to put something specific together. I am using the PrimeFaces website – C96 Aug 04 '20 at 12:19
  • Uhhhhmmmm the primefaces `p:inputText` showcase has a working example – Kukeltje Aug 04 '20 at 12:21
  • And what you seem to want in the action attribute is strange, very strange – Kukeltje Aug 04 '20 at 12:23
  • What I mean by that, is that the action must somehow utilise the input-field's text to update the bean. I am updating the question to better reflect that – C96 Aug 04 '20 at 12:25
  • And all that is described in basic JSF tutorials... So please read https://stackoverflow.com/tags/jsf/info and pick one (it is so basic, the PrimeFaces showcase of the inputtext and commandButton don't even show it. – Kukeltje Aug 04 '20 at 12:28
  • The suggested post does not answer my question. I want to take the input from the textfield and pass it as a variable inside a method that I will call when I click the button – C96 Aug 04 '20 at 13:25
  • 1
    I found this link to be more direct and straight to the point than the proposed solution answer: https://stackoverflow.com/questions/11941943/pass-input-text-value-to-bean-method-without-binding-input-value-to-bean-propert –  Aug 05 '20 at 15:44
  • @MilanPopescu thank you this is what I was actually looking for. – C96 Aug 05 '20 at 15:45

0 Answers0