HTML cell button leaves off the applicability condition

If you think that something doesn't work in Aware IM post your message here
Post Reply
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

HTML cell button leaves off the applicability condition

Post by JonP »

If you create an HTML cell in a form section and select the button feature, entering a condition into "applicable when" does not incorporate that condition.

As a workaround, I attempted to manually enter it into the HTML using the following in red based on what I learned about applicability from exporting to XML, but I get a syntax error.

<button class="k-primary aw_custom_form_button" data-ref="<operation name="View Primary Reason" type="start_process" operand="ViewReasonFromForm" parameters="AssertionReason" applicability_condition="AssertionReason.PrimaryReason.Name <> &apos;&apos; AND (InitiativeCondition.Initiative.Sponsor=LoggedInPerson OR LoggedInPerson.Role.Conditions=&apos;Responsible (Full)&apos;)" image_cls="fa fa-edit" display_text="false"> <description>View Primary Reason</description> </operation>">
</button>

I got ID>0 instead of Name<>'' (shown below) to not give me a syntax error, but it still doesn't hide the button:

<button class="k-primary aw_custom_form_button" data-ref="<operation name="View Primary Reason" type="start_process" operand="ViewReasonFromForm" parameters="AssertionReason" applicability_condition="AssertionReason.PrimaryReason.ID>0 AND (InitiativeCondition.Initiative.Sponsor=LoggedInPerson OR LoggedInPerson.Role.Conditions=&apos;Responsible (Full)&apos;)" image_cls="fa fa-edit" display_text="false"> <description>View Primary Reason</description> </operation>">
</button>
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Jaymer
Posts: 2443
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML cell button leaves off the applicability condition

Post by Jaymer »

easiest to use a SECTION START around it...

<<IF Invoice.Status='Approved' or Invoice.Status='Scheduled' AND Invoice.ps_Ticket.TicketNum IS UNDEFINED THEN SHOW SECTION_START>>
<button onClick="AwareApp.startProcessFromForm ('CreateTicket','new_tab', this, false)" type="button" class="MyButton" role="button"><i class="fa fa-ticket">&nbsp;&nbsp;</i> Create Ticket</button>
<<SECTION_END>>

<<IF Invoice.ps_Ticket.TicketNum IS DEFINED THEN SHOW SECTION_START>>
<button onClick="AwareApp.startProcessFromForm ('ViewTicket','new_tab', this, false)" type="button" class="MyButton" role="button"><i class="fa fa-ticket">&nbsp;&nbsp;</i> View Ticket</button>
<<SECTION_END>>

This shows a CREATE TICKET button when there isn't one, and later, only a VIEW TICKET button.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

Re: HTML cell button leaves off the applicability condition

Post by JonP »

Good thought, Jaymer, but I'm afraid that using sections doesn't address my particular use case (which I neglected to identify). I'm placing buttons next to certain relationship attributes that they operate on.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Jaymer
Posts: 2443
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML cell button leaves off the applicability condition

Post by Jaymer »

JonP wrote:I'm afraid that using sections doesn't address my particular use case (which I neglected to identify). I'm placing buttons next to certain relationship attributes that they operate on.
OK, I'm not arguing, but I don't get it.
If you can already make an HTML cell work (alignment, columns, etc.), then I don't see the difference between using
AIM's builtin way to hide a HTML button (which u can't get to work), and
SECTION_START to hide the same button.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
JonP
Posts: 287
Joined: Thu Feb 16, 2017 9:49 pm
Location: United States

Re: HTML cell button leaves off the applicability condition

Post by JonP »

There are two times when I should not reply to email, right after I get up and right before I go to sleep. I should get a tattoo with that statement like in Memento.

In my sleepiness, I assumed that section start/end affected the whole row. And in my laziness I did not bother to try your solution, which is actually more elegant than what I was trying to do since I have four buttons, two of which will always be hidden.

Also, your solution allows me to use IS [UN]DEFINED, which I don't believe the applicability condition allows me to do.

Sorry about that and thanks for the beautiful hack!
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Jaymer
Posts: 2443
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML cell button leaves off the applicability condition

Post by Jaymer »

Glad it worked for you - but its not a hack.
Mark Bailey copied & pasted that code to me a while back. Nifty.
jaymer...
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply