on 09-18-2007 2:56 PM
hi everyone
I am facing such problem while working with dynamic elements the exception I am getting is as follows:com.sap.tc.webdynpro.progmodel.context.ContextException: DataNodeInfo(DisplayList.DynamicNode): unknown child node ACTION
Hi Jaspreet,
Make doubly sure that you are not trying to access dynamic nodes which has not been created yet. Even after creating node, you nedd to set properties of node and then try to set values.
Regards,
Ganga.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi ganga
i have created a dynamic node and for the first time my dynamic node has been created properly the problem comes when i go back n recreate. let me explain my senario..
on the first pg i hav a drop down which contain report types, on clickin one of the type i move to the second view where i create a table dynamically using a dynamic node. Now for the first navigation its working fine but when i go back to first screen n select another report type from the drop down it gives me the following exception.
Thanks& regards
jaspreet
Hi Sumit
I have pasted my code below:
public static void wdDoModifyView(IPrivateDisplayList wdThis, IPrivateDisplayList.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
try
{
IWDMessageManager msgMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
int intCat = wdContext.nodeField_Catalog_Disp1_Out().size();
int intList = wdContext.nodeWeb_Table_Disp1_Out().size();
int intSelection = wdContext.nodeSelectionNode().size();
String selc_field=wdContext.currentReportTypeElement().getName();
wdContext.currentContextElement().setField_selection("Selection Fields: "+selc_field);
IWDTable theGrp = (IWDTable)view.getElement("Table2");
theGrp.setSelectionMode(WDTableSelectionMode.NONE);
theGrp.setFooterVisible(false);
theGrp.setDesign(WDTableDesign.ALTERNATING);
theGrp.setReadOnly(true);
if(firstTime)
{
IWDNodeInfo node = wdContext.nodeDynamicNode().getNodeInfo();
for(int i=0;i<intCat;i++)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("intcat"+intCat);
//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("i"+i);
node.addAttribute(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname(),"com.sap.dictionary.string");
IWDTableColumn tabCln = (IWDTableColumn)view.createElement(IWDTableColumn.class,"Cln_"+wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname());
IWDCaption clnCpt = (IWDCaption)view.createElement(IWDCaption.class,"hd_"+wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname());
clnCpt.setText("");
clnCpt.setText(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getHeading());
IWDTableStandardCell tblStdcell = (IWDTableStandardCell)view.createElement(IWDTableStandardCell.class,"stdCell_"+wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname());
IWDTextView txtHeader = (IWDTextView)view.createElement(IWDTextView.class,"Header_"+wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname());
txtHeader.setText(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getHeading());
txtHeader.setDesign(WDTextViewDesign.HEADER3);
tblStdcell.setEditor(txtHeader);
tblStdcell.setCellDesign(WDTableCellDesign.GROUP_LEVEL2);
tabCln.addFixedTopCell(tblStdcell);
IWDTextView clnTce = (IWDTextView)view.createElement(IWDTextView.class,"tce_"+wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname());
clnTce.bindText("DynamicNode."+wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(i).getFieldname());
clnTce.setWrapping(true);
tabCln.setTableCellEditor(clnTce);
theGrp.addColumn(tabCln);IWDTable table = (IWDTable) view.getElement("Table2");
wdContext.currentContextElement().setTableSorter(new TableSorter(table, wdThis.wdGetSortAction(), null));
}
IWDTransparentContainer theTarnsDisp = (IWDTransparentContainer)view.getElement("TransparentContainer_3");
//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("intsel"+intSelection);
for(int k =0;k<intSelection;k++)
{
//node.addAttribute("Disp_"+wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getName(),"com.sap.dictionary.string");
IWDTextView clnTxt1 = (IWDTextView)view.createElement(IWDTextView.class,"Disp1_"+wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getName());
clnTxt1.setText(wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getName()+ " : ");
clnTxt1.setDesign(WDTextViewDesign.HEADER3);
clnTxt1.setWrapping(true);
IWDTextView clnTxt2 = (IWDTextView)view.createElement(IWDTextView.class,"Disp2_"+wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getName());
clnTxt2.setText(wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getValue1());
if(("".equals(wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getValue2())))
{
clnTxt2.setText(wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getValue1());
}
if(!"".equals(wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getValue2()))
{
clnTxt2.setText(wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getValue1()" - "wdContext.nodeSelectionNode().getSelectionNodeElementAt(k).getValue2());
}
clnTxt2.setWrapping(true);
IWDGridData gridLayout1 = (IWDGridData)clnTxt1.createLayoutData(IWDGridData.class);
gridLayout1.setWidth("5%");
gridLayout1.setPaddingBottom("3");
IWDGridData gridLayout2 = (IWDGridData)clnTxt2.createLayoutData(IWDGridData.class);
gridLayout2.setPaddingBottom("3");
theTarnsDisp.addChild(clnTxt1);
theTarnsDisp.addChild(clnTxt2);
// wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("first ck in end of for");
}//end of intselection for loop
wdContext.currentContextElement().setModifyFlag(false);
// }
}
// wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("first check aftr for1");
//}//end of intcat for loop
//wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("first check aftr for2");
//}// if first time ends
// second chk
// wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("second check");
//........................................
if(wdContext.currentContextElement().getModifiedFlag())
{
String strLine = "";
int intLine =0;
Collection col = new Vector();
IWDTextAccessor textAccessor = wdThis.wdGetAPI().getComponent().getTextAccessor();
String strLan = textAccessor.getText("TXT_LAN");
if("EN".equalsIgnoreCase(strLan))
{
for(int j=0;j<intList;j++)
{
IDynamicNodeElement dynObj = wdContext.createDynamicNodeElement();
strLine = wdContext.nodeWeb_Table_Disp1_Out().getWeb_Table_Disp1_OutElementAt(j).getTline();
intLine = strLine.length();
strLine = strLine.substring(1,intLine-1);
for(int k=0;k<intCat;k++)
{
Integer startIntger = Integer.valueOf(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getStartpos());
Integer lengthIntger = Integer.valueOf(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getLength());
int start = startIntger.intValue();
int length = lengthIntger.intValue();
String strVal = strLine.substring(start,start+length);
if(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getDatatype().equalsIgnoreCase("DATE"))
{
try
{
String strdate ="";
String strFmt = "";
if("YYYY/MM/DD".equalsIgnoreCase(wdContext.currentUser_ProfileElement().getDatefmt()))
{
strFmt = "yyyy/MM/dd";
}
else
{
strFmt = "MM/dd/yyyy";
}
SimpleDateFormat ch1 = new SimpleDateFormat("yyyyMMdd");
//SimpleDateFormat ch2 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat ch2 = new SimpleDateFormat(strFmt);
strVal = strVal.trim();
if(!"".equals(strVal))
{
strdate = ch2.format(ch1.parse(strVal));
}
dynObj.setAttributeValue(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getFieldname(),strdate);
}
catch(Exception e)
{
// msgMgr.reportException(e.getLocalizedMessage(), false);
// msgMgr.reportException(e.getMessage(), false);
// msgMgr.reportException(e.toString(), false);
}
}
else if(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getDatatype().equalsIgnoreCase("QUAN"))
{
Double dblVal = null;
DecimalFormat sdf = new DecimalFormat("#,###.000####");
dblVal = new Double(strVal);
dynObj.setAttributeValue(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getFieldname(),sdf.format(dblVal.doubleValue()));
}
else
{
dynObj.setAttributeValue(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getFieldname(),strVal);
}
}
col.add(dynObj);
}// for ends
}
else
{
for(int j=0;j<intList;j++)
{
IDynamicNodeElement dynObj = wdContext.createDynamicNodeElement();
strLine = wdContext.nodeWeb_Table_Disp1_Out().getWeb_Table_Disp1_OutElementAt(j).getTline();
intLine = strLine.length();
strLine = strLine.substring(1,intLine-1);
String[] strArr = strLine.split("#");
for(int k=0;k<intCat;k++)
{
// Integer startIntger = Integer.valueOf(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getStartpos());
// Integer lengthIntger = Integer.valueOf(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getLength());
//
// int start = startIntger.intValue();
// int length = lengthIntger.intValue();
// String strVal = strLine.substring(start,start+length);
String strVal = strArr[k];
if(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getDatatype().equalsIgnoreCase("DATE"))
{
try
{
String strdate ="";
String strFmt = "";
if("YYYY/MM/DD".equalsIgnoreCase(wdContext.currentUser_ProfileElement().getDatefmt()))
{
strFmt = "yyyy/MM/dd";
}
else
{
strFmt = "MM/dd/yyyy";
}
SimpleDateFormat ch1 = new SimpleDateFormat("yyyyMMdd");
//SimpleDateFormat ch2 = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat ch2 = new SimpleDateFormat(strFmt);
strVal = strVal.trim();
if(!"".equals(strVal))
{
strdate = ch2.format(ch1.parse(strVal));
}
dynObj.setAttributeValue(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getFieldname(),strdate);
}
catch(Exception e)
{
// msgMgr.reportException(e.getLocalizedMessage(), false);
// msgMgr.reportException(e.getMessage(), false);
// msgMgr.reportException(e.toString(), false);
}
}
else if(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getDatatype().equalsIgnoreCase("QUAN"))
{
Double dblVal = null;
DecimalFormat sdf = new DecimalFormat("#,###.000####");
dblVal = new Double(strVal);
dynObj.setAttributeValue(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getFieldname(),sdf.format(dblVal.doubleValue()));
}
else
{
dynObj.setAttributeValue(wdContext.nodeField_Catalog_Disp1_Out().getField_Catalog_Disp1_OutElementAt(k).getFieldname(),strVal);
}
}
col.add(dynObj);
}// for ends
}
wdContext.nodeDynamicNode().bind(col);
if(wdContext.nodeDynamicNode().size()==0)
{
wdContext.currentContextElement().setDownLoadHide(WDVisibility.NONE);
}
else
{
wdContext.currentContextElement().setDownLoadHide(WDVisibility.VISIBLE);
}
wdContext.currentContextElement().setModifiedFlag(false);
}// if ends
}
catch(Exception e)
{
wdThis.wdGetAPI().getComponent().getMessageManager().reportException("Error Occurred in WdDoModifyView Method of DisplayList View. Please contact System Administrator"+e,false);
}
finally
{}
//@@end
}
Thanks & Regards
Jaspreet Kaur
HI Murtuza
I wrote these three lines in the beginning of my code:
wdThis.wdGetAPI().getContext().reset(true);
view.resetView();
then it was working for the first time and also it was populating data according to my report types whereas without this code my other report types were getting the same output as the first selected report ie my dynamic node was not refreshing .As the report type change the parameters for display table also change which was not happening without these two lines.But on goin back ie back link i was getting an exception.If I dont reset the context then my dynamic node does not get refreshed n i get an exception
DataNodeInfo(DisplayList.DynamicNode):unknown child node ACTION
and if i reset the context then also i am getting exception of some unidentified attribute but in this case the data is cummin according to report type.
Hi Murtuza
Yeah ur rite its not related to that i fixed that problem but a new problem arrised this time with my downloading to excel for one of the reports it is giving the following exception:java.io.FileNotFoundException: Credit/Debit Note.xls (A file or directory in the path name does not exist.)
Thanks & Regards
Jaspreet
Hi Murtuza
According to wut i observed is all xls files r opening they r being named by the report name only 2 are not opening as there name contains a / ie credit/debit so even i tested this in xls by creating an excel sheet with such a name so its also givin error.Is my assumption correct?if so then is it a possible way to trim the special character so further such problem should not occur.
Thanks & Regards
Jaspreet Kaur
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.