cancel
Showing results for 
Search instead for 
Did you mean: 

POP UP

Former Member
0 Kudos

My scenario,

I have got two inputfields which is followed by a button.

A user has to enter details in the input field and then click SUBMIT.

If he/she doesn't enter details in the parameters , a message should

Intimate the user , "these fields are MANDATORY".

and it should get back to the input field.(cursor).

How can I make thas yhappen ?

Regards

Tom.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Lets assume the two attributes names are valueOne and ValueTwo

write the following code in the action handler of the button


//first attribute
String valueOne = wdContext.currentContextElement().getValueOne();
//second attribute
	  String valueTwo = wdContext.currentContextElement().getValueTwo();
	  //if any of this is null message is displayed
	  if(valueOne == null || valueTwo == null)
		  wdComponentAPI.getMessageManager().reportException("Missing Input");
	  
	  if( valueOne == null)
	  {
		 IWDAttributeInfo attribute =  wdContext.getNodeInfo().getAttribute("ValueOne");
	     wdThis.wdGetAPI().requestFocus(wdContext.currentContextElement(), attribute);
	  }

 // do the same for the else part for the second one too,,

Regards

Ayyapparaj

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

First for the end user, you can show that those input fields are mandatory. For this, create two labels before two input fields and set LabelFor property of the Label to the corresponding inputfield id. Now there is a property called "State" for inputfield. If it is set as 'required', then a red star mark appears near the label. This would make the user enter the data. If not, you may have to validate on submit button action manually. Try some options like others have suggested.

Regards,

Harini S

Former Member
0 Kudos