multiobject and listviewRows

Michael_S
Senior Member
Beiträge: 160
Registriert: Mi 4. Feb 2004, 02:39
Wohnort: London / UK
Kontaktdaten:

multiobject and listviewRows

Beitragvon Michael_S » Di 17. Jun 2014, 17:52

Hi,

The tag listviewRows is not working with a multiobject listview, is there a workaround?

6.3.8.0 (SVN-Revision: 6985)

Code: Alles auswählen

<we:listview type="object">
	<we:repeat>
		<we:listview type="multiobject">

			<we:listviewRows />

			<we:repeat>
				-----
			</we:repeat>

		</we:listview>
	<we:repeat>
</we:listview>
Thanks,

Michael.
Production Area
London, UK
http://productionarea.com

Benutzeravatar
Carrear
webEdition Partner
webEdition Partner
Beiträge: 646
Registriert: Do 17. Jan 2013, 03:02
Wohnort: Hannover
Kontaktdaten:

Re: multiobject and listviewRows

Beitragvon Carrear » Mi 18. Jun 2014, 09:34

Make the same listview (with other name) before you start this listview. In the first one you dont make any Output, but:

Code: Alles auswählen

<we:listview type="object">
   <we:repeat>
      <we:listview type="multiobject">
         <?php $i = 0; ?>
         <we:repeat>
            <?php i++; ?>
         </we:repeat>

      </we:listview>
   <we:repeat>
</we:listview>
Now you have i as number of entries. Alternatively you can make only one listview and use php ob_start(); to buffer the output, at once initializing and count up the counter:

Code: Alles auswählen

<?php ob_start(); ?>
<we:listview type="object">
   <we:repeat>
      <we:listview type="multiobject">
         <?php $i = 0; ?>
         <we:repeat>
            <?php i++; ?>
         </we:repeat>

      </we:listview>
   <we:repeat>
</we:listview>
<?php
$page = ob_get_contents();
ob_end_clean();

doSomething();

echo $i;
echo $page;
?>
But - are u sure it doesnt work? I will try it and give you feedback.
Zuletzt geändert von Carrear am Mi 18. Jun 2014, 09:46, insgesamt 1-mal geändert.

Benutzeravatar
Carrear
webEdition Partner
webEdition Partner
Beiträge: 646
Registriert: Do 17. Jan 2013, 03:02
Wohnort: Hannover
Kontaktdaten:

Re: multiobject and listviewRows

Beitragvon Carrear » Mi 18. Jun 2014, 09:45

So ... in my case this works:

Code: Alles auswählen

<we:listview type="object" classid="4" workspaceID="552" >
	<we:repeat>
		<we:field type="text" name="SeminarTitel" />	
		<we:listview type="multiobject" name="SeminarModule">
			<we:listviewRows />
			<we:repeat>
				<we:field type="text" name="Titel" /><br/><br/>
			</we:repeat>
		</we:listview>
	</we:repeat>
</we:listview>
Ahh .. I think i see the problem - you have to give the attribute 'name' to the multiobject listview and as value it has to have the name of the multiobject-field - exactly (upper and lower-case).

Michael_S
Senior Member
Beiträge: 160
Registriert: Mi 4. Feb 2004, 02:39
Wohnort: London / UK
Kontaktdaten:

Re: multiobject and listviewRows

Beitragvon Michael_S » Mo 18. Aug 2014, 14:00

Yes, that could be it ... a simple mistake, I will test.

Cheers.
Production Area
London, UK
http://productionarea.com


Zurück zu „DB / Object Module“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 Gäste