Disable parameter view option in BIRT Viewer - report

Due to limitation of Birt parameter view we have implemented third party JSP to capture parameters and pass to Birt Engine.
But by default Birt viewer has option to see parameter view ( see the screen shot). I want to find a way to disable that option. Thanks in advance

After bit of a play around with codes I found the solution. The change needs to be done in ToolbarFragment.jsp , which can be found in the directory of
"birt/viewer/org.eclipse.birt.report.viewer/birt/webcontent/birt/pages/control/ToolbarFragment.jsp"
comment out the following snippet and your are done :)
<%-- <TD WIDTH="15px">
<INPUT TYPE="image" NAME='parameter' SRC="birt/images/Report_parameters.gif"
TITLE="<%= BirtResources.getHtmlMessage( "birt.viewer.toolbar.parameter" )%>"
ALT="<%= BirtResources.getHtmlMessage( "birt.viewer.toolbar.parameter" )%>" CLASS="birtviewer_clickable">
</TD> --%>

you can do it by using Javascript
scripts menu
client scripts
inside you can paste the code below
head.ready(function(){
document.getElementsByName("parameter")[0].parentElement.previousSibling.remove();
document.getElementsByName("export")[0].parentElement.previousSibling.remove();
document.getElementsByName("print")[0].parentElement.previousSibling.remove();
document.getElementsByName("exportReport")[0].parentElement.previousSibling.remove();
document.getElementsByName("exportReport")[0].parentElement.remove();
document.getElementsByName("printServer")[0].parentElement.previousSibling.remove();
document.getElementsByName("printServer")[0].parentElement.remove();
document.getElementsByName("toc")[0].parentElement.remove();
document.getElementsByName("export")[0].parentElement.remove();
document.getElementsByName("parameter")[0].parentElement.remove();
document.getElementById("navigationBar").parentElement.parentElement.remove();
});
clientscripts opiton will appear here

Related

liferay-ui:search-container-column-button wont react to click

i am using liferay-ui:search-container-column-button inside liferay container the button should point to another jsp with take parameter from the current selected row.
<liferay-ui:search-container emptyResultsMessage="There are no organizations available">
<liferay-ui:search-container-results
results="<%=OrganizationLocalServiceUtil.getOrganizationAll() %>"
total="<%=OrganizationLocalServiceUtil.getOrganizationsCount() %>">
</liferay-ui:search-container-results>
<liferay-ui:search-container-row
className ="fff.sem.service.model.Organization"
keyProperty="organizationId"
modelVar="organization"
escapedModel="<%=true %>"
>
<liferay-ui:search-container-column-text
name="Organization short name"
value="<%= organization.getOrganizationShortName() %>">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text
name="Organization full name"
value="<%= organization.getOrganizationFullName() %>">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-button href="<%=addOrganization1URL %>"></liferay-ui:search-container-column-button>
<liferay-ui:search-container-column-jsp
align="right"
path="/html/sem/organization_actions.jsp"
/>
</liferay-ui:search-container-row>
As you noticed in the code I used search-container-column-jsp to add edit and delete feature for the row. I use a column with search-container-column-button so that each button of that column point to another form, but the search-container-column-button wont react on clicking. What is going on?
Recent Liferay forum posts indicate a potential issue with the taglib:
search-container-column-button does not work
Issue in calling an action from liferay search-container-column-button tag
grep of the Liferay source code nor a github search return a single instance where the taglib is used.
My attempts to use the <liferay-ui:search-container-column-button to properly call any type (action, render, resource) URL were not successful. In examining the source closer, I believe the generic dump of the href attribute value into the onclick attribute is the problem.
In comparing the html generated by a <aui:button> to that of the search-container-column-button the onclick attribute is missing location.href=
I would recommend using a liferay-ui:search-container-column-jsp as you have done for the other actions, but instead of an icon-menu use a <aui:button> if you want the field to be a button.
Including the missing info:
<%
final String hrefFix = "location.href='" + addOrganization1URL .toString()+"'";
%>
<liferay-ui:search-container-column-button href="<%=hrefFix%>"/>
does provide a working solution, however, if this is indeed a bug and is fixed in a future patch, this workaround would then become a bug.

How to implement search engine in a asp.net page?

I want to implement search engine in my asp.net page. Means I want to keep one textbox and a search button. So what ever the keyword I will enter in that, it will search on this, the way it is happening in google.
Please give some idea.....
Thanks.
I have pretty good expirience with Lucene.NET, and you can also use MS SQL server Full Text Search if your data is in a MS SQL database.
Heres a great link to get you started on the HTML side. http://www.w3schools.com/html/html_forms.asp
<form>
Search: <input type="text" name="query" />
</form>
As for the ASP side, take a look at http://www.w3schools.com/aspnet/aspnet_forms.asp

Is nested <form> possible?

in a content page of an asp.net web page, i would like to include the "paypal" button "Pay Now".
So, i've a master page, and a content page.
In my content page i copy-paste paypal code.
In particular i use a "modalpopupextender" to permit my user to buy the object.
The problem is... it not work.
So my hypotheses are:
I'm not sure, but i think i can't use a nested <form action>
If not the first, maybe i can't use a <form action> into a modal popup ?
someone can suggest me an "elegant" solutions to solve this ?
Thank you ...
EDIT: in particular, what i'm trying to do is to permit to sell from a website.
I've a master page, and a content page.
Obviously in master page i've the classical "form action" .
Then i'm gone to paypal and got this code: "
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<table>
<tr><td>
<input type="hidden" name="on0" value="Annuncio Premium">Annuncio Premium
</td></tr>
<tr><td>
<select name="os0">
<option value="Premium 1">Premium 1 €1,00</option>
</select>
</td></tr>
</table>
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="encrypted" value="-----BEGIN ">
<input type="image" src="https://www.paypal.com/it_IT/IT/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - Il sistema di pagamento online più facile e sicuro!">
<img alt="" border="0" src="https://www.paypal.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>
So i've pasted it into my content page ... as it... without changing.
In particular i've pasted it, into a panel, that will show whith a "modalpopupextender".
It works. But what it not work is when i click the paypal "Buy Now" button.
My web page don't redirect to paypal, modalpopup disappears and nothing happens.
I had this exact issue too and couldn't believe that PayPal had not provided some sort of solution for .NET developers!!
Here is how I solved it:
<asp:ImageButton ID="btnPayNow" runat="server" ImageUrl="myPayPalButton.jpg"
PostBackUrl="https://www.paypal.com/cgi-bin/webscr" OnClick="btnPayNow_Click"/>
Use an ImageButton or normal button and simply remove the form tags for the PayPal code, leave in the hidden input fields and the data will be posted to the PayPal url!
Nice and easy :)
Ps. The method 'btnPayNow_Click()' does nothing, signature exists but there is no logic in the code I have.
You are quite correct, in that you cannot nest <form>s.
Nor can you use the form action to create a popup - the action attribute is the url to which the form posts to.
You can, however, have many <form>s on the page, so long as they are not nested. Perhaps that will solve you issue.
Can you please describe exactly what you are trying to achieve? It is not clear from your question what the problem is.
If I understand the question correctly, you are trying to create a dynamic HTML popup window which contains a PayPal form. You are having problems because the popup contains a form, but the HTML for the popup is already contained within a form.
If the problem you are experiencing is what I described above, the solution is fairly simple. You need to move all of the HTML for the popup outside of the exiting form element. If you are using CSS to properly lay out your site, it should be possible to display your dynamic popup wherever you need to on the page using relative or absolute positioning. The HTML for the popup need not be contained within another form. It may also be possible (perhaps even necessary) to put the contents of the popup into an iframe, which can be submitted entirely independently from the rest of the page. The semantics of how your popup works would depend on how you need your page to function.
So, to be clear...it is not possible to nest form elements. However, it is also not necessary to accomplish your needs.
EDIT:
To improve the answer above in light of the updated question. You can have multiple content panels on a master page. It should be entirely possible to create another content panel that is outside of your form element in your master page...and place your modal popup inside of this alternative content panel. My above answer would then still apply, as you no longer have nested forms.
You are right in your first hypothese, you can't have nested form tags in a page.
You just have to put the code for the popup outside the form, you can have any number of forms in the page as long as they are not nested.
Dal's answer is correct! (not taking credit with my answer)
I had a similar issue in ASP.NET (4.0) when trying to submit data to SagePay (same as PayPal form posting). I was writing the form fields in dynamically using panels in the code-behind using
Dim Panel As New Panel
Panel.Controls.Add(New LiteralControl("My <input> controls HTML")) '1 control.add per <input> control.
MyDiv.Controls.Add(Panel)
I was writing the whole < form> dynamically also, so when it came to debugging I received no warnings regarding the issue that my entire Site.Master is within a - this is not visible from a .aspx page using the master as a template! It was quite frustrating... Until I read that you cannot have a nested < form>... There are only two alternatives to this:
1) move the form details outside the first that is within my Site.Master from the .aspx page itself. (I didn't like the idea of this, messy messy!)
2) create another control that is NOT a to post my data.
I chose the latter!
<asp:Button id="btn_payment" value="Proceed to Payment" Text="Proceed to Payment" runat="server" PostBackUrl="https://test.sagepay.com/gateway/service/vspform-register.vsp" />
The button posted to SagePay, took my dynamically generated fields (Called from the .aspx page) and as they were already within the from my Site.Master - all worked well! - I hope this helps anyone using dynamically generated HTML with forms.

Explicit localization problem

when trying to translate the confirmation message to Norwegian i get the following error:
Cannot have more than one binding on property 'OnClientClick' on 'System.Web.UI.WebControls.LinkButton'. Ensure that this property is not bound through an implicit expression, for example, using meta:resourcekey.
i use Explicit localization in the following manner:
<asp:LinkButton ID="lnkMarkInvoiced" runat="server" OnClick="lnkMarkInvoiced_OnClick"
OnClientClick="<%# Resources: lnkMarkInvoicedResource.OnClientClick%>"
Visible="False" CssClass="stdtext" meta:resourcekey="lnkMarkInvoicedResource" ></asp:LinkButton>
here's the local resource file entry:
<data name="lnkMarkInvoicedResource.OnClientClick" xml:space="preserve">
<value>return confirm('Er du sikker?');</value>
if i remove the meta attribute i get the English text(default).
how do i get the Norwegian text appearing without resorting to using the code behind?
Update:
removing the meta attribute prevents the exception from occurring but the original problem still exists. I can't get the Norwegian text to show.
only the default English text shows.
Another Update:
I know this question is getting old but i still can't get the Norwegian text to display.
If anyone has some tips please post a response.
Looks like you're making the problem harder by inlining the onclick. Why not split it out to a separate line?
<script>
function markInvoiced()
{
return confirm('<%= Resources.SomehowGet.lnkMarkInvoicedResource.OnClientClick%>');
}
</script>
<asp:LinkButton ID="lnkMarkInvoiced" runat="server" OnClick="lnkMarkInvoiced_OnClick"
OnClientClick="return markInvoiced();"
Visible="False" CssClass="stdtext" meta:resourcekey="lnkMarkInvoicedResource" ></asp:LinkButton>
And while we're looking at your code, you realize that you're essentially building an <a> tag, right? As such, why not just build an <a> and save yourself some grief?
And finally, next project why not ditch the built-in ASP.NET localization nighmare in favor of something sane like FairlyLocal, in which case you'd write this:
<a href="#" onclick="return confirm(<%=_"really?"%>) onserverclick="lnkMarkInvoiced_OnClick" runat="server">
<%=_("Mark Invoice")%>
</a>
Are you using the .NET resource manager and satellite assemblies to store your localized resources? It looks like you have hard-coded the alternative language in your markup, rather than storing it in a language-specific resources assembly...
.NET has some extremely rich localization and globalization capabilities. If you use them properly, localization should be a pretty automatic thing (assuming your client is providing their language code as part of the HTTP headers). Even if your client has not configured their browser with the appropriate language, it is still easy enough to manually change the UI culture via a user request (clicking a flag icon, configuring a setting, etc.)
This article might be helpful: ASP.NET Web Page Resources Overview
That meta tag is using implicit localization when you're using explicit localization in the OnClientClick. You will need to choose one method or the other. If you are to use explicit localization, you'll need to do the necessary work to set the proper culture info in your application in the code-behind.

Validator in <noscript> causes JavaScript error

The following .NET 3.5 code, placed in an aspx file, will trigger a JavaScript error when the page is loaded (for users who have JavaScript enabled):
<noscript>
<asp:TextBox ID="txt" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="txt_RequiredFieldValidator" runat="server"
ControlToValidate="txt"></asp:RequiredFieldValidator>
<asp:Button ID="btn" runat="server" Text="Button" />
</noscript>
The error happens because the JavaScript generated by the ASP.NET validator control does not contain a null check on before the second code line below:
var ctl00_body_txt_RequiredFieldValidator =
document.all ?
document.all["ctl00_body_txt_RequiredFieldValidator"] :
document.getElementById("ctl00_body_txt_RequiredFieldValidator");
ctl00_body_txt_RequiredFieldValidator.controltovalidate = "ctl00_body_txt";
Can anyone suggest a workaround to this?
Footnote: Why am I doing this? For my non-JavaScript users I am replacing some AJAX functionality with some different UI components, which need validation.
You should add the following to the RequiredFieldValidator:
enableclientscript="false"
Seeing as you are using these in <noscript> tags, there is no point in supplying client side vaildation of the controls - they are only going to display if JS is turned off.
This will force the validation to happen (automatically) on the server side for you.
Just make sure you call "Page.IsValid" before you process the response.
See BaseValidator.EnableClientScript for more details.
The javascript is looking for an element contained in the noscript? AFAIK there's no clean way to detect script support from the server side.
I think you'll need to build in a redirect (I've seen this done with a meta-refresh in a header noscript if you don't mind a validation failure) to push noscript users to a "please turnscript on page" or do some surgery to loosen up the validation/control binding which may take some amount of wheel reinventing. This is one of those areas where asp.net's tight coupling between controller and view really punishes.

Resources