How can I draw a slight white 'glow' around a button or label in 10.5 and later? I have seen some apps do it, but I am still discombobulated how I should do this.
I currently have a UIControl, which has a number of subviews (image, label).
Unfortunately when I use addTarget etc. It doesn't detect touches on the subviews.
[myCustomView addTarget:self action:@selector(touchedView:)
forControlEvents:UIControlEventTouchUpInside];
Is it possible for the UIControl to detect touches on subviews or should i be approaching it differently.
I've been trying to get the Uploadify flash uploader (www.uploadify.com) to work with Zend Framework, with no success so far.
I have placed all Uploadify files under /public/flash-uploader directory.
In the controller I include all required files and libraries like this:
$this->view->headScript()->appendFile('/js/jquery-1.3.2.min.js');
$this->view->headLink()->appendStylesheet('/flash-uploader/css/default.css');
$this->view->headLink()->appendStylesheet('/flash-uploader/css/uploadify.css');
$this->view->headScript()->appendFile('/flash-uploader/scripts/swfobject.js');
$this->view->headScript()->appendFile('/flash-uploader/scripts/jquery.uploadify.v2.1.0.min.js');
And then I activate the plugin like this (#photo is id of the input file field):
$(document).ready(function() {
$("#photo").uploadify({
'uploader' : '/flash-uploader/scripts/uploadify.swf',
'script' : 'my-account/flash-upload',
'cancelImg' : '/flash-uploader/cancel.png',
'folder' : 'uploads/tmp',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : true,
'sizeLimit' : 2097152
});
});
As you can see I am targeting the my-account/flash-upload script as a backend processing (my-account is a controller, flash-upload is an action).
My form markup looks like this:
<form enctype="multipart/form-data" method="post" action="/my-account/upload-public-photo"><ol>
<li><label for="photo" class="optional">File Queue<div id="fileQueue"></div></label>
<input type="hidden" name="MAX_FILE_SIZE" value="31457280" id="MAX_FILE_SIZE" />
<input type="file" name="photo" id="photo" class="input-file" /></li>
<li><div class="button">
<input type="submit" name="upload_public_photo" id="upload_public_photo" value="Save" class="input-submit" /></div></li></ol></form>
And yet it's not working. The browse button doesn't even show up as in the demo page, I get only a regular input file field.
Any ideas where could the problem be? I've already been staring into the code for hours and I cannot see any mistake anywhere and I'm starting to be exhausted after going through the same 30 lines of code 30 times in a row.
hello
i created a form that it decorates as table form
its my code for decorates
$this->setElementDecorators(array(
'ViewHelper',
'Errors'
array(array('data'=>'HtmlTag'),
array('tag'=>'td','class'=>'element')),
array('Label',array('tag'=>'td')),
array(array('row'=>'HtmlTag'),array('tag'=>'tr')),
));
$this->setDecorators(array(
'FormElements',
array('HtmlTag',array('tag'=>'table')),
'Form'
));
it works correctly,
now i wana errors message decorates too
what do i change my code?
What are the lesser-known but useful features of the Python programming language?
Try to limit answers to Python core
One feature per answer
Give an example and short description of the feature, not just a link to documentation
Label the feature using bold title as the first line
This question is along the lines of :
Hidden Features of JavaScript
Hidden Features of CSS
Hidden Features of C#
Hidden Features of VB.Net
Hidden Features of Java
Hidden Features of ASP.NET
Hidden Features of Python
Hidden Features of TextPad
Hidden Features of Eclipse
Hidden Features of JavaScript
I have written a ASP.NET program for a customer, I want to add a message similar to "Preview version, ABD Consulting" on the master.master page, I had thought to use Response.write but it messes up the look of the page as it seems to move page elemets. If I use a label the customer can remove it from the Master.master file, any suggestions? The customer is in a different country so I want to ensure I'm paid.
Many thanks
I'm wondering how one can catch and add a custom handler when empty results are returned from the server when using jQueryUI autocomplete.
There seem to be a few questions on this point related to the various jQuery plugins (e.g. jQuery autocomplete display “No data” error message when results empty), but I am wondering if there's a better/simpler way to achieve the same with the jQueryUI autocomplete.
It seems to me this is a common use case, and I thought perhaps that jQueryUI had improved on the jQuery autocomplete by adding the ability to cleanly handle this situation. However I've not been able to find documentation of such functionality, and before I hack away at it I'd like to throw out some feelers in case others have seen this before.
While probably not particularly influential, I can have the server return anything - e.g. HTTP 204: No Content to a 200/JSON empty list - whatever makes it easiest to catch the result in jQueryUI's autocomplete.
My first thought is to pass a callback with two arguments, namely a request object and a response callback to handle the code, per the documentation:
The third variation, the callback, provides the most flexibility, and can be used to connect any data source to Autocomplete. The callback gets two arguments:
A request object, with a single property called "term", which refers to the value currently in the text input. For example, when the user entered "new yo" in a city field, the Autocomplete term will equal "new yo".
A response callback, which expects a single argument to contain the data to suggest to the user. This data should be filtered based on the provided term, and can be in any of the formats described above for simple local data (String-Array or Object-Array with label/value/both properties).
When the response callback receives no data, it inserts returns a special one-line object-array that has a label and an indicator that there's no data (so the select/focus recognize it as the indicator that no-data was returned).
This seems overcomplicated. I'd prefer to be able to use a source: "http://...", and just have a callback somewhere indicating that no data was returned.
Thank you for reading.
Brian
Hello
i am using the AsyncFileUpload from the ajaxtoolkit, upter the upload is complete ,
i want to display all the images that were uploaded (and their URL is inserted into the DB) with my repeater and binding method.
but its not working! the images are uploaded, the DB insert works file, but i cant see the images after the repeater is dinded.
(i have to mention that if i go step by step, i do see that the ITEMBOUND is being binded and executed)
<ajax:TabContainer runat="server" ID="testTab">
<ajax:TabPanel runat="server" ID="testTabContainer">
<ContentTemplate>
<ajax:AsyncFileUpload ID="uploadAsyncImage" runat="server" OnUploadedComplete="InsertToTemp" ThrobberID="Throbber"/>
<asp:Label ID="Throbber" runat="server" Style="display: none">
<img src="Images/indicator.gif" align="absmiddle" alt="loading" />
</asp:Label>
<br />
<asp:UpdatePanel runat="server" ID="pnlImages" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Repeater runat="server" ID="rptImages" >
<ItemTemplate>
<a href="<%# DataBinder.Eval(Container.DataItem, "PicURL")%>" rel="lightbox">
<asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PicURL")%>' Width="50" Height="50" runat="server" ID="testPic" />
</a>
</ItemTemplate>
</asp:Repeater>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</form>
also adding my Code Behind, since it might be important or will help you get an idea of what i am trying to do.private void BindRepater()
{
ProjDataContext db = DbContext.DbContextProvider();
var pic = from p in db.TempProdCats
where p.SessionID == Session.SessionID.ToString()
select new { PicURL = p.PicURL };
rptImages.DataSource = pic;
rptImages.DataBind();
pnlImages.Update();
}
protected void rptImages_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
Image lblCat = (Image)e.Item.FindControl("testPic");
lblCat.ImageUrl = (string)DataBinder.Eval(e.Item.DataItem, "PicURL");
pnlImages.Update();
}
}
your help will be highly appreciated , if any of you got any idea how to make it work...
Hi,
how to set the fourth parameter of the setCell method : the class parameter
$("#myGrid").jqGrid('setCell',rowid,'label', class ,{color:'black', weightfont:'bold'});
Thank you !
Hi,
I'm having following problem.
I should convert a control to a certain type, this can be multiple types (for example a custom button or a custom label, ....)
Here's an example of what i would like to do:
private void ConvertToTypeAndUseCustomProperty(Control c)
{
Type type = c.getType();
((type) c).CustomPropertieOfControl = 234567;
}
Thanks in advance.
I am lost on this MVC project I am working on. I also read Brad Wilsons article.
http://bradwilson.typepad.com/blog/2010/01/input-validation-vs-model-validation-in-aspnet-mvc.html
I have this:
public class Employee
{
[Required]
public int ID { get; set; }
[Required]
public string FirstName { get; set; }
[Required]
public string LastName { get; set; }
}
and these in a controller:
public ActionResult Edit(int id)
{
var emp = GetEmployee();
return View(emp);
}
[HttpPost]
public ActionResult Edit(int id, Employee empBack)
{
var emp = GetEmployee();
if (TryUpdateModel(emp,new string[] { "LastName"})) {
Response.Write("success");
}
return View(emp);
}
public Employee GetEmployee()
{
return new Employee {
FirstName = "Tom",
LastName = "Jim",
ID = 3
};
}
and my view has the following:
<% using (Html.BeginForm()) {%>
<%= Html.ValidationSummary() %>
<fieldset>
<legend>Fields</legend>
<div class="editor-label">
<%= Html.LabelFor(model => model.FirstName) %>
</div>
<div class="editor-field">
<%= Html.DisplayFor(model => model.FirstName) %>
</div>
<div class="editor-label">
<%= Html.LabelFor(model => model.LastName) %>
</div>
<div class="editor-field">
<%= Html.TextBoxOrLabelFor(model => model.LastName, true)%>
<%= Html.ValidationMessageFor(model => model.LastName) %>
</div>
<p>
<input type="submit" value="Save" />
</p>
</fieldset>
<% } %>
Note that the only field editable is the LastName. When I postback, I get back the original employee and try to update it with only the LastName property. But but I see on the page is the following error:
•The FirstName field is required.
This from what I understand, is because the TryUpdateModel failed. But why? I told it to update only the LastName property.
I am using MVC2 RTM
Thanks in advance.
I'm trying to use Dojo (1.3) checkBoxes to make columns appear/hide in a Dojo Grid that's displayed below the checkBoxes. I got that functionality to work fine, but I wanted to organize my checkBoxes a little better. So I tried putting them in a table. My dojo.addOnLoad function looks like this:
dojo.addOnLoad(function(){
var checkBoxes = [];
var container = dojo.byId('checkBoxContainer');
var table = dojo.doc.createElement("table");
var row1= dojo.doc.createElement("tr");
var row2= dojo.doc.createElement("tr");
var row3= dojo.doc.createElement("tr");
dojo.forEach(grid.layout.cells, function(cell, index){
//Add a new "td" element to one of the three rows
});
dojo.place(addRow, table);
dojo.place(removeRow, table);
dojo.place(findReplaceRow, table);
dojo.place(table, container);
});
What's frustrating is:
1) Using the Dojo debugger I can see that the HTML is being properly generated for the table.
2) I can take that HTML and put just the table in an empty HTML file and it renders the checkBoxes in the table just fine.
3) The page renders correctly in Firefox, just not IE6.
The HTML that is being generated looks like so:
<div id="checkBoxContainer">
<table>
<tr>
<td>
<div class="dijitReset dijitInline dijitCheckBox"
role="presentation" widgetid="dijit_form_CheckBox_0"
wairole="presentation">
<input class="dijitReset dijitCheckBoxInput"
id="dijit_form_CheckBox_0"
tabindex="0" type="checkbox"
name="" dojoattachevent=
"onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick"
dojoattachpoint="focusNode" unselectable="on"
aria-pressed="false"/>
</div>
<label for="dijit_form_CheckBox_0">
Column 1
</label>
</td>
<td>
<div class="dijitReset dijitInline dijitCheckBox"
role="presentation" widgetid="dijit_form_CheckBox_1"
wairole="presentation">
<input class="dijitReset dijitCheckBoxInput"
id="dijit_form_CheckBox_1"
tabindex="0" type="checkbox"
name="" dojoattachevent=
"onmouseover:_onMouse,onmouseout:_onMouse,onclick:_onClick"
dojoattachpoint="focusNode" unselectable="on"
aria-pressed="false"/>
</div>
</td>
</tr>
<tr>
...
</tr>
</table>
</div>
I would have posted to the official DOJO forums, but it says they're deprecated and they're using a mailing list now. They said if a mailing list doesn't work for you, use stackoverflos.com. So, here I am! Thanks for any insight you can provide.
I'm gonna create a ListView in WPF like the below image
http://www.picfront.org/d/7xuv
I mean I wanna add an image beside of Gravatar label within Name column.
Would it be OK if you guided me ?
I have an ASP.net page which contains some controls.
I generate this controls by code, [Actually I have a method which uses a stringBuilder and add Serverside tag as flat string on it]
My page shows the content correctly but unfortunately my controls became like a Client-side control
For example I had a LoginView on my generated code which dosen't work, and also I had read some string from LocalResources which dosen't appear on the page
What Should I do to make my generating method correct
here is the code
protected string CreateSubSystem(string id, string roles, string AnonymousTemplateClass, string href, string rolesContentTemplateClass, string LoggedInTemplateClass)
{
StringBuilder sb = new StringBuilder();
sb.Append("<div class=\"SubSystemIconPlacement\" id=\"");
sb.Append(id);
sb.Append("\"><asp:LoginView runat=\"server\" ID=\"");
sb.Append(id);
sb.Append("\"><AnonymousTemplate><div class=\"");
sb.Append(AnonymousTemplateClass);
sb.Append("\"></div><asp:Label ID=\"lblDisabled");
sb.Append(id);
sb.Append("\" runat=\"server\" SkinID=\"OneColLabel\" meta:resourcekey=\"lbl");
sb.Append(id);
sb.Append("\" /></AnonymousTemplate><RoleGroups><asp:RoleGroup Roles=\"");
sb.Append(roles);
sb.Append("\"><ContentTemplate><a class=\"ImageLink\" href=\"");
sb.Append(href);
sb.Append("\"><div class=\"");
sb.Append(rolesContentTemplateClass);
sb.Append("\"></div></a><asp:HyperLink runat=\"server\" CssClass=\"SubSystemText\" ID=\"lnk");
sb.Append(id);
sb.Append(" NavigateUrl=\"~/");
sb.Append(href);
sb.Append(" \" meta:resourcekey=\"lbl");
sb.Append(id);
sb.Append("\" /></ContentTemplate></asp:RoleGroup></RoleGroups><LoggedInTemplate><div class=\"");
sb.Append(LoggedInTemplateClass);
sb.Append("\"></div><asp:Label runat=\"server\" SkinID=\"OneColLabel\" ID=\"lblDisabledLoggedIn");
sb.Append(id);
sb.Append("\" meta:resourcekey=\"lbl");
sb.Append(id);
sb.Append("\" /></LoggedInTemplate></asp:LoginView>");
sb.Append("</div>");
return sb.ToString();
}
I also use this method on page_PreRender event
I have just changed a compiler option from 4.0 to 4.2.
Now I get an error:
jump to case label crosses initialization of 'const char* selectorName'
It works fine in 4.0
Any ideas?
I'm not being able to make this line work with Tk
import os
while(1):
ping = os.popen('ping www.google.com -n 1')
result = ping.readlines()
msLine = result[-1].strip()
print msLine.split(' = ')[-1]
I'm trying to create a label and text = msLine.split... but everything freezes
I am stuck on how to create tags for each post on my site. I am not sure how to add the tags into database.
Currently...
I have 3 tables:
+---------------------+ +--------------------+ +---------------------+
| Tags | | Posting | | PostingTags |
+---------------------+ +--------------------+ +---------------------+
| + TagID | | + posting_id | | + posting_id |
+---------------------+ +--------------------+ +---------------------+
| + TagName | | + title | | + tagid |
+---------------------+ +--------------------+ +---------------------+
The Tags table is just the name of the tags(ex: 1 PHP, 2 MySQL,3 HTML)
The posting (ex: 1 What is PHP?, 2 What is CSS?, 3 What is HTML?)
The postingtags shows the relation between posting and tags.
When users type a posting, I insert the data into the "posting" table. It automatically inserts the posting_id for each post(posting_id is a primary key).
$title = mysqli_real_escape_string($dbc, trim($_POST['title']));
$query4 = "INSERT INTO posting (title) VALUES ('$title')";
mysqli_query($dbc, $query4);
HOWEVER, how do I insert the tags for each post?
When users are filling out the form, there is a checkbox area for all the tags available and they check off whatever tags they want. (I am not doing where users type in the tags they want just yet)
This shows each tag with a checkbox. When users check off each tag, it gets stored in an array called "postingtag[]".
<label class="styled">Select Tags:</label>
<?php
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$query5 = "SELECT * FROM tags ORDER BY tagname";
$data5 = mysqli_query($dbc, $query5);
while ($row5 = mysqli_fetch_array($data5)) {
echo '<li><input type="checkbox" name="postingtag[]"
value="'.$row5['tagname'].'" ">'.$row5['tagname'].'</li>';
}
?>
My question is how do I insert the tags in the array ("postingtag") into my "postingtags" table?
Should I...
$postingtag = $_POST["postingtag"];
foreach($postingtag as $value){
$query5 = "INSERT INTO postingtags (posting_id, tagID)
VALUES (____, $value)";
mysqli_query($dbc, $query5);
}
1.In this query, how do I get the posting_id value of the post?
I am stuck on the logic here, so if someone can help me explain the next step, I would appreciate it!
Is there an easier way to insert tags?
I have a UITableView with cells containing variable-height UILabels. I am able to calculate the minimum height the label needs to be using sizeWithFont:constrainedToSize:lineBreakMode:, which works fine when the table view is first loaded. When I rotate the table view the cells become wider (meaning there are fewer lines required to display the content). Is there any way I can have the height of the cells redetermined by the UITableView during the orientation change animation or immediately before or after? Thank you.
I know soft shadows are not supported by the UILabel our of the box, on the iPhone. So what would be the best way to implement my own one?
EDIT: Obviously I will subclass the UILabel and draw in the -drawRect:
My question is, how do I get the contents of the label as graphics and draw around them, blur them etc...
I am using listview in tabwidget tab1 when my focus is on "Tab label" and i press arrow keys or track ball to go down focus directly jumps to the 5th row in the listview.
any idea whats going wrong ?
Hi,
I need to read a complex model in an ordered way with eclipselink. The order is mandantory because it is a huge database and I want to have an output of a small portion of the database in a jface tableview. Trying to reorder it in the loading/quering thread takes too long and ordering it in the LabelProvider blocks the UI thread too much time, so I thought if Eclipselink could be used that way, that the database will order it, it might give me the performance I need. Unfortunately the object model can not be changed :-(
The model is something like:
@SuppressWarnings("serial")
@Entity
public class Thing implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int id;
private String name;
@OneToMany(cascade=CascadeType.ALL)
@PrivateOwned
private List<Property> properties = new ArrayList<Property>();
...
// getter and setter following here
}
public class Property implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int id;
@OneToOne
private Item item;
private String value;
...
// getter and setter following here
}
public class Item implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
private int id;
private String name;
....
// getter and setter following here
}
// Code end
In the table view the y-axis is more or less created with the query
Query q = em.createQuery("SELECT m FROM Thing m ORDER BY m.name ASC");
using the "name" attribute from the Thing objects as label.
In the table view the x-axis is more or less created with the query
Query q = em.createQuery("SELECT m FROM Item m ORDER BY m.name ASC");
using the "name" attribute from the Item objects as label.
Each cell has the value
Things.getProperties().get[x].getValue()
Unfortunately the list "properties" is not ordered, so the combination of cell value and x-axis column number (x) is not necessarily correct. Therefore I need to order the list "properties" in the same way as I ordered the labeling of the x-axis.
And exactly this is the thing I dont know how it is done. So querying for the Thing objects should return the list "properties" "ORDER BY name ASC" but of the "Item"s objects. My ideas are something like having a query with two JOINs. Joing Things with Property and with Item but somehow I was unable to get it to work yet.
Thank you for your help and your ideas to solve this riddle.
I have a reciever that works well, but I can't seem to show a proper UI, although the toast appears correctly. As far as I can tell, this is caused by Android requiring the class to extend Activity, however, the class already extends BroadcastReciever, so I can't do this.
So, I tried to do an Intent, but this failed too. There are no errors, but the screen doesn't show. Source code is below, and any help would be most appreciated.
Reciever
public class Reciever extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Toast.makeText(context, "Alarm Recieved", Toast.LENGTH_LONG).show();
Intent i = new Intent();
i.setClass(context, AlarmRing.class);
}
}
AlarmRing
public class AlarmRing extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.alarm);
MediaPlayer mp = MediaPlayer.create(getBaseContext(), R.raw.sweetchild);
mp.start();
}
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.comaad.andyroidalarm"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".AndyRoidAlarm"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name="com.comaad.andyroidalarm.Reciever" android:enabled="true">
<intent-filter>
<action android:name="com.comaad.andyroidalarm.Reciever"></action>
</intent-filter>
</receiver>
<activity android:name=".AlarmRing"></activity>
</application>
</manifest>
}
How can one move a label around in the hello world example using the on_mouse_motion function?
The docs aren't clicking for me.
on_mouse-motion
hello_world_example.py
Hi,
I have a UILabel tha contains a URL (ie www.google.com). Is there a way to display the label as URL so the User can tap on the URL for Safari to open it?
Same question I have for a mailto item (ie [email protected]) to open mail with a new email to that address
thanks in advance