Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

One of common tasks in In-Portal is to display data from database. However we also need to account for case, when no data was selected and different text needs to be shown to user. This can be achieved using following template code:

<inp2:m_DefineElement name="topic_element">
	<li><inp2:Field name="Title"/></li>
</inp2:m_DefineElement>
 
<inp2:m_if check="topic_TotalRecords"> <!-- DB query #1 here -->
	<ul>
		<inp2:topic_PrintList render_as="topic_element"/> <!-- DB query #2 here -->
	</ul>
<inp2:m_else/>
	No Topics
</inp2:m_if>

From the above code it's obvious that doing 2 DB queries isn't necessary because selected record count (0 or more) is enough to determine if there is enough data to be displayed.

Solution

  1. in kDBList::GetSelectedCount all call to kDBList::Query method if list wasn't queried
  2. create kDBTagProcessor::SelectedRecords tag, that will call above method
  3. add selected type to kDBTagProcessor::GridInfo tag to allow retrieval of selected record count

Related Tasks

Error rendering macro 'jira' : Unable to locate Jira server for this macro. It may be due to Application Link configuration.

  • No labels