IDEMPIERE-191 Product Info search dialog assign the wrong value to the name field.

http://jira.idempiere.com/browse/IDEMPIERE-191
This commit is contained in:
Carlos Ruiz 2012-03-14 19:47:50 -05:00
parent 36494f3e91
commit cc07ae21b7
3 changed files with 24 additions and 5 deletions

View File

@ -480,9 +480,11 @@ public class InfoProduct extends Info implements ActionListener, ChangeListener
// Pick init
fillPicks(M_PriceList_ID);
int M_PriceList_Version_ID = findPLV (M_PriceList_ID);
// Set Value or Name
if (value.startsWith("@") && value.endsWith("@"))
fieldName.setText(value.substring(1,value.length()-1));
// Set Value
if (value != null && value.length() > 0 && value.indexOf("_") > 0) {
String values[] = value.split("_");
fieldValue.setText(values[0]);
}
else
fieldValue.setText(value);
// Set Warehouse

View File

@ -203,7 +203,7 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
public void onEvent(Event e)
{
if (Events.ON_CHANGE.equals(e.getName()) || Events.ON_OK.equals(e.getName()))
if (Events.ON_CHANGE.equals(e.getName()))
{
if (infoPanel != null)
{
@ -211,7 +211,19 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
infoPanel = null;
}
actionText(getComponent().getText());
}
else if ((Events.ON_OK.equals(e.getName()))) {
if (getComponent().getText() == null || getComponent().getText().length() == 0) {
// open Info window similar to swing client
if (infoPanel != null)
{
infoPanel.detach();
infoPanel = null;
}
actionText(getComponent().getText());
} else {
actionRefresh(getValue());
}
}
else if (Events.ON_CLICK.equals(e.getName()))
{

View File

@ -203,6 +203,11 @@ public class InfoProductPanel extends InfoPanel implements EventListener
// AutoQuery
if (value != null && value.length() > 0)
{
// Set Value
if (value.indexOf("_") > 0) {
String values[] = value.split("_");
value = values[0];
}
// Set Value or Name
fieldValue.setText(value);
testCount();