How to set default selection in tableSelectOne

Hi Friends,
How to set tableSelectOne through backing bean.
I am opening a child window which will populate the list in table format. I am loading it through manually. Now i want to set the first record to be selected. Kindly let me know how to do it.
The below is my code in jspx
<af:table emptyText="#{mofRes['mofEgov.po.noItemsFound']}" rows="5" banding="row"
bandingInterval="1" binding="#{BeneficiaryTableHandler.beneficiaryTable}"
value="#{BeneficiaryTableHandler.beneficiaryTableModel}" var="rowBeneficiary"
id="table2" width="900">
<f:facet name="selection">
<af:tableSelectOne binding="#{BeneficiaryTableHandler.beneficiarySelectOne}"
id="tableSelectOne"/>
</f:facet>
<af:column sortable="false" sortProperty="bankName"
headerText="#{mofRes['mofEgov.supplier.bankName']}"
binding="#{BeneficiaryTableHandler.beneficiaryColumn3}"
id="beneficiaryColumn3" formatType="icon">
<af:outputText value="#{rowBeneficiary.bankName}"
id="beneficiaryOutputText3"
binding="#{backing_apps_po_POBeneficiaryOutput.beneficiaryOutputText3}"/>
</af:column>
<af:column sortable="false" sortProperty="bankActName"
headerText="#{mofRes['mofEgov.supplier.bankActName']}"
binding="#{BeneficiaryTableHandler.beneficiaryColumn1}"
id="beneficiaryColumn1" formatType="icon"
gridVisible="true">
<af:outputText value="#{rowBeneficiary.bankActName}"
id="beneficiaryOutputText1"
binding="#{backing_apps_po_POBeneficiaryOutput.beneficiaryOutputText1}"/>
</af:column>
</af:table>
Below code used in backing bean to create rows in the table
for (int rwIndx = 0; rwIndx < siteLiseSize ; ++rwIndx) {
beneficiaryBean = (BeneficiaryBean)beneficiaryList.get(rwIndx);
handler.createRow(beneficiaryBean);
logger.log(Level.INFO," --- Bank Name --- :"+beneficiaryBean.getBankActName()+": --- Bank Act No -- :"+beneficiaryBean.getBankActNo());
public void createRow(BeneficiaryBean bean) {
//logger.log(Level.FINE," ---- createRow Start --- ");
((Collection)beneficiaryTableModel.getWrappedData()).add(bean);
//logger.log(Level.FINE," ---- createRow End --- ");
Thanks & Regards
VB

This is probably too late to help, but I had a similar situation. There are a couple of ways to solve this.
1. Set the ID values on the af:form, af:table, and af:tableSelectOne tags, and write some javascript code to select the first radio button, in the event there are no radio buttons selected. Something like this would work.
          function selectFirstRadio() {
            radioButtons = document.myform['mytable:myradios'];
            anypressed = false;
            for (i = 0; i < radioButtons.length; i++) {
              radioButton = radioButtons;
if (anypressed.checked) {
anypressed = true;
if (!anypressed) {
document.myform['mytable:myradios'][0].checked = true;
This would have an af:form with an id='myform', an af:table with an id='mytable', and an af:tableSelectOne with an id='myradios'
The other method I used was, in the accessor for getting the value for the af:table was this:
    public DataModel getMyModel() {
        RowKeySet selectedItem = myTable.getSelectionState();
        if ((selectedItem == null) || (selectedItem.getSize() == 0)) {
            Object o = myModel.getWrappedData();
            List rows = (List)myModel.getWrappedData();
            try {
                selectedItem.getKeySet().add( "0" );
            } catch (Throwable t) {
                t.printStackTrace();
        return myModel;
    }'myTable' is a binding from an af:table to a UIXTable.
I should add, this is for ADF 10.1.3.x, not ADF 11.
Best of luck.
Edited by: daiken on Mar 27, 2009 7:13 AM

Similar Messages

  • How to set default selection in html:radio

    hai
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • How to set default selected checkbox in af:tableSelectMany /

    Hi,
    I am new to ADF technology, I am using JDev 10..3g.
    I want to set the checkbox as default selected for particular rows.
    but I don't know how to set default selected checkbox in <af:tableSelectMany />
    Is there any way to do this using ADF<af:tableSelectMany />
    Thanks,
    Mohammed

    Hi Jeroen,
    Thanks for reply. but the problem is that I am getting data from database and based on some flag I need to select checkbox while page is loading first time.
    at that time the table is null as till now it not rendered. and when its rendered it means page is displayed now.
    just before display I need to set checkbox as selected.
    I don't want to do like this (when user is pressing any command button then only is should update checkbox selection).
    Thanks,
    Mohammed.

  • Plsss help me: how to set default values in html:file and html:radio

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?
    how to set default selection in <html:radio>.

    No it won't help.
    You can't set a value into an <input type="file"> control at all. The user has to put values in themselves.
    The reason behind this is security. If the programmer could put any value they liked in there, you could upload any file at all from a users computer without their intervention. eg C:\windows\system32\passwords.txt
    Bottom line: you can't put a default value into the input type="file" control.
    And a good thing too ;-)

  • How to set default values in initialization event for select option

    Abapers,
    I have 3 GL account like 0024831231,0024831238,0024831245.
    Please help me how to set default values in select-options ( s_hkont ) in INTIALIZATION event
    Thanks

    Select option is table <Structure> with fields, low, high, sign & option
    you need to append the value into the select option, with appropriate value in low or
    example:
    S_HKONT-low  = <value>
    S_HKONT-SIGN = 'I'
    S_hkont-OPTION = 'EQ'
    append s_hkont.
    Default value for select-option also can be added directly in select-option statement.
    Regards,
    Mahesh

  • How to make default selected "Set to Null" option in  Prompt screen?

    Hi,
         I have created Report using Bex Query. It has around 20 Optional variables.
        In the Prompt screen for Optional variables it is showing "Set to Null" Check box.
         I want to make this Check box selected by default when we preview. Kindly help me to make this option.
         Thanks for your support in advance.
    Thanks & Regards,
    Shiva

    Hi.
    If you mean on how to set default to date between dashboard prompt there is a Default to part in the prompt.
    Example - SQL Results:
    SELECT min(TIMES.TIME_ID) FROM "Presentation folder"
    SELECT max(TIMES.TIME_ID) FROM "Presentation folder"
    Or you can add repository variable as default for each date (from and to), etc.
    Regards
    Goran
    http://108obiee.blogspot.com

  • In Transaction code va41 how to set default sales contract start date

    Hi ,
    In Transaction code " VA41 "  how to set default sales contract start date and end date.
    Can any one tell me the correct user exit for the same.
    Thanks
    Basu

    hi,
    u have to use user exits  or badis.
    use sutable exits mentioned below.
    SDTRM001  Reschedule schedule lines without a new ATP check          
    SDVFX006  User exit: Tax line (transfer to accounting)               
    V45A0001  Determine alternative materials for product selection      
    V45A0002  Predefine sold-to party in sales document                  
    V45A0003  Collector for customer function modulpool MV45A            
    V45A0004  Copy packing proposal                                      
    V45E0001  Update the purchase order from the sales order             
    V45E0002  Data transfer in procurement elements (PRreq., assembly)   
    V45L0001  SD component supplier processing (customer enhancements)   
    V45P0001  SD customer function for cross-company code sales          
    V45S0001  Update sales document from configuration                   
    V45S0003  MRP-relevance for incomplete configuration                 
    V45S0004  Effectivity type in sales order                            
    V45W0001  SD Service Management: Forward Contract Data to Item       
    V46H0001  SD Customer functions for resource-related billing         
    V60F0001  SD Billing plan (customer enhancement) diff. to billing plan
    Edited by: katigiri linganna on Apr 28, 2009 12:19 PM

  • How to set default User preferences in Analyzer for all users

    How to set default User preferences in Analyzer for all users<BR><BR>Hi,<BR><BR>I would like to set some settings in Analyzer as default for all users. For example:<BR>1. Display | Char<BR>2. right mouse click on char | Chart Properties<BR>3. Axes tab<BR>4. "Format: Currency" i would like to change to "Format: Number".<BR><BR>How to set default values to all users? Is this possible?<BR><BR>Thanks,<BR>Grofaty

    I'm pretty sure higher access superceedes, so you could set up a group with no actual access, just to get the preferences working, then their individual security will dictate what they can do. I haven't tested this fully, but I beleive this is how it will work.<BR>As far as setting the preferences, go into the admin console and right click on the group, then select Preferences. To apply the group preferences to a user, add the user to the group, then right click on the user, select preferences and from the upper left corner, use the drop down to select the active preference, in this case, it will be the group you created and added them to.<BR><BR>HTH

  • How to set default print orientation in oracle reports 6i?

    Can anyone please help how to set default print orientation of Oracle Reports 6i? Currently document is printed in Portrait orientation, but I need to print it in Landscape orientation. Is this possible?

    It is solved now. Go to Layout Model -> Main Section, Press F4. In the property pallet select the Orientation that is required to be selected when print is taken for that report.

  • How to set default value to date type attribute.

    Hi,
    How to set default value to date type attribute.
    E.g I want to set u201C01/01/1999u201D to date attributes.
    First i want to set value and then i want to fetch the same & want to check equals.
    please suggest solution.
    Regards,
    Smita

    Hi,
    In wdinit() method u can set the date
    DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
    Date today = Calendar.getInstance().getTime();
    String reportDate = df.format(today);
    wdContext.currentContextElement().setFromDate(reportDate);
    Another way you have set the this formate like that
    1. Create a Simple type under "Dictionaries->SimpleType" called DateFormat
    2. Select the type as "date"
    3. Go to the "Representation" tab and set the format as "dd/MM/yyyy" (or whatever u want, but month should be MM)
    4.Bind the context attribute to the type created now.
    Hope this helps u.
    Best Regards
    Vijay K

  • How to set default programs???

    How to set default programs?
    An example: when I click on a .doc it opens in TextEdit, but I want it to open with NeoOffice (to make that happen now requires right-click>open with>NeoOffice)
    How can I set NeoOffice as the default program for .doc, .xls, .ppt?
    And set default programs for other files?
    Thanks.

    redaple
    Select a .doc and go File -> Get Info
    In the resulting window you'll see a pane called Open With... Select your preference from the Drop Down. To make the new app default for all these types, click 'Change All...'
    Regards
    TD

  • How to set default currency and Country in R12 financial modules

    Hi all,
    How to set default currency and Country in R12 financial modules (AR,AP,GL,FA,CE) becuase I found some default settings are shown "USD" & "United States" such as create AR Customer, the Country is shown the default "United States"....
    Can anybody advise ?
    Thanks & Regards,

    Hi,
    Change the below profile for the user to a territory different than the US :
    In System Administrator, navigate to Profiles -> System.
    Select Site, Application, and Responsibility.
    Profile options:
    Default Country
    HZ: Reference Territory
    ICX: Territory
    Regards,
    Raju.

  • How to set default values for boolean columns

    I'm trying to deploy some content types and columns into a site with a feature. All it's ok, except that I'm trying to set a default value for boolean columns with no success.
    I've tried to set default value at column level:
    <Field ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DisplayName="Se publican noticias en español"
    Type="Boolean" Hidden="FALSE" Group="Columnas ShaCon" >
    <Default>TRUE</Default>
    </Field>
    and at content type level:
    <FieldRef ID="{EFE23A1D-494E-45cf-832E-45E41B17F0CF}" Name="ScopeSpanish" DefaultValue="TRUE" Required="TRUE" />
    But in any case, when i create a new item with this content type, default value is applied.
    Can anyone tell how to set default values for boolean columns?
    Thanks in advance,
    Regards,
    Sergio

    In the field definition you can set
    <Default>1</Default>
    or
    <Default>0</Default>
    How to set the default value Null?

  • How to set default reject reason in VA01 (create sales order)

    Hi
    Everybody can tell me how to set default reject reason for item in sales order.
    in our sap system there are a default reject reason as '90'. We want to set it as "Null".
    Thanks
    Henry

    Hi,
    Assigning a default Reason for Rejection is not in standard SAP. I am sure there is some enhancement/user exit which updates the reason for rejection.
    Please get the help of an ABAPer, create the sales order in debugging mode and he will find out the logic behind the automatic reason for rejection.
    Before that you can find the exits in the include MV45AFZZ for any code related to this.
    Hope this helps

  • How to set default file path while downloading alv output

    Hi,
    Can anyone tell me that how to set default file path while downloading the ALV output to system using Local file button on tool bar.
    Please look below screenshots:
    Kindly help me resolve it.
    Thanks in advance.
    Regards,
    Ashutosh Katara

    This information initial value is (maybe) stored in Windows Register (register.exe) at Software\SAP\SAPGUI Front\SAP Frontend Server\Filetransfer -> PathDownload, you can read it thru class CL_GUI_FRONTEND_SERVICES method GET_UPLOAD_DOWNLOAD_PATH and update it thru method REGISTRY_SET_VALUE. (Else there may be some parameter ID to force data, but I'm no longer sure)
    Regards,
    Raymond

Maybe you are looking for