Validating the number of selected options in html:select multiple

Hi i am trying to validate the maximum number that can be selected from:
<html:select property="supportingWorkerIds" multiple="true" size="4"
                         tabindex="4">
<html:optionsCollection property="workerList" label="workerName"
                              value="userId" />
</html:select>
I want the user to not select more that 10 options for this. If its greater than 10 i want to display an error message.
I have tried adding the following in validation.xml:
<field property="supportingWorkerIds"
                    indexedListProperty="supportingWorkerIds" depends="validwhen">
<arg0 key="bookSeminarSessionForm.maxSupportWorkers" />
                    <var>
                         <var-name>test</var-name>
                         <var-value>( supportingWorkerIds.length > 10 )</var-value>
                    </var>
</field>
But it doesnt work .
Any suggestions?
Thanks in advance

Hi i am trying to validate the maximum number that can be selected from:
<html:select property="supportingWorkerIds" multiple="true" size="4"
                         tabindex="4">
<html:optionsCollection property="workerList" label="workerName"
                              value="userId" />
</html:select>
I want the user to not select more that 10 options for this. If its greater than 10 i want to display an error message.
I have tried adding the following in validation.xml:
<field property="supportingWorkerIds"
                    indexedListProperty="supportingWorkerIds" depends="validwhen">
<arg0 key="bookSeminarSessionForm.maxSupportWorkers" />
                    <var>
                         <var-name>test</var-name>
                         <var-value>( supportingWorkerIds.length > 10 )</var-value>
                    </var>
</field>
But it doesnt work .
Any suggestions?
Thanks in advance

Similar Messages

  • Preselect an option in html:select

    Hey,
    I am implementing struts in my application. How do i preselect an option in <html:select> tag
    here is what i am doing but the option does not get preselected.. the collection below returns A, B , C etc..
    <html:select property="accountClass" name="criteriaForm" value ="B" styleClass="selectBoxStyle">
    <logic:iterate id="myCollectionElement" collection="<%= Util.getAllClasses() %>">
    <html:option value ="<bean:write name="myCollectionElement" />">
    <bean:write name="myCollectionElement" /></html:option>
    </logic:iterate>     
    </html:select>
    everything seem to work fine except value "B" in the list box is not preselected.. how do i achieve this??
    Thanks
    KM

    Try using the <html:options> tag.
    <html:select property="accountClass" value="B">
        <html:options collection="<%= Util.getAllClasses() %>"
                      property="someValue"
                      labelProperty="someDescription" />
    </html:select>

  • Which system field returns the number of records returned after a select?

    Which system field returns the number of records returned after a select?
    a) sy-index
    b) sy-recno
    c) sy-lncnt
    d) sy-dbcnt
    e) sy-tabix

    Hi,
       SY-DBCNT
    Regards,
    Prashant

  • Need to disable one of the select-options in dynamic selection screen

    Hi,
    we have copied the Standard program: RFDOPR00 into Z, my requirement is to disable one of the select-options in dynamic selection screen for ex: Reason code(User shouldnot able to enter anything in it).
    Can anyone please tell me the procedure to do it... I had tried using at selection-screen but it doesnt work as it in 'LOOP AT SCREEN', i am not able to capture the Parameter name(screen-name).
    Thanks,
    Ravi

    Hi,
    Get inside your selection screen, by executing your program.
    Now type /h in the field where you enter transaction code and press enter.
    Now again press enter, this will take you debugger starting from your Selection screen.
    You might be knowing this, still if you are not aware of this, this might be a valuable tip.
    From here , you can trace your Parameter name.

  • How can I limit the number of rows returned by a select stat

    How can I limit the number of rows returned by a select
    statement. I have a query where I return the number of stores
    that are located in a given area.. I only want to return the
    first twenty-five stores. In some instances there may be over
    200 stores in a given location.
    I know is SQL 7 that I can set the pagesize to be 25....
    Anything similiar in Oracle 8i?
    null

    Debbie (guest) wrote:
    : Chad Nale (guest) wrote:
    : : How can I limit the number of rows returned by a select
    : : statement. I have a query where I return the number of
    : stores
    : : that are located in a given area.. I only want to return the
    : : first twenty-five stores. In some instances there may be
    : over
    : : 200 stores in a given location.
    : : I know is SQL 7 that I can set the pagesize to be 25....
    : : Anything similiar in Oracle 8i?
    : If you are in Sql*Plus, you could add the statement
    : WHERE rownum <= 25
    : Used together with an appropriate ORDER BY you
    : could get the first 25 stores.
    Watch out. ROWNUM is run before ORDER BY so this would only
    order the 25 selected
    null

  • Why am I not able to export NEF files to Photoshop from Lightroom to edit. This is new. When I right click on an image, the export to PS option is not selectable.

    Why am I not able to export NEF files to Photoshop from Lightroom to edit. This is new. When I right click on an image, the export to PS option is not selectable. I've never had this happen before. I haven't used it for a few weeks, so maybe there's an update (Mac or otherwise) that's screwing things up? HELP!

    I have an Edit In - Photoshop option, but not an Export - Photoshop option.
    Obviously to have right-click Edit In to work, the photo you're right-clicking on needs to be selected.  I assume this is not the problem, and that the photo is selected.
    Mavericks 10.9.3 has a problem where the Users folder is hidden, and you need to update iTunes to fix it, but it's been a few weeks since this happened so hopefully you're up-to-date and the Users folder isn't hidden anymore.
    If you can't get things to work, I'd uninstall LR and uninstall Photoshop, then install Photoshop, and update it, then install LR and update it, as a way to get any wayward security or other OS-level things reset.

  • Can I limit the number of rows returned on a Select?

    Can I limit the number of rows returned on a Select statement? I would be using JDBC in a Java program.

    Use Java prepared statements with the equivalent of this SQL*plus script:
    VARIABLE n number
    EXEC :n := 3;
    SELECT rownum FROM all_objects WHERE rownum <= :n;
        ROWNUM
             1
             2
             3
    EXEC :n := 5;
    SELECT rownum FROM all_objects WHERE rownum <= :n;
        ROWNUM
             1
             2
             3
             4
             5

  • Count the number of rows resulting from a select statement

    Hi,
    Is there any way of counting the number of rows resulting from a select statement. i.e I have a select distinct statement and I then want to perform an IF statement on the number of rows resulting from the select statement.
    Any help appreciated
    Thanks
    Gary

    Declare
    var1 number;
    Begin
    select count(distinct column_name) into
    var1 from table_name;
    If var1 > x Then
    End IF;
    End;
    Hope I understood the problem correctly
    null

  • Adding default value for a select-options in a selection-screen

    hello gurus,
    i have a report program with the following select-options in a selection-screen block:
    select-options:  so_site  for MyTable-werks.
    i want the so_site to have a default value once the program displays. can it be possible?
    regards,
    sid

    Hi sid,
    1. Whenever we use select-option,
       an internal table of type range is
      automatically created.
    2. so, in fact, we have to put
       record in this internal table.
    3. eg. Just copy paste in new program.
    4.
    report abc.
    tables : t001.
    select-options : bukrs for t001-bukrs.
    initialization.
      bukrs-sign = 'I'.
      bukrs-option = 'EQ'.
      bukrs-low = '1000'.
      append bukrs.
    regards,
    amit m.

  • Default Current year in select option field on selection Screen

    Dear Experts,
    I want to set current year as default value in fiscal year select-options field on selection screen.
    for this, i hv written following code
    DATA:VAR_DATE TYPE SY-DATUM.
    DATA VAR(4) TYPE C.
    VAR_DATE = SY-DATUM.
    VAR = VAR_DATE+0(4).
    this retrieves current year .
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS I11 FOR ANLC-GJAHR DEFAULT VAR TO VAR..                            "Fiscal Year
    SELECTION-SCREEN END OF BLOCK B1.
    Now when i am executing program pop-up is raised describing "Specify the range Limits". Please help.
    Regards,
    Apoorv Sharma

    >
    Ganga Bhavani R wrote:
    > Use below lines.
    >
    > SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    > SELECT-OPTIONS I11 FOR ANLC-GJAHR DEFAULT SY-DATUM+0(4). "Fiscal Year
    > SELECTION-SCREEN END OF BLOCK B1.
    Hi, Ganga,
    I think it will not working properly that way, Please test the bellow Sample Code.
    TABLES: anlc.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS i11 FOR anlc-gjahr .
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      IF i11[] IS INITIAL.
        i11-low = sy-datum+0(4).
        APPEND i11.
      ENDIF.
    Thanks and Regards,
    Faisal

  • Say in selection screeen (ie is in select-options) i have selected record r

    say in selection screeen (ie is in select-options) i have selected record range from 1000 to 2000 but in the final display list i sholud not get 1200 to 1300 records it should be hide how is it posible
    Thanks
    Basu

    Hello Math,
    There are two ways of restricting the records with 1200 & 1300 values in output list display -
    1. Either restrict the records while selecting the data from database using SELECT query. This can be achieved by ranges table populated with the values, which won't select the 1200 & 1300 records.
    Find the following code for this -
    TABLES: TAB1.
    RANGES: R_FLD1 FOR TAB1-FLD1.
    R_FLD1-SIGN = 'I' .
    R_FLD1-OPTION = 'EQ'.
    R_FLD1-LOW = '1000'.
    R_FLD1-HIGH = '2000'.
    APPEND R_FLD1.
    R_FLD1-SIGN = 'I' .
    R_FLD1-OPTION = 'NE'.
    R_FLD1-LOW = '1200'.
    R_FLD1-HIGH = '1300'
    APPEND R_FLD1.
    SELECT * FROM TAB1
        INTO IT_TAB1
        WHERE FLD1 IN R_FLD1.
    2. Select the data first in internal table first and then delete the entries having 1200 & 1300 values.
    Find the following code for this -
    TABLES: TAB1.
    RANGES: R_FLD1 FOR TAB1-FLD1.
    SELECT * FROM TAB1
        INTO IT_TAB1
        WHERE FLD1 IN R_FLD1.
    IF SY-SUBRC EQ 0.
      SORT IT_TAB1 BY FLD1.
      DELETE IT_TAB1 WHERE ( FLD1 = '1200' ) OR  ( FLD1 = '1300' ).
    ENDIF.
    Hope this helps you.
    PS If the answer solves your query, plz close the thread by rewarding each reply and marking it Solved.
    Regards

  • Can we hide the select-option in a selection screen

    Hi all,
    I have two radio buttons in my selection screen with 1 select-option criteria, now on choosing the other radio button I want that a different select-option criteria should appears.
    Thanks

    hi kunal check the code below.
    TABLES : SSCRFIELDS,MARA.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
    PARAMETERS : R1 RADIOBUTTON GROUP RB1 DEFAULT 'X',
    R2 RADIOBUTTON GROUP RB1,
    R3 RADIOBUTTON GROUP RB1,
    R4 RADIOBUTTON GROUP RB1.
    SELECTION-SCREEN PUSHBUTTON /10(20) FRST USER-COMMAND FRST.
    SELECTION-SCREEN PUSHBUTTON /10(20) SCND USER-COMMAND SCND.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA : ACTIVE1 VALUE '1',
    ACTIVE2 VALUE '1'.
    initialization.
    move 'frst' to frst.
    move 'scnd' to scnd.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF SCREEN-NAME = 'R1' OR SCREEN-NAME = 'R2' .
    SCREEN-INVISIBLE = ACTIVE1.
    screen-output = '1'.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-NAME = 'R3' OR SCREEN-NAME = 'R4' .
    SCREEN-INVISIBLE = ACTIVE2.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    AT SELECTION-SCREEN.
    CASE SSCRFIELDS-UCOMM.
    WHEN 'FRST'.
    ACTIVE1 = '0'.
    ACTIVE2 = '1'.
    WHEN 'SCND'.
    ACTIVE2 = '0'.
    ACTIVE1 = '1'.
    ENDCASE.

  • How to Limit the Number of Users Logged into HTML DB

    I'm using LDAP based SSO and I'd like to limit the number of users who can log into the application at a given time. If my users are assigned to groups, can I also limit the number of users who belong to a certain group who can be logged in at one time? Can anyone think of any HTML DB APIs that might be useful in doing this?

    Well if you apply a "time-out" on the session and if the there is a HTML DB table in the FLOWS account that can be queried to see the number of sessions, then you could restrict HTML DB sessions to a certain number. But if you have multiple HTML DB applications, how are you going to know which HTML DB session goes which application?
    It is very ugly. I realistically cannot see a way. Maybe the Oracle folks have a way of limiting the sessions internally within HTML DB
    Just out of curiosity, why do you want to limit the number of users? Maybe if you explain that then that might help in coming up with a solution.
    Mike

  • How to measure the number of pixels involved in a selected area of a digital photo?

    Hi everyone. I want to determine the number of pixels in an object that is part of a digital photo. I use cameras to film chunks of ice breaking away from ice cliffs or tidewater glaciers. I want to know the size of the ice chunk that my digital photographs capture. I know the width and height of the ice cliff in metres already, so I was thinking that I could convert the equivalent of 1 pixel : ? metres - this is really what I want to do. That way every time I see a chunk of ice breaking off, I can pull up the photo, outline the chunk, calculate how many pixels fill the area of ice removed by the chunk breaking off and convert to metres area 2 - thus giving me my size order. If anyone has ideas on how to do this I would really appreciate it, thanks so much community. I was thinking that Photoshop or Fireworks could help me with this, Ricky

    Hi SIlkrooster,
    Thanks for responding and giving a suggestion,
    I followed your approach (see attached screen shot) , Image, Image Size, and found that approximately 37 pixels = 1 centimetre. So just to be clear - if I measure a straight line with the ruler tool that is say 10cm long, I can simply do: 10 cm * 37 pixels (1cm equivalent) = 370 pixels for the straight line. Do you agree?
    Do you agree?

  • How to validated the number values in Controller

    Hi
    How to validate the number values in Controller.
    Please help me.
    Thanks
    Rajavel Ramalingam

    Hi
    Nagesh Manda,
    MessageTextInput one filed already have varchar2 filed. I am going modified character to number(throw the controller). For the example that page submit button press that time validate the filed. Only enter number. don’t enter charter.
    Thanks
    Rajavel

Maybe you are looking for

  • Photosmart

    I have a MS Lumia 830 smartphone with WPh8. The available printing app in my Phone : the HP AiO remote BETA, sees my Printer but does not print. When will this app be completed ?

  • Multiple users updates the same data - RowInconsistentException

    Hi, I'm using JDeveloper 11.1.2.1 Locking mode: optimistic Scenario: - Have 2 users (user 1 & user 2) running application x - Both users updates the same record - user 1 hits save first (and hence no error) - user 2 hits save after user 1, and gets R

  • Downpayment Clearing in Logistic Invoice verification

    Hi All, we have activated Business Function " LOG_MMFI_P2P " and Switch "MM_SFWS_CI_01 - Enhanced Functions in EhP4 for Applications in Materials Management" using Tcode SFW1. And followed all instructions documented when activated Business Function

  • How to get unit cost for finished goods in prod order

    HI all, IN a production order of type PP04, there is cost analysis you can get from CO03.  This shows the cost for finished goods and BOM components.  Would anyone know how the cost for finished goods are calculated ?  The issue i have is that the un

  • Calculated Re depreciation for an asset

    Hi, Please help me in solving the below issue, The unplanned depreciation was been charged in the month of December for the fiscal year 2010 and it has been reversed. I want to charge the depreciation once again for the same asset but it should not g