cancel
Showing results for 
Search instead for 
Did you mean: 

HTMLB TableView Iterator

Former Member
0 Kudos

Hello,

I try the weblog OF Brian McKellar corresponding to the HTMLB TableView Iterator and as like certain people, the Dropdownlist of the column 'CURRENCY' is empty. This is cetainely due of how in the constructor the table is declared. So, for those which succeeded in replir the Dropdownlist of the column 'CURRENCY' can they give me the code of your constructor.

Thanks a lot.

Farid BERRA

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Farid,

In the iterator class declare a new Attribute with TYPE TIHTTPNVP.

For Example:

TABLE_TYPE Instance Attribute Public Type TIHTTPNVP

Then in the constructor code something like this:

method CONSTRUCTOR .

DATA: wa TYPE LINE OF TIHTTPNVP,

wa_tipo TYPE zmtvetipo.

  • -- TIPOS DE VIVIENDA

SELECT * FROM zmtvtipo INTO wa_tipo

WHERE tipcu = '1'.

MOVE wa_tipo-tipcu TO wa-name.

MOVE wa_tipo-zztipo TO wa-value.

APPEND wa TO table_type.

ENDSELECT.

endmethod.

Best regards

Ariel

Former Member
0 Kudos

Thank you Ariel,

In your example have you to create the table zmtvtipo?

Can i use, like i begin to do, the table SCURX?

Former Member
0 Kudos

ZMTVTIPO is a table TYPE. Create your own table type or use the table type of SCURX if exists or create a "Z" table type from SCURX.

If it solves your problem dont forget to mark the solution and regard me!

Ariel

Former Member
0 Kudos

Hello Ariel,

Thanks to your councils, i succeeded to get data in the DROPDOWNLISTBOX.

In the method RENDER_CELL_START, for CURRENCY, i have:

WHEN 'CURRENCY'.

IF P_EDIT_MODE IS NOT INITIAL.

DATA: DROP_DOWN TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.

DROP_DOWN = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(

ID = P_CELL_ID

SELECTION = M_ROW_REF->CURRENCY

  • TABLE = ME->M_CURRENCIES_REF

NAMEOFKEYCOLUMN = 'NAME'

NAMEOFVALUECOLUMN = 'VALUE' ).

GET REFERENCE OF TT_CURR INTO DROP_DOWN->TABLE.

P_REPLACEMENT_BEE = DROP_DOWN.

ENDIF.

And in the constructor:

DATA: LS_TCURT TYPE TCURT,

WA_LINE TYPE LINE OF TIHTTPNVP.

SELECT WAERS LTEXT

INTO (LS_TCURT-WAERS, LS_TCURT-LTEXT)

FROM TCURT.

CLEAR WA_LINE.

MOVE LS_TCURT-LTEXT TO WA_LINE-NAME.

MOVE LS_TCURT-WAERS TO WA_LINE-VALUE.

APPEND WA_LINE TO TT_CURR.

ENDSELECT.

And finally, I declared in the Instance Attribut:

TT_CURR TYPE REF TO TIHTTPNVP.

Former Member
0 Kudos

ok, remember to click the little star above the message that solves your problem.

Cheers

Ariel

Former Member
0 Kudos

Ok Ariel!

A last thing, when i leave the raw selected and i select another row, the data selected (currency) is lost. What i have to do to memory the data? At that time of my knowledge it's not very clear...

Thanks

Former Member
0 Kudos

Farid,

What you have to do is to catch the event that is triggered when the user changes the data on this cell. (Just put a breakpoint on the "onInputProcessing" event and analize the EVENT )

Then change the new selected value into the corresponding column / row of internal table (the one which was used to fill the table)..

And thats all when the server refresh the page your value will be changed magically!

PD: today is Saturday, if you dont understand something tell me and on Monday I will show you how to do it with some code.

Cheers

Ariel

Message was edited by: Ariel Ferreiro

Former Member
0 Kudos

Ok Farid...

1) change your code to this:

DROP_DOWN = CL_HTMLB_DROPDOWNLISTBOX=>FACTORY(

ID = P_CELL_ID

SELECTION = M_ROW_REF->CURRENCY

  • TABLE = ME->M_CURRENCIES_REF

NAMEOFKEYCOLUMN = 'NAME'

NAMEOFVALUECOLUMN = 'VALUE'

ONSELECT = 'DRPDWN_EVENT' ).

Note I have added the "ONSELECT" event.

2) Then put a breakpoint on the OnInputProcessing and check what happend when the user selects a new value on your table. Look that your dropdownlistbox has an ID that is the CELL_ID this id has the column position and the row position.

3) Capture the new value with something like this:

DATA: myDropDown TYPE REF TO CL_HTMLB_DROPDOWNLISTBOX.

myDropDown ?= CL_HTMLB_MANAGER=>GET_DATA(

request = request

id = '<HERE PUT THE CELL ID!!!!!>'

name = 'dropdownListBox' ).

4) Finally change your internal table using de CELL_ID attributes and the recovered data (myDropDown->SELECTION)..

Cheers,

Ariel

Former Member
0 Kudos

Ariel,

Sorry, i couldn't work BSP so i can't contact you...

Happy christmas and happy good year.

Farid

Former Member
0 Kudos

hi,

In the code you have pasted here, Are you able to get the selected VALUE?

In my case mydropdown->selection gives me the name of that column/cell, and not the value.

Can you help?

Thanks & Regards,

Krupa

Answers (0)