hi,
i hv created the following application:
http://ep62:50100/webdynpro/dispatcher/local/TutWD_Dynamic/DynamicApp?SAPtestId=103
i hv made the firstname as mandatory.
bt when i click on the save btn it goes to the nxt view.
hw do i stop it?
i hv written the following code in my save btn:
public void onActionGenericAction(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String Command )
{
SomeBackEnd theBackend = new SomeBackEnd();
SomeBackEnd.FieldDescriptor fld=null;
IWDNode node = wdContext.currentContextElement().node ().getChildNode("DynamicNode", 0);
IWDNodeElement nodeElement = node.getCurrentElement();
if(SomeBackEnd.FieldDescriptor.class.getName()=="firstName")
{
wdComponentAPI.getMessageManager().reportSuccess("PLEASE ENTER YOUR FIRST NAME");
}
else if (Command.equals("save"))
{
String result = "Your data was successfully saved:" + "\n\r";
/*Object obj;
//obj = nodeElement.getAttributeValue("HomePage");
obj=wdContext.getNodeInfo().getAttribute("HomePage");
if(obj==null)
obj="<NULL>";
result = "Your data was successfully saved:" + "\n\r";
result = result + "HOME PAGE" + " :" +obj.toString() + "\n";*/
for (int index = 0; index < theBackend.getNumberFields(); index++)
{
fld = theBackend.getField(index);
Object value = nodeElement.getAttributeValue(fld.getName());
if (value == null)
{
if(fld.getName()=="firstName")
{
wdComponentAPI.getMessageManager().reportSuccess("Please Enter Your First Name ");
wdContext.currentContextElement().setVisible(WDVisibility.NONE);
}
break;
}
result = result + fld.getName() + " : " + value.toString() + "\n";
}
wdContext.currentContextElement().setVisible(WDVisibility.VISIBLE);
wdContext.currentContextElement().setResult(result);
}
else if(Command.equals("delete"))
{
for (int index = 0; index < theBackend.getNumberFields(); index++)
{
fld = theBackend.getField(index);
nodeElement.setAttributeValue(fld.getName(), fld.getInit());
}
wdContext.currentContextElement().setVisible(WDVisibility.NONE);
}
plz help.
regards,
ankita