on 12-15-2009 4:02 PM
Hi,
I've built a web dynpro with an embedded select-options view using component WDR_SELECT_OPTIONS.
One of those select options is a parameter, added using method add_parameter_field( ).
The parameters are properly displayed in the browser and I wanted to validate the user input and give an error message.
Currently I'm using that coding:
l_element TYPE REF TO if_wd_context_element,
l_node_sel_opt TYPE REF TO if_wd_context_node
.
l_node_sel_opt = wd_context->get_child_node(
name = wd_this->wdctx_select_options
).
l_element = l_node_sel_opt->get_element( )
[..]
wd_comp_controller->g_message_controller->report_attribute_t100_message(
msg = l_symsg
element = l_element
attribute_name = 'CHECKBOX_PERSKAUF'
This coding works fine, the message is available on top of the page, however, I cannot navigate to the appropriate element. I guess I cannot do this with the coding I'm currently using because there is no relation between the select-options fields and the context element/attribute. Am I correct?
If yes, is this possible at all - build my own select-options and let the user navigate to the validated field via a error message click?
Hi,
When you use select options component you automatically get the button CHECK.
so you can call the event ON_CHECK of select options i.e of WD comp WDR_SELECT_OPTIONS and do the validations accordingly and throw an error message.
Priya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{rant on}
Has anybody actually read the problem I've got??
The answers here in the forum really do lack some quality! It seems that some guys here are just hunting for forum points instead of reading the postings from top to bottom and give comprehensive answers accordingly.
Please don't post any answer if you did not understand the problems at all. I appreciate if you try to be helpful, but if you don't actually get the intention behind the postings then please don't answer at all.
{/rant off}
So, I will try to repeat my message with different words in case somebody did not understand:
1) I've set up some select-options/parameters on a web-dynpro, using component WDR_SELECT_OPTIONS
2) the user clicks button check
3) the action on_check is fired which calls my method oncheck().
4) inside this method I'm doing some checks after fetching the values from the web-dynpro
5) if some validation errors occur, the method displays some error message in the message area on top of he page
6) the user cannot click on the error message to immediately focus the field where the validation failed.
That's the current coding.
What I want to get as a result, is that the error message from 5) should be click-able to let the user jump to the appropriate select-option parameter/field where the validation error was found.
That's all - nothing more. If somebody has actually done this before, please post some sample coding - thanks
Hi,
you can get access to the context of component WDR_SELECT_OPTIONS
and select the corresponding element.
Regards,
Christian
Example for an error message on a Select-Option with ID "CUSTOMER"
name of comp_usage: SELECT_OPTIONS_SEARCH
METHOD check_selection .
DATA cmp_usage TYPE REF TO if_wd_component_usage.
DATA cmp_control TYPE REF TO iwci_wdr_select_options.
DATA contr_selop TYPE REF TO if_wd_controller.
DATA context_selop TYPE REF TO if_wd_context.
DATA root_node TYPE REF TO if_wd_context_node.
DATA node TYPE REF TO if_wd_context_node.
DATA element TYPE REF TO if_wd_context_element.
get reference of component usage
cmp_usage = wd_this->wd_cpuse_select_options_search( ).
IF cmp_usage->has_active_component( ) IS INITIAL.
cmp_usage->create_component( ).
ENDIF.
get reference of component controller ( WDR_SELECT_OPTIONS )
cmp_control = wd_this->wd_cpifc_select_options_search( ).
get reference of context
contr_selop = cmp_control->wd_get_api( ).
context_selop = contr_selop->get_context( ).
root_node = context_selop->root_node.
get node of select-option "CUSTOMER"
CALL METHOD root_node->get_child_node
EXPORTING
name = 'CUSTOMER'
RECEIVING
child_node = node.
get element
element = node->get_element( ).
fire message for select-option field "low"
CALL METHOD wd_this->go_mm->report_attribute_error_message
EXPORTING
message_text = 'TEXT'
element = element
attribute_name = 'LOW'.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You are right.
Interface of select options component should provide a way out.
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Interface of select options component should provide a way out.
Hi,
could you please explain a bit more? Is it possible to link a select option parameter/field and a message or not? Saying 'link' I mean the message in the message area should be clickable and the appropriate field should be highlighted and focused.
If yes, how should I change my coding to get this running?
Thanks!
You are right.
Interface of select options component should provide a way out.
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
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.