The following link passes query parameters as f:param and they get substituted in Users.page.xml, and these parameters appear as query parameters in the browse URL which we would like to not show to the end user. Is there an alternate mechanism to pass parameters to the entity query bean
<rich:menuItem>
<s:link value="Users" view="/Users.xhtml">
<f:param name="gender" value="male" />
</s:link>
</rich:menuItem>
With s:link you are doing a GET request, the parameter will be in the URL. To hide the parameter you can change this to a h:commandButton calling an action with the parameter:
<h:commandButton action="#{bean.listUsers('male')}" >
Related
i have a problem
I have an A form with one with a hidden field that redirects to the other in a button.
In form B, i mus get the value of this hidden field by POST.
But when I do the Request.Form("Hidden_Field"), it only brings me the name of the field, when what I need is the VALUE.
any ideas?.
here is the code:
Form A:
<asp:HiddenField ID="SIGNSYS_OUTPUT" runat="server" Value="123" />
Server.Transfer("~/VerifyAccountBGBAResult.aspx", True)
Form B:
Me.Value = Request.Form("SIGNSYS_OUTPUT")
This Request returns me in the value "SIGNSYS_OUTPUT".
Server.Transfer does not transfer the information unless the form got posted first, I'll assume this is the case.
Request.Form gets the information based on the name of the control, example.
<input type="hidden" name="SIGNSYS_OUTPUT" value = "123" />
When you use runat="server" the name is generated by .net. You'll need to do a viewsource to get the proper name. It might end up being something like this.
Request.Form("ctl00$ContentPlaceHolder$SIGNSYS_OUTPUT")
In your case, I think using Server.Transfer might not be the best solution. You could look at other solution like using a session, the database, process on the page and send to result to the other page, ect..
I have j meter setup
TestPlan
ThreadGroup
HTTP CacheManager
HTTP CookieManager
RegularEpression Extractor id="__VIEWSTATE" value="(.+?)"
RegularExpression Extractor id="__EVENTVALIDATION" value="(.+?)"
RecordingController
login ${VIEWSTATE}
browsingForminmyapp.aspx ${VIEWSTATE}
browsingForm2inmyapp.aspx ${VIEWSTATE}
Everything works as expected, but, I would like to set up OnceOnlyController so that my login form gets executed only the number of times as I set Number of threads in my ThreadGroup. If i create this OnceOnly controller, my ViewStates are not getting right and i GET redirrect, object moved, invalid VIEWSTATE.
This would be the setup that is not working, but gets my login form executed right number of times.
TestPlan
ThreadGroup
HTTP CacheManager
HTTP CookieManager
RegularEpression Extractor id="__VIEWSTATE" value="(.+?)"
RegularExpression Extractor id="__EVENTVALIDATION" value="(.+?)"
RecordingController
OnceOnlyController
login.aspx ${VIEWSTATE}
browsingForminmyapp.aspx ${VIEWSTATE}
browsingForm2inmyapp.aspx ${VIEWSTATE}
How can I get it work as it works using first setup, but after creating once only controller things are getting messy, VIEWSTATES are not OK
I would suggest putting your login.aspx sampler under If Controller. Use the following statement as "Condition"
${__BeanShell(vars.getIteration()==1)}
__Beanshell() function - allows executing arbitrary Beanshell script
vars.getIteration() - method which returns current loop number (on thread group level)
Also move your Regular Expression Extractor elements to be children of your login.aspx request elsewise they will be applied to each and every sampler causing additional overhead.
I'm coming from Rails so I'm a little lost since this is my first time touching ASP.
I'm working on a legacy ASP app and I have a form in classic ASP and there are two inputs. How would I view and use the parameters so that I can use them to update my records? Are they stored in some sort of variable by default? And do I do this on the page of the form or the page after?
My input:
<input class="textboxsm" type="text" onkeypress="return numbersonly(window.event.keyCode,1)" onblur="poswarnings(1);updateTotals();" onfocus="rowfocus=0" value="2" maxlength="4" size="2" name="ia1" style="text-align:right;">
And this is the button that submits the form:
<input width="116" type="image" height="70" onmouseout="this.src='art/order_continue.gif'" onmouseup="this.src='art/order_continue.gif'" onmousedown="this.src='art/down_order_continue.gif'" onclick="return orderdone()" name="submitorder" alt="Done" src="art/order_continue.gif">
So how would I extract the value from my input?
Values sent via POST are stored in the Request.Forms collection. Items passed via query string are in the Request.QueryString collection.
Depending on your setup, you can access the values a number of different ways. Most commonly, people know what form fields to expect, so if you have:
<input type="text" name="Title" maxlength="200" size="90" />
Assuming your form method is POST, you would retrieve it on the page the form is posted to by:
strTitle = Request.Form("Title")
This does assume you have already defined strTitle, and the value is not null/empty/etc. and/or that you are checking for that later on...
You're pulling the value of the form item named "Title" from the Request.Form collection and assigning it to the variable strTitle (which should have been defined earlier) From there you can do whatever validation you need to do.
The only thing that would change if you were sending the request via GET instead of POST is you would use the Request.QueryString collection - like so:
strTitle = Request.QueryString("Title") 'Same assumption as before...
I have in my flow some input, i.e.
<input name="someInput" type="long" required="true"/>
and I'd like to redirect in an end-state to a location that depends on this input. I'm trying the following:
<end-state id="done" view="externalRedirect:contextRelative:/blahblah/${someInput}"/>
This is not working (the webflow does not replace ${someInput} with its value (it treats this as a standard string. Do you know how to do this properly?
If you are speaking about Webflow 2.0 please try
<end-state id="done" view="externalRedirect:contextRelative:/blahblah/#{someInput}"/>
I haveasp:GridView displaying client requests using asp:SqlDataSource. I want to limit displayed information by client:
View.aspx has to display everything, View.aspx?client=1 has to display only requests from client ID #1.
So I'm using <asp:QueryStringParameter Name="client" QueryStringField="client" /> for query "EXEC getRequests #client".
Everything works properly when some client is specified. But don't - if not.
I tested my SP using SSMS - it works properly in both cases - when parameter is specified and when it isn't (NULL passed explicitly).
What have I do?
SqlDataSource won't fire if any of it's parameters are null, unless you specify otherwise:
<asp:SqlDataSource CancelSelectOnNullParameter="False" />
It might also be necessary to add a null default value to your querystring parameter:
<asp:QueryStringParameter Name="client" QueryStringField="client" DefaultValue="" ConvertEmptyStringToNull="True" />
You need to define a Default value to the parameter for those situations, for example:
<asp:QueryStringParameter Name="client" QueryStringField="client" DefaultValue="0"/>
and then in the SP you need verify if the client is 0, return all the clients, otherwise the specific one.