on 07-23-2007 3:09 AM
i need to clear the data
wdDoModify(){
//create and populate data in table inside IWDTransparentContainer
}
first time page1, when i key in the value for instance
customer id : 00001
the page will naviagate to page2
and populate the data in the table correctly,
later , if i naviagate back to page 1 and key in different values,
the data still the same,
i submit the data to call a model with the value in input field...
the data doesnt refresh....in wdDoModify...
Hi Yzme,
You can place the code to clear the "inputfield" in the "onPlugfrom<Page2>"
method in ur Page1 (View 1) instead of wdoModifyview().
Hope it helps.
Regards,
Alka.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
inputfield value is not an issue, the data it get back is.
the thing is the data get populated the first time i key in the value
for instance 000001
2nd time : 000002
the data inside same as the first time. but i am sure that i pass in 00002 into the function..
the data is get populated inside the wdModifyView..
Message was edited by:
yzme yzme
HI,
Make sure that u added <b>wdContext.nodeOutput().invalidate()</b>
after calling RFC inside execute().
If this is not the issue, then u can invalidate the node of the WebDynpro table by
wdContext.node<Table>().invalidate();
inside the inbound plug to which the 2nd view returns.
Regards
Fahad Hamsa
something like this
but what is the solution
it reflect the changes in the table with the bindings
the data populated in the table reflect the changes
NodeOutput
- NodeOutputCalendar
- NodeOutputEmployee
- NodeOutputLeave
if i bind the those node in each tables, it reflect the changes
after i <b> invalidate() </b>
but when i create the table dynamically ,where i combine several nodes to create the table
wdDoModify(){
IWDTransparentContainer rootElement;
if(firstTime()){
System.err.println("break point 1");
rootElement=(IWDTransparentContainer)view.getElement("TransparentContainer_Calendar");
System.err.println("break point 2");
}
}
View 1 to View 2--input : 00001 View 2 refect changes and the table successfully created dynamically.
after that navigate back : Enter input : 00002 and the 00002 is pass in correctly to the function, the table in the binding works ok. but not the table create dynamically.
it only show <b>break point 1</b> and will not get into <b>break point 2</b>
rootElement=(IWDTransparentContainer)view.getElement("TransparentContainer_Calendar");
IWDNodeInfo tabNode=wdContext.getNodeInfo().addChild("Tab_Node",null,true,true,true,false,true,false,null,null,null);
IWDTable tab=(IWDTable)view.createElement(IWDTable.class,"Dyntable");
IWDNode dynTabNode=(IWDNode)wdContext.getChildNode("Tab_Node",0);
if i remove the
if(firstTime){
}
i will receive this
Exception wdDoModify: DataNodeInfo(TeamCalendarView): duplicate name for child node Tab_Node
if (firstTime) {
IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TheNode");
/* The following line is necessary to create parameter mapping from parameter "path" to parameter "selectedElement".
* Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
* that raised the onAction event. Parameter "selectedElement" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
* that handles the onAction. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
* be accessed within the event handler
*/
treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");
/* The following line is necessary to create parameter mapping from parameter "path" to parameter "element".
* Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
* that raised the onLoadChildren event. Parameter "element" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
* that handles the onLoadChildren. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
* be accessed within the event handler
*/
treeNode.mappingOfOnLoadChildren().addSourceMapping("path", "element");
wdThis.callModify();
wdThis.checkAllLegendTab();
IWDTransparentContainer rootElement;
try{
wdThis.PassModifyText("break point 1");
//IWDTransparentContainer rootElement = (IWDTransparentContainer)view.getRootElement();
rootElement=(IWDTransparentContainer)view.getElement("TransparentContainer_Calendar");
IWDNodeInfo tabNode=wdContext.getNodeInfo().addChild("Tab_Node",null,true,true,true,false,true,false,null,null,null);
IWDTable tab=(IWDTable)view.createElement(IWDTable.class,"Dyntable");
IWDNode dynTabNode=(IWDNode)wdContext.getChildNode("Tab_Node",0);
wdThis.PassModifyText("break point 2");
//generate the name column
IWDAttributeInfo attrib = tabNode.addAttribute("Name", "ddic:com.sap.dictionary.string");
IWDTableColumn tabColumn =(IWDTableColumn)view.createElement(IWDTableColumn.class, "NameCol");
IWDCaption nameCap =(IWDCaption)view.createElement(IWDCaption.class, "NameCap");
nameCap.setText("Name");
tabColumn.setHeader((IWDCaption)nameCap);
tabColumn.setWidth("120");
IWDInputField nameText =(IWDInputField)view.createElement(IWDInputField.class, "NameText");
nameText.bindValue(attrib);
tabColumn.setTableCellEditor((IWDTableCellEditor)nameText);
tab.addColumn(tabColumn);
tab.createLayoutData(IWDRowHeadData.class);
wdThis.PassModifyText("CalendarDayTab:" +wdContext.nodeEx_Calendar_Day_Tab().size());
if(wdContext.nodeEx_Calendar_Day_Tab().size()>0){
for(int i=1;i<wdContext.nodeEx_Calendar_Day_Tab().size()+1;i++){
//IPrivateTeamCalendarView.IEx_Calendar_Day_TabElement cd=wdContext.nodeEx_Calendar_Day_Tab().getEx_Calendar_Day_TabElementAt(i);
IWDAttributeInfo attrib1=tabNode.addAttribute("f_" + String.valueOf(i), "ddic:com.sap.dictionary.string");
IWDTableColumn tabColumn1 =(IWDTableColumn)view.createElement(IWDTableColumn.class, "tab_" + String.valueOf(i));
IWDCaption nameCap1 =(IWDCaption)view.createElement(IWDCaption.class, "cap_" + String.valueOf(i));
nameCap1.setText(String.valueOf(i));
tabColumn1.setHeader((IWDCaption)nameCap1);
tabColumn1.setWidth("24");
IWDInputField nameText1=(IWDInputField)view.createElement(IWDInputField.class, String.valueOf(i)+ "_text");
nameText1.bindValue(attrib1);
tabColumn1.setTableCellEditor((IWDTableCellEditor)nameText1);
//tab.setWidth("80");
tab.addColumn(tabColumn1);
tab.createLayoutData(IWDRowHeadData.class);
}
}
/*
for(int i=1; i<31; i++){
IWDAttributeInfo attrib1=tabNode.addAttribute("f_" + String.valueOf(i), "ddic:com.sap.dictionary.string");
IWDTableColumn tabColumn1 =(IWDTableColumn)view.createElement(IWDTableColumn.class, "tab_" + String.valueOf(i));
IWDCaption nameCap1 =(IWDCaption)view.createElement(IWDCaption.class, "cap_" + String.valueOf(i) );
nameCap1.setText(String.valueOf(i));
tabColumn1.setHeader((IWDCaption)nameCap1);
tabColumn1.setWidth("24");
IWDInputField nameText1=(IWDInputField)view.createElement(IWDInputField.class, String.valueOf(i)+ "_text");
nameText1.bindValue(attrib1);
tabColumn1.setTableCellEditor((IWDTableCellEditor)nameText1);
//tab.setWidth("80");
tab.addColumn(tabColumn1);
tab.createLayoutData(IWDRowHeadData.class);
}
*/
tab.bindDataSource(tabNode);
tab.setCompatibilityMode(WDTableCompatibilityMode.AUTO);
wdThis.PassModifyText("break point 3");
IWDCaption headerCap=(IWDCaption)view.createElement(IWDCaption.class, "headerCap");
headerCap.setText("JULY 2007 " +wdThis.checkAllLegendTab());
tab.setHeader((IWDCaption)headerCap);
tab.setDesign(WDTableDesign.ALTERNATING);
tab.setVisibleRowCount(10);
IWDNodeElement dynTabElem=(IWDNodeElement)dynTabNode.createElement();
//generate the Day in the month
String[] dayArrayOfMth = getDayArrayOfMth("Fri", 30);
wdThis.PassModifyText("break point 4");
wdThis.PassModifyText("CalendarDayTab:" +wdContext.nodeEx_Calendar_Day_Tab().size());
errmsg+=" size of calendar tab:" +wdContext.nodeEx_Calendar_Day_Tab().size();
if(wdContext.nodeEx_Calendar_Day_Tab().size()>0){
for(int i=0;i<wdContext.nodeEx_Calendar_Day_Tab().size();i++){
IPrivateTeamCalendarView.IEx_Calendar_Day_TabElement cd=wdContext.nodeEx_Calendar_Day_Tab().getEx_Calendar_Day_TabElementAt(i);
dynTabElem.setAttributeValue("f_"+String.valueOf(i+1),cd.getDaytxt());
}
}
dynTabNode.addElement(dynTabElem);
/*
for(int k=0; k<30; k++){
//if(k==0){
// dynTabElem.setAttributeValue("f_1", "");
//}else{
dynTabElem.setAttributeValue("f_" + String.valueOf(k+1), dayArrayOfMth[k]);
//}
}
dynTabNode.addElement(dynTabElem);
*/
errmsg +="before addrow:" +wdContext.nodeEx_Rowlabel().size();
wdThis.PassModifyText("break point 5");
wdThis.PassModifyText("RowLabel:" +wdContext.nodeEx_Rowlabel().size());
for(int i=0;i<wdContext.nodeEx_Rowlabel().size();i++){
IPrivateTeamCalendarView.IEx_RowlabelElement rl=wdContext.nodeEx_Rowlabel().getEx_RowlabelElementAt(i);
IWDNodeElement dynTabElem1=(IWDNodeElement)dynTabNode.createElement();
String empid=rl.getRow_Id();
String rowLabel=rl.getRowlabel();
errmsg+="row" +i+":" +empid +rowLabel;
Map map=new HashMap();
ArrayList arr=new ArrayList();
//check
if(wdContext.nodeEx_Calendar_Tab().size()>0){
for(int j=0;j<wdContext.nodeEx_Calendar_Tab().size();j++){
IPrivateTeamCalendarView.IEx_Calendar_TabElement ct=wdContext.nodeEx_Calendar_Tab().getEx_Calendar_TabElementAt(j);
if(ct.getRow_Id().equalsIgnoreCase(empid)){
errmsg+="compare:" +ct.getRow_Id() +":" +empid;
errmsg+="st: " +ct.getBegda().toString() +"end: " +ct.getEndda().toString();
if(ct.getBegda().equals(ct.getEndda())){
errmsg+="same date";
}else{
errmsg+="not same date";
}
if(ct.getBegda().equals(ct.getEndda())){
String col=ct.getBegda().toString().substring(ct.getBegda().toString().length()-2,ct.getBegda().toString().length());
String strAPD=wdThis.checkLegendTab(ct.getLegendid());
dynTabElem1.setAttributeValue("Name",rowLabel);
dynTabElem1.setAttributeValue("f_"+col, strAPD.substring(0,1));
errmsg+=" check Legend: " +wdThis.checkLegendTab(ct.getLegendid());
//dynTabElem1.setAttributeValue("f_10", "P");
//dynTabElem1.setAttributeValue("f_20", "D");
}else{
dynTabElem1.setAttributeValue("Name",rowLabel);
int start=Integer.parseInt(ct.getBegda().toString().substring(ct.getBegda().toString().length()-2,ct.getBegda().toString().length()));
int enddate=Integer.parseInt(ct.getEndda().toString().substring(ct.getEndda().toString().length()-2,ct.getEndda().toString().length()));
for(int k=start;k<enddate;k++){
String col=String.valueOf(k);
dynTabElem1.setAttributeValue("f_"+col,"A");
}
}
}else{
dynTabElem1.setAttributeValue("Name",rowLabel);
}
dynTabNode.addElement(dynTabElem1);
}//end for
}else{
dynTabElem1.setAttributeValue("Name",rowLabel);
dynTabNode.addElement(dynTabElem1);
}
}//end for rootElement.addChild(tab);
}catch(Exception e){
errmsg+=" Exception wdDoModify: " +e.getMessage();
}finally{
wdContext.currentContextElement().setMsgtxt("errmsg:" +errmsg);
}
}//end for firstTime
Message was edited by:
yzme yzme
Message was edited by:
yzme yzme
Something amiss here !
Change the view property LifeSpan to "When Visible" and run the application.
Thanks and Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You just use the invalidate() method to refresh the node values.for example if ur table node is "NODE" then u write code like below.
<b>wdContext.nodeNODE().invalidate();</b>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.