Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

conditional attribute - how to

843838Mar 28 2007 — edited Mar 28 2007
Hi,

I'm writing JSP document, so the jsp must be well formed.

I want to set the background of even and odd table rows by adding a class only on even rows (to avoid unnecessary source - network traffic).

Something like

if (even)
<tr class="even>
else
<tr>

How can this be done in JSP documents?
I've tried many approaches with JSTL,... but the "problem" is that condition can only be checked with <c:if> and <jsp:attribute> within <c:if> sets the attribute to <c:if>.

What am I missing?

Any ideas?

Comments

Patrick Devine
Hello Sri,

My team is looking for a solution to the same question. We're integrated with a separate system that has already generated the instances, and we do not want the user to be able to add to or remove them. I'm wondering - did you find out how to remove these buttons?

- Patrick
Jasmine Lee-Oracle
Answer
Hi Sri and Patrick,

There's no out-of-the-box configuration to hide the Add/Remove Instance buttons from entity collect screens in Web Determinations. However, this requirement can be achieved through Custom Properties. This requires a technical person to create the custom property, which the rulie then attaches to the Rule Project. The technical person also needs to modify the velocity template which renders the entity collect screens so that it will remove the Add/Remove buttons on any entity collect control where the custom property is set to True.

I can't advise on exactly how to write the custom property or edit the velocity template (I'm a functional expert, not a programmer), but the OPA Developer Help should have guidance. Try searching on ‘custom property’. From the rulie perspective, have a look at this article for how to attach a custom property to the project and to the particular screen control:

* Augment the rulebase with metadata: http://docs.oracle.com/html/E24270_01/Content/Integrating/Augment_the_rulebase_with_metadata.htm (particularly the sections 'Specify a custom property defintion' and 'Assign a custom property to a control'). This link is to the 10.3 version of the OPM Help. If you are using an earlier release of OPA, you can look at the equivalent article in your copy of the Help.

(If there are technical people following this thread, perhaps you could reply with specific OPA Developer Help articles people should look at with regard to writing custom properties?)

Cheers,
Jasmine
Marked as Answer by 900697 · Sep 27 2020
Patrick Devine
I wanted to reply with a different technical solution that someone on our team discovered. By setting a property in the CSS (display:none) for those buttons, we have been able to hide them. Does anyone have opinions on benefits / risks associated with a CSS approach to hiding page elements?

Thanks,
- Patrick
LukeStudley
Hi

As Jasmine says you should create a custom property on the screen.
E.g. a boolean property "HideInstanceButtons" and set it to True on the screen where you do not want them displayed.

Then you need to edit the velocity template that you will find in OWD under WEB-INF/classes/templates/controls/ButtonControl.vm
you should add an if block around the output of the button tag along the lines of: (Note I'm writing this off the cuff - so there's probably some syntax errors there - but you get the gist)

#if( ! ( "True".equalsIgnoreCase($control.getProperty("HideInstanceButtons","False")) && ("add".equals(${control.getButtonClass()}) || "remove".equals(${control.getButtonClass()}) )
... input tag
#end


By the way - this is much safer than using display:none CSS approach as the markup is never sent to the user. A user could in theory override the CSS styles to redisplay the buttons using your approach.
Patrick Devine
Thanks Luke! Appreciate that tip. We'll take a closer look at your approach.
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 25 2007
Added on Mar 28 2007
16 comments
539 views