Dynamic webdynpro
Hi All
I would like to create some GUI component dynamically via webdynpro java.
I have a context node (regular node u2013 not dynamic) which its elements attribute represent the requested GUI component. How can I run by for loop on this node and create and bind new GUI component (for example IWDTextEdit) dynamically? Should I create other dynamic node or can I use existing not dynamic node?
Thanks in advance
Yoni,
You can create View as well as Context of a Web Dynpro application dynamically. Binding UI elements with context at runtime is also easily possible. The basic process for dynamic UI generation is given below.
1. Obtain a reference to RootUIElementContainer.
IWDTransparentContainer container = (IWDTransparentContainer)view.getRootElement()
2. Assign the desired layout Manager to RootUIElementContainer if entire view is being created dynamically. I've assigned RowLayout.
container.createLayout(IWDRowLayout.class)
3. Create desired UI element/s.
IWDTextView textView = (IWDTextView)view.createElement(IWDTextView.class, "SomeText")
4. Set UI elemnts's properties and add to RootUIElementContainer.
textView.setText("Text here");
textView.setDesign(WDTextViewDesign.HEADER2);
container.addChild(textView);
Please follow [this tutorial|https://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/503f22f6-b978-2a10-bf97-ddc21267e752#34] to learn the process of UI generation in detail.
These links may be helpful as well.
1. [Dynamic UI Generation|http://help.sap.com/saphelp_nw04/helpdata/en/4f/07cf3dd28b5610e10000000a114084/frameset.htm].
2. [Dynamic UI Generation in Web Dynpro for Java|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/WDJava/Dynamic%2bUI%2bGeneration]
3. [Dynamic User Interface Generation in Web Dynpro for Java - Use and Implementation|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/7765]
Hope this helps.
Vishwas.
Similar Messages
-
Dynamic webdynpro context mapping in GP
Hi Experts,
I have created a webdynpro coponent which contains a Dynamic node as a Gp context Output parameter.
This Dynamic node is mapped to another WD callable object's GP context input parameter.
Will i be able to transfer data using this dynamic node between these two WD callble objects?
Regards,
Ashish ShahHi Shanto,
This is how i plan to use these dynamic nodes
i have total 4 WD callable objects
1) A - Data capture Component
2) B- Request Component
3) C- Approver determination Component
4) D- Approver Action component
Requester enters data in component A in a static node N1, passing data to dynamic node DN1
Data input node in component B will be a dynamic node DN2 which will be mapped to node DN1
Component C will have a Dynamic node DN3 getting data from DN2
Component D will have a Dynamic node DN4 mapped to node DN3 , from DN4 data will be mapped to static node N2 and will be utilized further.
Not sure whether my plan will be able to utilize these dynamic node to its fullest or not.
May be you can help me analyze it better.
Regards,
Ashish -
Problem while creating multiple tabs dynamically webdynpro abap
Hi Experts,
i am trying to create multiple tabs in tabstrip dynamically but the tabs are hiding behind one other..
Let me know how to fix this.
Thanks
Abdul HakimAre you expecting from expert only?Sorry I am not a expert,
About issue:...
I think number of tabs will display that depends on the width of the container.. As of now how many tabs you have and hw many displaying at a time...
Please increase width ofyour container and check and let me know.
Its just a try not a solution.
Regards
`srinivas -
Dear all,
I want to know how the parameters are passed to the addChild method while creating dynamic views.
Manoj kumarDear all,
I want to know how the parameters are passed to the addChild method while creating dynamic views.
Manoj kumar -
How to create a webdynpro view dynamically and embed into view container?
Hi all,
Anyone knows how to create a view dynamically and embed the view into an existing view container?
My layout looks like this:
I have an existing view named main_view.
Inside main_view, I create a view ui container named vcu_view.
I embed the main_view into my window.
I need the codes to create a view dynamically and embed the view into the view container. Anyone have any idea?
Thanks in advance.
Rgds,
Siong Chaohi Siong Chao ,,
empty view insence ..( create a view without any UI element in it ) in design time ..
>
Siong Chao wrote:
> Hi Chinnaiya,
>
> How do you create an empty view dynamically then? Thanks in advance.
i think we cannot create a new view dynamically because it is a webdynpro restriction ..
NOTE: experts correct me if i am wrong in this answer
Regards
Chinnaiya P -
How to create a dynamic radiobutton in webdynpro dynamically
HI,
I want to create radiobutton in webdynpro dynamically.But this button in not enabled.Code:-
IWDNodeInfo info =wdContext.getNodeInfo().addChild("RadioBUttonDymanicNode",null,true,false,true,false,false,true,null,null,null);
IWDRadioButton rb = (IWDRadioButton)view.createElement(IWDRadioButton.class,null);
String testAtt = "testAtt";
info.addAttribute ("testAtt","ddic:com.sap.dictionary.string");
rb.bindSelectedKey("RadioBUttonDymanicNode." + testAtt);
rb.bindKeyToSelect("aa");
rb.setEnabled(true);
theTransContainer1.addChild(rb);
Please suggest me how to make it enable.
Regards
-SandipHi Sandip,
Try this code inside the wdModifyView(),
if (firstTime)
IWDRadioButtonGroupByKey radioButtonGroup =(IWDRadioButtonGroupByKey)
view.createElement(IWDRadioButtonGroupByKey.class, "MyRadioButtonGroupByKey");
radioButtonGroup.bindSelectedKey(<attributeName>);
radioButtonGroup.setEnabled(true);
IWDTransparentContainer container=(IWDTransparentContainer)
view.getElement("RootUIElementContainer");
container.addChild(radioButtonGroup);
Regards
Kishan -
Dynamically Creation of input field in webdynpro
Hello Experts,
I am new to webdynpro.
I have a requirement to create the input filed dynamically for material.
Requirement:- I have to button in my screen "+" and "-" button.
after execution while i will click on + button one input filed should be created automatically and while i will clicik on
- button the newly creaed inputfield should be deleted from the screen.
Coulld anybody help me on this.
it would be great if somebody can share any solutin or sample code.
Thanks in Adv...Hi Kiran,
Jus to clarify on this: There might be situations, we don't know how many fields the user wants to create at runtime.
Yes, OK, that does make sense and justifies the effort in this case, I agree with you.
But in OP's case I think he only wants one field:
after execution while i will click on + button one input filed should be created automatically and while i will clicik on
Still, it does make sense to dynamically create them if there could be one up to X to keep the application slender.
Cheers, Lukas -
Dynamic table in webdynpro interactive form not working. Urgent
Hi guys,
I am facing a problem when trying to retreive data entered in interactive form dynamic table.i can get the data entered in non dynamic fields no problem.
I have a node structure like this
Root
Data 1...1 singleton and non tried both
Table 1...n singleton and non tried both
In my adobe form i tried adding rows using add instance, and also using add button in webdynpro native. In the same method that adds row i simulated the submit button to create row in WD context! It adds rows but any data entered later is lost. One more thing i have noticed is it sometimes works after adding just one row! Data is passed to context but from next row it doesnt work! What am i missing?
I also tried adding a button in webdynpro tray and adding the row directly to the context. new row is created in form but any data entered in new rows is lost!
I am unable to obtain the data entered in Dynamic fields. I thought i would try the xml reading method but the problem is after crating a couple of rows dynamically if i go save pdf locally the new rows are not showing up in the pdf!
I have seen a post which said using the if_wd_iactive handler to set the form as dynamic but that method is not available in our system! Sorry i am not in front of an SAP system so i cant type exact names!
I tried using zci update program/ etc etc but i am still struggling at the moment. Any help would be much appreciated! Pls ask if you need more info.
Regards
Naresh
Edited by: naresh dwadasi on Oct 7, 2011 9:05 PMproblem solved! I had to recreate the form. not sure if i corrupted the webdynpro scripts etc by mistake.
-
Dynamic table in Webdynpro Java
Hi Colleagues,
I need to develop a table dynamically in webdynpro(Java), the table should not contain scrollbar, header, lines and border...Actual requirement is to group 12 elements in the from of a table
could anyone please help me here?
Thanks & Regards
SwethaHi Armin,
In a window i have to develop a part of window which looks like this
Image URL Description
Image URL Description
Image URL Description
Image URL Description
I have tried doing this using Flow layout for each line
But when i follwed that the last column "description" is not alligned in a straight line(for all rows)
structure is not even as shown above
(varying depending upon the length of the URL)
Here i have attached the piece of code i used
IWDTransparentContainer MainContainer1 = (IWDTransparentContainer)view.createElement(IWDTransparentContainer.class);
IWDFlowLayout flowlayout1 = (IWDFlowLayout)MainContainer1.createLayout(IWDFlowLayout.class);
////For adding Image
IWDImage image = (IWDImage)view.createElement(IWDImage.class);
image.createLayoutData(IWDFlowData.class);
image.setSource("~sapicons/s_b_alet.gif");
/////for Adding URL
IWDLinkToAction link1 = (IWDLinkToAction)view.createElement(IWDLinkToAction.class);
IWDTextAccessor link1text = wdComponentAPI.getTextAccessor();
link1.setText("Collaboration Window");
IWDAction Action1 = (IWDAction)view.getAction("Openlink");
link1.setOnAction(Action1);
IWDFlowData linkdata1 = link1.createLayoutData(IWDFlowData.class);
WDLayoutCellDesign rightpad = WDLayoutCellDesign.R_PAD;
WDLayoutCellSeparator seperator = WDLayoutCellSeparator.LARGE;
linkdata1.setCellDesign(rightpad);
linkdata1.setVGutter(seperator);
///for adding description
IWDTextView text1 = (IWDTextView)view.createElement(IWDTextView.class);
text1.setText("Testing");
IWDFlowData textdata1 = text1.createLayoutData(IWDFlowData.class);
textdata1.setCellDesign(rightpad);
textdata1.setVGutter(seperator);
MainContainer1.addChild(image);
MainContainer1.addChild(link1);
MainContainer1.addChild(text1);
IWDGridData maincont1 = MainContainer1.createLayoutData(IWDGridData.class);
maincont1.setPaddingLeft("10px");
maincont1.setPaddingTop("20px");
I found that this static way of adding rows is not the right way( Keeping in mind the future enhancements)
So thought of trying it through table
i have used IWDtable ...but the look does'nt meets the requirement at all(it has header....border..scrollbar..rows and colums are seperated by lines---> which are not needed)
Could you please let me know is there a approach to do this?
Thanks & Regards
Swetha
Edited by: Swetha Nellore on Feb 18, 2009 12:32 PM
Edited by: Swetha Nellore on Feb 18, 2009 12:33 PM
Edited by: Swetha Nellore on Feb 18, 2009 12:34 PM -
Dynamic table data isn't transfered to the context, with webdynpro for java
Hi,
I'm using LifeCycle designer 7.1 and Adobe reader 7.0.5.
I'm trying to make a dynamic table in a PDF form, that will be related to a table in the context.
I've designed the context like it says here: Dynamic Table - same data repeating in all rows
I made a dynamic table and related the cells on the row to the context, by dragging the variables from the DataView into them.
The table is related to TableList, the row to TableWrapper[], and the cells are related like this: TableData[].ItemName
And there's a button which adds a row to the table.
And for some reason, that's not working; When hitting the Submit to SAP button, it doesn't appear as though the data was transferred to the WebDynpro context.
Can anyone help me with it please..?
By the way - I tried using the SAP standard subform controls, the 'Insert Remove Move' control.
When trying it through the PDF preview, it doesn't work - whatever I click displays an error message, and when it runs from the browser - It automatically searches for an update for Adove Reader (I use 7.0.5).
Is it supposed to work only with version 8 of the Adobe Reader?Well, I reinstalled ACF, and now the Submit button works, and the Insert Remove Move buttons work as well.
But the table context still doesn't work.
I had put some values in the context, in DoInit, and they appeared in the table in the form, but when I changed them in the form it didn't affect the context at all.
There's a simple attribute value related to a text field, which IS affected when changed in the form, and the Submit button is clicked. Only the table doesn't work.
How can I make it work?
Thanks,
Udi Dekel -
How to create a roadmap ui element dynamically in webdynpro abap?
Dear team
iam new for webdynpro my question is how to create the road map programme dynamically using webdynpro
could you tell me what are the steps i have to take, what are the elements i have to bind?
and what code & where i have to write the code?
regards
sathyaHi Sathya,
Write the follwing code in WDDOMODIFYVIEW method to create a Dynamic ROADMAP and also create an attribute of
type string to control the selection of steps in road map.
method WDDOMODIFYVIEW .
data : lr_ele type ref to if_wd_view_element.
data : lr_rm type ref to cl_wd_road_map.
data : lr_step type ref to cl_wd_road_map_step.
data: lr_container type ref to cl_wd_transparent_container.
data : lr_flowdata type ref to cl_wd_flow_data.
CALL METHOD view->get_root_element
receiving
root_view_element = lr_ele.
lr_container ?= lr_ele.
CALL METHOD cl_wd_road_map=>new_road_map
EXPORTING
id = 'ROADMAP'
receiving
control = lr_rm.
CALL METHOD lr_rm->bind_selected_step
EXPORTING
path = 'VALUE'.
CALL METHOD cl_wd_flow_data=>new_flow_data
EXPORTING
element = lr_rm
receiving
control = lr_flowdata.
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_rm.
CALL METHOD cl_wd_road_map_step=>new_road_map_step
EXPORTING
id = 'ONE'
name = '1'
receiving
control = lr_step.
CALL METHOD lr_rm->add_step
EXPORTING
index = 1
the_step = lr_step.
CALL METHOD cl_wd_road_map_step=>new_road_map_step
EXPORTING
id = 'TWO'
name = '2'
receiving
control = lr_step.
CALL METHOD lr_rm->add_step
EXPORTING
index = 2
the_step = lr_step.
CALL METHOD cl_wd_road_map_step=>new_road_map_step
EXPORTING
id = 'THREE'
name = '3'
receiving
control = lr_step.
CALL METHOD lr_rm->add_step
EXPORTING
index = 3
the_step = lr_step.
endmethod.
Then you can use the context attribute to navigate between the steps and do respective actions. -
Dynamic form in Webdynpro for ABAP - Context Cardinality question
Hello -
I have an adobe form in a webdynpro for ABAP application which I want to be able to be dynamic. Basically I want to be able to use a Webdynpro context node with a cardinality of 1-N and the form will take each node of the context and create a page for each one. I am able to do a static form with a context node that has a 1-1 cardinality, but once I change my cardinality to 1-N on the node the static form no longer works (there is no data). Is what I want to do possible? I've looked through all the documentation I could find and could not get a definite answer. Any help would be appreciated.
Widget (1-N)
-Widget_info (1-1)
*Name
*Sku
*Description
-Widget_plant (1-M)
*Plant_Code
*Plant_State
*Plant_City
-Widget_pic (1-1)
*Picture
... So I want to have a form which can print a page for each widget in the context (the number of which can vary). That form would have the Name, sku, description, plant_code, plant_state, plant city and the picture on it. (This is just a generic example of what I need to do)
Regards,
- JasonOk, I think I found a bug... It seems for adobe forms in WD4A, the root context node must be 1-1 and you must nest the 1-n node within that... Not sure why, but it worked. So in my case my context would look like this:
FOO_NODE (1-1)
Widget (1-N)
-Widget_info (1-1)
*Name
*Sku
*Description
-Widget_plant (1-M)
*Plant_Code
*Plant_State
*Plant_City
-Widget_pic (1-1)
*Picture -
Dynamic rows in ABAP webdynpro table
hi all
I've got a question. I have a webdynpro with a table.
This table is feed by a node. The number of rows of this node is dynamic.
I had seen in the properties of the table object that the number of visible rows can be set.
But is there also a method to set this number of rows dynamicly? So when the node has 20 rows
the table object is also set to show 20 rows and when there are none, the table
only shows the header of the table.
Currently the table always shows 5 rows, without checking how many rows there actually are.
Does any of you know how to do this?
kind regards,
Anton PierhagenHi Anton ,
You can use the method SET_VISIBLE_ROW_COUNT() of the class cl_wd_table for setting the visible row count dynamically.
In the WDDOMODIFY view , you can get the reference of the table UI element used and proceed.
DATA lo_table TYPE cl_wd_table.
lo_table ?= view->get_element( ID = 'name_of_table_in_the_view').
lo_table->SET_VISIBLE_ROW_COUNT(value = 5)."Here the value you can decide based on your data.
But this method is not recommended as it directly deals with the view's elements and will be very difficult for the person maintaining the code.
Instead create a attribute which can store a number and bind the visible row count property to this attribute.
set this attribute with the values based on the data.(as in number of visible rows you would want to see.)
Thanks,
Aditya -
Filling dynamic drop down in adobe interactive form( webdynpro ABAP)
HI all,
Im new in Webdynpro ABAP, my requirement is to fill drop down list in adobe interactive form. i created adobe form and its working fine.
I Created context like ROOT(cardinality 1:1)->DATANODE cardinality 0:n. This context is for drop down and in wddoinit i did like this.
IN WDDOINIT ,
DATA lo_nd_root TYPE REF TO if_wd_context_node.
DATA lo_nd_datanode TYPE REF TO if_wd_context_node.
DATA lo_el_datanode TYPE REF TO if_wd_context_element.
DATA ls_datanode TYPE wd_this->elements_datanode.
navigate from <CONTEXT> to <ROOT> via lead selection
lo_nd_root = wd_context->get_child_node( name = wd_this->wdctx_root ).
navigate from <ROOT> to <DATANODE> via lead selection
lo_nd_datanode = lo_nd_root->get_child_node( name = wd_this->wdctx_datanode ).
get element via lead selection
lo_el_datanode = lo_nd_datanode->get_element( ).
ls_datanode[] = lt_dna_value[].
CALL METHOD lo_nd_datanode->bind_table
EXPORTING
new_items = ls_datanode
set_initial_elements = ABAP_TRUE.
index =
while executing i'm getting this error ": WebDynpro Exception: ADS: com.adobe.ProcessingException: No output was generated while rendering: Stream for: PDFOut.(200,101). " . can u please tell me how to bind value for drop down.
I created sample table in same form and i binded same value to table, that time its executing fine.
can u please tell me solution for this Scenario.
Thanks
Hemachandran.
Edited by: hemachandran R on Sep 12, 2008 2:27 PMhi,
My requirement, is to use dynamic drop down in dynamic table. I am using webdynpro abap.
i populated the value in drop down.
Its working fine but the problem is how to fill the default value in drop down. because i want to bind the default value which im getting specify value from the table.because each row
im getting different values, like first row
CAR
, that CAR want to fill as a default value in drop down and second row as
BIKE
that BIKE want to fill as default value in drop down ( example drop down contain car , bike , cycle).
In adobe form i binded like this
$record.DATANODE.DATA[*].DNA_RATING
i dont know whether this one is correct or wrong .
im getting default value as empty.
please give me some solution how to do this.its very urgent
thanks
hemachandran. -
Creating a dynamic valuehelp in webdynpro abap
Hello,
I am doing some development in Webdynpro Abap.
At this point I am unable to use the standard valuehelp provided in the system for selecting some values in an SAP HR system. Would there be any code samples for coding a custom value help in Webdynpro for ABAP. One of the things I have to be able to do is to dynamically generate the values of the valuehelp based on the value of some other fields on the screen that I am coding.
Any code samples or links will be appreciated.
Thanks for your help.
Best Regards
Sumit Agarwal.hi,
Check out OVS Input help.
/people/shruti.rathour/blog/2008/05/05/ovs-help-in-web-dynpro-abap
http://help.sap.com/saphelp_nw04s/helpdata/en/47/9ef8c99b5e3c5ce10000000a421937/frameset.htm
I hope this will help you.
Thanx.
Maybe you are looking for
-
What do I do if my MBP doesn't recognize my HDD after a hard reboot?
I have a MBP 13'' Mid 2010 2.4GHz 4GB. I work on Lion, with BootCamp and Parallels installed. Two weeks ago, I used Parallels to open up Windows for the first time since months. I think, maybe for the first time since i migrated with TimeMachine from
-
Encoding problem (Umlaute) in HTTP-Headers
Hi! I have a servlet that is being called by another server via a POST request. The request contains user data in HTTP-headers, and whenever there is a German Umlaut in the user's name, it ends up garbled. :( The requests character encoding is set to
-
Redirection question - best practice
I have a managed session scoped bean, named UserBean, which as it's name implies stores user information. Now, if the session has expired (or was never created), a lot of it's methods will return null values and will result in an error. What I'd like
-
Getting Total Order Cost for each order
I have a fact table, order lines. There are two dimension tables, customer & Product. For each order i want to display on a pivot table: - the cost of the line. -the cost of the total order. Is this possible? I have been playing with ALL & All excep
-
F4140 Pringting blank page from web pages & pdf
My F4140 is working and printing but is printing blank pages when I try to print from a PDF. I just tried to print a word document and it only printed the black and white section and left the color sections blank. It is also only printing the blac