Search Results

Search found 13848 results on 554 pages for 'custom membershipprovider'.

Page 8/554 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • LinearLayout as custom button, OnClickListener never called

    - by ohra
    I've been using the common Android Button with both icon (drawableTop) and text. It works really poorly if you want to have a non-standard size button, so I decided to make a custom button with a LinearLayout having the following layout: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@style/ButtonHoloDark" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:clickable="true" android:focusable="true" android:orientation="vertical" > <ImageView android:id="@+id/buttonIcon" android:layout_width="fill_parent" android:layout_height="wrap_content" android:duplicateParentState="true" /> <TextView android:id="@+id/buttonText" android:layout_width="fill_parent" android:layout_height="wrap_content" android:duplicateParentState="true" android:gravity="center" android:textColor="@color/white" /> </LinearLayout> The layout is used by a custom class: public class CustomIconButton extends LinearLayout { public CustomIconButton(Context context, AttributeSet attrs) { super(context, attrs); setAttributes(context, attrs); LayoutInflater.from(context).inflate(R.layout.custom_icon_button, this, true); } ... But when I set an OnClickListener on my button in its parent layout it never gets called. I can only receive clicks if a set the listener to the ImageView and/or TextView. This leads to two possible effects when the button is clicked: The click is inside the ImageView or the TextView. The click is registered ok, but the buttons state drawable doesn't change i.e. it doesn't appear depressed. The click is inside the "empty area" of the button. The click is not registered, but the state drawable works ok. Neither of these is feasible. I've played around with the following attributes on the LinearLayout or its children, but none really seem to have any effect whether true or false: duplicateParentState clickable focusable There doesn't seem to be any reasonable way to get the LinearLayout parent receive clicks instead of its children. I've seen some possible solutions overriding dispatchTouchEvent or onInterceptTouchEvent on the custom component itself, but that really seems like a big mess if I have to start analyzing touch events to identify proper clicks. So OnClickListener on a LinearLayout with children = no go?

    Read the article

  • custom control in DataGridTemplateColumn

    - by Johnsonlu
    Hi all, I'd like to add my custom control into a template column of data grid. The custom control is very similar to a text box, but has an icon in it. The user can click the icon, and selects an item from a prompted window, then the selected item will be filled into the text box. My problem is when the text box is filled, after I click the second column, the text will disappear. If I replace the custom control with a simple text box, the result is the same. Here is the sample code: //Employee.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SimpleGridTest { public class Employee { public string Department { get; set; } public int ID { get; set; } public string Name { get; set; } } } Mainwindow.xaml <Window x:Class="SimpleGridTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <DataGrid x:Name="grid" Grid.Row="1" Margin="5" AutoGenerateColumns="False" RowHeight="25" RowHeaderWidth="10" ItemsSource="{Binding}" CanUserAddRows="True" CanUserSortColumns="False"> <DataGrid.Columns> <DataGridTemplateColumn Header="Department" Width="150"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBox Text="{Binding Department}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTextColumn Header="ID" Binding="{Binding Path=ID}" Width="100"/> <DataGridTextColumn Header="Name" Binding="{Binding Path=Name}" Width="200"/> </DataGrid.Columns> </DataGrid> </Grid> </Window> MainWindow.xaml.cs using System.Windows; using System.Collections.ObjectModel; namespace SimpleGridTest { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { private ObservableCollection<Employee> _employees = new ObservableCollection<Employee>(); public ObservableCollection<Employee> Employees { get { return _employees; } set { _employees = value; } } public MainWindow() { InitializeComponent(); grid.ItemsSource = Employees; } } } How can I fix this problem? Or I need to write a DataGrid***Column as DataGridTextColumn? Thanks in advance! Best Regards, Johnson

    Read the article

  • Windows authetication with Silverlight custom binding.

    - by sfx
    Hello, I am trying to set up security within a web.config file for a WCF service hosted in IIS but keep getting the error message: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. I have read Nicholas Allen’s blog (link text) and it appears that this is the route that I need to take. However, I am using “binaryMessageEncoding” in a customBinding for my Silverlight service, and as such, I’m not sure how to apply this type of security to such an element. This is how my custom binding looks in config at present: <customBinding> <binding name="silverlightBinaryBinding"> <binaryMessageEncoding /> <httpTransport /> </binding> </customBinding> Has anyone had any experience getting Windows authentication to work with a custom binding using binaryMessageEncoding? Cheers, sfx

    Read the article

  • iPhone - Custom Tab Icons, Remove Highlight

    - by user269737
    I am creating a custom tab bar for my iPhone app and I need to change the images. I have changed the actual tab bar background, but I need to know how to add custom images for the icons and their respective "selected" icons. I also need to remove the square highlight that is default. Pretty much, it just needs to be my icons. Also wondering if the images can be coloured or not. I've looked a lot of this, but no one seems to have the solution. Someone please help.

    Read the article

  • Custom Attributes in Android

    - by Arun
    I'm trying to create a custom attribute called Tag for all editable elements. I added the following to attrs.xml <declare-styleable name="Spinner"> <attr name="tag" format="string" /> </declare-styleable> <declare-styleable name="EditText"> <attr name="tag" format="string" /> </declare-styleable> I get an error saying "Attribute tag has already been defined" for the EditText. Is it not possible to create a custom attribute of the same name on different elements?

    Read the article

  • Custom control packaging

    - by CSharpened
    Quick question: You are building a setup for your application. The application contains a custom control developed by you, which will be shared across multiple applications. How should you package the custom control? Package the control in a Merge Module (.msm) and add the .msm file to a Windows Installer project. Package the control into a cabinet project (.cab) and add the .cab file to a Windows Installer project. Create a separate directory for the control and then package it in a Windows Installer project along with the rest of the project files. Package the control as a Web setup project and create a link to that project from the Windows Installer project. Any ideas?

    Read the article

  • Trouble Copying custom class initialization

    - by Parad0x13
    I have a custom class of type NSObject that contains a single NSMutableArray. This class is called Mutable2DArray and is designed to emulate a 2 dimensional array of type NSMutableArray. There is a custom init method - (id)initWithX:(int)x Y:(int)y that asks for the dimensions for the array and allocates the required arrays within the only array the class owns. My issue is when I try to copy an instance of Mutable2DArray I get an error saying the copyWithZone is an unrecognized selector. I thought copy was a base method of NSObject so I'm confused why I cant create a copy of the instance like this: Mutable2DArray *Array1 = [[Mutable2DArray alloc] initWithX:10 Y:10]; Mutable2DArray *Array2 = [Array1 copy]; Am I missing something so obvious here?

    Read the article

  • Modifying the Label Property(text and font) by a custom ComboBox

    - by BDotA
    I have created a custom combobox that has a LABEL property so when we drop it on a form, we can say the Label associated with this ComboBox is say Label2 this is what I wrote for its label property. The whole thing I want to do is that when I am assigning the Label property of my custom ComboBox to one of the labels on the form, I want that label to change its font to bold and also add an "*" to its Test property. thats it ... but it does not work! any ideas? private Label assignedLabelName; public Label AssignedLabelName { get { return assignedLabelName; } set { assignedLabelName = value; assignedLabelName.Text = "*" + assignedLabelName.Text; assignedLabelName.Font = new Font(AssignedLabelName.Font, FontStyle.Bold); } }

    Read the article

  • Creating Custom validation rule and register it

    - by FormsEleven
    What is Validation Rule? A validation rule is a piece of code that performs some check ensuring that data meets given constraints.In an enterprise application development environment, often it might require developers to have validation be performed based on some logic at several places across projects. Instead of redundant validation creation, a custom validation rule provides a library with a validation rules that can be registered and used across applications.A custom Validation is encapsulated in a reusable component so that you do not have to write it every time when you need to do input validation. Here is how we can easily implement a custom validation that checks for name of an employee to be "KING" For creating a custom Validation , 1.         Create Generic Application Workspace "CustomValidator" with the project "Model" 2.         Create an BC4J based on emp table. 3.         Create a custom validation rule.In EmpNamerule class, update the validateValue(..) method as follows:  public boolean validateValue(Object value) { EntityImpl emp = (EntityImpl)value; if(emp.getAttribute("Ename").toString().equals("KING")){ return false; } return true; } Create ADF Library: Next step would be to create ADF library. Create ADF library with name lets say testADFLibrary1.jarRegister ADF Library Next step is to register the ADF library , so that its available across the applications. Invoke the menu "Tools -> Preferences"Select the option "Business Components -> Registered Rules" from left paneClick on button "Pick Library". The dialog "Select Library" comes up with  the user library addedAdd new library' that points to the above jarCheck the checkbox "Register" and set the name for the rule Sample UsageHere is how we can easily implement a validation rule that restrict the name of the employee not to be "KING".Create new Application with BC4J based on EMP table.Create new validation under Business rule tab for Ename & select the above custom validation rule.Run the AppModule tester.

    Read the article

  • wpf custom control problem

    - by josika
    Hi! I have a problem, and I have not found the solution yet. I woud like to create a base custom control and use it in another custom control. The base control work fine when I use in a window, but when I use in the other custom control, the binding does not work. What's wrong with my code? Code: Model: public class ElementModel { public string Name { get; set; } public string FullName { get; set; } } The base control: public class ListControl : Control { static ListControl() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ListControl), new FrameworkPropertyMetadata(typeof(ListControl))); } public ListControl() { SetValue(ElementListProperty, new List<ElementModel>()); } public static readonly DependencyProperty ElementListProperty = DependencyProperty.Register( "ElementList", typeof(List<ElementModel>), typeof(ListControl), new FrameworkPropertyMetadata(new List<ElementModel>()) ); public List<ElementModel> ElementList { get { return (List<ElementModel>)GetValue(ElementListProperty); } set { SetValue(ElementListProperty, value); } } } The Wrapper Control: public class ListWrapper : Control { static ListWrapper() { DefaultStyleKeyProperty.OverrideMetadata(typeof(ListWrapper), new FrameworkPropertyMetadata(typeof(ListWrapper))); } public ListWrapper() { SetValue(EMListProperty, new List<ElementModel>()); } public static readonly DependencyProperty EMListProperty = DependencyProperty.Register( "EMList", typeof(List<ElementModel>), typeof(ListWrapper), new FrameworkPropertyMetadata(new List<ElementModel>()) ); public List<ElementModel> EMList { get { return (List<ElementModel>)GetValue(EMListProperty); } set { SetValue(EMListProperty, value); } } } Generic.xaml <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:UIControl"> <Style TargetType="{x:Type local:ListControl}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:ListControl}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <ListBox ItemsSource="{TemplateBinding ElementList}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Label Content="Name:"/> <TextBlock Text="{Binding Path=Name}" /> <Label Content="Full name:"/> <TextBlock Text="{Binding Path=FullName}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type local:ListWrapper}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:ListWrapper}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <local:ListControl ElementList="{TemplateBinding EMList}" /> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> If I put the controls in the window and binding properties, than the ListControl works fine and shows the elements, but the WrapperList does not. <Window x:Class="MainApplication.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ui="clr-namespace:UIControl;assembly=UIControl" Title="Window1" Height="304" Width="628"> <Grid> <ui:ListControl x:Name="listCtr" ElementList="{Binding Path=EList}" HorizontalAlignment="Left" Width="300" /> <ui:ListWrapper x:Name="listWrp" EMList="{Binding Path=EList}" HorizontalAlignment="Right" Width="300" Background="Gray"/> </Grid> Project archive

    Read the article

  • Ninject with MembershipProvider | RoleProvider

    - by DVark
    I'm using ninject as my IoC and I wrote a role provider as follows: public class BasicRoleProvider : RoleProvider { private IAuthenticationService authenticationService; public BasicRoleProvider(IAuthenticationService authenticationService) { if (authenticationService == null) throw new ArgumentNullException("authenticationService"); this.authenticationService = authenticationService; } /* Other methods here */ } I read that Provider classes get instantiated before ninject gets to inject the instance. How do I go around this? I currently have this ninject code: Bind<RoleProvider>().To<BasicRoleProvider>().InRequestScope(); From this answer here. If you mark your dependencies with [Inject] for your properties in your provider class, you can call kernel.Inject(MemberShip.Provider) - this will assign all dependencies to your properties. I do not understand this.

    Read the article

  • Wordpress: Retriving posts of a specific custom category in a custom taxonomy

    - by Extrakun
    I am able to retrieve all the posts from a custom category with this call to WP_Query $q = new WP_Query(array( 'taxonomy' => 'jh-portfolio-category', 'term' => 0, 'post_type' => 'jh-portfolio' )); However, let say within the jh-portfolio-category taxonomy I have defined some sub-categories, how do I specify I wish to have posts from a specific sub-category? Changing the 'term' property to the term_id as presented in wp_term_taxonomy doesn't seem to work.

    Read the article

  • Anyone using ASP.NET MembershipProvider with Nhibernate?

    - by JLago
    Hi, I'm trying to implement Membership controls in a mvc 2 application and i'm having trouble dealing with the MembershipUser class. I have my own data store (in Postgresql) and I'm using Nhibernate to deal with it from C#. The thing is, I have my own user class, but I can't use it with any provider I found that implements Membership, because all the functions return the predefined MembershipUser class and cannot return my own. I'm losing my mind here, is there any way i can work with this, or should I implement everything myself? thanks in advance!

    Read the article

  • Drupal Theming and custom variables in custom pages

    - by GaxZE
    hello, I have created a custom page which sits at site.com/user/me/soe now im trying to theme this page and have created a subsequent template file. however if i copy in any basic html into my template file, all it does is produce a white page with my text and abandons the sites structure i originally had. i was hoping somebody could help me understand preprocessing as i feel that is the way to solve this.

    Read the article

  • Multiple choice list with custom view?

    - by Po
    I've seen example com.example.android.apis.view.List11 from ApiDemos. In that example, each row takes the view android.R.simple_list_item_multiple_choice. Each such view has a TextView and a CheckBox. Now I want each view to have 2 TextView's and 1 CheckBox, somewhat similar to the List3 example. I tried creating a custom layout file row.xml like this: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <CheckBox android:id="@+id/checkbox" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="fill_parent" /> <TextView android:id="@+id/text_name" android:textSize="13px" android:textStyle="bold" android:layout_toLeftOf="@id/checkbox" android:layout_alignParentLeft="true" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <TextView android:id="@+id/text_phone" android:textSize="9px" android:layout_toLeftOf="@id/checkbox" android:layout_below="@id/text_name" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </RelativeLayout> Then in Activity.onCreate(), I do like this: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Query the contacts mCursor = getContentResolver().query(Phones.CONTENT_URI, null, null, null, null); startManagingCursor(mCursor); ListAdapter adapter = new SimpleCursorAdapter(this, R.layout.row, mCursor, new String[] { Phones.NAME, Phones.NUMBER}, new int[] { R.id.text_name, R.id.text_phone }); setListAdapter(adapter); getListView().setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); } The result kind of looks like what I want, but it looks like the list doesn't know which item of it is selected. Also, I need to click exactly on the checkbox. In the List11 example, I only need to click on the item row. So what do I need to do to make a multiple choice list with my custom view for each row? Many thanks.

    Read the article

  • .NET custom property attribute?

    - by ropstah
    EDIT: I'd better rephrase: How can I shift the GET-implementation of a Class property to a / using a custom attribute? (I've added instantation vars (classname, propertyname) to the attribute, however I'd rather have these automatically fetched ofcourse.) Public Class CustomClass <CustomAttributeClass(ClassName:="CustomClass", PropertyName = "SomeProperty")> _ Public Property SomeProperty() as String Get() as String //This implementation should be handled by the attribute class End Get Set(Byval value as String) Me._someProperty = value End Set End Property End Class Old question: I want to create a custom property attribute for classes. I can create a class derived from Attribute, and 'mark' the property with the attribute, but where to go from here? I have a repository where I can quickly get data based on the attributes values. I would like to generalize the behaviour of the property in the attribute but I don't know how to go from here... Any help would be greatly accepted! Public Class CustomDataAttribute : Inherits Attribute Private _name As String Public Sub New(ByVal name As String) Me.Name = name End Sub Property Name() As String Get Return _name End Get Set(ByVal value As String) Me._name = value End Set End Property End Class Public Class CustomClass <CustomDataAttribute(Name:="CustomField")> _ Public Property CustomField() End Property End Class

    Read the article

  • Custom IIdentity and passing data from an attribute to a controller

    - by DM
    Here's my scenario: I've successfully created a custom IIdentity that I pass to a GenericPrincipal. When I access that IIdentity in my controller I have to cast the IIdentity in order to use the custom properties. example: public ActionResult Test() { MyCustomIdentity identity = (MyCustomIdentity)User.Identity; int userID = identity.UserID; ...etc... } Since I need to do this casting for nearly every action I would like to wrap this functionality in an ActionFilterAttribute. I can't do it in the controller's constructor because the context isn't initialized yet. My thought would be to have the ActionFilterAttribute populate a private property on the controller that I can use in each action method. example: public class TestController : Controller { private MyCustomIdentity identity; [CastCustomIdentity] public ActionResult() { int userID = identity.UserID; ...etc... } } Question: Is this possible and how? Is there a better solution? I've racked my brain trying to figure out how to pass public properties that are populated in an attribute to the controller and I can't get it.

    Read the article

  • Android Custom View Constructor

    - by Mitch
    I'm learning about using Custom Views from the following: http://developer.android.com/guide/topics/ui/custom-components.html#modifying The description says: Class Initialization As always, the super is called first. Furthermore, this is not a default constructor, but a parameterized one. The EditText is created with these parameters when it is inflated from an XML layout file, thus, our constructor needs to both take them and pass them to the superclass constructor as well. Is there a better description? I've been trying to figure out what the constructor(s) should look like and I've come up with 4 possible choices (see example at end of post). I'm not sure what these 4 choices do (or don't do), why I should implement them, or what the parameters mean. Is there a description of these? Thanks. Mitch public MyCustomView() { super(); } public MyCustomView(Context context) { super(context); } public MyCustomView(Context context, AttributeSet attrs) { super(context, attrs); } public MyCustomView(Context context, AttributeSet attrs, Map params) { super(context, attrs, params); }

    Read the article

  • Custom Repeater with hiractial Databinding

    - by Dooie
    Im using a Custom NestedRepeater Control for ASP.NET which can be found on code project The source is in c# which i have converted to vb and plugged into my solution, so far so good. The problem, im having is databinding to the repeater, my code behind looks like this... '' get all pages Dim navPages As DataSet = Navigation.getMenuStructure() navPages.Relations.Add(navPages.Tables(0).Columns("ID"), navPages.Tables(0).Columns("ParentID")) NestedRepeaterNavigation.RelationName = RelationName NestedRepeaterNavigation.DataSource = navPages NestedRepeaterNavigation.RowFilterTop = "ParentID is null" NestedRepeaterNavigation.DataBind() Then in the item template of my custom repeater im trying the following... <ItemTemplate> <img src="/pix.gif" height="10" width="<%#(Container.Depth * 10)%>"> <%# (Container.DataItem as DataRow)["DESCRIPTION"]%> <%# (Container.NbChildren != 0 ? "<small><i>(" + Container.NbChildren.ToString() +")</i></small>" "") %><small><i></i></small> </ItemTemplate> The databinding falls over; firstly that 'as DataRow' says it was expecting an ')'. And secondly that '!=' identifier expected. Is this due to the translation from c#, should the databinding be different?

    Read the article

  • Building a custom (dynamic) dataset and grid

    - by marko.ivanovski.nz
    Hi, I'm in the process of building a dynamic table in which you can add/remove rows & columns so it varies in size depending on what the user wants. Its purpose is to store properties for a product, but there can be from 1 to 10 different properties(columns) per product, and multiple instances(rows) of the product as well. Here's a screenshot of what I mean http://i40.tinypic.com/nbqkxc.jpg As you can see I need the structure to be completely up to the client which is where I'm getting stuck. I've started writing a custom DataSet that has "add column" & "add row" buttons, and have built a custom Table with Textboxes in each cell which builds from that dataset. I have no idea how to store the data on submit though, and to make it even more complex I need to store this in the database as a string which I think I can do by converting it to XML. Any help is appreciated, I think I just need a pointer in the right direction and am happy to do research from there. Thanks in advance. Marko

    Read the article

  • How do i close the alert dialog that displays custom view

    - by Asdfg
    I have an activity named MainActivity which has a button. On click of that button i am displaying an AlertDialog which contains a custom view named ChildWindow.xml. That custom view has multiple textboxes and a OK button. On click of the OK button, i am calling a method of MainActivity. I am able to access the ChildWindow here as view.getRootView().findViewById(R.id.txtFirstName); Once the user clicks on the OK button, i have to close the alert dialog which i am able to do as view.getRootView().setVisibility(View.GONE); My problem is even though i have closed the the ChildWindow in the above statement, i am able to get reference to the textbox in the next line which means AlertDialog is closed but child window is still there. This is how the OK button click looks like: This works as expected: EditText tb = (EditText) view.getRootView().findViewById(R.id.txtFirstName); Toast toast = Toast.makeText(getApplicationContext(), tb.getText(), Toast.LENGTH_LONG); toast.show(); view.getRootView().setVisibility(View.GONE); This should not work as i am closing the alert dialog and then getting the reference of the textbox but this works too. view.getRootView().setVisibility(View.GONE); EditText tb = (EditText) view.getRootView().findViewById(R.id.txtFirstName); Toast toast = Toast.makeText(getApplicationContext(), tb.getText(), Toast.LENGTH_LONG); toast.show(); I think i am closing the alert dialog but i am not destroying it from the memory. Can someone point me out what am i missing here?

    Read the article

  • Rails does not display error messages on a form in a custom method

    - by slythic
    Hi all, I've created a custom method called checkout in my app. I create an order (which is done my adding products to my "cart"), assign it to my client, and then I head to my checkout screen where I confirm the items and enter their customer order number and complete the order (submit). Everything works great except that it doesn't display error messages. I'm able to display a flash error notice (seen in complete_order method) when things go wrong but it doesn't specify the details like a normal form would. The error messages should appear if the customer order number is not unique for that client. Below is the custom method (checkout) related code. Order Model: validates_uniqueness_of :customer_order_number, :scope => :client_id Orders_controller: def checkout @order = current_order end def complete_order @order = current_order respond_to do |format| if @order.update_attributes(params[:order]) @order.complete #sets submitted datetime and state to 'complete' flash[:notice] = 'Thank you! Your order is being processed.' format.html { redirect_to( products_path ) } format.xml { head :ok } else flash[:error] = 'Please review your items' #added to confirm an error is present format.html { redirect_to( checkout_path ) } format.xml { render :xml => @order.errors, :status => :unprocessable_entity } end end end And the form in the checkout view: <% form_for @order, :url => { :controller => "orders", :action => "complete_order" } do |f| %> <%= f.error_messages %> <%= f.text_field :customer_order_number, :label => "Purchase Order Number" %> <p> <%= f.submit 'Complete Order', :confirm => 'Are you sure?' %> <small> or <%= link_to 'cancel', current_cart_path %></small> </p> <% end %> Any idea how I can display the specific error messages? Thank you in advance! -Tony

    Read the article

  • Select box is not working properly after including google custom search box in web page

    - by Vinay
    I have got a select box and google custom search box in a page, when i choose a option from select box and navigate away from the page and again if i come back to the same page the option will not be selected (violates the default functionality of select box), The code is below <script src="https://www.google.com/jsapi" type="text/javascript"></script> <script type="text/javascript"> google.load('search', '1', {language : 'en'}); google.setOnLoadCallback(function() { var customSearchControl = new google.search.CustomSearchControl('004920913350056953771:kpkclvhujzk'); customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); var options = new google.search.DrawOptions(); options.setAutoComplete(true); options.enableSearchboxOnly("<?=$homeurl?>my_results.php", "query"); customSearchControl.draw('cse-search-form', options); }, true); </script> <select multiple="yes"> <option>1</option> <option>2</option> </select> If i remove the custom search script, the select box selected option will be retained even after navigating away from the page. (default functionality) Its working fine in chrome, IE but not in Firefox. Is there any solution for this, so that select box must work fine even in the presence of search box, but the order must be same 1) Search box 2)Select Box

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >