cancel
Showing results for 
Search instead for 
Did you mean: 

InputField state = required problem

Former Member
0 Kudos

Dear Experts,

I have a strange problem. I have an input field which i have set state="required" to make it mandatory. However it does not work.

I have not ticked "without Validation" in the action as well so ideally there shouldn't be a reason why it doesnt work. Have i missed something?

thanks and regards

dilanke

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Friend,

Check the label for property of the Label for your input field it might have blank. If so make it input field and revert back.

Regards

Jeetendra

Former Member
0 Kudos

Hi Jeetendra,

Thanks for you're prompt response. I have alreaady done this for the label prior to the input field. I also get the red * mark on the label. However this still does not work.

thanks and regards

dilanke

Former Member
0 Kudos

Dilanke,

Setting that property to required does not provide you a validation check once you submit the form. You have to manually code the validation check in the submit action. Basically, what that does is it puts the * notation to the label indicating that it's required on the UI level. There is no way that field knows which 'submit' or 'action' it is for the UI framework to perform the validation.

Regards,

Jan

Former Member
0 Kudos

Hi friend,

For IWDMessageManager you can use following code after validation


IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
				msgMgr.reportContextAttributeMessage(wdContext
						.currentNodeElement().getAttributePointer(
								"<AttributeName>"),
						IMessagePackScopingComp.<MessageKey>,
						new Object[] { "<InputFieldName>" });

Hope it helps.

Regards

Jeetendra

Former Member
0 Kudos

Dear All,

Thank you for you're responses. I didnt know that code was necessary to solve this but have correted this now. hence closing thread.

thanks and regards.

dilanke

Answers (1)

Answers (1)

siarhei_pisarenka3
Active Contributor
0 Kudos

Hi dilanke

Property state="required" is responsible for displaying the red asterisk only. You have to validate the field by yourself in code. Just check the value is not empty and report the corresponding message using IWDMessageManager.

BR, Siarhei