Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Display of multiple selections in a PT
lcarr
My DCT has a <select> item where multiple ='t'. How can I display all values in the PT when more than one option is selected?
Find more posts tagged with
Comments
LooseCannon
One way:
parse_items("Multiple Select Item");
sub parse_items {
my $item_name = shift;
my $dcr_list = dcr . "." . $item_name;
my
@temp
;
foreach my $index (iwpt_dcr_list($dcr_list)) {
# Do something w/values
push
@temp
, iwpt_dcr_value('$index');
}
}
lcarr
Thanks, That worked.
I defined my subroutine in the tpl as:
<!-- End CDATA -->
]]>
<iw_perl>
sub parse_items
{
# subroutine to display values from a multiselect list box
my $item_name = shift;
my $dcr_list = dcr . "." . $item_name;
foreach my $index (iwpt_dcr_list($dcr_list))
{
# Build a table cell containing the value
# my $html = join("","<td class='text'>",iwpt_dcr_value('$index'), "<br></td>\n");
my $html = join("",iwpt_dcr_value('$index'), "<br>\n");
iwpt_output($html);
}
}
</iw_perl>
<!-- Begin CDATA -->
<![CDATA[
and called it later in the tpl as:
<td class="text">
<!-- End CDATA -->]]><iw_perl>parse_items("Way(s) To Initiate Money Transfer");</iw_perl><!-- Begin CDATA --><![CDATA[
</td>
LooseCannon
Glad to help.
Banking Layout 20111107_EP1.dcpackage