on 12-15-2011 9:55 AM
I played around a bit with POD plugins and the browse functionality that is supported there
It's working to the extend that I have a field with a browse button that opens a dialgue with the browse results. But when I choose an entry and close the dialgue the value is not written back into the browse field
But they seem to be still connected since when I write a few letters into the browse field they act as filter for the browse result
The field has a getter and a setter (but the later will not be called after closing the browse dialogue)
The field is defined like this in the JSP of the plugin:
<ls:inputField facet="content" id="OPERATION" name="OPERATION_CUSTOM"
fieldHelpPressInfoEnabled="true"
fieldHelpPressInfoClientAction="submit"
fieldHelpPressInfoResponseData="delta"
fieldHelpPressInfoParameters="#"
fieldHelp="F4LOOKUP" showHelpButton="true"
actionListener="#{customLotHoldPlugin.browseActionListener}"
value="#{customLotHoldPlugin.operation}">
<f:attribute name="browseable" value="true" />
<f:attribute name="browseId" value="OPERATION_CUSTOM" />
<f:attribute name="browseCustom" value="custom" />
<f:attribute name="browseSelectionModel" value="single" />
<f:attribute name="browseCallBack" value="customLotHoldPlugin.processOperationCallback"/>
</ls:inputField>
I also tried to use a callback function and maybe set the value manually. But I can't find the chosen value anywhere in the context
Another question would be what kind of legacy browses are supported. The manual doesn't really help here much.
What we would need would be a browse for shop order (I already found SHOP_ORDER with browseCustom set to "standard" for this one) and hold codes for a custom lot hold plugin
Thanks,
Anton
Anton,
I have written a test plugin and was having the same problem you have encountered. I was finally able to get it working. The important part is to extend from the BasePodPlugin class and to implement the BrowseSelectionEventListener. In the constructor make sure to add the listener. In the JSP file, make sure the id starts with an upper case letter. The id is used to construct the set method that will be called. It appends the first character of the id to "set" and the the rest of the characters in the id are converted to lower case and appended to the end. So id=OPERATION will create a method name of "setOperation".
This is my java class:
import com.sap.me.wpmf.BrowseSelectionEventListener;
import com.sap.me.production.podclient.BasePodPlugin;
public class TestBrowsePlugin extends BasePodPlugin implements BrowseSelectionEventListener {
private static final long serialVersionUID = 1L;
private String operationText = null;
public TestBrowsePlugin() {
super();
getPluginEventManager().addPluginListeners(this.getClass());
}
public void setOperation(String operation) {
setOperationText(operation);
}
public String getOperationText() {
return operationText;
}
public void setOperationText(String operationText) {
this.operationText = operationText.toUpperCase();
}
}
This is my browse definition in the jsp file:
<ls:inputField facet="content" id="Operation" name="OPERATION" upperCase="true" width="200px"
containerWidthSet="true" showHelpButton="true" fieldHelp="F4LOOKUP"
fieldHelpPressInfoEnabled="true" fieldHelpPressInfoClientAction="submit"
fieldHelpPressInfoResponseData="delta"
fieldHelpPressInfoParameters="#"
actionListener="#{testBrowsePlugin.browseActionListener}"
value="#{testBrowsePlugin.operationText}">
<f:attribute name="browseable" value="true" />
<f:attribute name="browseId" value="OPERATION_CUSTOM" />
<f:attribute name="browseCustom" value="custom" />
<f:attribute name="browseSelectionModel" value="single" />
<f:attribute name="browseDialogWidth" value="20em" />
<f:attribute name="browseDialogHeight" value="25em" />
</ls:inputField>
Regards,
Stan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stan,
thats too bad. But thanks for the hint for a possible workaround and all the help so far
Best regards,
Anton
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anton,
Currently there is not a way for 3rd party developers to add new custom browses to the system. This abilty has been added to our development backlog, but I am not sure when it will be scheduled to be developed. The only way you could add your own browse is to create a custom dialog that is posted when the browse icon is selected.. You will need to add a browse actionListener to your managed bean. That listener method will be responsible for posting your custom browse dialog which you create.
Regards,
Stan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Stan,
thank you very much. This solved my problem.
I don't know how I could miss that but I forgot the BrowseSelectionEventListener Interface.
Now the browse selection is written back into the text box
But this is only the first step to what I want to achieve finally. I need a browse for Hold codes since our pod plugin should implement a custom hold shop order.
Is there a list of legacy browse-ids available somewhere? The Plugin Writers Guide doesn't help much here.
But I guess this is not some kind of legacy browse anyways. Is there an example somewhere how to write a custom browse?
Thanks,
Anton
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stan,
I just tried your solution but also with no luck.
What I don't understand is is that the field seems to be connected to the browse window since every letter I type in before opening the browse will filter the results.
Only the writing back of the selected entry to the textfield doesn't seem to work
Thanks,
Anton
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rajeev,
I just tried your suggestion. Unfortunately it didn't make any difference
Thanks,
Anton
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Anton,
Change name attribute to be OPERATION instead of OPERATION_CUSTOM and value attribute to be operationText (not operation) as follows:
<ls:inputField facet="content" id="OPERATION" name="OPERATION"
fieldHelpPressInfoEnabled="true"
fieldHelpPressInfoClientAction="submit"
fieldHelpPressInfoResponseData="delta"
fieldHelpPressInfoParameters="#"
fieldHelp="F4LOOKUP" showHelpButton="true"
actionListener="#{customLotHoldPlugin.browseActionListener}"
value="#{customLotHoldPlugin.operationText}">
<f:attribute name="browseable" value="true" />
<f:attribute name="browseId" value="OPERATION_CUSTOM" />
<f:attribute name="browseCustom" value="custom" />
<f:attribute name="browseSelectionModel" value="single" />
<f:attribute name="browseCallBack" value="customLotHoldPlugin.processOperationCallback"/>
</ls:inputField>
You should then have the following in your managed bean:
// Needed to update field after browse.
public void setOperation(String operation) {
setOperationText(operation);
}
// to support value attribute
public String getOperationText() {
return operationText;
}
public void setOperationText(String operationText) {
this.operationText = operationText;
}
Regards,
Stan
Hi Anton,
can you please change
fieldHelpPressInfoParameters="#" fieldHelp="F4LOOKUP" showHelpButton="true"
to
fieldHelpPressInfoParameters="#" fieldHelp="F4LOOKUP" showHelpButton="true"
and try if it works or not.
thanks
Rajeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nityanand,
since it doesn't really work for me I fear I can't help you much.
Other than that there is an example in the examples folder of the SDK
Also the documentation about POD plugins helps a bit
Best regards,
Atnon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anton,
Im trying get the browse functionality. Im not able to achieve it. As you have already done it, can you please guide me.
Thanx in advance.
Plese help me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
97 | |
10 | |
10 | |
6 | |
3 | |
3 | |
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.