GithubHelp home page GithubHelp logo

ezform's People

Contributors

allistoncarlos avatar bok- avatar chrismiles avatar ehlersd avatar jessedc avatar jlerner avatar nbarnold01 avatar petehare avatar raven avatar sgleadow avatar stephsharp avatar tasomaniac avatar yakubbaev avatar zats avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ezform's Issues

Problems with EZFormRadioField with array updated dinamically based on value in another fiels

Hello

I'm trying to implement a EZFormRadioField with UIPickerView with setChoicesFromArray called dinalically based on other field value.

I check the values changing in

  • (void)form:(EZForm *)form didUpdateValueForField:(EZFormField *)formField modelIsValid:(BOOL)isValid
    {
    if ([formField.key isEqualToString:@"country"]) {
    [self updateRegionCountry];
    }

}

and in updateRegionCountry I update the EZFormRadioField content with a new array passed with setChoicesFromArray.
Everything work but when I open the picker I have the new values but the number of items shown are limited to previous array count.

I mean if first array assigned with setChoicesFromArray had 20 elements, and the new array has 30 elements, the Picker shows the new elements but only the first 20.
Please note that both choices and orderedKeys in EZFormRadioField have the right number of elements after the update, but the picker still shows only 20 elements

EZFormRadioField.valueOrUnselectedAtIndex throws NSInvalidArgumentException

This part of code:

- (NSString *)valueOrUnselectedAtIndex:(NSUInteger)index
{
    NSString *value = nil;
    if (self.unselected) {
    if (index == 0) {
        value = self.unselected;
    }
    else {
        NSString *key = [self.orderedKeys objectAtIndex:index - 1];
        value = [self.choices valueForKey:key];
    }
    }
    else {
    NSString *key = [self.orderedKeys objectAtIndex:index];
    value = [self.choices valueForKey:key];
    }
    return value;
}

... should use -(id)objectForKey instead of -(id)valueForKey.
Otherwise, if u use for example NSNumber as keys, u get:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException',
 reason: '-[__NSCFNumber length]: unrecognized selector sent to instance

EZFormValueTransformer.m:63:33: Implicit conversion from nullable pointer 'id _Nullable' to non-nullable pointer type 'id _Nonnull'

Demo projects compile failed at : EZFormValueTransformer.m:63:33:

Does anyone have the same issue?

  • (instancetype)valueTransformerWithKeyPath:(NSString *)keyPath
    {
    return [self valueTransformerWithBlock:^id(id input) {

    if (input == nil) {
        return nil;
    }
    
    if ([input isKindOfClass:[NSString class]]) {
        return input;
    }
    
    // did we end up with an array? multi-select data
    if ([input isKindOfClass:[NSArray class]]) {
    
        // if it is an array of strings we can't map on that
        if ([((NSArray *)input).firstObject isKindOfClass:[NSString class]]) {
            return input;
        }
    
        NSMutableArray *keys = [NSMutableArray array];
        for (id i in (NSArray *)input) {
            [keys addObject:[i valueForKeyPath:keyPath]]; //  <-------------------- Failed to  compile
        }
        return [keys copy];
    }
    
    id value = [input valueForKeyPath:keyPath];
    return value;
    

    }];
    }

Clarification on setting a simple EZFormField

Hi Chris,

Nice job on this library.

I wonder if you could clarify how to use / set fields that don't necessarily have an associated uilabel / uitextfield.

static NSString *const EZFDRegistrationFormIssueLatitudeKey = @"Latitude";
static NSString *const EZFDRegistrationFormIssueLongitudeKey = @"Longitude";

I am basically hooking up the formfields like this

        EZFormField *lat = [[EZFormField alloc]initWithKey:EZFDRegistrationFormIssueLatitudeKey];
        [form addFormField:lat];
        EZFormField *lng = [[EZFormField alloc]initWithKey:EZFDRegistrationFormIssueLongitudeKey];
        [form addFormField:lng];

then later in the class - trying to set this values.
[formDelegate.form setModelValue:[NSString stringWithFormat:@"%f", c.latitude] forKey:EZFDRegistrationFormIssueLatitudeKey];
[formDelegate.form setModelValue:[NSString stringWithFormat:@"%f", c.longitude] forKey:EZFDRegistrationFormIssueLongitudeKey];

[EZFormField setActualFieldValue:]: unrecognized selector sent to instance 0x170450f50

  • (void)setFieldValue:(id)value canUpdateView:(BOOL)canUpdateView
    {
    [(id)self setActualFieldValue:value];

    if (canUpdateView && [(id)self respondsToSelector:@selector(updateView)]) {
    [(id)self updateView];
    }

    __strong EZForm *form = self.form;
    [form formFieldDidChangeValue:self];
    }

Is the EZFormField not intended to be used directly?

JP

Preloaded data not validated by EZForm if validationMinCharacters > 0

Hey Chris,

I'm trying to configure EZForm framework and have some issues. When I have some existing data in textfields after viewDidLoad, validation not working if textField.validationMinCharacters > 0. I've tracked updateValidityIndicatorForField method, it's sending null to isValid method. When I start typing something in this field, the validator starting work as expected. Can you point me to the right direction, where to fix it? Thank you

P.S. the textField already has valid data, but isValid returns null (FALSE)

EZFormRadioField

Is there a reason why EZFormRadioField uses NSException's instead of NSAsserts?

Xcode 9 installation Error

Can't install in Xcode9. I've a older project where I used this library now I need to update this project. When I open this with xcode 9, I notice this error, it says :

#import <EZForm/EZForm.h> File not found.

I tried with creating a new project and installing this library again. Same issue.

Can you help me ?

How to dinamically remove a Validator from a field

Hello
I need to handle my form dinamically.
I mean to enable and disable validation on certain fields due to other constraints
More in detail I have an email field (set by default with addValidator:EZFormEmailAddressValidator) I need to disable in a specific condition (so that EZform doesn't check if it contains an email address)
Is there a way to do it?

Thanks

Paolo

Documentation

Hi,

Is there a way you can publish you documentation on a website (like the wiki pages)? I understand you use appledoc, but I also know that it generates a complete html. Maybe you can publish that?

Thanks a lot!

EZForm delegate not calling

When i input the character in textfield

  • (void)form:(EZForm *)form didUpdateValueForField:(EZFormField *)formField modelIsValid:(BOOL)isValid

this delegate method is not called.

Thnks

Bug when use UITextField with autocorrection

When is showing a correction and I tap on 'Return' button my string will be replaced with correct string and action that's setted to UIControlEventEditingChanged event isn't perform and here is bug because model value isn't updated. Example: I wrote 'Helo' will be suggested 'Hello' and I tap return button, in text field text is 'Hello' but model value remains 'Helo'. P.S. Sorry for my bad english...

text field with validationMinCharacters turns red when it resigns first responder

I have a login form with a validationMinCharacters of 6 on my password field. When the field is invalid I set the text to be red.

As soon as the field resigns first responder the text turns red even if the field contents are valid.

Here's the weird part... Its not my code that turning it red. I've set breakpoints and logging statements, and my invalid handler is not being called. It only seems to happen with the validationMinCharacters validator.

Any idea what's happening here?

Error message support

The library has various validation methods but we cannot give any error message to the user.

For example if a field has a maximum value of 500 and it the user gives 600. It gives error indicator but does not give any feedback to user. I think it needs integrated message system that displays the error message below the views.

Update Podspec

The currently available Podspec is still referencing 1.1.0 which is missing some features that have currently been merged in. It would be awesome to have these new features accessible to CocoaPods users.

EZFormRadioField.unwireInputView throws exception : [UILabel setInputView:] unrecognized selector

Setup:

-(void)viewDidLoad { 
/*...*/
//First (of 6 culprits)
EZFormRadioField *sampleRateField = [[EZFormRadioField alloc] initWithKey:InitFormDevice_SampleRate_Key];
[sampleRateField setChoicesFromArray:self.sampleRateOptions];
sampleRateField.validationRequiresSelection = YES;
sampleRateField.validationRestrictedToChoiceValues = YES;
[sampleRateField setFieldValue:@"30"];
[self.initializationForm addFormField:sampleRateField];
/*...*/

// Radio/Select Fields (Use labels)
    for (NSString *t in radioFields) {
        EZFormRadioField *f = [self.initializationForm formFieldForKey:t];
        if([t isEqualToString:InitFormDevice_SampleRate_Key]) [f useLabel:self.lblDeviceSampleRate];
/*...*/
}

}

/*
Initialization of the form fields, and wiring them up has already completed. Now i'm trying to leave the form via the UINavigationController (back button).
*/
-(void)viewWillDisappear:(BOOL)animated { 
    [super viewWillDisappear:animated];
    [self.initializationForm unwireUserViews];
}

Error:

-[UILabel setInputView:]: unrecognized selector sent to instance 0x15d23ff0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UILabel setInputView:]: unrecognized selector sent to instance 0x15d23ff0'

Using XCode 5, iOS7 (iOS6 SDK), iPhone 4S (just incase someone needed this information)

With only a few exceptions like viewDidUnload (deprecated), I followed exactly how the example project built up and tore down the fields. This only seems to occur with the combination of EZFormRadioFields and UILabels.

The reason why I bring this up is because every time I fire up this view, memory consumption increases a bit, but when leaving the view, it doesn't get released (using ARC, etc, etc). Figured I would have to use the unwireUserViews to fix this. For the most part, up until it hits that exception, the memory usage drops a little bit.

Could I be missing something?

How use with tableView and fields inside tableViewCells

Hello, im trying to use the EZForm lib with textFields and buttons inside tableViewCells - when the field clicked inside the cell the tableView adjust its position and so on. What is the proper way to do this? I'm searched for a long time and cant found nothing. And i'm having difficulties to generate the appledoc. I would appreciate a little help. Thank you!

Can't get the key value when using setChoicesFromKeys

I can't get the key value when using setChoicesFromKeys i only get the value.

Is there a way of getting the key value instead of the value itself?

My output is:

< EZFormInputControl: 0x17600220; baseClass = UIControl; frame = (12 516; 277 30); text = 'Space'; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x175d4a60>; layer = <CALayer: 0x17600120>>

There is no Key variable

Thanks

Meni

Unexpected multi radio form field behaviour

I've tried to edit existed model with EZFrom component

code cut from lib demo app

EZFormMultiRadioFormField *likesField = [[EZFormMultiRadioFormField alloc] initWithKey:EZFDRegistrationFormLikesKey];
likesField.choices = @{
@"everything" : @"Everything",
@"pizza" : @"Pizza",
@"pasta" : @"Pasta",
@"bacon" : @"Bacon",
@"salad" : @"Salad",
@"cheese" : @"Cheese",
@"tacos" : @"Tacos"
};

NSArray * predefinedFieldValues = [NSArray arrayWithObjects:@"pizza", @"tacos", nil];
[likesField setFieldValue:predefinedFieldValues];

I expected to see list with checked "pizza" and "tacos" items, but nothing happened
What wrong with my expectations? In other words: how to show multi radio form with predefined selected items? e.g. existed object edit form solution

tnx

EZFormRadioField UIPickerView background

Hi,

The first time I use a EZFormRadioField the UIPickerView' background is completely transparent (like [uicolor clearColor]). If I close and open the view, I get the background correctly. I'm attaching an image to show the problem.

Thanks a lot!
captura de pantalla de simulador ios 06-02-2014 0 45 17

Enhanced field validations

I think it would be helpful to have a method that provides a way to get a list of all the validations that failed on a specific field. This would allow forms to provide specific messages to the user based on why a field is invalid.

Add EZForm to CocoaPods

Thanks for making this wonderful form validation library. Do you by any chance plan to add EZForm to CocoaPods?

That would make integrating, installing and getting updates for EZForm really easy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.