ViewPanel shows empty rows

  • I have a ViewPanel on a custom control. It’s childishly simple … it’s a plain ViewPanel with a pager with a static view name. The only custom configuration is I have max rows set to 10 to see the Pager work. Trivial, right?- Wrong. The pager shows it has three pages, but the view is rendered as ten blank table rows. If I click “Next” I get an error 500, Command not handled Exception.

  • If I use a repeat control and render the View “by hand” it works fine, but it’s tons more work.

  • What’s up with that?

---------------------------- Xpage source

<?xml version="1.0" encoding="UTF-8"?>

<xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>

<xp:viewPanel rows=“10” id=“viewPanel1”>

xp:this.facets

<xp:pager layout=“Previous Group Next” xp:key=“headerPager” id=“pager1”>

</xp:pager>

</xp:this.facets>

xp:this.data

<xp:dominoView var=“view1”

viewName=“Configuration”></xp:dominoView>

</xp:this.data>

</xp:viewPanel>

</xp:view>

Subject: Ah, the 2-steps forward, 1-step back of Views in XPages

“So apparently one may trivially compute the View to use, but it won’t show anything. I’m not sure of the utility of computing a View if it’s going to be blank, and the only way the View control works is to statically insert a bunch of junk to make it function. Will a repeat control work to replace all this static mess with something that works off the View data?”

Yeah, it’s kind of sad - you want the equivalent of $$ViewTemplate functionality. XPages apparently shipped without a full equivalent, even though the absolute #1 first area where people WANT to implement XPages first is views.

I think the only viable alternative is to create a custom control with N number of columns, and dynamically calculate everything for those columns (display as icon, hiding, color, link attributes, etc.) based on the column hiding attributes of the derived view. Re-re-re-inventing the wheel. Search on this forum, there’s other discussion here.

Hopefully 8.5.1 will have progress in this area.

Subject: Actually (saint) Dec has a solution…

  • Use a repeat control to manually iterate over the View and build the table from scratch. I have that implemented as a custom control; I simply pass in the View name (when DDE deigns to show me that custom property) and bing, rendered View where-ever I want it.- I was looking for an alternative and hoping Lotus had one. I should have known that (saint) Dec would have used a View control if that would work. I couldn’t do XPages without his blog. Period.

  • XPages are right spiffy, but man they are nightmarish for things that used to be trivial. I’ve spent weeks just getting a basic page layout and View to render in a reasonably flexible manner, where that same work would have taken HOURS using the old way. I’m about to abandon XPages entirely and do all the work using R7 Designer. I keep hoping at some point this will get easier.

Subject: Source seems to be missing view column definition

David, the source you posted doesn’t include any viewColumn tags… the xp:viewPanel tag should have a child for each column to display, e.g.:

<xp:viewColumn columnName=“subject” id=“viewColumn1”>

		<xp:viewColumnHeader value="subject"

			id="viewColumnHeader1">

		</xp:viewColumnHeader>

	</xp:viewColumn>

Subject: Odd.

  • Doesn’t it pull that off the View?

  • Tried again today and it worked. I think I did a “Computed View” yesterday, so it never put the columns in.

  • So apparently one may trivially compute the View to use, but it won’t show anything. I’m not sure of the utility of computing a View if it’s going to be blank, and the only way the View control works is to statically insert a bunch of junk to make it function. Will a repeat control work to replace all this static mess with something that works off the View data?

  • Also Is it normal for DDE to completely and totally freeze up for twenty seconds when I click on the drop-down to select a View? I see that with abysmal consistentency.

  • Thanks for your time…

Subject: Apparently repeat controls don’t work in view controls

  • The editor lets me put a repeat in, but then it automagically nukes the “value=” attribute, which DDE then bitches about when I try to save. So how does one use a computed View on an XPage, if computing the View name means it’s impossible to include columns?