How would I capture the dropdown box's selected item and pass it on to a java script function that actually raises EPCF.raiseEvent()?
Am using following code:
<script language="javascript">
function raiseEvent()
{
var funcName = htmlb_formid+"_getHtmlbElementId";
func = window[funcName];
var dropdown = eval(func("ddListName"));
var name = dropdown.getValue();
EPCM.raiseEvent("urn:com.epcf.EPCFProducer", "objid",dropdown.getValue());
}
</script>
<hbj:dropdownListBox
id="ddListName" width="150"
model="TESTBEAN.model"
selection="<%=TESTBEAN.getItemText()%>"
onClientSelect="JavaScript:raiseEvent();"
>
</hbj:dropdownListBox>
And in second iView:
<script>
function eventHandler(event)
{
myFormId.data.value=event.dataObject;
}
EPCM.subscribeEvent("urn:com.epcf.EPCFProducer", "objid", eventHandler);
</script>
<form id="myFormId" >
The string passed is:
<input type="text" value="" name="data"/>
</form>
Can anybody correct my code or suggest me appropriateway to do it??
Regards,
Vaibhav