Getting rid of "value" attribute in f:selectItems?

Hello,
There is a simple problem I am facing at work that is actually hurting us significantly... we have a JSF 1.1 (yes, it's very old!) situation where we need to present a page that has a very long dropdown list, more than 5000 options in it. The problem is that the options are very long, and the entire page ends up being over 600Kb in the browser, and worse than that the application server gobbles up massive amounts of RAM just to generate the page.
One optimization we want to do is to take advantage of the following fact: all of the options have values that match the labels. In other words, our options look like this:
<option value="longString1">longString1</option>
<option value="longString2">longString2</option>
<option value="longString3">longString3</option>
We'd like to reduce the page by 50% with a simple optimization: suppress the value attributes like the following:
<option>longString1</option>
<option>longString2</option>
<option>longString3</option>
We are generating these options in an ArrayList of SelectItems, and using an f:selectItems to generate the HTML... but we have NOT figured out how to suppress the value attributes. Try as we might, we are unable to remove them... Is there any way to get:
<f:selectItems ...>
to just display the labels???
Or is there another approach we should use??
Thanks in advance.

Hi,
Can't help specifically with JSF 1.1 I'm afraid, but in 2.0 you need to supply a custom renderer to achieve this. The default MenuRenderer will always write out the value attribute, as per the following code:
// com.sun.faces.renderkit.html_basic.MenuRenderer
protected boolean renderOption(...) {
  ResponseWriter writer = context.getResponseWriter();
  writer.startElement("option", component);
  writer.writeAttribute("value", valueString, "value");
  writer.write(curItem.getLabel());
  writer.endElement("option");
}I achieved an option list with no value attributes by extending this class, overriding the renderOption method, commenting out the writeAttribute line, and setting that as the default renderer for the SelectOneMenu. Like I said, this was JSF 2, but maybe a similar approach would work for JSF 1.1?
On a completely different approach, how often do the values in the list change? If they are infrequent, then maybe you could use something like the following:
- dynamically create a javascript file that holds the data, plus a method to build an option list from this data
- include a reference to this javascript file in the page header
- create a custom tag in the page which uses the javascript to build the option tags
The advantage of this is that you can let the browser cache the big javascript file with all the options in it, and only include a link to it and a call to the javascript function in the page data. If required, you can add a sequence number to the javascript link to force the browser to reload it when the data changes.
Obviously, you still get the hit the first time you load the list (although the data here is much more concise, as you don't need to send the XML tags at this point and also you only need to send each value once), and it's not as useful if your data changes frequently. Also dumps some processing on the client side, but that sounds like it would be a good thing in your case!
I've used this approach in other situations where I had to repeatedly push a lot of static data to the client. Never actually used it from JSF, but the principle is still valid. Let me know if you think it would be useful; sure I've still got the old javascript lying around somewhere
Cheers,
Barney
@EJP / qimbal2: The OP asked a pretty specific question: "how to render a dropdown list without the value attribute", which is a perfectly valid question. Yes, we can all see that 5,000 items in a drop down list is not ideal, and I understand that anyone answering questions like these is generally doing so on their own time, but just stating that the design sucks isn't really helping.

Similar Messages

  • How do I use Get-ADUser to get just the Managers attribute? And then get rid of duplicates in my array/hash table?

    Hello,
          I am trying to just get the Managers of my users in Active Directory. I have gotten it down to the user and their manager, but I don't need the user. Here is my code so far:
    Get-ADUser-filter*-searchbase"OU=REDACTED,
    OU=Enterprise Users, DC=REDACTED, DC=REDACTED"-PropertiesManager|SelectName,@{N='Manager';E={(Get-ADUser$_.Manager).Name}}
    |export-csvc:\managers.csv-append 
    Also, I need to get rid of the duplicate values in my hash table. I tried playing around with -sort unique, but couldn't find a place it would work. Any help would be awesome.
    Thanks,
    Matt

    I would caution that, although it is not likely, managers can also be contact, group, or computer objects. If this is possible in your situation, use Get-ADObject in place of Get-ADUser inside the curly braces.
    Also, if you only want users that have a manager assigned, you can use -LDAPFilter "(manager=*)" in the first Get-ADUser.
    Finally, if you want all users that have been assigned the manager for at least one user, you can use:
    Get-ADUser
    -LDAPFilter "(directReports=*)" |
    Select @{N='Manager';E={ (Get-ADUser
    $_.sAMAccountName).Name }}
    -Unique | Sort Manager |
    Export-Csv .\managerList.csv -NoTypeInformation
    This works because when you assign the manager attribute of a user, this assigns the user to the directReports attribute of the manager. The directReports atttribute is multi-valued (an array in essence).
    Again, if managers can be groups or some other class of object (not likely), then use Get-ADObect throughout and identify by distinguishedName instead of sAMAccountName (since contacts don't have sAMAccountName).
    Richard Mueller - MVP Directory Services

  • How to get rid of No Value in Olap cube based SSRS report

    hi there, I am trying to create a report based on SSAS cube.  As you can see, some returns 0 while some does not return anything. This actually messed out the border style as well... Any idea on how to get rid of this? 
    thanks
    --Currently using Reporting Service 2000; Visual Studio .NET 2003; Visual Source Safe SSIS 2008 SSAS 2008, SVN --

    Hi  Cat_ca,
    Are you using SQL Server Reporting Services 2000? Currently, we do not have SSRS 2000 test environment, and SQL Server 2000 was out of support since April 2013.
    I have tested it on SSRS 2008 R2, everything works fine. It display nothing on the cell for the NULL value. Please refer to the screenshot below.
    In your scenario, to avoid this issue you can use NonEmpty function in your query to remove the NULL values.
    NonEmpty (MDX)
    If I have anything misunderstand, please point it out.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to get rid of the residual value in my account

    hi
    i have 1 kr in my itunes accout and i need to change my country but i cant , what i do to get rid of the remaining value .
    thank you

    If you can, enter in a credit card from your original country temporarily so you can buy something that costs more than the balance remaining on your account and thereby use up all the remaining credit. If you cannot or do not wish to put in a credit card, go here:
    http://www.apple.com/support/itunes/contact/
    and follow the instructions to report the issue to the iTunes Store. They can probably clear your remaining balance for you.
    Regards.

  • What is the file attribute @ and how can I get rid of it

    I converted some wav files using Roxio Toast 11 and the output AIF files have a '@' in the file permissions and are not displayed in Finder. What does the '@' mean and how can I get rid of it. Would love to know why Toast adds it but I posted a question on Roxio's site and hopefully will get an answer to that.
    thanks for the help
    john

    okay, so I yes, it does indicate extended attributes. I executed ls -l@ *.aif and got this
    -rw-r--r--@ 1 johnprokopek  staff
    9690378 Oct  6 13:30 zeppelin1969-08-31t01.aif
        com.apple.FinderInfo      
    32
    -rw-r--r--@ 1 johnprokopek  staff   31533402 Oct  6 13:30 zeppelin1969-08-31t02.aif
        com.apple.FinderInfo      
    32
    -rw-r--r--@ 1 johnprokopek  staff   72260634 Oct  6 13:30 zeppelin1969-08-31t03.aif
        com.apple.FinderInfo      
    32
    -rw-r--r--@ 1 johnprokopek  staff  167361402 Oct  6 13:30 zeppelin1969-08-31t04.aif
        com.apple.FinderInfo      
    32
    -rw-r--r--@ 1 johnprokopek  staff  114149754 Oct  6 13:30 zeppelin1969-08-31t05.aif
        com.apple.FinderInfo      
    32
    -rw-r--r--@ 1 johnprokopek  staff  246019338 Oct  6 13:30 zeppelin1969-08-31t06.aif
        com.apple.FinderInfo      
    32
    -rw-r--r--@ 1 johnprokopek  staff   51214938 Oct  6 13:30 zeppelin1969-08-31t07.aif
        com.apple.FinderInfo      
    32
    I then did xattr -c *.aif to clear the extended attributes which got rid of the '@' but the files are still not being displayed in Finder.
    Help!

  • How can I get rid of the values shown on x axis

    How can I get rid of the values shown on x axis ?
    The two diagrams are for illustrations .I want the A diagram like values and wanna get rid of 50 150 250 350on x axis
    Mudassar

    In Axis Options, set Interval to 1. Every category group label
    is displayed. If you want to show every other category group label on the x-axis, type 2.
    "If you want to show every other category group label on the x-axis, type 2."
    what does this mean ?
    when you set 1 as per it everything is shown and when you set 2 every other ????
    Any example on this ?
    Mudassar

  • How to get the distinct values in Attribute View?

    Hi,
    While doing the data preview of attribute view its showing duplicate records.
    Can i restrict all these duplicate in attribute view and get only distinct values?
    Thanks in advance.

    Hi Deepak,
    Please check the Key Attribute combination in the Source System and Create Attribute view with the same combination.
    so that you won't get any duplicate values.
    If you are taking fields randomly Pls ensure that you are taking at least one primary key combination  use the same combination while creating Attribute View.
    As u know that the purpose of Attribute view is to store the Master Data Objects like BI/BW which stores Non duplicate values.

  • When we run query how it gets the characteristic values and attributes.

    Hi,
    When we load transaction data it chacks characteristic values then SIDs then DIM IDs then insert  DIM IDs into fact table but when we run the query how it checks and gets the characteristic values and attributes.
    Bye
    GK

    when we run the query how it checks and gets the characteristic values and attributes.
    Just the opposite way you have described. It gets from the corresponding masterdata tables, with the connected SID.

  • How to load values from database into the f:selectItems value attribute

    Hi,
    I am trying to load the drop down menu value i.e f:selectItems from the database with a list of values from a column in the databse table. how can i do this? Should i use binding? or is there any other way.
    Note:i am able to load values into f:selectItems from the faces-config.xml file but they are static values. i want the values from the database
    Please reply with sample codes of faces jsp, bean file and config.xml file

    But this is working for me,
    JSF
         <h:selectOneMenu value="#{loadbean.grade}" >
              <f:selectItems value="#{loadbean.gradelist}" />
         </h:selectOneMenu>
    bean
    private String grade;
    private List<SelectItem> gradelist;
    public String getGrade() {
              return grade;
         public void setGrade(String grade) {
              this.grade = grade;
         public List<SelectItem> getGradelist() {
              return gradelist;
         public void setGradelist(List<String> items) {
              gradelist=new ArrayList<SelectItem>();
              gradelist.add(new SelectItem("daniel"));//this value can be from data base
              gradelist.add(new SelectItem("pspindia"));
              gradelist.add(new SelectItem("prelude sys"));
    faces-config.xml
    <managed-property>
              <property-name>gradelist</property-name>
              <null-value/>
    </managed-property>
    this working fine for me. So setter method also works to load value for the h:selectItems
    Thanks a lot.

  • How to get rid of Default Transaction Attribute warning at deployment

    Hi,
    When I deploy Entity and Session Beans on BEA 8.1 SP3,
    I get warings about Default Trabsaction setting.
    I need to know which @XDoclet Tags to insert in my Entity or Session Beans in order
    to get rid of this Deployment waring: The Default Transaction is set to Supported...
    with kind regards,
    Harry van Rijn

    I think @ejbgen:entity 'default-transaction ' should avoid the warning.
    http://e-docs.bea.com/wls/docs81/ejb/EJBGen_reference.html#1126084
    --Sathish
    <Harry van RIjn> wrote in message news:[email protected]..
    Hi,
    When I deploy Entity and Session Beans on BEA 8.1 SP3,
    I get warings about Default Trabsaction setting.
    I need to know which @XDoclet Tags to insert in my Entity or Session Beans
    in order
    to get rid of this Deployment waring: The Default Transaction is set to
    Supported...
    with kind regards,
    Harry van Rijn

  • How to get the selected values from a selectmanylistbox?

    Hi ADF Experts,
    <af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb2"
                            value="#{viewScope.TestBean.lovValue}"
                      autoSubmit="true"      valuePassThru="true">
        <f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
                       binding="#{viewScope.TestBean.selectedItems}"/>
      </af:selectManyListbox>
      <af:commandButton text="get selected values" id="cb3"
                        actionListener="#{viewScope.TestBean.getSelectedValues}"
                        partialSubmit="true"/>
      private List<String> lovValue;
      private List<SelectItem> actualList;
    //getters and setters
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
        for (String selectedItem : lovValue) {
            System.out.println("Selected item: " +selectedItem.); // this is giving 1 and 3 like this. how to get the checked values as I'm getting only the indexes. In this scenario I am populating the list programmatically.Just I wanted to know how can we get the selected values(not indexes). Please suggest.
    Thanks-
    Abhijit

    Hi Timo,
    As I am sharing the page fragment and the Java class. So its my usecase I have mentioned below
    I am sharing the jsff page fragment and java class. So that it wud be of help to others.
    jsff page fragment
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
              xmlns:f="http://java.sun.com/jsf/core">
            <af:panelGroupLayout id="pgl1">
              <af:commandButton text="Search"  id="cb1"
                                actionListener="#{viewScope.TestBean.searchSupplier}"/>
    </af:panelGroupLayout>
        <af:popup id="p1" binding="#{viewScope.TestBean.searchSupplierPopup}">
              <af:dialog id="d2"
                         type="none">
               <af:table value="#{bindings.Contacts.collectionModel}" var="row"
                      rows="#{bindings.Contacts.rangeSize}"
                      emptyText="#{bindings.Contacts.viewable ? 'No data to display.' : 'Access Denied.'}"
                      fetchSize="#{bindings.Contacts.rangeSize}"
                      rowBandingInterval="0"
                      binding="#{viewScope.TestBean.tsupportIssues}"
                      filterModel="#{bindings.ContactsQuery.queryDescriptor}"
                      queryListener="#{bindings.ContactsQuery.processQuery}"
                      filterVisible="true" varStatus="vs"
                      selectionListener="#{bindings.Contacts.collectionModel.makeCurrent}"
                      rowSelection="multiple" id="t1">
              <af:column sortProperty="name" filterable="true" sortable="true"
                         headerText="#{bindings.Contacts.hints.name.label}" id="c2">
                <af:outputText value="#{row.name}" id="ot1"/>
              </af:column>
              <af:column sortProperty="email" filterable="true" sortable="true"
                         headerText="#{bindings.Contacts.hints.email.label}"
                         id="c1">
                <af:outputText value="#{row.email}" id="ot2"/>
              </af:column>
            </af:table>
          <af:commandButton text="OK" id="cb5" partialSubmit="true"       actionListener="#{viewScope.TestBean.testMethod}"/>
          <af:commandButton text="Cancel" id="cb6"
                            actionListener="#{viewScope.TestBean.cancelPopupSearch}"/>
        </af:dialog>
            </af:popup>
      <af:selectManyListbox label="Label 1" id="sml1" partialTriggers="cb5"
                            value="#{viewScope.TestBean.lovValue}"
                      autoSubmit="true"      valuePassThru="true"
                            binding="#{viewScope.TestBean.prp1}">
        <f:selectItems value="#{viewScope.TestBean.actualList}" id="si1"
                       binding="#{viewScope.TestBean.selectedItems}"/>
      </af:selectManyListbox>
      <af:commandButton text="get selected values" id="cb3"
                        actionListener="#{viewScope.TestBean.getSelectedValues}"
                        partialSubmit="true"/>
      <af:commandButton text="remove selected" id="cb4"
             partialSubmit="true"           actionListener="#{viewScope.TestBean.removeSelectedValues}"/>
    </jsp:root>
    TestBean.java
    package com.demo.view;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.component.UISelectItems;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.DialogEvent;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class TestBean {
      private RichTable tsupportIssues;
      private List<SelectItem> lovValue;
      private List<SelectItem> actualList;
      private RichSelectManyListbox prp1;
      private List valuesChoosed = new ArrayList();
      private UISelectItems selectedItems;
      private RichPopup searchSupplierPopup;
        public TestBean() {
        super();
      public void setTsupportIssues(RichTable tsupportIssues) {
        this.tsupportIssues = tsupportIssues;
      public RichTable getTsupportIssues() {
        return tsupportIssues;
      public void testMethod(ActionEvent actionEvent) {
        // Add event code here...
        // For learning purposes - show Select Many Button clicked 
         System.out.println("Select Many Button has been Clicked");
        // // RowKeySet Object can hold the selected rows from a user as follows    
        RowKeySet rksSelectedRows =         this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows 
        Iterator itrSelectedRows = rksSelectedRows.iterator();  
        // Get the data control that is bound to the table - e.g.
        // OpenSupportItemsIterator    
        DCBindingContainer bindings =         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding dcIteratorBindings =         bindings.findIteratorBinding("findAllContactsIterator"); 
        // Information from binding that is specific to the rows  
        RowSetIterator rsiSelectedRows =         dcIteratorBindings.getRowSetIterator();   
        // Loop through selected rows  
        int i=1;
        while (itrSelectedRows.hasNext()) {        
          // Get key for selected row    
          Key key = (Key)((List)itrSelectedRows.next()).get(0);  
          // Use the key to get the data from the above binding that is related to the row      
          Row myRow = rsiSelectedRows.getRow(key);         
          // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces       
          System.out.println(myRow.getAttribute("name"));
          valuesChoosed.add(myRow.getAttribute("name"));
    //        actualList = new ArrayList<SelectItem>();
    //        String j = Integer.toString(i);
    //        actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
    //      i++;
           searchSupplierPopup.hide();
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setLovValue(List<SelectItem> lovValue) {
        this.lovValue = lovValue;
      public List<SelectItem> getLovValue() {
        return lovValue;
      public void setActualList(List<SelectItem> actualList) {
        this.actualList = actualList;
      public List<SelectItem> getActualList() {
        actualList = new ArrayList<SelectItem>();
        if(valuesChoosed.size()!=0){
        for(int i=0;i<valuesChoosed.size();i++){
          actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
        else{
          actualList.add(new SelectItem("1","Select One"));
        return actualList;
      public void setPrp1(RichSelectManyListbox prp1) {
        this.prp1 = prp1;
      public RichSelectManyListbox getPrp1() {
        return prp1;
      public void setValuesChoosed(List valuesChoosed) {
        this.valuesChoosed = valuesChoosed;
      public List getValuesChoosed() {
        return valuesChoosed;
      public void getValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<valuesChoosed.size();i++){
          System.out.println(valuesChoosed.get(i));
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
         for(int i=0;i<this.getLovValue().size();i++){
             System.out.println("Selected Value:"+this.getLovValue().get(i));
      public void removeSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
      public void setSelectedItems(UISelectItems selectedItems) {
        this.selectedItems = selectedItems;
      public UISelectItems getSelectedItems() {
        return selectedItems;
        public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
            this.searchSupplierPopup = searchSupplierPopup;
        public RichPopup getSearchSupplierPopup() {
            return searchSupplierPopup;
        public void cancelPopupSearch(ActionEvent actionEvent) {
            // Add event code here...
            searchSupplierPopup.hide();
        public void searchSupplier(ActionEvent actionEvent) {
            // Add event code here...
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            searchSupplierPopup.show(hints);
    package com.demo.view;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import javax.faces.component.UISelectItems;
    import javax.faces.event.ActionEvent;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.BindingContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.model.binding.DCIteratorBinding;
    import oracle.adf.view.rich.component.rich.RichPopup;
    import oracle.adf.view.rich.component.rich.data.RichTable;
    import oracle.adf.view.rich.component.rich.input.RichSelectManyListbox;
    import oracle.adf.view.rich.context.AdfFacesContext;
    import oracle.adf.view.rich.event.DialogEvent;
    import oracle.jbo.Key;
    import oracle.jbo.Row;
    import oracle.jbo.RowSetIterator;
    import org.apache.myfaces.trinidad.model.RowKeySet;
    public class TestBean {
      private RichTable tsupportIssues;
      private List<SelectItem> lovValue;
      private List<SelectItem> actualList;
      private RichSelectManyListbox prp1;
      private List valuesChoosed = new ArrayList();
      private UISelectItems selectedItems;
      private RichPopup searchSupplierPopup;
        public TestBean() {
        super();
      public void setTsupportIssues(RichTable tsupportIssues) {
        this.tsupportIssues = tsupportIssues;
      public RichTable getTsupportIssues() {
        return tsupportIssues;
      public void testMethod(ActionEvent actionEvent) {
        // Add event code here...
        // For learning purposes - show Select Many Button clicked 
         System.out.println("Select Many Button has been Clicked");
        // // RowKeySet Object can hold the selected rows from a user as follows    
        RowKeySet rksSelectedRows =         this.getTsupportIssues().getSelectedRowKeys();
        // Iterator object provides the ability to use hasNext(), next() and remove() against the selected rows 
        Iterator itrSelectedRows = rksSelectedRows.iterator();  
        // Get the data control that is bound to the table - e.g.
        // OpenSupportItemsIterator    
        DCBindingContainer bindings =         (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry(); 
        DCIteratorBinding dcIteratorBindings =         bindings.findIteratorBinding("findAllContactsIterator"); 
        // Information from binding that is specific to the rows  
        RowSetIterator rsiSelectedRows =         dcIteratorBindings.getRowSetIterator();   
        // Loop through selected rows  
        int i=1;
        while (itrSelectedRows.hasNext()) {        
          // Get key for selected row    
          Key key = (Key)((List)itrSelectedRows.next()).get(0);  
          // Use the key to get the data from the above binding that is related to the row      
          Row myRow = rsiSelectedRows.getRow(key);         
          // Display attribute of row in console output - would generally be bound to a UI component like a Label and or used to call another proces       
          System.out.println(myRow.getAttribute("name"));
          valuesChoosed.add(myRow.getAttribute("name"));
    //        actualList = new ArrayList<SelectItem>();
    //        String j = Integer.toString(i);
    //        actualList.add(new SelectItem(j, (String)myRow.getAttribute("name")));
    //      i++;
           searchSupplierPopup.hide();
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setLovValue(List<SelectItem> lovValue) {
        this.lovValue = lovValue;
      public List<SelectItem> getLovValue() {
        return lovValue;
      public void setActualList(List<SelectItem> actualList) {
        this.actualList = actualList;
      public List<SelectItem> getActualList() {
        actualList = new ArrayList<SelectItem>();
        if(valuesChoosed.size()!=0){
        for(int i=0;i<valuesChoosed.size();i++){
          actualList.add(new SelectItem(valuesChoosed.get(i), (String)valuesChoosed.get(i)));
        else{
          actualList.add(new SelectItem("1","Select One"));
        return actualList;
      public void setPrp1(RichSelectManyListbox prp1) {
        this.prp1 = prp1;
      public RichSelectManyListbox getPrp1() {
        return prp1;
      public void setValuesChoosed(List valuesChoosed) {
        this.valuesChoosed = valuesChoosed;
      public List getValuesChoosed() {
        return valuesChoosed;
      public void getValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<valuesChoosed.size();i++){
          System.out.println(valuesChoosed.get(i));
      public void getSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
         for(int i=0;i<this.getLovValue().size();i++){
             System.out.println("Selected Value:"+this.getLovValue().get(i));
      public void removeSelectedValues(ActionEvent actionEvent) {
        // Add event code here...
        for(int i=0;i<this.getLovValue().size();i++){
            System.out.println("Selected Value:"+this.getLovValue().get(i));
            System.out.println(this.getLovValue().remove(i));
          AdfFacesContext.getCurrentInstance().addPartialTarget(prp1);
      public void setSelectedItems(UISelectItems selectedItems) {
        this.selectedItems = selectedItems;
      public UISelectItems getSelectedItems() {
        return selectedItems;
        public void setSearchSupplierPopup(RichPopup searchSupplierPopup) {
            this.searchSupplierPopup = searchSupplierPopup;
        public RichPopup getSearchSupplierPopup() {
            return searchSupplierPopup;
        public void cancelPopupSearch(ActionEvent actionEvent) {
            // Add event code here...
            searchSupplierPopup.hide();
        public void searchSupplier(ActionEvent actionEvent) {
            // Add event code here...
            RichPopup.PopupHints hints = new RichPopup.PopupHints();
            searchSupplierPopup.show(hints);
    Thanks,
    A. Abhijit

  • How to get the selected value in SelectOneMenu in backing bean

    Hello all,
    I need your help. I want to have 2 select menus with the second menu's items list are populated based on the selection in the first menu. I don't know how to get the selected value in the backing bean so that I can based on that select menu to populate the second menu's item list. Basically I need to access to the UI Component of the first select Menu and retrieve its selected value.
    Could you help me out?
    Thank you very much in advance,
    Lngo

    Hi Lingo,
    There r two ways of getting the values into the list. First one is hardcoding the values and the second one is use the list and get the values into the list by firing a query in the database.
    Inorder to display the values in the second menu based on the first onces selection we need to add an attribute to the first selectonemenu known as valueChangeListener and we need to sumit the page.
    Here is the sample code
    <h:selectOneMenu id="catalogue"
                                  binding="#{urbean.catalogue}" onchange="submit()"
                                  valueChangeListener="#{urbean.categoryValueChange}"
                                  <f:selectItem itemLabel="Select Catalogue" itemValue="" />
                                  <f:selectItems value="#{urbean.catalogueList}" />
    </h:selectOneMenu>
    <h:selectOneMenu id="category"
                                  binding="#{urbean.category}">     <f:selectItem itemLabel="Select Category" itemValue="" />
                                  <f:selectItems value="#{urbean.categoryList}" />
                                  <                         </h:selectOneMenu>
    now in method called by valuechangelistener we need to write the similar code
    public void categoryValueChange(ValueChangeEvent event) {
    String rfnum = (String) event.getNewValue();
    List categoryList = new ArrayList();
    List tempList = new TablenameDAO().getActiveCatByCatalogueID(rfnum);
              for (int i = 0; i < tempList.size(); i++) {
                   Tablename tablename = (Tablename ) tempList.get(i);
                   String value = "" + tablename .getrfnum();
    String label = tablename .getname();
         if (label == null) {
                   label = "";
                   SelectItem item = new SelectItem(value, label);
                   categoryList.add(item);
              bean.setCategoryList(categoryList);
    ///getActiveCatByCatalogueID (rfnum) should bring the records which r based on the rfnum
    if u follow this process i am damsure that u will get the values in to the secondlist based upon the first list
    Thanks & Regards
    Manidhar

  • Can't get rid of background image of toolbar buttons

    I am just a front-end developer and responsible for the front-end look of an ADF application that we are creating: We are using jDeveloper 11.1.1.4.0 (and we cannot upgrade due to being told no...so I cannot USE the skin editor which when I tried to use, migrates the files).
    I have created the necessary directories and files per tutorials I have been reading up on...
    skins directory - (new directory)
    skin.css (new file)
    Web-Inf -
    trinidad-skins.xml (new file and correctly configured)
    trinidad-config.xml (existing file but updated to use the new skin)
    Within the trinidad-skins.xml file I have the the new skin specified and is extending the "fusionFx-v1.desktop" default theme being used.
    Now the problem... I cannot get the background images to be overwritten or disabled for af|toolbar::item within the .css file
    I have looked up information about how to overwrite this and I tried to use the
    -tr-inhibit: background-image; within the .css declaration like this
    <code>
    af|toolbar::item {
    -tr-inhibit: background-image;
    </code>
    That was unsuccessful. I even just tried standard background {none;} and that was a no go as wel.
    What am I doing wrong here? This is driving me nuts... they made this skinning stuff way too complicated IMO. I don't see why I can't just add a class to the component within the property inspector of that component and then be able to reference it via normal css conventions... but nope BREAKS grrr... And I'm advanced level CSS coder! This stuff has me absolutely clueless and ready to just quit!
    Any suggestions or help is appreciated! And again... I cannot use the skin editor! Everytime I tried to, it prompted me to migrate the application and I cannot do this since there are about 5 other developers working on this application (we use clearcase for version control).
    Thanks,
    Michael

    I can't use the stand alone skin editor since it will want me to migrate the project files (developed in 11.1.1.4) and all files are source controlled via ClearCase.
    I have been experimenting...This is the code on the .jspx page
    <code>
    <af:panelGroupLayout id="header" styleClass="headerParent">
    <af:panelGroupLayout id="topLinkBar" layout="horizontal" styleClass="topLinkBar AFStretchWidth">
    <af:outputLabel value="#{customeradminportalviewcontrollerBundle.CUSTOMER_ACCOUNT}" styleClass="customerLabel"/>
    <af:outputText value="outputText2012" styleClass="customerOutput"/>
    <af:toolbox id="topLinkToolBox" styleClass="topLinkToolBox">
    <af:toolbar id="topLinkToolBar" styleClass="topLinkToolBar">
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.HELP}" id="ctb2"/>
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.POWER_INVOICE}" id="ctb1"/>
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.CONTRACT}" id="ctb3"/>
    <af:commandToolbarButton text="#{customeradminportalviewcontrollerBundle.SIGNOUT}" id="ctb4"/>
    </af:toolbar>
    </af:toolbox>
    </af:panelGroupLayout>
    </af:panelGroupLayout>
    </code>
    Here is the CSS code
    <code>
    #topLinkToolBar af|commandToolbarButton {
    background-image: none;
    background-color: transparent;
    border: 0;
    </code>
    That WILL NOT get rid of the background images on the buttons! However if I do the !important hack within the CSS like this:
    <code>
    #topLinkToolBar af|commandToolbarButton {
    background-image: none!important;
    background-color: transparent!important;
    border: 0!important;
    </code>
    Then BOOM it works... I do NOT want to use the !important hack since that will cause problems in CSS inheritance and cascading...
    What am I doing wrong?
    Also how do I (if possible) target a specific ID used? For example the af:toolbar has an ID of "topLinkToolBar" how can I target that within the CSS? I know I can target it via class attribute like this:
    <code>
    af:toolbar.topLinkToolBar
    </code>
    but how would I do the same if I wanted to only apply to a component with a particular ID?
    Thank you everyone for all your patience, suggestions and help with this... I'm totally new to this type of environment and it's been a slow and frustrating learning experience!
    Michael

  • Get-rid of the format we get using Get-ADuser in a CSV. Send CSV data in an email in table format

    Hi,
    I am using get-ADuser in order to extract a few AD attributes of some users. I export the users and their respective attributes to a CSV. However, the output in CSV i get has the following format in each cell for its AD attribute. 
    @{description=<Value>} or @ { info=<Value>}
    I have tried to use Expandproperty switch in order to get rid of it but it does not accept null values and hence if a user has no value for a said attribute, the previous value is copied for that user too. However, without expand property it gives me the
    above format in the output.
    $Desc = Get-ADUser $Username -Properties description | select description
    I would like the cells to contain only values and not this format along.
    Also, once I have the CSV with values I would also like to copy the values from CSV in an email in the form of a TABLE. I have been able to copy the content in an email using the following however, this in not in a table format. 
    $mail = Import-Csv $newlogonfile | Out-String
    Please HELP!

    Yes I am already using Export-Csv but still getting the same kind of format in output :-
    $Username = $Event.Properties[5].Value
                $Title_var = get-aduser $Username -properties Title | select Title
           $Ofc_phone = get-aduser $Username -Properties OfficePhone | select OfficePhone
           $Info_var = get-aduser $Username -properties info | select info
           $Display_Name = get-aduser $Username -properties DisplayName | select DisplayName
                $Mail = Get-ADUser $Username -Properties Mail | select Mail
           $Desc = Get-ADUser $Username -Properties description | select description
            $Props = @{ 
                    User = $Event.Properties[5].Value;
                    TimeCreated = $Event.TimeCreated;
                    LogonType = $Event.Properties[8].Value;
                    DCName = $Event.MachineName;
    Workstation_address = $Event.Properties[18].Value;
    Title = $Title_var;
    OfficePhone = $Ofc_phone;
    Info = $Info_var;
    DisplayName = $Display_Name;
            Description = $Desc;
           EMail = $Mail
                $LogonRecord = New-Object -TypeName psobject -Property $Props
                $Result += $LogonRecord
    $Result | Export-Csv -Path $logFile -append -UseCulture -NoTypeInformation # Log it to CSV
    OUTPUT has values in this format in the CSV :-
    @{info=} @{description=abc} @{DisplayName=} @{Officephone=}
    @{Mail=[email protected]}

  • New Imac. I get rid off login password from security and account and restart. Now it asks for username and password and it's not acepting anything. Any ideas?

    New Imac. I get rid off login password from security and accounts and restart. Now it asks for username and password and it's not acepting anything. Any ideas?

    First, reset your password as follows.
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select Utilities ▹ Terminal from the menu bar.
    In the Terminal window, type this:
    resetpassword
    That's one word with no spaces. Then press return. A Reset Password window opens.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Follow the prompts to reset the password. It's safest to choose a password that includes only the characters a-z, A-Z, and 0-9.
    Select  ▹ Restart from the menu bar.
    You should now be able to log in with the new password, but you won't be able to unlock the Keychain. If you've forgotten the Keychain password (which is ordinarily the same as your login password), there's no way to recover it. You’ll need to reset your keychain in the preferences of the Keychain Access application.
    If you're being prompted to authenticate when making changes to files inside your home folder, continue as follows.
    Back up all data now.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null
    Be sure to select the whole line by triple-clicking anywhere in it. You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. You don't need to post the warning. If you don’t have a login password, you’ll need to set one before you can run the command.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select Utilities ▹ Terminal from the menu bar. A text window opens.
    In the Terminal window, type this:
    resetpassword
    That's one word with no spaces. Then press return. A Reset Password window opens. You’re not going to reset a password.
    Select your boot volume if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

Maybe you are looking for