HTML table cells overlapping on Blackberry - html

I have the following HTML code:
<table><tr>
<td>Search: </td>
<td>'.GetCategoryDropdownList().'</td>
<td>for: </td>
<td class="input">
<input class="header-right-search" type="text" name="q" placeholder="Search by Book Name, Author, Module Code, or Module Name" style="width: 100%;" />
</td>
<td><input type=submit value="GO" class="yellowhighlightbutton" /></td>
</tr></table>
where "GetCategoryDropdownList()" just returns the HTML for a simple dropdown menu.
This table displays fine in all web browsers (including on android/iphone/etc), with each table cell nicely spaced, but on Blackberry the cells end up overlapping.
Do you know why this is happening or any way to fix it?
Thanks
GetCategoryDropdownList() is
function GetCategoryDropdownList()
{
$query = sprintf("SELECT %scategorylist.* FROM %scategorylist", dbprefix, dbprefix, dbprefix);
$catlist = DbQuery($query);
$catselect = '<select class="header-category-select" name="category_select">';
foreach($catlist as $cat)
{
if($cat['Code'] == 'catAll')
{
$catselect = $catselect.sprintf("<option class=\"header-category-option\" value=\"%s\" selected=\"selected\">%s</option>",$cat['Code'],$cat['Name']);
}
else
{
$catselect = $catselect.sprintf("<option class=\"header-category-option\" value=\"%s\">%s</option>",$cat['Code'],$cat['Name']);
}
}
$catselect = $catselect.'</select>';
return $catselect;
}
All it does is make a dropdown menu, which displays correctly on every platform except blackberry.

Can you give the GetCategoryDropdownList() code? Have you also set the correct headers for displaying in a mobile website? For blackberry browser you can use
<meta name=”HandheldFriendly” content=”True” />
Check it out: http://docs.blackberry.com/en/developers/deliverables/6176/HTML_ref_meta_564143_11.jsp

Related

Error When iterate over with a DataView component that is dynamically visible

doubt the wicket ... I'm using a DataView and is being released the following error:
"... Expected close tag is' <td wicket: id =" lblRowspan "> 'Possible attempt to embed component (s)' <input type =" text "placeholder =" Item "wicket: id =" txtNomeBem "class = "form-control" /> 'in the body of this component Which discards its body ... "
The situation is as follows in this DataView am using ROWSPAN to merge some cells, 100% works well if there is no type of component in the lines that I'm mixing, for example, if the lines that I'm using rowSpan write a sentence works. .. but when I insert the TextField component in the cell does not.
In the application I'm developing need to show a TextField so that the person enter some information, only it's always thrown the exception that pointed up.
here is my code:
(html)
<tr wicket:id="dataGruposSelecionados">
<td wicket:id="lblRowspan">
<input type="text" placeholder="Item" wicket:id="txtNomeBem"
class="form-control" />
</td>
<tr/>
Here is my java
dataViewGruposSelecionados = new DataView<ItemBemDto>("dataGruposSelecionados", new Provider(listaDeGrupos)) {
#Override
protected void populateItem(Item<ItemBemDto> item) {
Label lblRowspan = new Label("lblRowspan",item.getModelObject().getNomeItemGrupo());
.
.
.
int tamanho = listaBens.size();
if(primeiroLoop)
{
lblRowspan.add(new AttributeAppender("rowspan", new Model<Integer>(tamanho), " "));
primeiroLoop = false;
}else{
lblRowspan.setVisible(false);
}
.
.
.
.
item.add(lblRowspan);
item.add(newTextFieldNomeItem(item));
}
}
as I said, it works 100% if in place of the TextField I leave it blank or type something in HTML, the merge works ... but when I insert any component within the 'td' is thrown the exception ...
<tr/> should be </tr>
I found the answer :)
.
Instead of a label to control the 'rowspan' the Dataview I created a WebMarkupContainer receiving ROWSPAN ... well, below the HTML and java solution I found.
<td wicket:id="containerRowspan">
<div wicket:id="panelNomeGrupo">
<input type="text" placeholder="Item" wicket:id="txtNomeBem" class="form- control" />
</div>
</td>
Code Java:
WebMarkupContainer containerRowspan = new WebMarkupContainer("containerRowspan");
int tamanho = listaComTodosBens.size();
if(primeiroLoop || !item.getModelObject().getNomeItemGrupo().equalsIgnoreCase(nomeAnterior)){
containerRowspan.add(new AttributeAppender("rowspan", new Model<Integer>(tamanho), " "));
primeiroLoop = false;
}else{
containerRowspan.setVisible(false);
}
PanelNomeItem panel=new PanelNomeItem("panelNomeGrupo", item);
panel.setVisible(mostrarPainel);
containerRowspan.add(panel);
item.add(containerRowspan);

send data from table to another page into forms

I have a table in "clients.html" that contains clients data,when I clic on one of those clients then the "create Document" I want to send the data of this clients to the new page "Doc.html",this is my code:
clients.html
<div class="btn-group" style="
right: 5px;
" ng-repeat="post in posts">
<div class="btn btn-icon">
<a ui-sref="app.deviscl({customerID:post.id})" data-toggle="tooltip" title="create Doc"><img src="img\facturejj.png"
class="m-b-xs w-xs"> </a>
</div></div>
this is the routing:
.state('app.deviscl', {
url: '/devis/ajout/:customerID',
templateUrl: 'tpl/deviscl.html',
controller: 'editController'
})
but in the clients.html the button create Doc appears many times,If I try to remove ng-repeat from the div of the button I can't get any result
thanks a lot for help
Basicly with this code you are creating a button for every post in posts. I am guessing you want 1 button, but somehow that 1 button knows which post in posts is selected?
In that case you can create a form with a select dropdown, then they pick a 'post in posts' from the select and then submit the form, which links them to the create doc page with the right data?
UPDATE
Example as requested:
<form>
<table>
<tr>
<td>
<select ng-model="postId" ng-options="post.id as post for post in posts"></select>
</td>
</tr>
<tr>
<td><input type="submit" ng-click="createDoc(postId) value="save" /></td>
</tr>
</table>
</form>
Ofcourse you can alter this simple form to be applicable for your own app. e.g add css or change some names etc.
and then in your controller:
$scope.createDoc = function(postId) {
app.deviscl({customerID:postId});
}
and your routing remains the same.

html POST request login to website

Hi im trying to figure out how to login to a website using a post request.
I want to do this because i want to make a web app using particular data from content shown on the website after login.
However i cannot seem to figure out which url i need to use to login.
This is the FORM :
<FORM onSubmit="return checkrequired(this)" METHOD=POST ACTION="/pkmslogin.form">
<FONT SIZE="+2">
<TABLE BORDER="0" WIDTH="400">
<TR>
<TD ALIGN="LEFT"><UL><LI>Gebruikersnaam</LI></UL></TD>
<TD><INPUT TYPE="TEXT" NAME="username" SIZE="15" AUTOCOMPLETE="off">
</TD>
</TR>
<TR>
<TD ALIGN="LEFT"><UL><LI>Wachtwoord</LI></UL></TD>
<TD><INPUT TYPE="PASSWORD" NAME="password" SIZE="15" AUTOCOMPLETE="off"></TD>
<INPUT TYPE="HIDDEN" NAME="login-form-type" VALUE="pwd">
</TR>
</TABLE>
</FONT>
<BR>&nbsp <INPUT TYPE="SUBMIT" VALUE="Aanmelden">
The javascript checkrequired():
function checkrequired(which) {
var pass=true;
if (document.images) {
for (i=0;i<which.length;i++) {
var tempobj=which.elements[i];
if (((tempobj.type=="text"||tempobj.type=="password")&&tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&tempobj.selectedIndex==0)) {
pass=false;
break;
}
}
}
if (!pass) {
shortFieldName=tempobj.name.substring(0,30).toUpperCase();
if (shortFieldName=="USERNAME") {
shortFieldName="Gebruikersnaam";
}
if (shortFieldName=="PASSWORD") {
shortFieldName="Wachtwoord";
}
alert("Het veld \""+shortFieldName+"\" is niet ingevuld.");
return false;
}
else
return true;
}
I thought i needed to use /?Username='...'&password='...' but this is not the case.
edit
Chrome developer tools tells me no variables are being passed to the pkmslogin.form
Path = pkmslogin.form
method = POST
Status = 302 Moved Temporarily
type = text/html
Initiator = Other
Size = 713 B 0 B
Time = 367 ms 366 ms
It seems that you are using IBM WebSEAL but instead of using its management page, you made your own
So, the problem is that you are sending the request to /pkmslogin.form but as your application is behind WebSEAL, so it must be accessed by a junction.
So, your request actually goes to:
https://WebSEAL_HOST:WebSEAL_Instance_Port/Your_Junction/Your_App_Context_Root/pkmslogin.form
You have two solution:
Use a relative URL:
../../Your_Junction/pkmslogin.form
Use an absolute URL: https://WebSEAL_HOST:WebSEAL_Instance_Port/pkmslogin.form

Making an image appear in a jsp

I currently have a jsp where in m html section I have the following
<select>
<%if(size == 1)%>
<option>None selected</option>
<%if(size > 1)%>
<option>1</option>
</select>
I also have the following image.
<td style="text-align:left">
<label id="checked" style="color:grey; display:none">
<img src="images/check.png" width="20px" height="20px"/>
Checked
</label>
</td>
My question is that how do I get my image to appear only if the option none is selcted. If 1 is selected then I do not want the image to appear. How would I do this?
I think, this will give you solution for your problem, i have used JQUERY here.
$("#selectID or .selectClass").change(function () { //just use id or class name for select element
var option=$(this).val();
if(option=="None selected")
{
$("#checked").css("display","block");
}
else
{
$("#checked").css("display","none");
}
});

Displaying info in form to update - Razor WebMatrix

People, i have been breaking my back searching the internet for the answer to this. I need to know the code needed to show user details in a form, so that they can change and update their info?
I've tried with the following code, but i am hitting a brick wall?
#{
Layout = "~/_template1.cshtml";
var db = Database.Open("StayInFlorida");
var OwnerID = WebSecurity.CurrentUserId;
var FirstName = ("SELECT FirstName from OwnerInfo WHERE OwnerID='OwnerID'");
<h1>My Details</h1>
<form method="post">
<input>#FirstName</input>
<input type="submit" value="Insert" class="submit" />
</form>
}
I'm sure this is really wrong, but help on the net about this is very limited.
Check out the awesome Getting Started tutorials on the ASP.NET Web Pages web site:
http://www.asp.net/web-pages/tutorials/introducing-aspnet-web-pages-2/getting-started
The links on the right go to all 9 parts of the article, including extensive details on adding and editing data in a database.
<form action="" enctype="multipart/form-data" method="post">
<input type="submit" value="#FirstName" class="submit" />
</form>
and then to update:
if(IsPost)
{
var FName = Request["FirstName"];
var insertQueryString = "UPDATE OwnerInfo Set FirstName=#0";
db.Execute(insertQueryString, FName);
}
and I don't think you need
<input>#firstName</input>