cancel
Showing results for 
Search instead for 
Did you mean: 

Change Inputfield to not editable

MaG
Explorer
0 Kudos

I want to change the status from a columnfield to not editable.

IF m_maut_row_ref->flag_ok = 'X'.

p_replacement_bee = cl_htmlb_tableviewcolumn=>factory(

columnname = 'MAUT_GEB'

edit = 'FALSE' ).

ENDIF.

but when i do this i get a white field not a grey with the value.

anyone can help ?

thx

Accepted Solutions (0)

Answers (1)

Answers (1)

maximilian_schaufler
Active Contributor
0 Kudos

Hi Marcel,

you want to disable the inputfield, but in fact you are just setting a parameter for the tableview column.

The "edit" parameter for the column just controls the ability of this column whether its content should be editable or not, BUT just in case the whole table row is set to edit_mode (note the parameter P_EDIT_MODE for the method render_cell_start, in case you are using an iterator).

What you want to do is - according to your problem description - to display a disabled inputfield in the column. To do so you should get familiar with tableview iterators where you can control rendering of the whole tableview, its rows, cells and contents.

See these weblogs for iterator info:

<a href="/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators:///people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

<a href="/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator:///people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator

MaG
Explorer
0 Kudos

i had found a solution from an other user.

I disabled the inputfield and gave him a VALUE. Then I have a not editable inputfield with value.

But I have an other problem. Is it possible to get changes in the inputfield in a tableview, when the row is not selected ?

maximilian_schaufler
Active Contributor
0 Kudos

What do you mean by "get changes" ... you want to have an editable inputfield in a row that is not selected?

If so, than the answer is yes - using the iterator you can control the displayed elements in every way you like.

In our main web application I'm using a tableview in which I do not use the given tableview selection/edit functions, but I added some code to be able to edit non-selected lines as well.

I'm currently writing on a weblog about my tableview, might end up with several blogs, as there are quite a few non-standard things I built in there. My selection/editing solution will be included in one of these, not sure yet which one. If you have smaller additional questions, I will nevertheless help you in forum, for the "bigger picture" you gotta be patient til the weblog is done

MaG
Explorer
0 Kudos

i have a tableview with a currency inputfield. The content of this field ist 22,50. But now the user change it to 23,50 and press a button. (the line is not selected) Where can I get the new value ?

maximilian_schaufler
Active Contributor
0 Kudos

Ah, you don't know how to retrieve the values after they are submitted?

Do you use MVC or just pages with flow logic?

MaG
Explorer
0 Kudos

yeah thats right. where are the new value ?

i use MVC

Message was edited by: Marcel Gäbe

maximilian_schaufler
Active Contributor
0 Kudos

Did you ever think of using Data Binding for your form elements? This way you don't have to care about manually retrieving the values.

If you want to access the value manually, this is how the id of the form field looks like in a tableview:

with data binding:

CONTROLLERID_MODELID_TABLENAME[ROWINDEX].COLUMNNAME

without data binding:

CONTROLLERID_TABLEVIEWID_ROWINDEX_COLUMNINDEX

MaG
Explorer
0 Kudos

where can i get some informations about data binding ?

maximilian_schaufler
Active Contributor
0 Kudos

Check the SAP online documentation:

<a href="http://help.sap.com/saphelp_webas620/helpdata/en/0f/ab3a3c9ca75402e10000000a114084/frameset.htm">Model View Controller (MVC)</a>

<a href="http://help.sap.com/saphelp_webas620/helpdata/en/fb/fbb84c20df274aa52a0b0833769057/frameset.htm">Data Binding</a>

MaG
Explorer
0 Kudos

hmmm here is my code to get the value of the field.

tv ?= cl_htmlb_manager=>get_data(

request = runtime->server->request

name = 'tableView'

id = 'maut' ).

IF tv IS NOT INITIAL.

tv_data = tv->data.

value = tv_data->get_cell_id(

row_index = '1'

column_index = '1' ).

  • value = tv_data->get_cell_value(

  • row_index = '7'

  • column_index = '1' ).

*

inputfield ?= cl_htmlb_manager=>get_data(

request = request

name = 'inputField'

id = value ).

he creates me a value = maut_1_1 but it doesn't work. He doesn't get any value.

maximilian_schaufler
Active Contributor
0 Kudos

Try calling the method REQUEST->GET_FORM_FIELDS and have a look at the received values while debugging:

Here is the code to access the form fields (place in DO_HANDLE_EVENT):

data: fields type tihttpnvp.

call method request->get_form_fields_cs
  changing
    fields = fields.

This table holds all values that were received by the server on last form submit.

Check for the values there and see if this helps to identify the cause of your problem.

MaG
Explorer
0 Kudos

i did it, but i didn't get any changed field.

maut_AllCo<TKNUM/SND_NR/EMPF/PALL/BTGEW/GEWEI/MAUT_GEB/FLAG_OK/VBELN/

mautvisb<1214

I despair. =(

maximilian_schaufler
Active Contributor
0 Kudos

Were you able to identify to field you are having troubles with? If you don't find it in this listing then I guess we have to look at the HTML/BSP code of your page.

MaG
Explorer
0 Kudos

the field is maut_geb. should i post my bsp code ?

Message was edited by: Marcel Gäbe

maximilian_schaufler
Active Contributor
0 Kudos

According to this entry in your fields table ...

maut_AllCo<TKNUM/SND_NR/EMPF/PALL/BTGEW/GEWEI/<b>MAUT_GEB</b>/FLAG_OK/VBELN/

...

you should receive this value - what is the content of this field when you look at it on debugging into your request?

The old value? The new/changed one? Or something different?

MaG
Explorer
0 Kudos

I only get a filled table. But there are only my TKNUM.


ASSIGN table_event->selectedrowindex TO <i>.
CLEAR row.
row-value1 = table_event->get_cell_value( row_index  = <i>
                                     column_index = '1' ).
row-value2 = table_event->get_cell_value( row_index  = <i>
                                     column_index = '3' ).

...
  value = request->get_form_field( name ).

Here the same problem. The request->get_form_field( name ) don't work on this server. On my developserver it works. I get the values.

-

-


when i use request->get_form_fields, then i get my changed value. But how can i get access to field ? fields-xxxx?

It is a little bit strange. request->get_form_fields work on the other server but not on my localserver. confused

Message was edited by: Marcel Gäbe

maximilian_schaufler
Active Contributor
0 Kudos

Please inform us about the WebAS server version and the SP level you are running on your machines.

> The request->get_form_field( name ) don't work on this server.

What do you mean by 'dont work'?

MaG
Explorer
0 Kudos

WebAS on my the local developer maschine is 6.20 with SP 30

WebAS on the other Server is 6.20 with SP 43.

I mean with "don't work", that the method doesn't get any value. The value is empty.

Former Member
0 Kudos

Hi Marcel,

you should check SAP note 616900 for both servers/patchlevels. This note keeps a list of all notes for every patchlevel of WebAS.

Checking this note from time to time can save you a lot of time...

Regards,

Alex

MaG
Explorer
0 Kudos

thx for the list. but there are many double entries. that make the list complex.

i had debugged the methode get_form_field. I get an error number. M_LAST_ERROR = 20. Where can I found a description of this error ?

Message was edited by: Marcel Gäbe

former_member181879
Active Contributor
0 Kudos

<i>The request->get_form_field( name ) don't work on this server.

i had debugged the methode get_form_field. I get an error number. M_LAST_ERROR = 20.</i>

We very (very!) seldomly experience errors at the level of the HTTP request. In this case, I would seriously recommend OSS message, queue BC-CST-IC.

brian