[opencms-dev] Direct editing: popup for complex type - also possible for a list of elements?

Marc Johnen opencms at johnen.biz
Mon Apr 20 15:32:46 CEST 2015


Hi everyone,

I very much like the new feature with the popup, like you can see for
example in the demo (9.5.1) on the page
/grid-demo/element-pages/text-elements/index.html. 
When you click into one of the text-boxes you get a button to add a link
which has a text and an uri. The button opens a pop with an edit-diallog
only for his element.

I'm trying to implement something similar but with a list of elements. This
I'm using to edit element in the page footer. 
At the end of this mail you can se the schema, it's quite simple.

In my formatter I try to implement the direct editing like this:

<div>
	<c:if test="${value.Title.exists and ''!=value.Title}">
	    <div class="headline" ${rdfa.Title}>${value.Title}</div>
	    <hr>
	</c:if>
	<ul> 
		<c:forEach var="entry" items="${content.valueList.Links}">
			<li ${linkClass} ${rdfa.Links}>
					${entry.value.TextLink}
			</li> 
		</c:forEach> 
	</ul> 
</div>	

When trying to edit the elements, the editbuttons are shown correctly and
the popup opens, but as soon as I edit anything I get an error message
"(TypeError) __gwt$exception: : Cannot read property 'innerHTML' of null".
When I close the dialog and reload the page, the values have been altered
correctly.

Here are two screenshot:
http://johnen.biz/direct-editing-1.png
http://johnen.biz/direct-editing-2.png

So now I'm wondering, is this not fully implemented yet? Am I doing
something wrong?

pagefooterlinks.xsd
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
	
	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
	<xsd:include
schemaLocation="opencms://system/modules/biz.johnen.bootstrap.schemas/schemas/nested/pagefooterlink.xsd"/>
		
	<xsd:element name="Pagefooterlinkss" type="OpenCmsPagefooterlinkss"/>
	
	<xsd:complexType name="OpenCmsPagefooterlinkss">
		<xsd:sequence>
			<xsd:element name="Pagefooterlinks" type="OpenCmsPagefooterlinks"
minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="OpenCmsPagefooterlinks">
		<xsd:sequence>
			<xsd:element name="Title" type="OpenCmsString" />
			<xsd:element name="Links" type="OpenCmsPagefooterlinksEntry"
minOccurs="1" maxOccurs="50"/>
		</xsd:sequence>
		<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
	</xsd:complexType>

...
</xsd:schema>

pagefooterlink.xsd:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
	
	<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
	<xsd:element name="PagefooterlinksEntrys"
type="OpenCmsPagefooterlinksEntrys"/>
	
	<xsd:complexType name="OpenCmsPagefooterlinksEntrys">
		<xsd:sequence>
			<xsd:element name="PagefooterlinksEntry"
type="OpenCmsPagefooterlinksEntry" minOccurs="0" maxOccurs="unbounded"/>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="OpenCmsPagefooterlinksEntry">
		<xsd:sequence>
			<xsd:element name="Link" type="OpenCmsVarLink" />
			<xsd:element name="TextLink" type="OpenCmsString" />
			<xsd:element name="Popup" type="OpenCmsBoolean" />
		</xsd:sequence>
		<xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
	</xsd:complexType>
...
</xsd:schema>



-----
Greetings
Marc Johnen
http://www.johnen.biz
--
View this message in context: http://opencms.996256.n3.nabble.com/Direct-editing-popup-for-complex-type-also-possible-for-a-list-of-elements-tp25275.html
Sent from the OpenCMS mailing list archive at Nabble.com.



More information about the opencms-dev mailing list