Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to implementpublic void reset(QueryDescriptor qd) { }

raj_inAug 26 2015 — edited Aug 12 2016

Hi all, How to implement public void reset(QueryDescriptor qd) {  }, Actually i have created a af:inputListOfValues programmatically, in that  by default it has Reset button , but that functionality is not implemented , How can i implement it

  1. <span><span> 
  2. package view.lov; 
  3.  
  4. import java.text.ParseException; 
  5. import java.text.SimpleDateFormat; 
  6.  
  7. import java.util.ArrayList; 
  8. import java.util.Collections; 
  9. import java.util.Date; 
  10. import java.util.HashMap; 
  11. import java.util.Iterator; 
  12. import java.util.List; 
  13.  
  14. import java.util.Map; 
  15. import java.util.Set; 
  16.  
  17. import javax.faces.application.FacesMessage; 
  18. import javax.faces.component.UIComponent; 
  19. import javax.faces.context.FacesContext; 
  20. import javax.faces.validator.ValidatorException; 
  21.  
  22. import oracle.adf.view.rich.model.AttributeCriterion; 
  23. import oracle.adf.view.rich.model.AttributeDescriptor; 
  24. import oracle.adf.view.rich.model.ColumnDescriptor; 
  25. import oracle.adf.view.rich.model.ConjunctionCriterion; 
  26. import oracle.adf.view.rich.model.Criterion; 
  27. import oracle.adf.view.rich.model.ListOfValuesModel; 
  28. import oracle.adf.view.rich.model.QueryDescriptor; 
  29. import oracle.adf.view.rich.model.QueryModel; 
  30. import oracle.adf.view.rich.model.TableModel; 
  31.  
  32. import org.apache.myfaces.trinidad.model.CollectionModel; 
  33. import org.apache.myfaces.trinidad.model.RowKeySet; 
  34. import org.apache.myfaces.trinidad.model.RowKeySetImpl; 
  35.  
  36.  
  37. public class ListOfValuesModelImpl extends ListOfValuesModel { 
  38.     //baseModel is for defined for the base component. 
  39.     CollectionModel baseModel = new BaseLovCollection(); 
  40.     //listModel is for the table binding for table in LOV popup dialog 
  41.     CollectionModel listModel = new ListLovCollection(); 
  42.     List _values = new ArrayList(); 
  43.     List _recentValues = new ArrayList(); 
  44.     List _recentValues1 = new ArrayList(); 
  45.     List _filteredList = new ArrayList(); 
  46.     List<LOVItemSelectionListener> _selectionListeners = new ArrayList<LOVItemSelectionListener>(); 
  47.     List _listenersFilteredList = new ArrayList(); 
  48.     //display attributes. 
  49.     String[] _attrs = new String[] { "ename", "job", "sal" }; 
  50.  
  51.     List<String> _attributes = new ArrayList<String>(); 
  52.  
  53.     public ListOfValuesModelImpl() { 
  54.         initAttrbiutes(); 
  55.         initTestData(); 
  56.     } 
  57.  
  58.     private void initAttrbiutes() { 
  59.         _attributes.add("ename"); 
  60.         _attributes.add("empno"); 
  61.         /*</span><a class="oracl-km-link oracle-km-link-bug" href="https://support.oracle.com/rs?type=bug&id=6909956" target="_blank">Bug 6909956</a><span> - inputcombolistofvalues demo should only show two columns*/ 
  62.         _attributes.add("job"); 
  63.         _attributes.add("mgr"); 
  64.         _attributes.add("hireDate"); 
  65.         _attributes.add("sal"); 
  66.         _attributes.add("comm"); 
  67.         _attributes.add("deptno"); 
  68.     } 
  69.  
  70.     private void initTestData() { 
  71.          
  72.          
  73.          
  74.         Object[][] _DIR_DATA = DummyDataService.getInst().getEmpData(); 
  75.         for (int i = 0; i < _DIR_DATA.length * 50; i++) { 
  76.             try { 
  77.                 Object data[] = _DIR_DATA[i % _DIR_DATA.length]; 
  78.  
  79.                 String item1 = (String)data[0] + new Integer(i).toString(); 
  80.                 Integer item2 = new Integer(data[2].toString()); 
  81.                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); 
  82.                 Date item3 = sdf.parse(data[3].toString()); 
  83.                 Integer item4 = new Integer(data[4].toString()); 
  84.                 Integer item5 = new Integer(data[5].toString()); 
  85.                 Integer item6 = new Integer(data[6].toString()); 
  86.                 String item7 = new Integer(i).toString(); 
  87.                 EmpRowData _curRow = 
  88.                     new EmpRowData(new Integer(i), item1, (String)data[1], item2, item3, item4, item5, item6, item7); 
  89.                 _values.add(_curRow); 
  90.             } catch (ParseException e) { 
  91.                 e.printStackTrace(); 
  92.             } 
  93.         } 
  94.         _filteredList.addAll(_values); 
  95.     } 
  96.  
  97.     public void addItemSelectionListener(LOVItemSelectionListener list) { 
  98.         _selectionListeners.add(list); 
  99.     } 
  100.  
  101.     void filterList(String eName, List filtered) { 
  102.         filtered.clear(); 
  103.         if (eName != null) { 
  104.             for (Object data : _values) { 
  105.                 if (((EmpRowData)data).getEname().startsWith(eName)) { 
  106.                     filtered.add(data); 
  107.                 } 
  108.             } 
  109.         } 
  110.         if (filtered.size() == 0) { 
  111.             filtered.addAll(_values); 
  112.         } 
  113.     } 
  114.  
  115.     /**
  116.      * Not applicable as items are only supported in comboLOV
  117.      * @return
  118.      */ 
  119.     @Override 
  120.     public List<? extends Object> getItems() { 
  121.         return getValues(); 
  122.     } 
  123.  
  124.     /**
  125.      * Returns null for now.
  126.      * @return
  127.      */ 
  128.     @Override 
  129.     public QueryModel getQueryModel() { 
  130.         return new QueryModelImpl(); 
  131.     } 
  132.  
  133.     /**
  134.      * @return
  135.      */ 
  136.     @Override 
  137.     public List<? extends Object> getRecentItems() { 
  138.         return getRecentValues(); 
  139.     } 
  140.  
  141.     @Override 
  142.     public TableModel getTableModel() { 
  143.         return new TableModelImpl(getListModel()); 
  144.     } 
  145.  
  146.     public CollectionModel getListModel() { 
  147.         return listModel; 
  148.     } 
  149.  
  150.     @Override 
  151.     public List<ColumnDescriptor> getItemDescriptors() { 
  152.         List<ColumnDescriptor> descriptors = getTableModel().getColumnDescriptors(); 
  153.         if (descriptors != null && descriptors.size() > 3) { 
  154.             return descriptors.subList(0, 3); 
  155.         } 
  156.         return descriptors; 
  157.     } 
  158.  
  159.     @Override 
  160.     public boolean isAutoCompleteEnabled() { 
  161.         return false
  162.     } 
  163.  
  164.     public void performQuery(QueryDescriptor qd) { 
  165.         AttributeCriterion criterion = (AttributeCriterion)qd.getConjunctionCriterion().getCriterionList().get(0); 
  166.         String ename = (String)criterion.getValues().get(0); 
  167.         filterList(ename, _filteredList); 
  168.     } 
  169.  
  170.     public List<Object> autoCompleteValue(Object value) { 
  171.         // wierd way of filtering and accessing _filteredList but for now its ok 
  172.         filterList((String)value, _filteredList); 
  173.         if (_filteredList.size() == 1) { 
  174.             List<Object> returnList = new ArrayList<Object>(); 
  175.             EmpRowData rowData = (EmpRowData)_filteredList.get(0); 
  176.             Object rowKey = rowData.getRowId(); 
  177.             RowKeySet rowKeySet = new RowKeySetImpl(); 
  178.             rowKeySet.add(rowKey); 
  179.             returnList.add(rowKeySet); 
  180.             return returnList; 
  181.         } 
  182.         return null
  183.     } 
  184.  
  185.     public void valueSelected(Object value) { 
  186.         EmpRowData rowData = _getRowData(value); 
  187.         if (rowData != null) { 
  188.             _addToRecentValuesList(rowData, _recentValues); 
  189.         } 
  190.         Iterator<LOVItemSelectionListener> iter = _selectionListeners.iterator(); 
  191.         while (iter.hasNext()) { 
  192.             LOVItemSelectionListener lit = iter.next(); 
  193.             lit.valueSelected(rowData); 
  194.         } 
  195.     } 
  196.  
  197.     private void _addToRecentValuesList(EmpRowData rowData, List recentValues) { 
  198.         if (!recentValues.contains(rowData)) 
  199.             recentValues.add(0, rowData); 
  200.  
  201.         int size = recentValues.size(); 
  202.         if (size > 3
  203.             recentValues.remove(3); 
  204.     } 
  205.  
  206.     private EmpRowData _getRowData(Object selectedRow) { 
  207.         if (selectedRow != null && selectedRow instanceof List) { 
  208.             List listvalue = (List)selectedRow; 
  209.             for (int i = 0; i < listvalue.size(); i++) { 
  210.                 Object rowData = listvalue.get(i); 
  211.                 if (rowData instanceof EmpRowData) { 
  212.                     return ((EmpRowData)rowData); 
  213.                 } 
  214.             } 
  215.         } else if (selectedRow != null && selectedRow instanceof RowKeySet) { 
  216.             Iterator selection = ((RowKeySet)selectedRow).iterator(); 
  217.             while (selection.hasNext()) { 
  218.                 Object rowKey = selection.next(); 
  219.                 Object oldRowKey = listModel.getRowKey(); 
  220.                 listModel.setRowKey(rowKey); 
  221.                 EmpRowData rowData = (EmpRowData)listModel.getRowData(); 
  222.                 listModel.setRowKey(oldRowKey); 
  223.                 return rowData; 
  224.             } 
  225.         } 
  226.         return null
  227.     } 
  228.  
  229.     public void validate(FacesContext facesContext, UIComponent uIComponent, Object object) { 
  230.         for (Object data : _values) { 
  231.             if (((EmpRowData)data).getEname().equals(object)) { 
  232.                 return; 
  233.             } 
  234.         } 
  235.         FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "Not a Valid Value", "Not a Valid Value"); 
  236.         throw new ValidatorException(message); 
  237.     } 
  238.  
  239.     public List getValues() { 
  240.         return _values; 
  241.     } 
  242.  
  243.     public List getRecentValues() { 
  244.         List recentValues = new ArrayList(); 
  245.         recentValues.addAll(_recentValues); 
  246.  
  247.         if (recentValues.size() > 0
  248.             recentValues.add(new EmpRowData(null, null, null, null, null, null, null, null, null)); 
  249.  
  250.         return recentValues; 
  251.     } 
  252.  
  253.     @Override 
  254.     public Object getValueFromSelection(Object selectedRow) { 
  255.         EmpRowData rowData = _getRowData(selectedRow); 
  256.         if (rowData != null) { 
  257.             return rowData.getEname(); 
  258.         } 
  259.         return null
  260.     } 
  261.  
  262.  
  263.     public QueryDescriptor getQueryDescriptor() { 
  264.         if (_queryDescriptor == null
  265.             _queryDescriptor = new QueryDescriptorImpl(); 
  266.         return _queryDescriptor; 
  267.     } 
  268.  
  269.     private QueryDescriptor _queryDescriptor; 
  270.     private DemoComboboxLOVBean _bean; 
  271.  
  272.  
  273.     class BaseLovCollection extends CollectionModel { 
  274.         public Object getRowKey() { 
  275.             if (_row != null) { 
  276.                 return _row.getRowId(); 
  277.             } 
  278.             return null
  279.         } 
  280.  
  281.         /**
  282.          * Finds the row with the matching key and makes it current
  283.          * @param rowKey the rowKey, previously obtained from {@link #getRowKey}.
  284.          */ 
  285.         public void setRowKey(Object rowKey) { 
  286.             if (rowKey == null) { 
  287.                 _row = null; 
  288.                 return; 
  289.             } 
  290.  
  291.             int index = -1
  292.             for (int i = 0; i < _filteredList.size(); i++) { 
  293.                 String rowId = ((EmpRowData)_filteredList.get(i)).getRowId(); 
  294.                 if (rowId.equals(rowKey)) { 
  295.                     index = i; 
  296.                     break; 
  297.                 } 
  298.             } 
  299.  
  300.             setRowIndex(index); 
  301.         } 
  302.  
  303.         public void setRowIndex(int rowIndex) { 
  304.             int size = _filteredList.size(); 
  305.             if (rowIndex < 0 || rowIndex > size || size == 0) { 
  306.                 _row = null; 
  307.                 _rowIndex = -1; 
  308.             } else { 
  309.                 _row = (EmpRowData)_filteredList.get(rowIndex); 
  310.                 _rowIndex = rowIndex; 
  311.             } 
  312.         } 
  313.  
  314.         public int getRowIndex() { 
  315.             return _rowIndex; 
  316.         } 
  317.  
  318.         public Object getRowData() { 
  319.             return _row; 
  320.         } 
  321.  
  322.         public int getRowCount() { 
  323.             return _filteredList.size(); 
  324.         } 
  325.  
  326.         public boolean isRowAvailable() { 
  327.             return (_row != null); 
  328.         } 
  329.  
  330.         public Object getRowData(int rowIndex) { 
  331.             int oldIndex = getRowIndex(); 
  332.             try { 
  333.                 setRowIndex(rowIndex); 
  334.                 return getRowData(); 
  335.             } finally { 
  336.                 setRowIndex(oldIndex); 
  337.             } 
  338.         } 
  339.  
  340.         public boolean isSortable(String property) { 
  341.             return false
  342.         } 
  343.  
  344.         public List getSortCriteria() { 
  345.             return Collections.EMPTY_LIST; 
  346.         } 
  347.  
  348.         public Object getWrappedData() { 
  349.             return BaseLovCollection.this
  350.         } 
  351.  
  352.         public void setWrappedData(Object data) { 
  353.             throw new UnsupportedOperationException(); 
  354.         } 
  355.  
  356.         public BaseLovCollection() { 
  357.         } 
  358.  
  359.         EmpRowData _row = null; 
  360.         int _rowIndex = -1
  361.     } 
  362.  
  363.     class ListLovCollection extends CollectionModel { 
  364.         public Object getRowKey() { 
  365.             if (_row != null) { 
  366.                 return _row.getRowId(); 
  367.             } 
  368.             return null
  369.         } 
  370.  
  371.         /**
  372.          * Finds the row with the matching key and makes it current
  373.          * @param rowKey the rowKey, previously obtained from {@link #getRowKey}.
  374.          */ 
  375.         public void setRowKey(Object rowKey) { 
  376.             if (rowKey == null) { 
  377.                 _row = null; 
  378.                 return; 
  379.             } 
  380.  
  381.             int index = -1
  382.             for (int i = 0; i < _filteredList.size(); i++) { 
  383.                 String rowId = ((EmpRowData)_filteredList.get(i)).getRowId(); 
  384.                 if (rowId.equals(rowKey)) { 
  385.                     index = i; 
  386.                     break; 
  387.                 } 
  388.             } 
  389.  
  390.             setRowIndex(index); 
  391.         } 
  392.  
  393.         public void setRowIndex(int rowIndex) { 
  394.             int size = _filteredList.size(); 
  395.             if (rowIndex < 0 || rowIndex > size || size == 0) { 
  396.                 _row = null; 
  397.                 _rowIndex = -1; 
  398.             } else { 
  399.                 _row = (EmpRowData)_filteredList.get(rowIndex); 
  400.                 _rowIndex = rowIndex; 
  401.             } 
  402.         } 
  403.  
  404.         public int getRowIndex() { 
  405.             return _rowIndex; 
  406.         } 
  407.  
  408.         public Object getRowData() { 
  409.             return _row; 
  410.         } 
  411.  
  412.         public int getRowCount() { 
  413.             return _filteredList.size(); 
  414.         } 
  415.  
  416.         public boolean isRowAvailable() { 
  417.             return (_row != null); 
  418.         } 
  419.  
  420.         public Object getRowData(int rowIndex) { 
  421.             int oldIndex = getRowIndex(); 
  422.             try { 
  423.                 setRowIndex(rowIndex); 
  424.                 return getRowData(); 
  425.             } finally { 
  426.                 setRowIndex(oldIndex); 
  427.             } 
  428.         } 
  429.  
  430.         public boolean isSortable(String property) { 
  431.             return false
  432.         } 
  433.  
  434.         public List getSortCriteria() { 
  435.             return Collections.EMPTY_LIST; 
  436.         } 
  437.  
  438.         public Object getWrappedData() { 
  439.             return ListLovCollection.this
  440.         } 
  441.  
  442.         public void setWrappedData(Object data) { 
  443.             throw new UnsupportedOperationException(); 
  444.         } 
  445.  
  446.         EmpRowData _row = null; 
  447.         int _rowIndex = -1
  448.     } 
  449.  
  450.  
  451.     /* LOVModel for comboLOV with LaunchPopupListener */ 
  452.  
  453.  
  454.     // For now return a void implementation for the querymodel to show a simple query component 
  455.     // such that the Search... link will also be displayed in the dropdown 
  456.  
  457.     public static class QueryModelImpl extends QueryModel { 
  458.  
  459.         public QueryDescriptor create(String name, QueryDescriptor qdBase) { 
  460.             return null
  461.         } 
  462.  
  463.         public void delete(QueryDescriptor qd) { 
  464.         } 
  465.  
  466.         public List<AttributeDescriptor> getAttributes() { 
  467.             return null
  468.         } 
  469.  
  470.         public List<QueryDescriptor> getSystemQueries() { 
  471.             return null
  472.         } 
  473.  
  474.         public List<QueryDescriptor> getUserQueries() { 
  475.             return null
  476.         } 
  477.  
  478.         public void reset(QueryDescriptor qd) { 
  479.         } 
  480.  
  481.         public void setCurrentDescriptor(QueryDescriptor qd) { 
  482.         } 
  483.  
  484.         public void update(QueryDescriptor qd, Map<String, Object> uiHints) { 
  485.         } 
  486.     } 
  487.  
  488.     // Simple implementation of the QueryDescriptor classs to display one inputText 
  489.     // field to filter the data in the table inside dialog based on the Ename 
  490.  
  491.     public static class QueryDescriptorImpl extends QueryDescriptor { 
  492.         public QueryDescriptorImpl() { 
  493.             _conjCriterion = new ConjunctionCriterionImpl(); 
  494.         } 
  495.  
  496.         public void addCriterion(String name) { 
  497.         } 
  498.  
  499.         public void changeMode(QueryDescriptor.QueryMode mode) { 
  500.         } 
  501.  
  502.         public ConjunctionCriterion getConjunctionCriterion() { 
  503.             return _conjCriterion; 
  504.         } 
  505.  
  506.         public void setConjunctionCriterion(ConjunctionCriterion criterion) { 
  507.             _conjCriterion = criterion; 
  508.         } 
  509.  
  510.         public String getName() { 
  511.             return null
  512.         } 
  513.  
  514.         public Map<String, Object> getUIHints() { 
  515.             return new HashMap<String, Object>(); 
  516.         } 
  517.  
  518.         public void removeCriterion(oracle.adf.view.rich.model.Criterion object) { 
  519.         } 
  520.  
  521.         public AttributeCriterion getCurrentCriterion() { 
  522.             return null
  523.         } 
  524.  
  525.         public void setCurrentCriterion(AttributeCriterion attrCriterion) { 
  526.         } 
  527.  
  528.         ConjunctionCriterion _conjCriterion; 
  529.     } 
  530.  
  531.     public static class AttributeDescriptorImpl extends AttributeDescriptor { 
  532.  
  533.         public AttributeDescriptor.ComponentType getComponentType() { 
  534.             return AttributeDescriptor.ComponentType.inputText; 
  535.         } 
  536.  
  537.         public String getDescription() { 
  538.             return null
  539.         } 
  540.  
  541.         public String getFormat() { 
  542.             return null
  543.         } 
  544.  
  545.         public String getLabel() { 
  546.             return "Ename"
  547.         } 
  548.  
  549.         public int getLength() { 
  550.             return 0
  551.         } 
  552.  
  553.         public int getMaximumLength() { 
  554.             return 0
  555.         } 
  556.  
  557.         public Object getModel() { 
  558.             return null
  559.         } 
  560.  
  561.         public String getName() { 
  562.             return null
  563.         } 
  564.  
  565.         public Set<AttributeDescriptor.Operator> getSupportedOperators() { 
  566.             return null
  567.         } 
  568.  
  569.         public Class getType() { 
  570.             return null
  571.         } 
  572.  
  573.         public boolean isReadOnly() { 
  574.             return false
  575.         } 
  576.  
  577.         public boolean isRequired() { 
  578.             return false
  579.         } 
  580.     } 
  581.  
  582.     public static class ConjunctionCriterionImpl extends ConjunctionCriterion { 
  583.         public ConjunctionCriterionImpl() { 
  584.             _criterionList = new ArrayList<Criterion>(); 
  585.             _criterionList.add(new AttributeCriterionImpl()); 
  586.         } 
  587.  
  588.         public ConjunctionCriterion.Conjunction getConjunction() { 
  589.             return ConjunctionCriterion.Conjunction.NONE; 
  590.         } 
  591.  
  592.         public List<oracle.adf.view.rich.model.Criterion> getCriterionList() { 
  593.             return _criterionList; 
  594.         } 
  595.  
  596.         public Object getKey(oracle.adf.view.rich.model.Criterion criterion) { 
  597.             return Integer.toString(0); 
  598.         } 
  599.  
  600.         public Criterion getCriterion(Object key) { 
  601.             assert (_criterionList != null); 
  602.             return _criterionList.get(0); 
  603.         } 
  604.  
  605.         public void setConjunction(ConjunctionCriterion.Conjunction conjunction) { 
  606.         } 
  607.         List<Criterion> _criterionList; 
  608.     } 
  609.  
  610.     public static class AttributeCriterionImpl extends AttributeCriterion { 
  611.         public AttributeCriterionImpl() { 
  612.             if (_values == null) { 
  613.                 _values = new ArrayList<Object>(); 
  614.                 _values.add("A"); 
  615.             } 
  616.         } 
  617.  
  618.         public AttributeDescriptor getAttribute() { 
  619.             return new AttributeDescriptorImpl(); 
  620.         } 
  621.  
  622.         public AttributeDescriptor.Operator getOperator() { 
  623.             return null
  624.         } 
  625.  
  626.         public Map<String, AttributeDescriptor.Operator> getOperators() { 
  627.             return null
  628.         } 
  629.  
  630.         public List<? extends Object> getValues() { 
  631.             return _values; 
  632.         } 
  633.  
  634.         public boolean isRemovable() { 
  635.             return false
  636.         } 
  637.  
  638.         public void setOperator(AttributeDescriptor.Operator operator) { 
  639.         } 
  640.  
  641.         List<Object> _values; 
  642.     } 
  643.  
  644.     public class TableModelImpl extends TableModel { 
  645.         public TableModelImpl(CollectionModel collectionModel) { 
  646.             assert (collectionModel != null); 
  647.             _collectionModel = collectionModel; 
  648.         } 
  649.  
  650.         @Override 
  651.         public CollectionModel getCollectionModel() { 
  652.             return _collectionModel; 
  653.         } 
  654.  
  655.         @Override 
  656.         public List<ColumnDescriptor> getColumnDescriptors() { 
  657.             if (_descriptors == null) { 
  658.                 _descriptors = new ArrayList<ColumnDescriptor>(_attributes.size()); 
  659.                 for (String attr : _attributes) { 
  660.                     _descriptors.add(new ColumnDescriptorImpl(attr)); 
  661.                 } 
  662.             } 
  663.             return _descriptors; 
  664.         } 
  665.  
  666.         public class ColumnDescriptorImpl extends ColumnDescriptor { 
  667.             public ColumnDescriptorImpl(String name) { 
  668.                 _name = name; 
  669.             } 
  670.  
  671.             @Override 
  672.             public String getFormat() { 
  673.                 return null
  674.             } 
  675.  
  676.             @Override 
  677.             public String getLabel() { 
  678.                 return _name.toUpperCase(); 
  679.             } 
  680.  
  681.             @Override 
  682.             public String getName() { 
  683.                 return _name; 
  684.             } 
  685.  
  686.             @Override 
  687.             public Class getType() { 
  688.                 return String.class
  689.             } 
  690.  
  691.             @Override 
  692.             public String getAlign() { 
  693.                 return null
  694.             } 
  695.  
  696.             @Override 
  697.             public AttributeDescriptor.ComponentType getComponentType() { 
  698.                 return AttributeDescriptor.ComponentType.inputText; 
  699.             } 
  700.  
  701.             @Override 
  702.             public String getDescription() { 
  703.                 return null
  704.             } 
  705.  
  706.             @Override 
  707.             public Set<AttributeDescriptor.Operator> getSupportedOperators() { 
  708.                 return Collections.emptySet(); 
  709.             } 
  710.  
  711.             @Override 
  712.             public int getLength() { 
  713.                 return 0
  714.             } 
  715.  
  716.             public int getMaximumLength() { 
  717.                 return 0
  718.             } 
  719.  
  720.             public Object getModel() { 
  721.                 return null
  722.             } 
  723.  
  724.             @Override 
  725.             public int getWidth() { 
  726.                 if (_name.equalsIgnoreCase("ename")) 
  727.                     return 12 * 7 + 3
  728.                 else if (_name.equalsIgnoreCase("empno")) 
  729.                     return 3 * 7 + 3
  730.                 else if (_name.equalsIgnoreCase("job")) 
  731.                     return 10 * 7 + 3
  732.                 else if (_name.equals("mgr")) 
  733.                     return 2 * 7 + 3
  734.                 return 0
  735.             } 
  736.  
  737.             /**
  738.              * The column attributes are all readOnly.
  739.              *
  740.              * @return
  741.              */ 
  742.             @Override 
  743.             public boolean isReadOnly() { 
  744.                 return true
  745.             } 
  746.  
  747.             @Override 
  748.             public boolean isRequired() { 
  749.                 return false
  750.             } 
  751.  
  752.             private String _name; 
  753.  
  754.         } 
  755.  
  756.  
  757.         private CollectionModel _collectionModel; 
  758.         private List<ColumnDescriptor> _descriptors; 
  759.     } 
  760.  
  761.  
  762. </span></span> 
  1. <af:inputListOfValues label="Ename" id="idInputLOV" 
  2.                               value="#{demoComboboxLOV.ename}" autoSubmit="true" 
  3.                               popupTitle="Search and Select: Ename" 
  4.                               searchDesc="Choose a name" 
  5.                               model="#{demoComboboxLOV.listOfValuesModel}" /> 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 26 2015
Added on Aug 26 2015
12 comments
1,433 views