Adding a Link type field
authorAsier Galdos <asier.galdos@almis.com>
Fri, 04 Mar 2011 18:11:36 +0100
changeset 11037 cbf101e59f72
parent 11036 6a274a07ebbd
child 11038 3df47d728b0d
Adding a Link type field
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js	Fri Mar 04 18:10:59 2011 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js	Fri Mar 04 18:11:36 2011 +0100
@@ -22,6 +22,7 @@
 // * OBSearchItem: item used for search fields.
 // * OBFormButton: button used in forms.
 // * OBTextItem: string/text item
+// * OBLinkItem: string/text/link item
 // * OBTextAreaItem: string/text-area item
 // * OBDateItem: FormItem for dates
 // * OBDateTimeItem: FormItem for DateTime
@@ -340,6 +341,18 @@
   validateOnExit: true
 });
 
+//== OBLinkItem ==
+//Input for normal strings (links) with an added icon to navigate to the link  
+isc.ClassFactory.defineClass('OBLinkItem', TextItem);
+
+isc.OBLinkItem.addProperties({
+  validateOnExit: true,
+  icons: [{
+    src : '[SKIN]/../../org.openbravo.client.application/images/form/search_picker.png',
+    click: 'window.open(item.getValue());'
+  }]
+});
+
 //== OBFKFilterTextItem ==
 //Input used for filtering on FK fields.
 isc.ClassFactory.defineClass('OBFKFilterTextItem', TextItem);