MyFaces Tomahawk
  1. MyFaces Tomahawk
  2. TOMAHAWK-88

Add ability for credit card validator to choose card type based on another component

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Validators
    • Labels:
      None

      Description

      It would be nice if the credit card validator could, in one of its attributes, optionally specify the ID of another component, whose value should be used to determine which card type should be used in the validation. This would come in handy for forms that have a select-one component with a list of credit card types. I would think that forms with both card type and card number are common.

      Example of tags:

      <%-- Credit Card Type --%>
      <h:outputLabel for="cardType" value="Credit Card Type"/>
      <h:selectOneMenu id="cardType" value="#

      {backingBean.cardType}

      " required="true">
      <f:selectItems value="#

      {backingBean.cardTypeSelectItems}

      "/>
      </h:selectOneMenu>

      <%-- Credit Card Number --%>
      <h:outputLabel for="cardNumber" value="Credit Card Number"/>
      <h:inputText id="cardNumber" value="#

      {backingBean.cardNumber}

      " required="true">
      <t:validateCreditCard forCardType="cardType"/>
      </h:inputText>

      The code would have to make an assumption about what values from the card type map to which credit cards. The values amex, visa, mastercard, and discover seem appropriate.

      I may get around to adding this ability, in which case I will attach the patches here. If I don't, though, I wanted to capture this suggestion in case someone else wants to do it.

        Activity

        Ken Weiner created issue -
        Martin Marinschek made changes -
        Field Original Value New Value
        Priority Major [ 3 ] Minor [ 4 ]
        sean schofield made changes -
        Key MYFACES-467 TOMAHAWK-88
        Component/s Other [ 12310767 ]
        Component/s Tomahawk [ 12310162 ]
        Type Wish [ 5 ] Bug [ 1 ]
        Project MyFaces Core [ 10600 ] MyFaces Tomahawk [ 12310272 ]
        sean schofield made changes -
        Workflow jira [ 12323992 ] MyFaces Workflow [ 12347459 ]
        Matthias Weßendorf made changes -
        Component/s Validatiors [ 12310769 ]
        Matthias Weßendorf made changes -
        Assignee Matthias Weßendorf [ matzew ]
        sean schofield made changes -
        Workflow MyFaces Workflow [ 12347459 ] MyFaces Workflow2 [ 12348797 ]
        sean schofield made changes -
        Workflow MyFaces Workflow2 [ 12348797 ] MyFaces Workflow [ 12354207 ]
        sean schofield made changes -
        Workflow MyFaces Workflow [ 12354207 ] MyFaces Workflow2 [ 12356269 ]
        sean schofield made changes -
        Workflow MyFaces Workflow2 [ 12356269 ]  MyFaces Workflow [ 12356764 ]
        sean schofield made changes -
        Workflow  MyFaces Workflow [ 12356764 ] MyFaces Workflow2 [ 12358385 ]
        sean schofield made changes -
        Workflow  MyFaces Workflow [ 12358385 ] MyFaces Workflow2 [ 12360852 ]

          People

          • Assignee:
            Matthias Weßendorf
            Reporter:
            Ken Weiner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development