How to convert Outputtext Value as Password(*****)

Viewed 86

I have PIN column in DataTable coming from DataBase(as String). As of now the PIN is visible in DataTable, But it has to be shown as password with Asterix(****) and should be visible by double click then editable, after editing done it should be again Asterix(*****). Is there any way to convert Output text value as Password? I am queit new to Primefaces.

                <p:column headerText="PIN">
                    <p:cellEditor>
                        <f:facet name="output">
                            <h:outputText value="{PinDTO.pin}"/>
                        </f:facet>
                        <f:facet name="input">
                            <p:inputText value="#{PinDTO.pin}"
                                label="Name" />
                        </f:facet>
                    </p:cellEditor>
                </p:column>

Is there any way to convert Output text value as Password?

2 Answers

This is how i solved.

                <p:column headerText="PIN" style="width:250px;">
                    <p:cellEditor>
                        <f:facet name="output">
                            <p:password id="password" value="#{PinDTO.Pin}"
                                style="border:0px;" redisplay="true" />
                        </f:facet>
                        <f:facet name="input">
                            <p:inputText value="#{PinDTO.Pin}" label="Name" />
                        </f:facet>
                    </p:cellEditor>
                </p:column>
Related