0
votes

I have a VisualForce page that has three functionalities, Hence it has three 'public PageReference' subroutines, That are called when an action happens in the page [i.e. button]

One of the functionalities requires user input [i.e. inputText], So the main APEX code has a variable declaration for that input:

public String UserInput { get; set; }

Since each task is not really related, When I hit the button on the other two functionalities, I get a VisualForce error, Because the inputText object has no user input,

How can I prevent that from happening,

Another way to solve this, How do I turn off VisualForce Error messages? So I can do error handling from APEX, Looking at the debug log file, The error is in VisualForce NOT APEX,

Thanks

1
I see no "hat" here, it is some other type of epitaxtually activated gazonta?Mark Schultheiss
Sorry, not sure what that means!!!user2333346
"prevent hat from happening" - it's a joke on your typo :) preventing hats from happening...lolMark Schultheiss
Oh ok , sorry about that, any suggestions for the question itselfuser2333346
Would really appreciate any programming tipsuser2333346

1 Answers

2
votes

If you don't want to fire validation you can use the immediate = true attribute on the CommandButton/CommandLink to bypass any validation. - This isn't optimal in my opinion

If you only want to submit part of a page and still fire validation have a look at the ActionRegion. This should allow you to wrap a particular Region for the action call. This is probably best for your purpose.

Sorry I don't have time to post full examples but that should point you in the right direction :)