add

Add a subform to a form with ajax on submit

倖福魔咒の 提交于 2019-12-07 01:53:57
问题 I read this article: http://www.jeremykendall.net/2009/01/19/dynamically-adding-elements-to-zend-form/ That was very interesting and it works fine. I need to do the same but with a SubForm. I mean that when a user presses a button, I call, via ajax, an action that adds, attaches and displays a subform to my existing form. For example: I have a form where a user must fill in the name and surname of his children, so there is a button "Add Child". When the user presses that button a SubForm

Add view to a vertical LinearLayout at bottom (programmatically)

独自空忆成欢 提交于 2019-12-06 16:22:20
I need to add views to a vertical Linearlayout at bottom programmatically. (Yes we know that, it's in the title). Ok : i can add views to the linearlayout, it's not a problem. But it's for a chat, so i need to add views at the bottom for each message which is displayed. I don't find any attributes to the LinearLayout to do that. Adding messages : mHandler.post(new Runnable() { @Override public void run() { TextView message = new TextView(ChatActivity.this); String[] splitMessage = text.split(":"); message.setText(splitMessage[0]+"\n"+splitMessage[1]); message.setGravity(Gravity.LEFT); message

Add new properties to DocumentDB Document in Stored procedure

眉间皱痕 提交于 2019-12-06 14:53:25
I have a JSON document which I am passing to DocumentDB stored procedure. Is there a way I can add more properties to document in store procedure Passed to DocumentDB: { "id": "Authentication", "name": "All users must be authenticated before being authorized for any access to service data", "type": "Control" } Expected changes in Stored Procedure: { "id": "Authentication", "accountId": "Test", "versions": [ "name": "All users must be authenticated before being authorized for any access to service data", "type": "Control", "tags": [], "links": [] ] } You can manipulate the object (add / remove

add text on 1st page of a pdf file

懵懂的女人 提交于 2019-12-06 12:26:05
I'm tryin to add a text comment (not a note) to a pdf file. I create a date.ps file with contains the text comment : %! /Arial findfont 30 scalefont setfont newpath 10 720 moveto (PAID on 5.1.2013) show showpage and I launch the shell command with $i=name of the pdf file to tag: gs -q -dNOPAUSE -dSAFER -dBATCH -sOutputFile=$RFP/$DOMAINE/$NEWNAME -sDEVICE=pdfwrite -sPAPERSIZE=a4 date.ps $i This works, but it create a new 1st page empty with the text "PAID on 5.1.2013" alone. I do not find the trick to overlay the text on the 1st page of the original pdf. Can you help me pls Because your

Updating Database Using Datagridview

 ̄綄美尐妖づ 提交于 2019-12-06 11:30:24
I can add, edit, delete database using listbox. But I want to do it using DatagridView I already bind it to my database. How do I add,edit,delete update my database in datagridview using codes? These are my codes: namespace Icabales.Homer { public partial class Form1 : Form { SqlConnection cn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=c:\users\homer\documents\visual studio 2010\Projects\Icabales.Homer\Icabales.Homer\Database1.mdf;Integrated Security=True;User Instance=True"); SqlCommand cmd = new SqlCommand(); SqlDataReader dr; SqlDataAdapter da; DataTable dt = new

Java add remove methods of sets

家住魔仙堡 提交于 2019-12-06 10:48:29
Why does the method add(<T> element) and remove(Object o) accept different arguments? For example in a Set<Short> you add short elements. Why does the method remove accepts Object ? If you can't add any other data type, why would you remove other data type? Thank you. add(<T> element) : to ensure that just a T element is added. remove(Object o) : you can delete the T element even if it's a referenced by an Object reference. For instance : T t = new T(); Set<Short> set = new HashSet<Short>(); Short number = 2; set.add(number); Object numberObject = number; set.remove(numberObject) // it will

Objective-C add an NSButton to my iphone app at runtime

£可爱£侵袭症+ 提交于 2019-12-06 10:38:10
I am absolutely clueless on this front! Step-by-step explanation earns bonus points. In iOS We have UIButtons (not NSButtons) Here is how to create an UIButton programmatically: UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; //3 [button setFrame:CGRectMake(320, 0, 100,100 )]; [button setTitle:@"PressMe!" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];//2 [aView addSubview:button]; //1 and : - (void)buttonPressed:(UIButton *)sender{ //do something here ;) [sender setTitle:@"PressMe!.

Java: using hasNextInt with do-while loop, it ignores integer inputs at even times

爷,独闯天下 提交于 2019-12-06 09:25:25
I am trying to learn Java programming by myself and came across the course CS106A provided by Stanford. It's a great free online course. I watched several of the lecture videos and I enjoyed them so far. I am now trying to do the assignments and I have this problem I can't solve by myself. It is the number 5 of this assignment . Basically, it requires the learner to create a console program to get some integers input by the user and in response, showing the biggest and smallest number. The following code is what I have done and the problem is when I try to input integers, it will skip the even

Convert Sorted Array to Binary Search Tree (Picturing the Recursion)

杀马特。学长 韩版系。学妹 提交于 2019-12-06 09:02:56
I want to convert a sorted integer array into a binary search tree. I believe I understand how to do this. I have posted my pseudo-code below. What I cannot picture is how the recursion actually works. So if my array is 1, 2, 3, 4, 5... I first make 3 the root of my BST. Then I make 2 the left-child node of 3. Then do I make 1 the left-child node of 2, and come back to 2? I don't get how the recursion steps through the whole process... Thanks in advance, and apologies if this question is poorly explained. I don't want explicit code, but I would really appreciate if someone could help me go

Perl, A hash of arrays: adding and removing keys, adding to an array, all in a while loop

淺唱寂寞╮ 提交于 2019-12-06 08:37:53
问题 I have a hash which should contain certain keys which are linked to their own arrays. To be more specific, the hash keys are quality values and the arrays are sequence names. If there already is an array for that quality, I'd want to add the sequence name to the array that is linked to the quality in question. If there isn't one, I want to create one and add the sequence name to it. All this is done in a while loop, going through all the sequences one by one. I've tried to do things like in