Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating command link value in JSF 2.0

Tags:

jsf

jsf-2

I have a command link and on its click i have a dialog in JSF 2.0 as:

<p:commandLink  value="(.3%)" style="font-size:10px;" onclick="lrDlg.show()"     id="percentchange"/>

Now on the dialog i want the value of command link value as:

<h:outputText value="Change Value" />
<h:panelGroup>
<p:inputText size="10" value="#{bean.changeValue}" required="false"
styleClass=" ui-inputfield ui-widget ui-state-default ui-corner-all " />
<h:outputText value="" style="font-size:10px;" />
</h:panelGroup>

My Question is how i update the value in inputtext so as to reflect in commandlink value(shown as "(.3%)".

like image 337
curious Avatar asked Dec 27 '25 14:12

curious


1 Answers

Make it a bean property.

private String commandLinkValue;

public Bean() {
    commandLinkValue = "(.3%)";
}

// ...

with

<p:commandLink value="#{bean.commandLinkValue}" ...>

and

<h:inputText value="#{bean.commandLinkValue}" ...>
like image 186
BalusC Avatar answered Dec 31 '25 17:12

BalusC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!