AI. AI. - 5 months ago 42
MySQL Question

How to change MySQL value inside mybatis?

I have a supplier table with column

. The table have two rows, with value F and S.

In my PrimeFaces dataTable, I also created a table with column
with drop down menu filter as below code

<p:column filterBy="#{vo.gstInvoiceType}" headerText="GST Invoice Type." sortBy="#{vo.gstInvoiceType}"
style="width:130px;" visible="false">
<f:facet name="filter">
<p:selectOneMenu style="width:110px; vertical-align:middle;" autoWidth="false"
<f:selectItem itemLabel="ALL" itemValue="" noSelectionOption="true" />
<f:selectItem itemLabel="Full Tax Invoice" itemValue="F" />
<f:selectItem itemLabel="Simplified Invoice" itemValue="S" />
<h:outputText value="#{vo.gstInvoiceType}"/>

When select All, all data (F and S) will be retrieved and located in Gst_Invoice_Type, which working correctly. But is it possible to let the F and S display as Full Tax Invoice and Simplified Invoice ?


Simply insert two conditionally rendered <h:outputText /> elements with different values.

    value="Full Tax Invoice"
    rendered="#{vo.gstInvoiceType eq 'F'}"
    value="Simplified Invoice"
    rendered="#{vo.gstInvoiceType eq 'S'}"

Another option is to do the mapping programmatically in a bean method like:

  <h:outputText value="#{}" />


public class Bean {
  public String map(String input) {
    // however you implement your mapping