Search Results

Search found 16162 results on 647 pages for 'property attribute'.

Page 3/647 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Ant loadfile override property

    - by lucks
    Hi, I'm trying to use the Ant task <loadfile> in a loop to parse the contents of a file. I have something like <loadfile srcFile="@{some.input}" property="my.property"> Since Ant properties are immutable, this doesn't work for me. I need 'my.property' to update on every iteration. Is there a way to achieve this? I know Ant-contrib has a <var> task but I'm not sure how to use <loadfile> with it. Any recommendations? Thanks.

    Read the article

  • c# Attribute Question

    - by Petoj
    Well i need some help here i don't know how to solve this problem. the function of the attribute is to determine if the function can be run... So what i need is the following: The consumer of the attribute should be able to determine if it can be executed. The owner of the attribute should be able to tell the consumer that now it can/can't be executed (like a event). It must have a simple syntax. This is what i have so far but it only implements point 1, 3. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] public class ExecuteMethodAttribute : Attribute { private Func<object, bool> canExecute; public Func<object, bool> CanExecute { get { return canExecute; } } public ExecuteMethodAttribute() { } public ExecuteMethodAttribute(Func<object, bool> canExecute) { this.canExecute = canExecute; } }

    Read the article

  • Accessing property file through batch script

    - by Farid
    Hi everyone, I'm trying to write a batch script, this script is responsible to launch a jar with one parameters. This parameter indicate to my jar wich property file to use in order to setup some configuration. Then the script will zip the results produced by the jar and send them to a location. But in order to set the name of the zip file I would need to be able to read the property file directly from the batch, is there a way to do so ? Thanks and regards, F

    Read the article

  • .NET Dictionary as a Property

    - by Anand
    Can someone point me out to some C# code examples or provide some code, where a Dictionary has been used as a property for a Class. The examples I have seen so far don't cover all the aspects viz how to declare the dictionary as property, add, remove, and retrieve the elements from the dictionary.

    Read the article

  • Creating a handle to a class' property

    - by shadeMe
    Would it be possible to create a handle ( or a tracking handle ) to a class' property ? For instance, System::Windows::Forms::CheckBox^ Box = gcnew System::Windows::Forms::CheckBox() I'd like to create a handle to its Checked property and use it to access and modify the same.

    Read the article

  • Jquery get attribute of few ul to create another attribute

    - by Josemalive
    Hello, I have the following HTML: <ul actualpage=0> <li/> <li/> .... </ul> <ul actualpage=0> <li/> <li/> .... </ul> Im trying to get the value of actualpage of each ul and create a new attribute. Its easy but not in one jquery sentence... Its possible? Until now i have the following line (between ## simbols the missing part that i need. /* select all uls with attribute actualpage and create a new attribute on each with the current actualpage value */ $('ul[actualpage]').attr('newactualpage',##Current value of actualpage attr of UL##);

    Read the article

  • Xerces SAX parser ignore the xmlxs:xsi attribute as an attribute of an element

    - by user603301
    Hi, Using Xerces SAX parser I try to retrieve all elements and their attributes of this XML file: -------------- Begin XML file to parse ---------------- <?xml version="1.0" encoding="UTF-8"?> <invoice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="my.xsd"> <parties> (...) -------------- End XML file to parse ---------------- When getting the attributes for the element 'invoice', Xerces++ does not insert the 'xmlns:xsi' attribute in the list of 'Attributes' for the element 'invoice'. However, the attribute 'xsi:noNamespaceSchemaLocation' is inserted in the list. Why? Is there a specific reason from an XML standard point of view ? Is there a way to configure Xerces++ SAX parser so that it inserts this attribute as well? (The documentation on setting the parser properties does not tell how). Thanks for your help.

    Read the article

  • Create a delegate from a property getter or setter method

    - by thecoop
    To create a delegate from a method you can use the compile-safe syntax: private int Method() { ... } // and create the delegate to Method... Func<int> d = Method; A property is a wrapper around a getter and setter method, and I want to create a delegate to a property getter method. Something like public int Prop { get; set; } Func<int> d = Prop; // or... Func<int> d = Prop_get; Which doesn't work, unfortunately. I have to create a separate lambda method, which seems unnecessary when the setter method matches the delegate signature anyway: Func<int> d = () => Prop; In order to use the delegate method directly, I have to use nasty reflection, which isn't compile-safe: // something like this, not tested... MethodInfo m = GetType().GetProperty("Prop").GetGetMethod(); Func<int> d = (Func<int>)Delegate.CreateDelegate(typeof(Func<int>), m); Is there any way of creating a delegate on a property getting method directly in a compile-safe way, similar to creating a delegate on a normal method at the top, without needing to use an intermediate lambda method?

    Read the article

  • A better python property decorator

    - by leChuck
    I've inherited some python code that contains a rather cryptic decorator. This decorator sets properties in classes all over the project. The problem is that this I have traced my debugging problems to this decorator. Seems it "fubars" all debuggers I've tried and trying to speed up the code with psyco breaks everthing. (Seems psyco and this decorator dont play nice). I think it would be best to change it. def Property(function): """Allow readable properties""" keys = 'fget', 'fset', 'fdel' func_locals = {'doc':function.__doc__} def probeFunc(frame, event, arg): if event == 'return': locals = frame.f_locals func_locals.update(dict((k,locals.get(k)) for k in keys)) sys.settrace(None) return probeFunc sys.settrace(probeFunc) function() return property(**func_locals) Used like so: class A(object): @Property def prop(): def fget(self): return self.__prop def fset(self, value): self.__prop = value ... ect The errors I get say the problems are because of sys.settrace. (Perhaps this is abuse of settrace ?) My question: Is the same decorator achievable without sys.settrace. If not I'm in for some heavy rewrites.

    Read the article

  • WPF: Cannot set properties on property elements weirdness...

    - by Willy
    private TextBlock _caption = new TextBlock(); public TextBlock Caption { get { return _caption; } set { _caption = value; } } <l:CustomPanel> <l:CustomPanel.Caption Text="Caption text" FontSize="18" Foreground="White" /> </l:CustomPanel> Gives me the following error: Cannot set properties on property elements. If I use: <l:CustomPanel> <l:CustomPanel.Caption> <TextBlock Text="Caption text" FontSize="18" Foreground="White" /> </l:CustomPanel.Caption> </l:CustomPanel> My TextBlock shows up fine but it's nested inside another TextBlock like so, it even seems to add itself outside of the Caption property: <l:CustomPanel> <l:CustomPanel.Caption> <TextBlock> <InlineUIContainer> <TextBlock Text="Caption text" FontSize="18" Foreground="White" /> </InlineUIContainer> </TextBlock> </l:CustomPanel.Caption> <TextBlock> <InlineUIContainer> <TextBlock Text="Caption text" FontSize="18" Foreground="White" /> </InlineUIContainer> </TextBlock> </l:CustomPanel> As you might have already guessed, what i'd like my code to do is to set my Caption property from XAML on a custom panel, if this is possible. I've also tried the same code with a DependencyProperty to no avail. So, anyone that can help me with this problem?

    Read the article

  • Binding property to Silverlight dependency property independent of DataContext

    - by Simon_Weaver
    I'm trying to make an Address control that has an IsReadOnly property, which will make every TextBox inside read only when set to true. <my:AddressControl Grid.Column="1" Margin="5" IsReadOnly="True"/> I've managed to do this just fine with a dependency property and it works. Here's a simple class with the dependency property declared : public partial class AddressControl : UserControl { public AddressControl() { InitializeComponent(); this.DataContext = this; } public static readonly DependencyProperty IsReadOnlyProperty = DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(AddressControl), null); public bool IsReadOnly { get { return (bool)GetValue(IsReadOnlyProperty); } set { SetValue(IsReadOnlyProperty, value); } } } In the XAML for this codebehind file I have a Textbox for each address line: <TextBox IsReadOnly="{Binding IsReadOnly}" Text="{Binding City, Mode=TwoWay}"/> <TextBox IsReadOnly="{Binding IsReadOnly}" Text="{Binding State, Mode=TwoWay}"/> <TextBox IsReadOnly="{Binding IsReadOnly}" Text="{Binding Zip, Mode=TwoWay}"/> Like i said this works just fine. The problem is that the Address control itself is bound to its parent object (I have several addresses I am binding). <my:AddressControl DataContext="{Binding ShippingAddress, Mode=TwoWay}" IsReadOnly="True"> <my:AddressControl DataContext="{Binding BillingAddress, Mode=TwoWay}" IsReadOnly="True"> The problem is that as soon as I set DataContext to something other than 'this' then the binding for IsReadOnly breaks. Not surprising because its looking for IsReadOnly on the Address data entity and it doesn't exist or belong there. I've tried just about every combination of binding attributes to get IsReadOnly to bind to the AddressControl obejct but can't get it working. I've tried things like this, but I can't get IsReadOnly to bind independently to the AddressControl property instead of its DataContext. <TextBox IsReadOnly="{Binding RelativeSource={RelativeSource Self}, Path=IsReadOnlyProperty}" Text="{Binding City, Mode=TwoWay}" /> I think I'm pretty close. What am I doing wrong?

    Read the article

  • Why can't I Bind a viewmodel property to a dependency property of a custom control

    - by Robert
    I want to use a color picker in my wpf application and I saw a nice looking one on this codeproject page. The control works fine until I want to connect the control to a viewmodel. I created a small test program with this viewmodel: public class ColorViewModel : ViewModelBase { public ColorViewModel() { LineColor = Brushes.Yellow; } SolidColorBrush _brushColor; public SolidColorBrush LineColor { get { return _brushColor; } set { _brushColor = value; RaisePropertyChanged(() => LineColor); } } } The test program has a textbox and the colorpicker controls: <StackPanel Orientation="Horizontal"> <TextBlock Text="Please Select a Color" FontWeight="Bold" Margin="10" Foreground="{Binding Path=LineColor, UpdateSourceTrigger=PropertyChanged}"/> <vw:ColorPickerControlView x:Name="ForeColorPicker" Margin="10" CurrentColor="{Binding Path=LineColor, UpdateSourceTrigger=PropertyChanged }"/> </StackPanel> In the loaded event of the window I set the viewmodel to the datacontext like this: DataContext = new ColorViewModel(); The problem is that I can't seem to bind the LineColor property of the viewmodel to the CurrentColor property of the ColorPickerControlView. The CurrentControl property of the ColorPickerControlView seems to be fine. The constructor looks like this: public ColorPickerControlView() { this.DataContext = this; InitializeComponent(); CommandBindings.Add(new CommandBinding(SelectColorCommand, SelectColorCommandExecute)); } In the constructor of the UserControl there is the line this.DataContext = this; I read that is is necessary to bind the dependency properties. Do I override this line when I set my viewmodel to the datacontext and is that why I can't bind to the CurrentColor property? Is there any workaround? Or did I make another mistake?

    Read the article

  • WPF ContextMenu bind some property to another property of the same control

    - by bebicasoft
    I have a ContextMenu and a ColumnHeaderStyle defined in Window.Resource section witch i use-it to a DataGrid ColumnHeader. My code is something like this: <ContextMenu x:Key="cm_columnHeaderMenu"/> <Style x:Key="DefaultColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="ContextMenu" Value="{StaticResource cm_columnHeaderMenu}" /> </Style> <DataGrid Grid.Column="2" Grid.Row="1" x:Name="dgridFiles" IsReadOnly="True" ColumnHeaderStyle="{StaticResource DefaultColumnHeaderStyle}"> I want to know if I can (and if the answer it true, then HOW I could do it) bind the ContextMenu Visibility property to same control ContextMenu Items.Count>0 property. Initially based on some other treeView control selections made there shoud be no items in the context menu, but i wish to add dinamically items in ContextMenu based on selection in treeView. This part is done, the context has those items. On some selections there are no-items, but still on the grid it appears an empty ContextMenu. So I believe the easiest part it would be to bind the Visibility to Items.Count property of the same control. Sorry if my english is not good enought, I'll try to explain better if i didnt make clear 1st time.

    Read the article

  • Can software company claim the intellectual property rights on my paintings?

    - by maksymko
    This is somewhat related to this question. I'm about to sign a contract with a company that this sort of "all your base are belong to us" clause in it: it says that all programs, designs, sketches, drawings I create in relation to my job belong to the company. More or less usual stuff (unfortunately). What worries me, however, is this "drawings, sketches" thing, because I'm a hobby-artist and I paint and draw at my spare time. Can the company somehow claim ownership of intellectual rights on this work? Should I ask them to explicitly state that this clause does not extend to work of art or is this "in relation to the job" part is good enough?

    Read the article

  • Expose UserControl property to XAML

    - by Jared
    WPF controls have certain properties (UserControl.Resources, UserControl.CommandBindings) that can have items added to them from the XAML of a user control declaration. Example: <UserControl ... > <UserControl.CommandBindings> ... </UserControl.CommandBindings> <UserControl.Resources> ... </UserControl.Resources> </UserControl> I have a new list property defined in my user control: public partial class ArchetypeControl : UserControl { ... public List<Object> UICommands { get; set; } I want to add items to this list like I can with resources and CommandBindings, but when I do this: <c:ArchetypeControl.UICommands> </c:ArchetypeControl.UICommands> I get the error "Error 4 The attachable property 'UICommands' was not found in type 'ArchetypeControl'. " Suggestions? - Given the comments, I've created a test control to show the entire code and reproduce the problem. I'm using visual studio 2010. <UserControl x:Class="ArchetypesUI.TestControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:c="clr-namespace:ArchetypesUI" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <c:TestControl.TestObject> </c:TestControl.TestObject> <Grid> </Grid> </UserControl> - namespace ArchetypesUI { /// <summary> /// Interaction logic for TestControl.xaml /// </summary> public partial class TestControl : UserControl { public Object TestObject { get; set; } public TestControl() { InitializeComponent(); } } } Now the error I get is "Error 2 The attached property 'TestControl.TestObject' is not defined on 'UserControl' or one of its base classes."

    Read the article

  • Fetched Property in XCode Data Model Editor for minimum value

    - by wal
    How do I add a Fetched Property in XCode's Data Model Editor for minimum value of one attribute?? My model: Item (name, note, storedItem) StoredItem (price, item) Item 1 ---> N StoredITem (1->N Relationship) I want that Item has a fetched property named minPrice and its value is the minimum value setted for price in the storedItems. Example: Item1 (banana, storedItem1 ... storedItem4, 10) StoredItem1 (10,item1) StoredItem2 (15,item1) StoredItem3 (30,item1) StoredItem4 (54,item1) What do I put in Destination?? StoredItem? And what do I put in Expression??

    Read the article

  • How can I bind a custom property of a windows form to a second property?

    - by jeroko
    I want to bind a custom property of a windows form to a second property, so when I update the former the latter gets the same value. This is the simplest example of what I'm trying to do: public partial class Form2 : Form { public string MyTargetProperty { get; set; } public string OtherProperty { get; set; } public Form2() { InitializeComponent(); this.DataBindings.Add("MyTargetProperty", this, "OtherProperty"); } private void button1_Click(object sender, EventArgs e) { MyTargetProperty = "test"; Console.WriteLine("OtherProperty " + OtherProperty); } } When I click button1 I should be able to see that 'OtherProperty' has the same value as 'MyTargetProperty'. Am I doing something wrong? Do I miss something?

    Read the article

  • Auto wiring of Property does not work for me

    - by Xabatcha
    Hi All, In my Asp.Net project I wanna use Property Auto-wiring, e.g. for my ILogger. Basically I placed Property into my base classes. One for Page, one for UserControl. Like below. public class UserControlBase : UserControl { public ILogger CLogger { get; set; } .... } However when calling in inherited control, logger is null. I checked the container and it'a definitely set. Below is setting which is called from Global.asax. public static void SetupForIoC() { Debug.WriteLine("SetupForIoC"); ObjectFactory.Initialize(x => { x.FillAllPropertiesOfType<ILogger>().TheDefaultIsConcreteType<EntLibLogger>().AsSingletons(); x.FillAllPropertiesOfType<ISiteService>().TheDefaultIsConcreteType<SiteService>().AsSingletons(); }); Debug.WriteLine(ObjectFactory.WhatDoIHave()); } Thanks for any advice, tip? X.

    Read the article

  • C# - Erase all property values from a class?

    - by John M
    In a C# Winforms (3.5) application I have added a class that contains many properties (get/set) used to stored values from a 12 form long process. After form 12 I would like wipe out all the property values in the storing class so that the next user won't accidentally record values when starting the process at form 1. Is it possible to erase/destroy/dispose of all property values in a class? My class looks like this: private static int battery; public int Battery { get { return storeInspectionValues.battery; } set { storeInspectionValues.battery = value; } }

    Read the article

  • XPath ordered priority attribute search

    - by user94000
    I want to write an XPath that can return some link elements on an HTML DOM. The syntax is wrong, but here is the gist of what I want: //web:link[@text='Login' THEN_TRY @href='login.php' THEN_TRY @index=0] THEN_TRY is a made-up operator, because I can't find what operator(s) to use. If many links exist on the page for the given set of [attribute=name] pairs, the link which matches the most left-most attribute(s) should be returned instead of any others. For example, consider a case where the above example XPath finds 3 links that match any of the given attributes: link A: text='Sign In', href='Login.php', index=0 link B: text='Login', href='Signin.php', index=15 link C: text='Login', href='Login.php', index=22 Link C ranks as the best match because it matches the First and Second attributes. Link B ranks second because it only matches the First attribute. Link A ranks last because it does not match the First attribute; it only matches the Second and Third attributes. The XPath should return the best match, Link C. If more than one link were tied for "best match", the XPath should return the first best link that it found on the page.

    Read the article

  • How to change the attribute value of svg file

    - by rafiq7s
    Hello, In samplexml.svg there is a node <image width="744" height="1052" xlink:href="image1.png"/> I need to replace "image1.png" with another value like "image2.png". Please guide me with sample code how to to that. I could get the attribute value "image1.png". Here is the code: > <?php $xdoc = new DomDocument; > $xdoc->Load('samplexml.svg'); $tagName > = $xdoc->getElementsByTagName('image')->item(0); > $attribNode = > $tagName->getAttributeNode('xlink:href'); > > echo "Attribute Name : > ".$attribNode->name; echo "<br > />Attribute Value : > ".$attribNode->value; ?> Here is samplexml.svg: > <svg> <g> <title>Test title</title> > <image x="0" y="0" width="744" > height="1052" > xlink:href="image1.png"/> </g> </svg> Please help me, how to change this attribute value. Regards, rafiq7s

    Read the article

  • Another Custom Property Locator: a Library of Books

    - by Cindy McMullen
    Introduction The previous post gave an introduction to custom property locators and showed how create one using JDeveloper.  This post continues on the custom locator theme, with a slightly more complex locator: a library of books.  It demonstrates using the DAO pattern to delegate data access from the Locator, which is likely how many actual backing stores will integrate with the Locator.  You can imagine, rather than a library of books, the data store might be a user database of sorts.  The same sort of pattern would apply. This post uses the BookLocator example originally shown in the WebCenter documentation, but has: updated the source code to reflect the final Property APIs includes the steps for generating the namespace and property definition files via JDeveloper detailed usage of the PropertyService APIs Getting Started If you're new to JDeveloper, you might want to check out this tutorial.  There is also the "Jump-Start to using Personalization" blog post that you might find useful.  Otherwise, if you're already familiar with both, you can skip those tutorials and jump right in to using JDeveloper. Download the BookLocator.zip file (which has been updated from the original post) and unzip it to a new directory.  Start JDeveloper, navigate to the BookLocator.jws file, and open it.   It should look something like this: The Properties Namespace file contains the property definitions and property set definitions you define.  It is explained more in detail in the Namespace documentation.  Although this example doesn't show it, the property set definitions have the ability to reference multiple locators per property.   This can be done by right-clicking on the 'Locator Info' box.  Configure the contents of the Locator Map  by editing locators and mapping them to available property names in the property set definition. Compiling, deploying, and running your locator The rest of the steps in this tutorial basically follow those in the previous blog on custom locators, and won't be repeated here.   A scenario to invoke your locator is included with the sample app: see BookProperties.scenarios_diagram above.  Summary This post demonstrates a simple library of books accessed by the BookPropertyLocator via the DAO layer.  This is a useful pattern for more realistic property retrievals, such as a backing user store.  It also points out the possibility of retrieving properties from multiple locators, which would be quite handy to retrieve user attributes from multiple sources.

    Read the article

  • Customer Attribute, not sorting select options

    - by Bosworth99
    Made a module that creates some customer EAV attributes. One of these attributes is a Select, and I'm dropping a bunch of options into their respective tables. Everything lines up and is accessible on both the front end and the back. Last thing before calling this part of things finished is the sort order of the options. They come out all scrambled, instead of the obvious default or alphabetical (seemingly at random... very wierd). I'm on Mage v1.11 (Pro/Enterprise). config.xml <config> <modules> <WACI_CustomerAttr> <version>0.1.0</version> </WACI_CustomerAttr> </modules> <global> <resources> <customerattr_setup> <setup> <module>WACI_CustomerAttr</module> <class>Mage_Customer_Model_Entity_Setup</class> </setup> <connection> <use>core_setup</use> </connection> </customerattr_setup> </resources> <models> <WACI_CustomerAttr> <class>WACI_CustomerAttr_Model</class> </WACI_CustomerAttr> </models> <fieldsets> <customer_account> <agency><create>1</create><update>1</update></agency> <title><create>1</create><update>1</update></title> <phone><create>1</create><update>1</update></phone> <mailing_address><create>1</create><update>1</update></mailing_address> <city><create>1</create><update>1</update></city> <state><create>1</create><update>1</update></state> <zip><create>1</create><update>1</update></zip> <fed_id><create>1</create><update>1</update></fed_id> <ubi><create>1</create><update>1</update></ubi> </customer_account> </fieldsets> </global> </config> mysql4-install-0.1.0.php <?php Mage::log('Installing WACI_CustomerAttr'); echo 'Running Upgrade: '.get_class($this)."\n <br /> \n"; //die ( 'its running' ); $installer = $this; /* @var $installer Mage_Customer_Model_Entity_Setup */ $installer->startSetup(); // bunch of attributes // State $installer->addAttribute('customer','state', array( 'type' => 'varchar', 'group' => 'Default', 'label' => 'State', 'input' => 'select', 'default' => 'Washington', 'source' => 'WACI_CustomerAttr/customer_attribute_data_select', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'required' => true, 'visible' => true, 'user_defined' => 1, 'position' => 67 ) ); $attrS = Mage::getSingleton('eav/config')->getAttribute('customer', 'state'); $attrS->addData(array('sort_order'=>67)); $attrS->setData('used_in_forms', array('adminhtml_customer','customer_account_edit','customer_account_create'))->save(); $state_list = array('Alabama','Alaska','Arizona','Arkansas','California','Colorado','Connecticut','Delaware','Florida','Georgia', 'Hawaii','Idaho','Illinois','Indiana','Iowa','Kansas','Kentucky','Louisiana','Maine','Maryland','Massachusetts','Michigan', 'Minnesota','Mississippi','Missouri','Montana','Nebraska','Nevada','New Hampshire','New Jersey','New Mexico','New York', 'North Carolina','North Dakota','Ohio','Oklahoma','Oregon','Pennsylvania','Rhode Island','South Carolina','South Dakota', 'Tennessee','Texas','Utah','Vermont','Virginia','Washington','West Virginia','Wisconsin','Wyoming'); $aOption = array(); $aOption['attribute_id'] = $installer->getAttributeId('customer', 'state'); for($iCount=0;$iCount<sizeof($state_list);$iCount++){ $aOption['value']['option'.$iCount][0] = $state_list[$iCount]; } $installer->addAttributeOption($aOption); // a few more $installer->endSetup(); app/code/local/WACI/CustomerAttr/Model/Customer/Attribute/Data/Select.php <?php class WACI_CustomerAttr_Model_Customer_Attribute_Data_Select extends Mage_Eav_Model_Entity_Attribute_Source_Abstract{ function getAllOptions(){ if (is_null($this->_options)) { $this->_options = Mage::getResourceModel('eav/entity_attribute_option_collection') ->setAttributeFilter($this->getAttribute()->getId()) ->setStoreFilter($this->getAttribute()->getStoreId()) ->setPositionOrder('asc') ->load() ->toOptionArray(); } $options = $this->_options; return $options; } } theme/variation/template/persistent/customer/form/register.phtml <li> <?php $attribute = Mage::getModel('eav/config')->getAttribute('customer','state'); ?> <label for="state" class="<?php if($attribute->getIsRequired() == true){?>required<?php } ?>"><?php if($attribute->getIsRequired() == true){?><em>*</em><?php } ?><?php echo $this->__('State') ?></label> <div class="input-box"> <select name="state" id="state" class="<?php if($attribute->getIsRequired() == true){?>required-entry<?php } ?>"> <?php $options = $attribute->getSource()->getAllOptions(); foreach($options as $option){ ?> <option value='<?php echo $option['value']?>' <?php if($this->getFormData()->getState() == $option['value']){ echo 'selected="selected"';}?>><?php echo $this->__($option['label'])?></option> <?php } ?> </select> </div> </li> All options are getting loaded into table eav_attribute_option just fine (albeit without a sort_order defined), as well as table eav_attribute_option_value. In the adminhtml / customer-manage customers-account information this select is showing up fine (but its delivered automatically by the system). Seems I should be able to set the sort-order on creation of the attributeOptions, or, certainly, define the sort order in the data/select class. But nothing I've tried works. I'd rather not do a front-end hack either... Oh, and how do I set the default value of this select? (Different question, I know, but related). Setting the attributes 'default' = 'washington' seems to do nothing. There seem to be a lot of ways to set up attribute select options like this. Is there a better way that the one I've outlined here? Perhaps I'm messing something up. Cheers

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >