on 03-31-2011 4:26 PM
Hi ,
Some one know how to do a table of input fields.
I do it in the binding process of the table but it doesn't work.
I discovred too checkox in in the node properties in the context of the component controller :
- interface node
- input element
I don't know if it's the solution.
I tried to select them both but when i excute i have error.
Any suggestion.
Thanks in advance.
Hi,
I read it several time to see if i understand what you have written unfortunately I am having difficulties to understand what the problem is.
What are you trying to do ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please walk through the steps.
1.in a view , you have a table UI.
2.Right click table UI and choose create binding.
3.In the new popup, you select a context node - select a node from your view
4.Standard cell editor - You choose input field.
5.Select the context attributes you want to be displayed in the table columns.
can you confirm which step is not working ?
BTW: Row repeater UI can also be used here instead of Table UI
Edited by: Baskaran Senthivel on Mar 31, 2011 5:55 PM
Hi..
I think already u bind table source property with some context.. after that
In right side.. ROOTUIELEMENTCONTAINER->Right click on table which you are using->click on create binding,
If opens one window, check IN STANDARD CELL EDITOR - IF it is text view change it to input field. and continue,
Now you get your table fields as input fields. hope it helps..
Cheers,
Kris.
Edited by: kissnas on Apr 1, 2011 6:54 AM
Hi ,
There is no code to post.
And yes, i let the cardinality as it was by default '0..n'.
What i want to develop is simple.
I have a product X and the user must fill-in all components of this product.
I want to do it in a table.
In this table each row corresponds to a substance (a component) that compose the product.
Tell me if i'm not clear enough.
Thanks
Hi..
It is simple to create table with input enable.
Create context first. select ROOTUIELEMENTCONTAINER
go to code wizard - you have options form and table - select table.
change standard cell editor to input field. or you can change this after binding.
click on CONTEXT - and BInd with your node.
Now you get created table with input enabled.
Hope it solves.
Cheers,
Kris.
Hi,
I guess the problem is that there is no element created. To allow the user to enter values in input field, you first need to create context element. The element should be of same type as the node which is bound to the table.
Suppose, TableNode is the node which is bound to the table. Then you can create element as follow:
DATA: lo_tablenode type ref to IF_WD_CONTEXT_NODE,
lo_element type ref to IF_WD_CONTEXT_ELEMENT.
lo_tablenode = wd_context->get_child_node( name = ''TABLENODE' ).
lo_element = lo_tablenode->create_element( ).
lo_tablenode->BIND_ELEMENT( new_items = lo_element set_intial_elements = abap_false ).
You can explore other methods of IF_WD_CONTEXT_NODE like bind_elements, bind_table etc..
Regards
Abhinav
Hi Abhinav Sharma,
I put the code that you gives to me after few syntax correction not very difficult to set up in WDDOINT in the view controller.
And it works.
The first row is unlocked and i solved also another problem.
Before these i can't retrieve also error messages.
Now i retreive them in a table.
The problem is that is only one row is unlocked.
Can you explain me what you do in these lines :
lo_element = lo_tablenode->create_element( ).
lo_tablenode->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).
i guess you create a new element but why we don't precise its type ?
thanks a lot for your response.
Hi
Actually, in these lines i am creating an instance of node so that it can contain values. If there is not instance you can not set the values.
lo_element = lo_tablenode->create_element( ).
lo_tablenode->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).
In order to create another element, use the same line of code. Also, what you can do is use BIND_TABLE method. For this you need to fill the internal table first and then u can pass the internal table to the method.
This way you can enable multiple elements at once based upon the no of rows in the internal table.
Refer this [Tutorial|http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp_poptable.htm]
and this [http://www.sapdev.co.uk/webapps/webdynpro/wdp_intotable.htm|http://www.sapdev.co.uk/webapps/webdynpro/wdp_intotable.htm]
Regards
Abhinav
HI,
here is the code. i use it in wddoint in the view.
When i use your code which is marked as a comment. it works for the first row.
I mean that only the first row is unlocked.
But when i use my code ("bind table") it doesn't work at all.
DATA: lo_tablenode type ref to IF_WD_CONTEXT_NODE, lo_element type ref to IF_WD_CONTEXT_ELEMENT.
DATA: lo_node_1 TYPE REF TO if_wd_context_node.
DATA: PROP_COMPONENT_TAB type standard table of bapi1077VP.
lo_tablenode = wd_context->get_child_node( name = 'PROP_COMPONENT' ).
lo_tablenode->BIND_TABLE( PROP_COMPONENT_TAB ).
* lo_element = lo_tablenode->create_element( ).
* lo_tablenode->BIND_ELEMENT( new_item = lo_element set_initial_elements = abap_false ).
Experts can you explain me this please.
Thanks
Hi
If you want to create N rows in a table then you have to create N elements. If you want to allow the users to add the row, then create one button say Add Rows. onAction of that button, write below mentioned code:
DATA: node_emp type ref to IF_WD_CONTEXT_NODE,
ele_emp type ref to IF_WD_CONTEXT_ELEMENT.
node_emp = wd_context->get_child_node( name = 'EMPLOYEE').
ele_emp = node_emp->create_element( ).
node_emp->bind_element( new_item = ele_emp set_initial_elements = abap_false ).
In this example, I have a node called Employee. and this node is bound to a table. When user clicks on Add button, a new row is created and user can enter the values.
Regards
Abhinav
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.