BookmarkSubscribeRSS Feed
acordes
Rhodochrosite | Level 12

I'm adapting a html form to my needs. The example is from @XavierBizoux 

I want to add a inputtype="text" object which is not data-driven but regex controlled. 

It shows the container section but the text box does not appear. input.png

 

<?xml version="1.0" encoding="UTF-8"?>
<Task schemaVersion="7.2">
    <Registration>
        <Name>Filter Cars</Name>
        <Description>Prompt for SASHelp Cars report</Description>
        <Version>5.2</Version>
    </Registration>
    <Metadata>
        <DataSources>
            <DataSource name="dataset" defaultValue="sashelp.cars" where="false" required="true" readOnly="true">
                <Filters>
                    <Filter name="originFilter">
                        <Column column="origin" sortBy="label" sortDirection="ascending"/>
                    </Filter>
                    <Filter name="typeFilter">
                        <Column column="type" sortBy="label" sortDirection="ascending"/>
                        <Where>
                            <Expressions>
                                <Expression operation="eq">
                                    <Column column="origin" sortBy="label"/>
                                    <Value option="var_origin"/>
                                </Expression>
                            </Expressions>
                        </Where>
                    </Filter>
                    <Filter name="driveTrainFilter">
                        <Column column="driveTrain" sortBy="label" sortDirection="ascending"/>
                        <Where>
                            <Expressions>
                                <Expression operation="in">
                                    <Column column="type" sortBy="label"/>
                                    <Value option="var_type"/>
                                </Expression>
                            </Expressions>
                        </Where>
                    </Filter>
                </Filters>
            </DataSource>
        </DataSources>
        <Options>
            <Option name="filterTab" inputType="string">
                Filtering
            </Option>
            <Option name="geoGroup" inputType="string">
                Geography
            </Option>
            <Option name="var_origin" filter="originFilter" inputType="combobox" defaultValue="Asia" required="true" missingMessage="Please select an origin!">
                Select the origin of the car:
            </Option>
            <Option name="characteristicsGroup" inputType="string">
                Car's characteristics
            </Option>
            <Option name="var_type" filter="typeFilter" inputType="select">
                Select the type of car:
            </Option>
            <Option name="var_driveTrain" filter="driveTrainFilter" inputType="combobox">
                Which kind of drive train do you want?
            </Option>
            <Option name="disc" inputType="string">
                Discount scheme
            </Option>
            <Option name="txt_origin" inputType="text" placeholder="2000|2100|2200|2300" 
				pattern="^(\d{3,4}\|\d{3,4}\|\d{3,4}\|\d{3,4}\|)(?=$)" >
            </Option>
            <Option name="financialGroup" inputType="string">
                Financial aspect
            </Option>
            <Option name="var_Invoice" inputType="slider" defaultValue="50000" minValue="10000" discreteValues="10" maxValue="100000" promptMessage="Please enter a value between 5.000 and 1.000.000">
                What is the maximum price you want to pay? 
            </Option>
        </Options>
    </Metadata>
    <UI>
        <Container option="filterTab">
            <DataItem data="dataset"/>
            <Group option="geoGroup" open="true">
                <OptionChoice option="var_origin">
                </OptionChoice>
            </Group>
            <Group option="characteristicsGroup" open="true">
                <OptionChoice option="var_type">
                </OptionChoice>
                <OptionChoice option="var_driveTrain">
                </OptionChoice>
            </Group>
            <Group option="disc" open="true">
                <Optionitem option="txt_origin"/>
            </Group>
            <Group option="financialGroup" open="true">
                <OptionItem option="var_Invoice"/>
            </Group>
        </Container>
    </UI>
    <OptionDependencies>
        <OptionDependency>
            <TriggerOption option="var_origin"/>
                    <TriggerValue value="Asia">
                              <ShowTarget option="financialGroup"/>
                    </TriggerValue>
        </OptionDependency>
    </OptionDependencies>
</Task>
2 REPLIES 2
acordes
Rhodochrosite | Level 12
It works with the inputtype "validationtext".
The mentioned blog entry from @xavierbizou lays the groundwork for my customized html prompt as it includes dependencies and grouping, data sources and filters.
XavierBizoux
SAS Super FREQ

Hi Arne, 

 

Sorry for the late feedback. I'm happy to read that you found the solution to validate the input using regular expressions. 

Please let me know if you have other questions. 

 

Regards, 

 

x@b

Xavier BIZOUX
Advisory Technical Architect ● Global Enablement and Learning
Technology Transfer and Governance, R&D

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 404 views
  • 1 like
  • 2 in conversation