on ‎2007 Jun 09 5:33 PM
Hi group!!
I'm using a table view with iterator. In this tableview i have a different checkboxes and a inputfield.
With the checkboxes i don't have problems becuase i can use de event on click and save the modified data, but with the inputfield i have a big problem.
The inputfield only appears in some cases (this is correct) but i don't know how to save the data introduced in the inputfield .
I created the inputfield like this:
p_replacement_bee = cl_htmlb_inputfield=>factory(
id = p_cell_id
disabled = lv_disable
MAXLENGTH = '12'
size = '12'
WIDTH = '80'
value = m_row_ref->reference
type = 'STRING'
TOOLTIP = 'IReference' ).
And when I press some of the other checkboxes the data disappear and i don't know what to do to save the data,
Thanks in advance!
Request clarification before answering.
Sorry and thanks Patrick!!!
I had the <htmlb:form> defined in my layout, but it's certainly taht if i create a object inside the iterator like:
Data: form type ref to cl_htmlb_form.
create object form.
the iterator doen't crash but the values are not stored...
snif... I only want to save the values that the user puts in an inputfield but i don't know how to do... aixxx!!!
any other suggestion, please?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Miquel,
you don't need to instantiate cl_htmlb_form in iterator - you have to you BSP-element <HTMLB:form> in your page with flow logic or in your view if you're using MVC.
e.g.
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>
<htmlb:content design="design2003" >
<htmlb:page title="Test" >
<htmlb:form id = "TEST"
method = "POST"
autoComplete = "TRUE" >
<htmlb:tableView id = "..."/>
</htmlb:form>
</htmlb:page>
</htmlb:content>
The data will be available after changing an input in your table in onInputProcessing of your flow logic page - look at the link in Tatvagnas first reply.
Regards,
Sebastian
Message was edited by:
Sebastian Behne
A lot of thanks Sebastian and tha nks to everybody, finally I resolve the problem.
A lot of thanks again and thanks to all the comunity because is a very helpful!!!
Sebastian thanks for your time, I reward the poimts to all who suggested me correct solutions.
Thanks again!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again and thank for the answers.. and sorry for my delay but i was on a trip..
when i make the solution that you suggested i recieve the error (in the browser):
<htmlb:inputField>: Class <htmlb:form> (CL_HTMLB_FORM) was not found as BSP parent element.
this is when iterator try to make the sentence:
event_html = cl_htmlb_manager=>render_event_call(
bsp_element = lrf_ip1
event_type = 'click'
server_event = 'VALUECHANGED'
return_value = 'FALSE'
client_event = ''
client_event_inlined = '' ).
i can not understand why is too difficult to save the contents of an inputfiels using iterator.
Please help and thanks in advance
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sebastian!!!
In my bsp the class htmlb_events doesn't exist exist one called cl_htmlb_event but this doesn't have a method called inputfield_submitted.
Furthermore, in the bsp_element i can't put a reference of inputfield becuase the doesn't admit this type. If you see the constructor of this class is:
APPEND 'htmlb:breadCrumb:click' TO events_dictionary.
APPEND 'htmlb:button:click' TO events_dictionary.
APPEND 'htmlb:checkbox:click' TO events_dictionary.
APPEND 'htmlb:image:click' TO events_dictionary.
APPEND 'htmlb:link:click' TO events_dictionary.
APPEND 'htmlb:radioButton:click' TO events_dictionary.
APPEND 'htmlb:tabStrip:click' TO events_dictionary.
APPEND 'htmlb:tree:click' TO events_dictionary.
APPEND 'htmlb:dateNavigator:navigate' TO events_dictionary.
APPEND 'htmlb:dateNavigator:monthclick' TO events_dictionary.
APPEND 'htmlb:dateNavigator:weekclick' TO events_dictionary.
APPEND 'htmlb:dateNavigator:dayclick' TO events_dictionary.
APPEND 'htmlb:dropdownListBox:select' TO events_dictionary.
APPEND 'htmlb:tableView:headerClick' TO events_dictionary.
APPEND 'htmlb:tableView:rowSelection' TO events_dictionary.
APPEND 'htmlb:tableView:cellClick' TO events_dictionary.
APPEND 'htmlb:tableView:navigate' TO events_dictionary.
APPEND 'htmlb:tableView:buttonItemClick' TO events_dictionary.
APPEND 'htmlb:tableView:linkItemClick' TO events_dictionary.
APPEND 'htmlb:tableView:filter' TO events_dictionary.
APPEND 'htmlb:tray:edit' TO events_dictionary.
APPEND 'htmlb:tray:expand' TO events_dictionary.
APPEND 'htmlb:tray:collapse' TO events_dictionary.
APPEND 'htmlb:tray:remove' TO events_dictionary.
......
no htmlb:inputfield is admitted!!!!
I don't know what to do....
thanks again to all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
if you double click to static method cl_htmlb_manager=>render_event_call you see that it expects for input parameter "event_type" a string - htmlb_events=>inputfield_submitted is a constant (no method) with value 'click'. So you also can use event_type = 'click' (be aware of small case).
CL_HTMLB_EVENTS is not relevant at this point.
In method cl_htmlb_manager=>render_event_call you also can see that it expects for import parameter an instance type ref to if_bsp_element. Well, cl_htmlb_inputfield implements this interface and every instance of cl_htmlb_inputfield is just a more specific instance of if_bsp_element. The compiler in my Release accepts the coding. But if your compiler has a problem you need to cast a bit.
Instead of
lrf_ip TYPE REF TO cl_htmlb_inputfield,
type lrf_ip as follows
lrf_ip TYPE REF TO if_bsp_element,
and use ?= when build the instance for type-cast
lrf_ip ?= cl_htmlb_inputfield=>factory(... )
What i do not understand in your post, where do you need to call a constructor and of which class?
Message was edited by:
Sebastian Behne
don't work Patrick!!! thanks again!!!
If you have some other idea don't hesitate to put here!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi again,
let me correct the bugs, I posted In my last post I used input and inputfield - which are the same. Do not give "me" to bsp_element of method cl_htmlb_manager=>render_event_call because "me" is the instance of the iterator class and this will not work.
Your compiler does not know htmlb_events=>inputfield_submitted? The class htmlb_events must be there or the bsp framework won't work.
DATA: lrf_ip TYPE REF TO cl_htmlb_inputfield,
event_html TYPE string,
lrf_table_bee TYPE REF TO cl_bsp_bee_table.
lrf_ip ?= cl_htmlb_inputfield=>factory(
id = p_cell_id
disabled = 'FALSE'
maxlength = '12'
size = '12'
width = '80'
value = 'XXX'
type = 'STRING'
submitonenter = 'TRUE'
tooltip = 'Insertar referencia' ).
event_html = cl_htmlb_manager=>render_event_call(
bsp_element = lrf_ip
event_type = htmlb_events=>inputfield_submitted
server_event = 'VALUECHANGED'
return_value = 'FALSE'
client_event = ''
client_event_inlined = '' ).
CONCATENATE '<script language="JavaScript">'
'function fire_VALUECHANGED(){'
event_html
'}'
'</script>'
'<script for="'
p_cell_id
'" event="onchange" type="text/javascript">'
'fire_VALUECHANGED();'
'</script>'
INTO event_html.
CREATE OBJECT lrf_table_bee.
lrf_table_bee->add( level = 1 element = lrf_ip ).
lrf_table_bee->add_html( level = 1 html = event_html ).
p_replacement_bee ?= lrf_table_bee.
Sorry for the confusion! Reward some points for the helpful answers.
Regards,
Sebastian
Thanks again Patrick!!! but my real problem is that i don't know what i have to put in the bsp_element because compile but when i start this page when pass for this line i catch a bsp dump
ok this with quotes! but the other must be a bsp_element. I saw the constructor of this class and an inputfield isn't valid.
Any idea?
Thanks again for all.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks again Patrick!!!
I don't know what is the problem, perhaps the types definitions but if i ommit the quotes the compiler tell me that the type htmlb_events=>inputfield_submitted is unknown
Sorry Patrick but I'm newbie in bsp's!!!
thanksss
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer. Seems that can work but i have one difficulty... i was changing something the code for the type elements...but for render_event_call i can't put an input field because tell me that the type is not correct
Anubody know's wht type of object i have to put fon an inputfield?
lrf_ip = cl_htmlb_inputfield=>factory(
id = p_cell_id
disabled = lv_disable
maxlength = '12'
size = '12'
width = '80'
value = m_row_ref->referencia
type = 'STRING'
submitonenter = 'TRUE'
tooltip = 'Insertar referencia' ).
event_html = cl_htmlb_manager=>render_event_call(
bsp_element = me
event_type = 'htmlb_events=>inputfield_submitted'
server_event = 'VALUECHANGED'
return_value = 'FALSE'
client_event = ''
client_event_inlined = '' ).
CONCATENATE '<script language="JavaScript">'
'function fire_VALUECHANGED(){'
event_html
'}'
'</script>'
'<script for="'
p_cell_id
'" event="onchange" type="text/javascript">'
'fire_VALUECHANGED();'
'</script>'
INTO event_html.
CREATE OBJECT lrf_table_bee.
lrf_table_bee->add( level = 1 element = lrf_ip ).
lrf_table_bee->add_html( level = 1 html = event_html ).
p_replacement_bee ?= lrf_table_bee.
thanks again!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Patrick, but..
My inputfield is in one cell is a tableview
<htmlb:tableView id = "cl"
design = "STANDARD"
noMatchText = "No data"
showNoMatchText = "TRUE"
fillUpEmptyRows = "false"
selectionMode = "singleselect"
table = "<%= t_lines %>"
iterator = "<%= iterator %>" >
</htmlb:tableView>
This input field only appears in some rows using iterator (if not appears blank cell)
In IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START
WHEN 'REFERENCE'.
IF m_row_ref->LEVEL = c_nivell3.
p_replacement_bee = cl_htmlb_inputfield=>factory(
id = p_cell_id
disabled = lv_disable
MAXLENGTH = '12'
size = '12'
WIDTH = '80'
value = m_row_ref->referencE
type = 'STRING'
cellvalue = 'TRUE' ).
ELSE.
nbsp_bee->add( html = ' ' ).
p_replacement_bee = nbsp_bee.
ENDIF.
I don't know how to reciver the data entered in one of this cells without force usaer to press enter, because if write when the cells appear no event is raised when you finish and then if you click in one of the other cells the iterator creates again the input field.
Thanks in advance for all!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
what about some additional html:
data: event_html type string,
input type ref to cl_htmlb_inputfield,
bee_table type ref to cl_bsp_bee_table.
input = cl_htmlb_inputfield=>factory(
id = p_cell_id
disabled = lv_disable
MAXLENGTH = '12'
size = '12'
WIDTH = '80'
value = m_row_ref->referencE
type = 'STRING'
cellvalue = 'TRUE' ).
event_html = cl_htmlb_manager=>render_event_call(
bsp_element = inputfield
event_type = htmlb_events=>inputfield_submitted
server_event = 'VALUECHANGED'
return_value = 'FALSE'
client_event = ''
client_event_inlined = '' ).
concatenate
`<script language="JavaScript">`
`function fire_VALUECHANGED(){`
event_html
`}`
`</script>`
`<script for="`
p_cell_id
`" event="onchange" type="text/javascript">`
fire_VALUECHANGED();`
`</script>`
into event_html.
create object bee_table.
bee_table->add_element( bee = input level =1 ).
bee_table->add_html( html = event_html level = 1).
p_replacement_bee ?= bee_table.
Hope it works - not possiblities test this at the moment.
Regards,
Sebastian
Please I need an answer....
thanks again
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the answer but this doesn't solve my problem.
My problem with the code taht you passed me is taht if I put on inputprocessing no event is launched after the inputfield is modified. Then when enters here an event of another field is launched and i in this moment i can't revcover the value because the iterator creates the field again and now returns to blank.
I'm reading about on change, find and replace function but i don't know how to implement in this case.
Thanks a lot for all and please is somebody know's the answer, please help me!!!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tatvagna thanks for the anser but I think it isn't my solution.
I 'm doing this for save the checboxes value beacuse I'm starting an event and I can put the lofgic that I want on the onInputProcessing, but with the inputfield is different beacuse i can't start and event and if the user put some information in one of the rows of the tableview and then click a checkbox in a different row i can not recover the value of the row that has the inputfield with data (the implementation of the iterator makes that i loss the data because the tableview cells are created again.
Tnhanks in adavance.
for the input fields value attribute use variables.
<htmlb: inputField id = "ip"
value = "<%= comment %>"
(same holds good inside iterator as well)
then in oninputprocessing you should do the following
data: ip type ref to cl_htmlb_inputfield .
ip ?= cl_htmlb_manager=>get_data( request = request
name = 'inputField'
id = 'ip' ).
if not ip is initial .
<variableused in the inputfielddeclaration> = ip->value .
endif .
| User | Count |
|---|---|
| 7 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.