Hi Gil,
the eTemplate is fine, but you completly misunderstood the way nextmatch
works. The widget get a static array as argument via the content array,
see
http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.nextmatch_widget.inc.php?view=markup
The value for the key ‘get_rows’ is a callback, which the widgets calls
(callback is either specified as “app.class.method” string or
"class::method" for autoloadable classes using a static method call).
If you use so_sql, it already supplies that get_rows() method.
The usual way is that your so (storage object) class is either so_sql or
extends so_sql and your bo (business object) class extends so. That way
you only reimplement search (eg. to add read ACL) and get_rows uses it
by calling $this->search().
UI then adds to content array something like:
$content = array(
‘nm’ => array(
‘get_rows’ => ‘test.test_bo.get_rows’,
// further values see above link
),
// further content
);
You need 2 eTemplates “test.index” containing a nextmatch-widget with
id=“nm” and specifies with options=“test.index.rows” an other eTemplate.
That template contains the actual table of the nextmatch like your
"test.gil" template.
Ralf
Hi there!
I created a personalize widget not following the nextmatch widget in the
eTemplate.
My worries is no rows returned on the ${row}[test_id]. The name of my test
app is TEST. The db name is test. The table name is egw_test.
Here is my template xml:
<?xml version="1.0"?>
Here is my method:
/* poligrates */
function gil($content=null)
{
$this->bo->so->so_sql(‘test’,‘egw_test’);
$array = $this->bo->so->search(’’,false,‘test_id DESC’);
print(’
’); print_r($array); print(’
’);
array_unshift($array,‘nothing’);
$content[‘test’] = Array(
‘get_rows’ => $array,
);
print(’
’); print_r($content); print(’
’);
$this->tmpl->read(‘test.gil’);
return
$this->tmpl->exec(‘test.test_ui.gil’,$content,$sel_options,’’,array(‘test_id’=>$this->data[‘test_id’]));//,0
}
/************************************************************************/
Here is my printed array:
Array
(
[0] => Array
(
[test_id] => 1
[test_name] => gil
)
[1] => Array
(
[test_id] => 2
[test_name] => ki
)
)
Array
(
[test] => Array
(
[get_rows] => Array
(
[0] => nothing
[1] => Array
(
[test_id] => 1
[test_name] => gil
)
[2] => Array
(
[test_id] => 2
[test_name] => ki
)
)
)
)
Please advise.
Any help will be appreciated.
Thanks,
Gil
–
View this message in context: http://egroupware.219119.n3.nabble.com/How-to-create-personalize-nextmatch-widget-tp3770993p3770993.html
Sent from the egroupware-developers mailing list archive at Nabble.com.
Virtualization& Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
–
Ralf Becker
Director Software Development
Stylite AG
Morschheimer Strasse 15 | Tel. +49 6352 70629 0
D-67292 Kirchheimbolanden | Fax. +49 6352 70629 30
Email: rb@stylite.de
www.stylite.de | www.egroupware.org
Managing Directors: Andre Keller | Ralf Becker | Gudrun Mueller
Chairman of the supervisory board: Prof. Dr. Birger Leon Kropshofer
Commerzbank BLZ 55040022 | Account 218111300
IBAN DE33 5504 0022 0218 1113 00 | BIC COBADEFFXXX
VAT DE214280951 | Registered HRB 31158 Kaiserslautern Germany
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers