Dropdown List Value Test For Null || " "

     I wrote a pre-sign script to test a for a value in a dropdown list before allowing signature of the document. However I want to test for a value of null in addtion to one space aka " ". I added a value in the dropdown list of " " along with the choices of names so users could erase an accidental selection in this list before they were ready. However when I place the or ( || ) operator in the if statement of the script the script doesn't work. If I remove the || " " statement the script works as it is supposed to. How do I test for this value of " " along with the null test so I don't have to write another if statement?
if (form1.Page3.Author.Reviewed.Admin.rawValue == null || " ")
xfa.event.cancelAction = 1
xfa.host.messageBox("You did not select your name on the dropdown list before trying sign the document .");
else

Your if statement is incomplete. You need to put the test in again for the other value:
if (form1.Page3.Author.Reviewed.Admin.rawValue == null || form1.Page3.Author.Reviewed.Admin.rawValue == " ")

Similar Messages

  • Max length of Dropdown list value

    Hello,
    I wanted to know the maximum length that a dropdown list value can have in an offline Adobe form. Any help would be appreciated.
    Thanks,
    Rohini.

    Hi,
    Its always better to keep the no: of values in the drop down to hundreds.
    If you are running to 1000's, go for some other options like asking the user to enter the value and then do the check for that specific value. Also, usability of the drop down will be worse, if it has more values (just think of you selecting a value from a list of 10000 values - sorted or not).
    It may also result in the scroll bar growing so thin that it disappears, do try it out yourselves by increasing the values to about 130000 [:)].
    Thanks and Best Regards,
    Anto.

  • Me21n change line item dropdown list value

    hi experts,
    i have a requirement to automatically remove the aulty po line item when user click on CHECK or SAVE button, i done this by removing the record from ETT[] and POT[] at ENHANCEMENT-POINT mm06ef0p_pruefen_01 SPOTS es_mm06ef0p_pruefen INCLUDE BOUND.
    it is working fine except one scenario which is, if the faulty line item is 00020, and the line item dropdown list is selected line item 20, after i removed the record from POT[], it hits abap runtime error. when i check at debugger, it is caused by system will look for line item 00020 ( follow dropdown list value ) but the record is removed, so come to error... it is working fine if the dropdown list is selected line item 10.
    so i am looking for a way to change the dropdown list value.
    or you all have some other suggestion?
    please help... i need it urgently coz i have been solving the problem for 2 weeks....
    thanks a lot

    Hi,
    generally it's not a good idea to delete item without using standard method. You can see one example why it is usually complicated. Maybe I have a workaround for you. You can try to use BADI ME_PROCESS_PO_CUST. There is a method CHECK where you get reference to PO header. You can easily get references to your items by calling method GET_ITEMS. So you will perform your check for each item and for wrong items you will call method INVALIDATE. This item will be marked as invalid and it will not be posted. Here I do not know how it will be displayed to user. Maybe the user will have to delete this item manually.
    Cheers

  • Test for null result set

    I am trying to do a test for a null result set. Basically if the result set returns a value I want to display a table, otherwise I want to display an error message. The following code does not produce the error message. Either the test for null is incorrect, or for some reason I am not getting a null result set even when I don't enter any text into the following text boxes (this is for a login screen, these text boxes come a login screen):
    <input type="text" name="username">
    <input type="text" name="password">
    This is the code for the action page:
    <HTML>
    <%@page import="java.sql.*"%>
    <%
    //define connection
    Connection con = null;
    String user1 = request.getParameter("username");
    String pass1 = request.getParameter("password");
    String test = "good";
    try{
    //get the class
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    //get the connection
    con = DriverManager.getConnection("jdbc:odbc:errorlog", "admin", "");
    //catch your exceptions!
    catch(Exception e){
         out.println(e.getMessage());
    %>
    <title>Error Application - Logged Errors</title>
    <link href="style/errorstyle.css" rel="stylesheet" type="text/css">
    <BODY>
    <%
    //define resultset and statement
    ResultSet rs=null;
    Statement stmt=null;
    try {
    //Using the current database connection create a statement
    stmt=con.createStatement();
    %>
    <%
    String sql="SELECT* FROM tblUsers" + " WHERE Username = '"+user1+"' AND Password ='"+pass1+"'";
    rs = stmt.executeQuery(sql);
    %>
    <% //Fetch all the records and print in table
    while(rs.next()){
    String user2 = rs.getString("FirstName");
    String pass2 = rs.getString("LastName");
    %>
    <table width="100%" border="0" cellspacing="1" cellpadding="6">
    <tr >
    <td width="67" height="27" bgcolor="#999999"><strong><font size="- 1">First Name</font></strong>
    </td>
    <td width="89" bgcolor="#999999"><strong><font size="-1">Last
    Name</font></strong>
    </td>
    </tr>
    <tr>
    <td>
    <%out.println(user2);%>
    </td>
    <td><%out.println(pass2);%></td>
    </table>
    <%}
    if (rs == null)
    out.println("Incorrect Username or Password");
    //close all your open resultsets, statements, and connection when you are done with them!
    rs.close();
    stmt.close();
    con.close();
    //catch all your exceptions
    catch (SQLException e) {
         out.println(e.getMessage());
    %>

    You simply test the rs.next().
    if ( rs.next() )
    //spit out the rs row and
    //continue processing the resultset 'til empty
    else
    msg = "invalid username or password
    }

  • Change image when form dropdown list value is selected

    I really thought this would be simpler but I just can't get it working.
    I have a submit from from paypal with a dropdown list. The list allows you to select color. I want to change an image on the page to display the appropriate color when the color is selected from the drop down list. So a black image shows up when black is selected, a red when red - etc...
    I would be very grateful if someone can share some succinct, browser compatible code. Thank you so much for any help you can provide.
    Bill

    Thanks so much.  I used your info from above and am in the process of creating a product configurator for our products.  Do you see any problems/issues etc or ways to make this script better?  I don't have most of the images there yet, but if you choose big boy chair and then choose navy/powder/black fabric and most accent colors you should see it working (in FireFox anyway).  Not sure why it isn't working in IE.  Any ideas?
    Here's the link:
    http://logochairs.com/j25cms/index.php/customform/test-form
    And here's my code:
    <script type="text/javascript">
    <!--
    function logo_prodImgBySel(objId,theValue) {
    var cobaseimages=["/j25cms/images/customimages/blank.jpg","/j25cms/images/customimages/11/base.jpg", "/j25cms/images/customimages/12/base.jpg", "/j25cms/images/customimages/13/base.jpg", "/j25cms/images/customimages/15/base.jpg", "/j25cms/images/customimages/20/base.jpg", "/j25cms/images/customimages/23/base.jpg", "/j25cms/images/customimages/24/base.jpg", "/j25cms/images/customimages/25/base.jpg", "/j25cms/images/customimages/27/base.jpg", "/j25cms/images/customimages/32/base.jpg", "/j25cms/images/customimages/35/base.jpg", "/j25cms/images/customimages/39/base.jpg", "/j25cms/images/customimages/41/base.jpg", "/j25cms/images/customimages/42/base.jpg", "/j25cms/images/customimages/48/base.jpg", "/j25cms/images/customimages/50/base.jpg", "/j25cms/images/customimages/51/base.jpg", "/j25cms/images/customimages/52/base.jpg", "/j25cms/images/customimages/54/base.jpg", "/j25cms/images/customimages/56/base.jpg", "/j25cms/images/customimages/57/base.jpg", "/j25cms/images/customimages/58/base.jpg", "/j25cms/images/customimages/60/base.jpg", "/j25cms/images/customimages/62/base.jpg", "/j25cms/images/customimages/64/base.jpg", "/j25cms/images/customimages/65/base.jpg", "/j25cms/images/customimages/68/base.jpg", "/j25cms/images/customimages/69/base.jpg", "/j25cms/images/customimages/71/base.jpg", "/j25cms/images/customimages/72/base.jpg", "/j25cms/images/customimages/74/base.jpg", "/j25cms/images/customimages/77/base.jpg", "/j25cms/images/customimages/78/base.jpg", "/j25cms/images/customimages/79/base.jpg", "/j25cms/images/customimages/80/base.jpg", "/j25cms/images/customimages/82/base.jpg", "/j25cms/images/customimages/83/base.jpg", "/j25cms/images/customimages/84/base.jpg", "/j25cms/images/customimages/90/base.jpg", "/j25cms/images/customimages/94/base.jpg"];
        var d=document;
        theValue=cobaseimages[theValue];
        if (!theValue || !d.getElementById ) return;
        var obj = d.getElementById(objId);
        if (obj) obj.src=theValue;  
    <!--
    function logo_prodImgPrim(objId,theValue) {
      var coimageprimary1='/j25cms/images/customimages/';
    var coimageprimary25= document.getElementById('ff_elem368');
    var coimageprimary2= coimageprimary25.options[coimageprimary25.selectedIndex].value; 
    var coimageprimary3='/primary/';
    var ttt='Powder.png';
    var mypath=(coimageprimary1 + coimageprimary2 + coimageprimary3);
      var coPrimaryimages=['/j25cms/images/customimages/blank.png',(mypath + 'White.png'),
    (mypath + 'Black.png'),
    (mypath + 'Lemon.png'),
    (mypath + 'Yellow.png'),
    (mypath + 'Gold.png'),
    (mypath + 'Tangerine.png'),
    (mypath + 'Rust.png'),
    (mypath + 'Orange.png'),
    (mypath + 'Carrot.png'),
    (mypath + 'Red.png'),
    (mypath + 'Cardinal.png'),
    (mypath + 'Garnet.png'),
    (mypath + 'Maroon.png'),
    (mypath + 'Purple.png'),
    (mypath + 'Powder.png'),
    (mypath + 'Navy.png'),
    (mypath + 'Royal.png'),
    (mypath + 'Hunter.png'),
    (mypath + 'Gray.png'),
    (mypath + 'Charcoal.png'),
    (mypath + 'Khaki.png'),
    (mypath + 'Vegas.png'),
    (mypath + 'Kelly.png'),
    (mypath + 'Pink.png'),
        var d=document;
        theValue=coPrimaryimages[theValue];
        if (!theValue || !d.getElementById ) return;
        var obj = d.getElementById(objId);
        if (obj) obj.src=theValue;  
      <!--
    function logo_prodImgSec(objId,theValue) {
      var coimagesecondary1='/j25cms/images/customimages/';
    var coimagesecondary25= document.getElementById('ff_elem368');
    var coimagesecondary2= coimagesecondary25.options[coimagesecondary25.selectedIndex].value; 
    var coimagesecondary3='/accent/';
    var ttt='Powder.png';
    var mypathz=(coimagesecondary1 + coimagesecondary2 + coimagesecondary3);
      var coSecondaryimages=['/j25cms/images/customimages/blank.png',(mypathz + 'White.png'),
    (mypathz + 'Black.png'),
    (mypathz + 'Lemon.png'),
    (mypathz + 'Yellow.png'),
    (mypathz + 'Gold.png'),
    (mypathz + 'Tangerine.png'),
    (mypathz + 'Rust.png'),
    (mypathz + 'Orange.png'),
    (mypathz + 'Carrot.png'),
    (mypathz + 'Red.png'),
    (mypathz + 'Cardinal.png'),
    (mypathz + 'Garnet.png'),
    (mypathz + 'Maroon.png'),
    (mypathz + 'Purple.png'),
    (mypathz + 'Powder.png'),
    (mypathz + 'Navy.png'),
    (mypathz + 'Royal.png'),
    (mypathz + 'Hunter.png'),
    (mypathz + 'Gray.png'),
    (mypathz + 'Charcoal.png'),
    (mypathz + 'Khaki.png'),
    (mypathz + 'Vegas.png'),
    (mypathz + 'Kelly.png'),
    (mypathz + 'Pink.png'),
        var d=document;
        theValue=coSecondaryimages[theValue];
        if (!theValue || !d.getElementById ) return;
        var obj = d.getElementById(objId);
        if (obj) obj.src=theValue;  
    function clear_OnChange()
    var combo = document.getElementById('ff_elemPriColor');
    combo.selectedIndex = "0";
    var combo2 = document.getElementById('ff_elemSecColor');
    combo2.selectedIndex = "0";
    </script>
    <div id="product1image_a" style="position: relative; float: right; top: -20px; right: 0px; width: 250px; height: 250px; border: 2px solid darkgray; box-shadow: 5px 5px 5px rgb(136, 136, 136);">
      <img width="250" height="250" style="position:absolute;bottom:0px;right:0px;" id="theImg" src="images/customimages/blank.jpg" alt="" />
      <img id="thePrimary" style="position:absolute; bottom:0px; right:0px; width:250px;" src="images/customimages/blank.png">
      <img id="theAccent" style="position:absolute; top:0px; left:0px; width:250px;" src="images/customimages/blank.png">
    </div>
    <span id="bfElemWrap368" class="bfElemWrap bfLabelLeft">
    <label id="bfLabel368" for="ff_elem358">Product Line</label>
    <select id="ff_elem368" name="ff_nm_prod1[]" onchange="logo_prodImgBySel('theImg',this.selectedIndex);clear_OnChange();logo_prodImgPrim('thePrim ary',this.selectedIndex);logo_prodImgSec('theAccent',this.selectedIndex);" class="ff_elem">
    <option value="" selected="selected"></option>
    <option value="11">Big Boy Chair</option>
    <option value="12">Deluxe Chair</option>
    <option value="13">Canvas Chair</option>
    <option value="15">Sphere Chair</option>
    <option value="20">Toddler Chair</option>
    <option value="23">Classic Fleece</option>
    <option value="24">Sherpa Throw</option>
    <option value="25">Fleece Throw</option>
    <option value="27">UltraSoft Blanket</option>
    <option value="32">Tailgate Table</option>
    <option value="35">Trashcan Cooler</option>
    <option value="39">Economy Tent</option>
    <option value="41">Color Tent</option>
    <option value="42">Checkerboard Tent</option>
    <option value="48">Side Panel</option>
    <option value="50">12 Pack Cooler</option>
    <option value="51">Luggage Set</option>
    <option value="52">Rolling Duffel</option>
    <option value="54">Sport Duffel</option>
    <option value="56">Lunch Pail</option>
    <option value="57">Rolling Cooler</option>
    <option value="58">Party Bucket</option>
    <option value="60">Picnic Cooler</option>
    <option value="62">Backpack</option>
    <option value="64">String Pack</option>
    <option value="65">Reversible Tote</option>
    <option value="68">Seat Blanket Combo</option>
    <option value="69">Stadium Seat with Arms</option>
    <option value="71">Stadium Cushion</option>
    <option value="72">Gym Bag</option>
    <option value="74">Sweatshirt Blanket</option>
    <option value="77">Round Coozie</option>
    <option value="78">Flat Coozie</option>
    <option value="79">Bottle Coozie</option>
    <option value="80">Stadium Seat</option>
    <option value="82">8-Can Cooler Tote</option>
    <option value="83">16-Can Cooler Tote</option>
    <option value="84">30-Can Cooler Tote</option>
    <option value="90">Camping Stool</option>
    <option value="94">Hardback Seat</option>
      </span>
    </select>
    <span id="bfElemWrapPriColor" class="bfElemWrap bfLabelLeft">
    <label id="bfLabelPriColor" for="ff_elemPriColor">Primary Fabric</label>
    <select id="ff_elemPriColor" name="ff_nm_prodcolor[]" onchange="logo_prodImgPrim('thePrimary',this.selectedIndex)" class="ff_elem">
    <option value="" selected="selected"></option>
    <option value="White">White</option>
    <option value="Black">Black</option>
    <option value="Lemon">Lemon</option>
    <option value="Yellow">Yellow</option>
    <option value="Gold">Gold</option>
    <option value="Tangerine">Tangerine</option>
    <option value="Rust">Rust</option>
    <option value="Orange">Orange</option>
    <option value="Carrot">Carrot</option>
    <option value="Red">Red</option>
    <option value="Cardinal">Cardinal</option>
    <option value="Garnet">Garnet</option>
    <option value="Maroon">Maroon</option>
    <option value="Purple">Purple</option>
    <option value="Powder">Powder</option>
    <option value="Navy">Navy</option>
    <option value="Royal">Royal</option>
    <option value="Hunter">Hunter</option>
    <option value="Gray">Gray</option>
    <option value="Charcoal">Charcoal</option>
    <option value="Khaki">Khaki</option>
    <option value="Vegas">Vegas</option>
    <option value="Kelly">Kelly</option>
    <option value=

  • Problem in mapping dropdown list  values with the queries

    hi,
    I am building a simple applicaittion of currency conversion.
    The scenario :
    I have a input form with a dropdown list and a input field to enter the amount
    I have created the drop down list with the respective details
    Value   Desc
    1          dollarToeuro
    2          euroTodollar 
    when the user selects the first option in the drop down list and then enters the value and gives a submit -> the conversion takes place
    but evrytime i select the second option --> the application hangs..
    i have given a guard condition in the submit action for each if the query as LIKE(@option,"1") OR LIKE(@option,"2") for the respective queries.
    Please can someone tell me where i am going wrong???
    Regards,
    Vaishali

    Hi ,
    what is the need of ur gaurd condition there?
    and try to run the model without that guard condition.
    Regards,
    Govindu

  • Dropdown list on Dynpro for a disabled input field - No PAI triggered?

    Hello experts,
    I am facing a problem with a dropdown list on a dynpro (defined as a subscreen). The drop down list should be  for a field that is not input ready (at least it should appear not being input ready).
    The user should be able to pick a value from the dropdown list and as soon the selected row changes a PAI should be processed as other fields on the main dynpro as well as the subscreen itself need to change accordingly.
    The dropdown list works fine but with the field not being set to input ready - neither the input field changes nor a PAI etc. is triggered.
    But if the property for input is set to input ready, it works fine.
    Info:
    Dropdown list is populated in POV
    A function code is assigned to the field
    What am I missing here?
    What properties must be set for the field.
    Thanks,
    Chris
    PS. If set to input - how do I prevent the single empty line in the list?

    hi
    good
    SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE node.
    allows you to define further nodes for dynamic selections. If the node has type T, you can use TABLE instead of NODE. The user can then decide at runtime the components of the node for which he or she wants to enter selections. Dynamic selections require special handling in the database program
    F4 HELP->
    AT SELECTION SCREEN ON VALUE REQUEST FOR P_SACHA.
        PERFORM VALUES_SACHA.
    THANKS
    MRUTYUN^

  • JSTL Core - How to test for null?

    How do I test an attribute for null using JSLT's if statement? The below code does not work (the JSTL if statement does not return true). The scriptlet however does work and displays the statement.
    - Chris
    index.jsp
    <%@ taglib uri="c.tld" prefix="c"%>
    <%@ taglib uri="fmt.tld" prefix="fmt"%>
    <%@page import="java.util.*"%>
    <%
       request.setAttribute("null", null);
    %>
    <html>
    <head>
      <title>JSTL Test Page</title>
    </head>
    <body>
    <c:if test="${null}==null">
    The value was null (JSTL)
    </c:if>
    <%
      if (request.getAttribute("null")==null) out.print("The value was null (Scriptlet)");
    %>
    </body>
    </html>
    <%out.flush();%>

    Well, I figured out. If anyone is interested, here is the code:
    <c:if test="${empty varName}">
      Its null
    </c:if>

  • Where condition to test for null

    Hi,
    I have a query where we were thinking that 2 fields will not have null values even though column allows nulls. So, wrote a query like this:
    select.......
    From table 1 left outer join table2 on (table1.name = 'I' and table2.accountnum in (table1.creditact, table1.debitact).
    Now I need to check for null if table1.creditact and table1.debitact. If both fields are null, then I have to use third column to check because out of 3 column (creditact, debitact, act) one must have account number. How can I do it.
    Thanks,
    Spunny

    I have a query where we were thinking that 2 fields [sic: columns are not fields] will not have NULL values [sic: NULL is not a value] even though column allows NULLs. So, wrote a query like this:
    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. What you did post implies that your design is wrong. Did you actually have debits and credits as separate attributes in RDBMS? No, surely not! I will guess, based 30+ years of SQL, that you have a crappy design
    with too many NULLs. 
    Would you like to obey the Netiquette so we can actually help you, or you do just want a Kludge? 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Trying to test for null input

    I am trying to get some input from a user using:
    String name="";       
    BufferedReader in = new BufferedReader(
        new InputStreamReader(System.in));
    name = in.readLine();Let's say the user inputs nothing other than the enter key, how can I test for this so that I can write output for it?
    In Python, one would use something like:
    if not name:
         <then do something>Thanks,
    Harlin Seritt

    Thanks for the help. When I try it with an empty
    string test, nothing happens. However, the test of
    name.length() works perfectly. Thanks!
    Harlin SerittI'm guessing you tried this, right?
    if (name == "") ...
    That's not the way to compare string values. The == operator only compares object references when comparing 2 objects. It's an extremely common mistake.

  • Query of queries testing for null or empty dates

    I'm having problems with this query (within a function). The
    last condition in the where clause needs to check for an empty or
    null date and then check against the current date (which is fine),
    im aware that the syntax is wrong but wondered if someone could
    correct it for me to get it working.
    <cfquery name="filterQuery" dbtype="query"
    maxrows="#arguments.top#">
    select * from getAllSaved
    where
    workFlowStatusId = <cfqueryparam
    cfsqltype="CF_SQL_INTEGER"
    value="#application.const.WORKFLOW_LIVE#" />
    and
    dateArchive > <cfqueryparam cfsqltype="CF_SQL_DATE"
    value="#now()#" />
    and
    dateLive <= <cfqueryparam cfsqltype="CF_SQL_DATE"
    value="#now()#" />
    and
    (dateExpiry is null or dateExpiry = '') or dateExpiry >
    <cfqueryparam cfsqltype="CF_SQL_DATE" value="#now()#" />
    </cfquery>

    I feel stupid, although i'd put a fiver on having tried that!
    thanks

  • Populate cc field based on dropdown list values

    I know this question has been posted before, but I'm very new at this, and the answers I've found so far are over my head.
    I'm trying to create a submit button that will not only e-mail to a specific address, but also carbon copy someone when their name is selected in a drop-down list on the form.
    I don't know much about javascript - and that seems to be the way to get this done - but I don't know the syntax or where to enter the JS to get this functionality. The field I am using is called 'Supervisor1', and I've assigned values (e-mail addresses) to each of the names in the drop-down.
    Can someone help me get this done?
    Thanks in advance!

    Hi,
    this scenario is not covered by the macro, but it's not that complicated to handle.
    1. Select the button with the script you generated with the macro.
    2. Now wrap the mail function into an if-expression.
    This sample checks if var0 or var1 is null.
    var var0 = xfa.resolveNode("Formular1.#subform.Dropdown1").rawValue;
    var var1 = xfa.resolveNode("Formular1.#subform.Textfield1").rawValue;
    if (var0 === null || var1 === null) {
              xfa.host.messageBox("Please select an item from the drop down box first!");
    } else {
              event.target.mailDoc({
                        bUI: false,
                        cTo: var1,
                        cCc: var0,
                        cBcc: '',
                        cSubject: 'Testmail',
                        cMsg: 'Hello,\n\nhere is the final form data. \n\nKind regards\nMe'

  • Beginner question - testing for null string from shell script command

    I'm trying to test the result of a shell script command. I want to put out a message if the result is a null string. At present I get this applescript error "The command exited with a non-zero status"
    I'm sure this is a simple question ... but I can't figure out how to do it. Help!

    You can use try clause for the problem:
    set _result to ""
    try
    set _result to do shell script "/blah/andblah"
    end

  • Conversion Error setting value '33'  for 'null Converter'

    Hi,everyone,it looks my custom Converter dosen't work.
    CreditCard class:
    package com.corejsf;
    public class CreditCard {
         private String number;
         public CreditCard(){
         public CreditCard(String number){
              this.number=number;
         public String toString(){
              return this.number;
    ==============================
    PaymentBean:
    package com.corejsf;
    import java.util.Date;
    public class PaymentBean {
         private double amount;
         private Date date=new Date();
         private CreditCard card;
         public PaymentBean(){
         public double getAmount(){
              return this.amount;
         public void setAmount(double newValue){
              this.amount=newValue;
         public Date getDate(){
              return this.date;
         public void setDate(Date newValue){
              this.date=newValue;
         public CreditCard getCard(){
              return this.card;
         public void setCard(CreditCard newValue){
              this.card=newValue;
    =================================
    CreditCardConvert:
    package com.corejsf;
    import javax.faces.component.UIComponent;
    import javax.faces.context.FacesContext;
    import javax.faces.convert.Converter;
    import javax.faces.convert.ConverterException;
    import javax.faces.application.FacesMessage;
    public class CreditCardConvert implements Converter{
         public Object getAsObject(FacesContext context,UIComponent component,String newValue) throws ConverterException{
              StringBuilder builderForNewValue=new StringBuilder(newValue);
              boolean foundInvalidCharacter=false;
              char invalidChar;
              int newValueLength=newValue.length();
              int i=0;
              char chFromNewValue;
              while(i<newValueLength && !foundInvalidCharacter){
                   chFromNewValue=builderForNewValue.charAt(i);
                   if(Character.isDigit(chFromNewValue) || Character.isSpaceChar(chFromNewValue)){
                        i++;
                   }else{
                        foundInvalidCharacter=true;
                        invalidChar=chFromNewValue;
                        FacesMessage message=new FacesMessage();
                        message.setDetail("detail error convert message for CreditCard with error Char:"+invalidChar);
                        message.setSummary("summary error convert message for CreditCard with error Char:"+invalidChar);
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        throw new ConverterException(message);
              return new CreditCard(builderForNewValue.toString());
         public String getAsString(FacesContext context,UIComponent component,Object newValue) throws ConverterException{
              return newValue.toString();
    ===============================
    faces-config.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <faces-config
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
    version="2.0">
         <managed-bean>
              <managed-bean-name>payment</managed-bean-name>
              <managed-bean-class>com.corejsf.PaymentBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <converter>
              <converter-id>com.corejsf.CardConvert</converter-id>
              <converter-class>com.corejsf.CreditCardConvert</converter-class>
         </converter>     
         <navigation-rule>
              <from-view-id>/index.xhtml</from-view-id>
              <navigation-case>
                   <from-outcome>result</from-outcome>
                   <to-view-id>/result.xhtml</to-view-id>
                   <redirect/>
              </navigation-case>
         </navigation-rule>
         <navigation-rule>
              <from-view-id>/result.xhtml</from-view-id>
              <navigation-case>
                   <from-outcome>index</from-outcome>
                   <to-view-id>/index.xhtml</to-view-id>
                   <redirect/>
              </navigation-case>
         </navigation-rule>
    </faces-config>
    ==================================================
    index.xhtml:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core">
         <h:head>
              <title>index page</title>
         </h:head>
         <h:body>
              <h:form>
                   <table>
                        <tr>
                             <td>
                                  <h:inputText id="iptCard" label="card" required="true" convert="com.corejsf.CardConvert" value="#{payment.card}">
                                  </h:inputText>
                                  <h:message for="iptCard"></h:message>
                             </td>
                        </tr>
                        <tr>
                             <td>
                                  <h:inputText id="iptAmount" label="amount" required="true" value="#{payment.amount}">
                                       <f:convertNumber minFractionDigits="2"></f:convertNumber>
                                  </h:inputText>
                                  <h:message for="iptAmount"></h:message>
                             </td>
                        </tr>
                        <tr>
                             <td>
                                  <h:inputText id="iptDate" label="date" required="true" value="#{payment.date}">
                                       <f:convertDateTime pattern="MM/yyyy"></f:convertDateTime>
                                  </h:inputText>
                                  <h:message for="iptDate"></h:message>
                             </td>
                        </tr>
                        <tr>
                             <td>
                                  <h:commandButton value="sumbit" action="result"></h:commandButton>
                             </td>
                        </tr>
                   </table>
              </h:form>
         </h:body>
    </html>
    Can anyone help me,TKS!

    And besides,if I change the first inputText to:
    <td>
    <h:inputText id="iptCard" label="card" required="true" value="#{payment.card}">
         <f:convert convertId="com.corejsf.CardConvert"></f:convert>
    </h:inputText>
    <h:message for="iptCard"></h:message>
    </td>
    The app runs and result in:
    WebContent/index.xhtml @13,55 <f:convert> Tag Library supports namespace: http://java.sun.com/jsf/core, but no tag was defined for name: convert
    Is any configuration problem there?
    TKS!

  • If / then calculation based on dropdown list value in repeating row

    Hello
    I am new to Livecycle. I have created a repeating row in a form. The last field in the repeating row is a numeric field that = the product of two previous fields in the row (NumericField1 *  Numeric Field2). I also have a DropDownList1 near the beginning of the row (third column) that contains variable categories for that calculation row, e.g. Advertising, Office Supplies, Entertainment. I would like to create numeric fields in the form (perhaps in a footer row?) that contain sums of the subtotals of each row, depending on the category selected in DropDownList1. In other words I need to create a subtotal field for all calculations beginning with the category of Advertising, another for Office Supplies, another for Entertainment.
    From what I understand I need to list the variables first, then create an if/then calculation but I am not sure about the steps involved in creating the script.
    df

    NumericField3 is the name of the field containing the product of NumericField1 * NumericField2. I have created a NumericField8 in the form with the following calculation in FormCalc:
    if(Table1.Row.DropDownList1.rawValue == "ADVERTISING") then
    sum(Table1.Row[*].NumericField3)
    end if
    That's not helping. I think I need to designate variables before the if/then script, yes? Would I need to use a resolve command, a getfield command, or . . .? Can anyone help?
    Thanks, in advance,
    df

Maybe you are looking for