on 11-10-2006 1:52 PM
Hi
I created 2 views
I fired an RFC on the click of a button on first view.
The output of RFC is the set of records generated depending on the input.
First screen is used as selection screen to select data which will act input for RFC
I
need to print the records in the second view . For this<b> i created
textviews dynamically depending on the no of rows retrieved</b>.
Now if the user clicks "Back" button from second view and selects different input values. I need to recreate the textviews again with new no of records retrieved.
Since more than 1 UI element cannot be created with the same id, again creating the UI elements is giving error.
I cannot use destroyAllChildren() method before recreating since there are lots of other UI elements and destroyAllChildren() will destroy all .
Please help.
Suitable Reward Points will be given if anyone solves the problem.
Regards
Sonal Mangla
You have a specic place where to work dynamically.
IWDUIElementContainer container = (IWDUIElementContainer)
view.getElement("ID_CONTAINER_YOUR_DYNAMIC_POINT");
container.destroyAllChildren();
and after do all your ADD
container.addChild(text);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here i create a Table
//@@begin javadoc:CreateTable()
/** Declared method. */
//@@end
public void CreateTable( com.sap.tc.webdynpro.progmodel.api.IWDView view, com.sap.tc.webdynpro.progmodel.api.IWDUIElementContainer container )
{
//@@begin CreateTable()
String BindTextBase = new String("__Sie__Swe_Cs_Bapi_Wd_Equipment_Input.Output_Search_Equi.It_Equnr.");
String BindTextName = new String("");
String TextHeader = new String("");
IWDTable tb = (IWDTable) view.createElement(IWDTable.class, null);
tb.bindDataSource("__Sie__Swe_Cs_Bapi_Wd_Equipment_Input.Output_Search_Equi.It_Equnr");
tb.setVisibleRowCount(16);
IWDAction theAction = wdThis.wdCreateAction(IPrivateElencoApperecchi.WDActionEventHandler.VISUALIZZA_DETTAGLIO,"Visualizza Dettaglio.");
tb.setOnLeadSelect(theAction);
IWDTableColumn tbc = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
IWDTextView text = (IWDTextView) view.createElement(IWDTextView.class, null);
BindTextName = BindTextBase + "Equipment";
text.bindText(BindTextName);
IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, null);
header.setText("Equipment");
tbc.setHeader(header);
tbc.setTableCellEditor(text);
tb.addColumn(tbc);
wdContext.nodeColumnSelezionati().moveFirst();
do {
tbc = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
text = (IWDTextView) view.createElement(IWDTextView.class, null);
TextHeader = wdContext.currentColumnSelezionatiElement().getText();
TextHeader = TextHeader.substring(0, TextHeader.lastIndexOf("("));
header = (IWDCaption) view.createElement(IWDCaption.class, null);
header.setText(TextHeader);
tbc.setHeader(header);
BindTextName = BindTextBase + wdContext.currentColumnSelezionatiElement().getNameCol();
text.bindText(BindTextName);
tbc.setTableCellEditor(text);
tb.addColumn(tbc);
}while(wdContext.nodeColumnSelezionati().moveNext() != null);
container.addChild(tb);
wdContext.nodeIt_Equnr().setLeadSelection(-1);
//@@end
}
Hi,
But why dynamic text views? Why not a table?
Thanks,
Rajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sonal
In addition to already mentioned answer about using a separate UI container... During a new element creation you can leave ID as NULL like
view.createElement(IWDInputField.class, null);
This will avoid recreation of UI controls with the same ID.
BR
Sergei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
First of all: usually a table is used for displaying records (Collections).
You can use a table with Textview as TableCellEditor.
If you don't want to do this, you must use destroyAllChildren to clear the view elements. You can place the textviews in a container (e.g. IWDTransparantContainer) and thus only destroy the children in this container using the destroyAllChildren method of that container.
Good luck.
Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
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.