Validating menu tab in django - django

In my django application,I am creating new report using django session,and my application contain 3 tabs namely Reports,Search and New Report.Tab highlight says that the application is in which page.If user clicks New report,the New report tab will be highlighted.
User can view all the reports by clicking the report link from Report tab.
If the user clicks any one of the report namely "report id 5"in Report tab,that will open the report under New report Tab,so the New report menu gets highlighted.But i want it to not highlight because New report Tab is for creating only new report,while seeing the existing report i should not highlight the New report Tab.How to do it using django.
views.py
def method(request):
Some code
return render(request, sometemplate.html',
{'
'newreport_menu': True,
})
In menu tab,i validated like this
<li {% if newreport_menu %}class="current"{% endif %}>New Report</li>
Now "New Report" menu is always gets highlighted for creating new report and if user click the existing report from Report Tab.But it should not highlight if the user clicks the existing report.
How to do this.
Thanks

Related

How to get value from a bar chart on oracle apex when clicking a specific bar?

I have a bar chart on an oracle-apex page, I want to get the value from a bar when I click on it.
How can this be done?
You can create a new Modal Page with one Item to receive the value.
On you Barchart page go to Series -> Link -> select Redirect Page in This aplication-> and choose the target.
In the Link Builder set Page field as your Modal Page Number and Set Items filed name = item in your modal page to receive the value

How to set modal dialog title dynamically in oracle apex 18

I want to set modal dialog title dynamically based on an interactive element.
ex) In page 50, I've made an Interactive Grid and set the link on "Title" column, when user click on title column, a modal dialog appears.
I want to set the title of that modal dialog to title column's content.
But modal dialog's title doesn't change dynamically.
In this case, how can I apply the titles dynamically?
I've seen many solution related to this question, but I can't solve my problem.
Let's say, your model page number is 51. Here are step by step approach [TESTED] to dynamically change title of model page:
Create a hidden item in your model page, let's say the hidden item name is P51_Title.
In Interactive report -> title column link -> click on link builder box -> set values -> add Hidden item as P51_TITLE under Name and value as '#Title#' Column (#ColumnName#).
In model page 51 static region header (title property), add hidden item value as &P51_TITLE. (dot is mandatory to add at last. This is substitution string with & and dot(.) before and after of item name respectively)
save both the pages and run. when you will click on title column link, the link will be redirecting to the model page and title data will be passed through URL to hidden item in the session, so model page header will automatically change based on title data from report.
I made such dialogcreate js function.
It moves popup page Title to modal dialog title.
So, dynamic calculated title &P51_TITLE. would be applied automatically.
$(document).on("dialogcreate", ".ui-dialog--apex", function(e) {
var lDialog = $(this);
lDialog.find('iframe').on('load',function () {
lDialog.children(".ui-dialog-content")
.dialog("option", "title", $(this.contentDocument).find('title').html());
});
});
I am very disappointed that something like this (or any other solution) do not work in apex modal pages by default!

In Oracle APEX, how do I make my button delete a row?

In Oracle APEX, I figured out how to add a button into the APEX table. Here is my table so far, and the extra column has a link "Sample Link Text" .
It is by adding this code :
<button class="t-Button " id="#edit_link#"
onclick="showRow(#edit_link#);" type="button"><span class="t-Button-label"> + </span></button>
However, I'm stuck on the task of causing the button click to delete the current row. How do I link the button to an action (like delete or update)?
thanks
If you have a created that Apex table as a tabular form, I believe that there's a default delete button that comes with it but if there's none, here's how to create a delete button:
Under the region of your table, create a button. Then set it's "Action" property to "Redirect to URL". Set it's target URL to this javascript:apex.confirm(htmldb_delete_message,'MULTI_ROW_DELETE');
Then Save.
Also Please check if the Delete check box is selected in process.
Property Screen Shot

validation on button without refresh page on APEX5 5.0

Need your suggestions on handling the validation without submitting page in APEX 5.0. I have following items on my apex report page.
"Select list" item which contains some static values
date pickers ( start date and end date)
Submit button ( Once submit is clicked the report date is displayed )
Here I need to add a dynamic action or validation to the submit button so that if user clicks the submit button without selecting a value from the "Select List", an error message should be displayed to the user that he needs to select the item first from the "Select list" page item. With out any selection from the list , the processing should stop and a warning message should be displayed ( either it could be popup message or message can be marked on the select list page item ) .Point to be noted here that during the submit I do not want to refresh the page, just would like a quick error message to display.
Appreciate your help.
in a similar case i used dynamic actions
dynamic actions works on client side
in my case i am not enabling submit button until user changes the select list value
in my dynamic action my config is as below
Event=change
selection=items
item=selectlistID
and true action is
action=disable
button=submitbuttonname
in your case you can choose javascript as action and add your javascript code

Sitecore Page Editor Publishing items related to content

I have a "Product Page",Product page maps to "ProductPage" Sitecore item. Website/Pages/ProductPage.
I have a text area in that page with page editor, which loads text from "Product Example Text" Sitecore item's "Description" text from Web database. (Sitecore.../CommonText/Product Example Text)
In my ascx file, mark up is pretty straigh forwad,
<sc:FieldRenderer ID="FieldRenderer1" runat="server" />
Codebehind,
FieldRenderer1.Item = //"Product Example Text" Sitecore item
FieldRenderer1.FieldName = "Description";
When I open the page in Page Editor(as a system admin), it allows me to change the "Product Example Text", and when I save using the "Save" button on the Page Editor it get saved to the master database. "Product Example Text" item get saved.
Now, when I try to publish the item using the "Publish" item in the Page Editor ribbon, these changes do not get reflected,reason is "Product Example Text" item does not get published.
When I save the page, somehow Sitecore understands the "Product Example Text" item has to be saved. But why does not it get published?
Am I doing anything wrong.... How can I solve this issue?
While saving an item in Page Editor, Sitecore saves all the field renderers which are displayed on the page, so if you set the Item property of a FieldRenderer1 to "Product Example Test" Sitecore Item, Page Editor know which item should be saved.
The problem with publishing is that you enqueue the current item in the publishing queue, but this item has no link to the "Product Example Test" Sitecore Item in any of its properties cause you're setting the Item property of the field renderer dynamically in the code.
The option would be to add another button to Page Editor next to Edit Related Item button and create a command that will Publish Related Item. The complete description how to add such a command can be found in the answer Sitecore page editor - how to extend page editor item editing panel
Another approach would be to create the "Product Example Test" content item under the "ProductPage" as a sub item. In publish options you can use publish sub items, which will publish all content you want.
But the problem is, if you want a particular content to be shared in several places, this won't work.
Maras's answer is a better solution.