Seite 1 von 1

multiobject and listviewRows

Verfasst: Di 17. Jun 2014, 17:52
von Michael_S
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.

Re: multiobject and listviewRows

Verfasst: Mi 18. Jun 2014, 09:34
von Carrear
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.

Re: multiobject and listviewRows

Verfasst: Mi 18. Jun 2014, 09:45
von Carrear
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).

Re: multiobject and listviewRows

Verfasst: Mo 18. Aug 2014, 14:00
von Michael_S
Yes, that could be it ... a simple mistake, I will test.

Cheers.