Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

insert table data

Hai to every one,

there is table contain 3 fileds name , city, contact.

and provided save button.

while inserting provided validation on contact, name should be must .

i looking like when the condition is satisfied , it should save and deleted from frontside.and incase which are the records are not satisfied, i need rise the exception and stop to insert.

i written code as below under save button.

for(int index=0;index<nodeSize;index++)
    {
    
    if(wdContext.currentCreateClientElement().getName()!= null && 
    wdContext.currentCreateClientElement().getName()!= "" )
       
    {
		IPrivateAddClientView.ICreateClientElement createClientElement = createClientNode.getCreateClientElementAt(index);
		clientName = createClientElement.getName();
		region = createClientElement.getcity();
		contact = createClientElement.getcontact();
		wdThis.wdGetTaskManagerCompController().insertClient(clientName,region,vertical);
		
//		wdContext.nodeCreateClient().invalidate();

		
    }
    else
    {
    	
    	wdComponentAPI.getMessageManager().reportException("enterclientname",false);
    	
    }
    
    }

Former Member
Former Member replied

Hi Eswar,

what i understood is you have a table with three input fields which has to be entered by client and you need validation on two fileds, then you can achieve this through MessagePool

Under message pool you create Message key u2013 validate

Message type u2013 error

Message text as u2013 Enter valid input

Create a method called validate with two parameters contact and name of String type

In Button action u have created write the following code

this.validate("name");

this.validate("contact");

wdComponentAPI.getMessageManager().raisePendingException();

In Validate method u write the following code

IWDMessageManager ID = wdComponentAPI.getMessageManager();

//write code to get parameter values name and contact

if(wdContext.CurrentContextElement.getName()=="")

{

ID.reportContextAttributeMessage(wdContext.nodeMSGNODE().currentMSGNODEElement(),info,IMessageMSG.VALIDATE,new Object[] {name},true);

}

if(wdContext.CurrentcontextElement.getContact()=="")

{

ID.reportContextAttributeMessage(wdContext.nodeMSGNODE().currentMSGNODEElement(),info,IMessageMSG.VALIDATE,new Object[] {contact},true);

}

else

WdComponentAPI.getMessageManager().reportSuccess(u201Cready to save inputu201D);

Regards

Raghu

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question