on 10-11-2004 7:01 PM
Hello,
According to the HTMLB documenation, "onClick" is supported on radiobuttonGroup. However, when I use it, I get a runtime error: Attribute 'onClick' not found in tag library 'HTMLB' for the tag radioButtonGroup.
Any idea how to generate a server event (onClick) when user changes the selected item of a radioButtonGroup?
Thanks ...
-shovon-
We all know that SAP´s sample code is mostly trivial and not covering all facets. But in this case the implementation is easy. Why did you not post a code snippet? The only thing I can guess is that you do not properly handle the event in your DynPage.
I found this test code for RadioButtons in my archive. It is based on a AbstractPortalComponent but should give anybody a proof of how it works.
protected void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
{
RadioButtonGroup rbg = new RadioButtonGroup("radioGroup");
rbg.setColumnCount(2);
RadioButton r1 = rbg.addItem("rb_one", "one");
RadioButton r2 = rbg.addItem("rb_two", "two");
RadioButton r3 = rbg.addItem("rb_three", "three");
RadioButton r4 = rbg.addItem("rb_four", "four");
RadioButton r5 = rbg.addItem("rb_five", "five");
rbg.setSelection("rb_one");
rbg.setOnClick("rbgEvent");
TextView text = new TextView("status");
text.setTooltip("Radio button status");
text.setText("no event");
IPageContext iPageContext = PageContextFactory.createPageContext(request, response);
Event event = iPageContext.getCurrentEvent();
if (null != event && "rbgEvent".equalsIgnoreCase(event.getAction()))
{
System.out.println("event invoked");
RadioButtonClickEvent evt = (RadioButtonClickEvent) event;
String selectedRadio = evt.getKey();
rbg.setSelection(selectedRadio);
text.setText(selectedRadio);
}
Form sampleForm = iPageContext.createFormDocument("form");
sampleForm.addComponent(rbg);
sampleForm.addComponent(text);
iPageContext.render();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. Your example was useful. I have, however, used JSP, and using inline scripting within JSP, I was able to solve the problem. Here is an example JSP I have now:
<hbj:radioButtonGroup id="REASON_FOR_REQUISITION"
columnCount="3" selection='<%= ISR.getValue("REASON_FOR_REQUISITION") %>'>
<%
REASON_FOR_REQUISITION.setOnClick("check");
%>
<hbj:radioButton id="D1"
key='New'
text='New'
tooltip='New'
disabled='<%= ISR.getDisabled("REASON_FOR_REQUISITION") %>'
encode="false"
/>
Thanks ....
-shovon-
Hi Moshiul,
I am SAP Technical Consultant ,currently finished NetWeaver & Ent Portal 6.0 SP2 corporate training arranged by my company www.enteg.com
I guess u r a Bangaladeshi .Basically i am based in Bangalore ,hailed from Malda ,West Bengal ,India .
I would like to make friendship with u .
Hoping that u will respond at moni@enteg.com
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.