[ http://issues.apache.org/jira/browse/MYFACES-467?page=all ]
Martin Marinschek updated MYFACES-467:
--------------------------------------
Priority: Minor (was: Major)
> Add ability for credit card validator to choose card type based on another
> component
> ------------------------------------------------------------------------------------
>
> Key: MYFACES-467
> URL: http://issues.apache.org/jira/browse/MYFACES-467
> Project: MyFaces
> Type: Wish
> Components: Tomahawk
> Reporter: Ken Weiner
> Priority: Minor
>
> 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.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira