On Mar 26, 2004, at 9:18 AM, Surjan Singh wrote:
Hello,
I have two selection lists on a page. The problem is this: the second one is a required field, only if the value of the first one is among a few values.
I've seen the car example (localhost:8888/samples/forms/carselector), which has served as a useful starting point, as I can populate the second list given a value in the first. However, I still can't find out how to make the second selection list a required field if the first one has a certain value.
Something tells me there might be a way to use a union widget to achieve this. But I couldn't give you any details, I'm kinda behind the curve on those bits... Tim, are you out there? :-)
I thought of hiding the second list field if it's not required, but I don't know how to do that either.
Try this...
1)
<wt:widget id="listA">
<wi:styling submit-on-change="true" />
</wt:widget>This will cause the form to redisplay when the selection is changed, but with any other form control values the user has entered/changed being redisplayed as well (unlike a client-side reload), however neither validation nor form finalization are triggered (think of it as a "smart"/sticky refresh!)
2) To conditionalize the display of the second selection list, use JXTemplateGenerator to generate your Woody template, and write something like this:
<jx:if test="${listA.value == 'whatever'}">
<wt:widget id="listB"/>
</jx:if>HTH, mark
PS — please don't "reply" with a new subject, unless it's related somehow to what you're replying to. It fouls up threaded news agents (including the archive web site). Your message is more likely to get read if it's not buried inside a thread with a different subject.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
