I want to use UD01 form to enter elements that will be used in setting up test results on various properties of a material (steel) to be stored in UD100/UD100A. The UD100A record would store selected elements with differing input types in the same fields – Input1, Input2, etc.
In some elements, we might be looking at a decimal percentage. In others a Y/N entry. Or even selection from a combo box.
I had a thought that I could define a textbox and use a function to handle the validation for character and numeric entries. But the combo box doesn’t play well there.
So I thought I’d define both a text box and a combo box bound to the same column and then hide the one I don’t need for the particular record.
Using row rules came to mind, but I think that will operate at the view level and not the control, so it would hide or show both controls.
Anyone have experience with this? Any hints? A better way to do it?
It seems a little excessive but if you put the different controls on different panel cards you can give the panel cards their own EpBinding (doesn’t have to be a real field just yourdataview.anything) and then you can use the row rules on those fake EpBindings to hide and show the panel card you want based on another selection.
You could potentially do this with an event with a condition and a property-set. A property-set can target a control ID. You would just need to figure out how/ when to trigger it.
I like Corys idead but was never able to get the fake field thing to work.
The row rules could never find the fake field to use and if I typed it in manually on the row rule it would just vanish.
When you setup your rule, you want the action data view at the top to be the same dataview you made the fake field on, and then on the actions section, you put only the field name (without the dataview.)
Hello Cory. I created a Custom Event after OnWindowLoad to set the value of TransView.MyCustomField, and then I created a Data Rule to hide a Panel control based on the value of TransView.MyCustomField. However, the Data Rule doesn’t seem to be firing. It does work if I manually change the value using another control bound to TransView.MyCustomField. Is this how it should work? Do you have any ideas on how to show/hide a control after the form loads?
My guess is that for the app you’re working on the event to set your custom field is just firing too early. Can you verify after the page loads what TransView.MyCustomField has in it? F12 for dev tools, Ctrl+Alt+8 for debug, then Ctrl+Alt+V for dataviews.
I checked DevTools and found my problem. It seems like there was some data type mismatch between the value I was setting in the Custom Event (string) and the one I was using in the Data Rule (int). After I made sure that both were the same data type, the rule started working. Thank you Cory!