on 09-23-2013 10:26 AM
Hello everybody,
I´m developing an wpmf plugIn with some production information and an input field. When a button in the pod has been clicked this plugIn should start in a selected pod area.
Now, my problem is that I can´t set fecus on the input field of my plugIn. I´ve already tried some javascript in my jsp like
<script type="text/javascript">
window.onload = function(){
document.getElementById('myField').focus();
};
</script>
but it doesn´t work. Please help!
Thank you and best regards,
Olga
Hello Olga,
please try this method:
private String getComponentID(String elementId) {
UIComponent panel = getContainer();
if (panel == null) {
return null;
}
UIComponent comp = findComponent(panel, elementId);
if (comp == null) {
return null;
}
return comp.getClientId(FacesContext.getCurrentInstance());
}
and then call the method "setComponentFocus" from the like this:
setComponentFocus(getComponentID("FIELDNAME"));
Kind Regards,
Christoph
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
the container should be set by the following in the JSP:
<f:subview id="CustomView">
<ls:panel facet="content" id="container"
binding="#{CustomView.container}"
title="#{gapiI18nTransformer['CustomView.HEADER']}"
hasEditableTitle="false" isCollapsible="false" collapsed="false"
enabled="true" headerDesign="STANDARD" areaDesign="TRANSPARENT"
borderDesign="BOX" scrollingMode="NONE" isDragHandle="false"
contentPadding="NONE" height="100%" width="100%">
<f:attribute name="sap-delta-id" value="#{sap:toClientId('container')}" />
The red should trigger the setContainer method and then you should be able to use getContainer() and get a value.
Christoph
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.