Search Results

Search found 33969 results on 1359 pages for 'custom view'.

Page 18/1359 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Scratchable Ticket kind Custom View Item in Android ?

    - by Andhravaala
    Hi All, I need to develop a Instant Lottery game app. I need an idea/procedure to implement Scratchable custom widget similar to instant Lottery Tickets in Android. The requirement is like, the actual content(secret number) should be covered by some image(which indicates scratch area). When the user touch and scratch the image, the image has to disappear slowly and the background content(secret number) should appear accordingly. Please let me know the best way to implement this. I am in real need of it. Thanks in advance.

    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

  • Constants in Model and View with select option and show view

    - by caplod
    i have a some values ,that i use in my model as constants. class Animal < ActiveRecord::Base LEGS = {:vierbeiner => 4, :zweibeiner => 2 } end in the form (formtastic) for the collection i use: <%= f.input :legs, :as => :select, :collection => Animal::LEGS => but how do i format the show view so instead showing me the number , the key of the hash? in show view i have: <p> <strong>Legs:</strong> <%=h @animal.legs %> </p>

    Read the article

  • Render view as string when Ajax request to view is made

    - by mare
    I have my views render to route requests like /controller/action (for instance, /Page/Create), so pretty classic. I am creating a form where view will be loaded through AJAX request with jQuery get(), so essentially I need my Views or to be precise, my controller actions, to return plain HTML string when an AJAX request is made to the route that renders the View. I want to use the same views as for normal requests, so I cannot afford to create any new views. It is something like calling RenderPartial("MyViewUserControl") but from inside the JS code.

    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

  • how to have two controller actions, one shared view for Zend_Controller_Action Class?

    - by arendn
    Hi Guys, How do you specify a custom view script for a given Controller Action method? For example: Class UserGalleryController extends Zend_Controller_Action { public function fooAction() { $this->view->actionMsg = 'foo'; // (uses foo.phtml automagically) } public function barAction() { $this->view->actionMsg = 'bar'; //use foo's view script ????? } } I basically want to have one view script (foo.phtml) Thanks :-)

    Read the article

  • Integrating Oracle Hyperion Smart View Data Queries with MS Word and Power Point

    - by Andreea Vaduva
    Untitled Document table { border: thin solid; } Most Smart View users probably appreciate that they can use just one add-in to access data from the different sources they might work with, like Oracle Essbase, Oracle Hyperion Planning, Oracle Hyperion Financial Management and others. But not all of them are aware of the options to integrate data analyses not only in Excel, but also in MS Word or Power Point. While in the past, copying and pasting single numbers or tables from a recent analysis in Excel made the pasted content a static snapshot, copying so called Data Points now creates dynamic, updateable references to the data source. It also provides additional nice features, which can make life easier and less stressful for Smart View users. So, how does this option work: after building an ad-hoc analysis with Smart View as usual in an Excel worksheet, any area including data cells/numbers from the database can be highlighted in order to copy data points - even single data cells only.   TIP It is not necessary to highlight and copy the row or column descriptions   Next from the Smart View ribbon select Copy Data Point. Then transfer to the Word or Power Point document into which the selected content should be copied. Note that in these Office programs you will find a menu item Smart View;from it select the Paste Data Point icon. The copied details from the Excel report will be pasted, but showing #NEED_REFRESH in the data cells instead of the original numbers. =After clicking the Refresh icon on the Smart View menu the data will be retrieved and displayed. (Maybe at that moment a login window pops up and you need to provide your credentials.) It works in the same way if you just copy one single number without any row or column descriptions, for example in order to incorporate it into a continuous text: Before refresh: After refresh: From now on for any subsequent updates of the data shown in your documents you only need to refresh data by clicking the Refresh button on the Smart View menu, without copying and pasting the context or content again. As you might realize, trying out this feature on your own, there won’t be any Point of View shown in the Office document. Also you have seen in the example, where only a single data cell was copied, that there aren’t any member names or row/column descriptions copied, which are usually required in an ad-hoc report in order to exactly define where data comes from or how data is queried from the source. Well, these definitions are not visible, but they are transferred to the Word or Power Point document as well. They are stored in the background for each individual data cell copied and can be made visible by double-clicking the data cell as shown in the following screen shot (but which is taken from another context).   So for each cell/number the complete connection information is stored along with the exact member/cell intersection from the database. And that’s not all: you have the chance now to exchange the members originally selected in the Point of View (POV) in the Excel report. Remember, at that time we had the following selection:   By selecting the Manage POV option from the Smart View meny in Word or Power Point…   … the following POV Manager – Queries window opens:   You can now change your selection for each dimension from the original POV by either double-clicking the dimension member in the lower right box under POV: or by selecting the Member Selector icon on the top right hand side of the window. After confirming your changes you need to refresh your document again. Be aware, that this will update all (!) numbers taken from one and the same original Excel sheet, even if they appear in different locations in your Office document, reflecting your recent changes in the POV. TIP Build your original report already in a way that dimensions you might want to change from within Word or Power Point are placed in the POV. And there is another really nice feature I wouldn’t like to miss mentioning: Using Dynamic Data Points in the way described above, you will never miss or need to search again for your original Excel sheet from which values were taken and copied as data points into an Office document. Because from even only one single data cell Smart View is able to recreate the entire original report content with just a few clicks: Select one of the numbers from within your Word or Power Point document by double-clicking.   Then select the Visualize in Excel option from the Smart View menu. Excel will open and Smart View will rebuild the entire original report, including POV settings, and retrieve all data from the most recent actual state of the database. (It might be necessary to provide your credentials before data is displayed.) However, in order to make this work, an active online connection to your databases on the server is necessary and at least read access to the retrieved data. But apart from this, your newly built Excel report is fully functional for ad-hoc analysis and can be used in the common way for drilling, pivoting and all the other known functions and features. So far about embedding Dynamic Data Points into Office documents and linking them back into Excel worksheets. You can apply this in the described way with ad-hoc analyses directly on Essbase databases or using Hyperion Planning and Hyperion Financial Management ad-hoc web forms. If you are also interested in other new features and smart enhancements in Essbase or Hyperion Planning stay tuned for coming articles or check our training courses and web presentations. You can find general information about offerings for the Essbase and Planning curriculum or other Oracle-Hyperion products here (please make sure to select your country/region at the top of this page) or in the OU Learning paths section , where Planning, Essbase and other Hyperion products can be found under the Fusion Middleware heading (again, please select the right country/region). Or drop me a note directly: [email protected] . About the Author: Bernhard Kinkel started working for Hyperion Solutions as a Presales Consultant and Consultant in 1998 and moved to Hyperion Education Services in 1999. He joined Oracle University in 2007 where he is a Principal Education Consultant. Based on these many years of working with Hyperion products he has detailed product knowledge across several versions. He delivers both classroom and live virtual courses. His areas of expertise are Oracle/Hyperion Essbase, Oracle Hyperion Planning and Hyperion Web Analysis.  

    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

  • MVVM- Trigger Storyboard in the View Model in Silverlight

    - by user275561
    I have a couple of Storyboards in my view that I would like to trigger from the ViewModel if possible. Is there a simple way or elegant way of doing this. Here is what I am trying to do. Person Clicks on a Button--RelayCommand (In the ViewModel), the Relay Command should then play the storyboard. Also one more thing, I would like to also trigger the storyboard animation by itself in the ViewModel without any interaction. <i:Interaction.Triggers> <i:EventTrigger EventName="MouseLeftButtonDown"> <cmd:EventToCommand Command="{Binding ButtonPress}" CommandParameterValue="RedButtonLight"> </cmd:EventToCommand> </i:EventTrigger> </i:Interaction.Triggers>

    Read the article

  • Transparent View with Android

    - by victorusmo
    Hi everybody, I try to have a bitmap moving over my android application. I m be able to have my bitmap behind my text view, but not over them. public void onCreate(Bundle savedInstanceState) ... // ll is a FrameLayout ll.addView(text1); ll.addView(text2); ll.addView(new Panel(this),200,400); my Panel class is defined like this : class Panel extends SurfaceView ...... @Override public void onDraw(Canvas canvas) { canvas.drawColor(0, PorterDuff.Mode.CLEAR); Bitmap bitmap; GraphicObject.Coordinates coords; for (GraphicObject graphic : _graphics) { bitmap = graphic.getGraphic(); coords = graphic.getCoordinates(); canvas.drawBitmap(bitmap, coords.getX(), coords.getY(), null); } } Can you help me ? How Can i Draw a transparent bitmap over my views of my application Thanks a lot, Cheers, Victor

    Read the article

  • How to organized page specific CSS link tags with spark view pages and application.spark

    - by dbr
    I'm currently using ASP.NET MVC 2 and the spark view engine. The main master page (application.spark) contains all of the CSS link tags that need to be present for all pages (global stuff). However, I have some content pages that have page specific CSS tags and currently I'm just sticking the link tag in the body as something like: <content name="MainContent"> <!-- page specific csss --> <link rel="stylesheet" href="/Content/css/page_specific.css" /> My problem is that when the page renders, this tag ends up in the which is not where it needs to be. Is there a solution for this? One idea I had was to check the controller in the Application.spark page and write out which page specific css file is required for that particular controller, however, that solution doesn't seem to scale well and I would imagine there is some way of creating the link in the child page and having it render where it's supposed to by the browser.

    Read the article

  • How to access the parent view controller?

    - by tarnfeld
    I am using this code to push a view controller in ViewControllerA: DatePickerViewController *viewController = [[DatePickerViewController alloc] initWithNibName:@"DatePickerViewController" bundle:nil]; NSMutableArray *info = [[NSMutableArray alloc] initWithObjects:@"Exam Duration",nil]; [viewController setInfo:info]; [info release]; [self.navigationController pushViewController:viewController animated:YES]; [viewController release]; In the DatePickerViewController that is slid in, it has a text field. In ViewControllerA how can I get the value of this text field once the viewWillDisappear method is fired, it's to save data.

    Read the article

  • CouchDB: How to change view function via javascript?

    - by osti
    Hello Guys, I am playing around with CouchDB to test if it is "possible" [1] to store scientific data (simulated and experimental raw data + metadata). A big pro is the schema-less approach of CouchDB: we have to be very flexible with the metadata, as the set of parameters changes very often. Up to now I have some code to feed raw data, plots (both as attachments), and hierarchical metadata (as JSON) into CouchDB documents, and have written some prototype Javascript for filtering and showing. But the filtering is done on the client side (a.k.a. browser): The map function simply returns everything. How could I change the (or push a second) map function of a specific _design-document with simple browser-JS? I do not think that a temporary view would yield any performance gain... Thanks for your time and answers. [1]: of course it is possible, but is it also useful? feasible? reasonable?

    Read the article

  • Scrollbars in ScrollView not showing after custom child view changes size

    - by Ted Hopp
    I have a ScrollView containing a client that is a vertical LinearLayout. The client, in turn, contains custom views that change height dynamically as a background thread does some work. The problem I'm having is that the ScrollView's vertical scroll bar is not updating correctly in Android 1.5. The most common problem occurs when the initial total height of the client is less than the viewport and grows. Initially there is no scroll bar, and it does not show up when the client grows until I actually scroll the window with a touch gesture or other UI action. After that, the scroll bar shows up. However, the thumb does not update as the height continues to change from the background thread. If I scroll the view again through the UI, the thumb immediately corrects itself. My code for updating the height from the background thread is: post(mLayoutRequestor); postInvalidate(); (mLayoutRequestor is a Runnable that just calls requestLayout().) This is done after I've recorded the new height in a variable mHeight. My onMeasure() method calls setMeasuredDimension with a height computed like this: private int measureHeight(int measureSpec) { int result; int specMode = MeasureSpec.getMode(measureSpec); int specSize = MeasureSpec.getSize(measureSpec); if (specMode == MeasureSpec.EXACTLY) { result = specSize; } else { result = mHeight; if (specMode == MeasureSpec.AT_MOST && result > specSize) result = specSize; } return result; } Am I supposed to be calling something else besides requestLayout() to get the scroll bar to update correctly?

    Read the article

  • What are the tradeoffs for using 'partial view models'?

    - by Kenny Evitt
    I've become aware of an itch due to some non-DRY code pertaining to view model classes in an (ASP.NET) MVC web application and I'm thinking of scratching my itch by organizing code in various 'partial view model' classes. By partial-view-model, I'm referring to a class like a view model class in an analogous way to how partial views are like views, i.e. a way to encapsulate common info and behavior. To strengthen the 'analogy', and to aid in visually organizing the code in my IDE, I was thinking of naming the partial-view-model classes with a _ prefix, e.g. _ParentItemViewModel. As a slightly more concrete example of why I'm thinking along these lines, imagine that I have a domain-model-entity class ParentItem and the user-friendly descriptive text that identifies these items to users is complex enough that I'd like to encapsulate that code in a method in a _ParentItemViewModel class, for which I can then include an object or a collection of objects of that class in all the view model classes for all the views that need to include a reference to a parent item, e.g. ChildItemViewModel can have a ParentItem property of the _ParentItemViewModel class type, so that in my ChildItemView view, I can use @Model.ParentItem.UserFriendlyDescription as desired, like breadcrumbs, links, etc. Edited 2014-02-06 09:56 -05 As a second example, imagine that I have entity classes SomeKindOfBatch, SomeKindOfBatchDetail, and SomeKindOfBatchDetailEvent, and a view model class and at least one view for each of those entities. Also, the example application covers a lot more than just some-kind-of-batches, so that it wouldn't really be useful or sensible to include info about a specific some-kind-of-batch in all of the project view model classes. But, like the above example, I have some code, say for generating a string for identifying a some-kind-of-batch in a user-friendly way, and I'd like to be able to use that in several views, say as breadcrumb text or text for a link. As a third example, I'll describe another pattern I'm currently using. I have a Contact entity class, but it's a fat class, with dozens of properties, and at least a dozen references to other fat classes. However, a lot of view model classes need properties for referencing a specific contact and most of those need other properties for collections of contacts, e.g. possible contacts to be referenced for some kind of relationship. Most of these view model classes only need a small fraction of all of the available contact info, basically just an ID and some kind of user-friendly description (i.e. a friendly name). It seems to be pretty useful to have a 'partial view model' class for contacts that all of these other view model classes can use. Maybe I'm just misunderstanding 'view model class' – I understand a view model class as always corresponding to a view. But maybe I'm assuming too much.

    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

  • I can't understand this issue java.lang.IndexOutOfBoundsException.

    - by praveenb
    I've strange issue, that My application is working fine on some devices, But its crashing one of the client device(on Galaxy Nexus 4.1.1 v) at app starting screen. I get this stack trace from ACRA report. java.lang.IndexOutOfBoundsException at android.graphics.Paint.getTextRunAdvances(Paint.java:1731) at android.graphics.Paint.getTextRunAdvances(Paint.java:1704) at android.text.MeasuredText.addStyleRun(MeasuredText.java:164) at android.text.MeasuredText.addStyleRun(MeasuredText.java:204) at android.text.StaticLayout.generate(StaticLayout.java:281) at android.text.DynamicLayout.reflow(DynamicLayout.java:284) at android.text.DynamicLayout.(DynamicLayout.java:170) at android.widget.TextView.makeSingleLayout(TextView.java:5843) at android.widget.TextView.makeNewLayout(TextView.java:5741) at android.widget.TextView.onMeasure(TextView.java:6098) at android.view.View.measure(View.java:15172) at android.widget.LinearLayout.measureVertical(LinearLayout.java:833) at android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at android.view.View.measure(View.java:15172) at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:617) at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:399) at android.view.View.measure(View.java:15172) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at android.view.View.measure(View.java:15172) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814) at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1390) at android.widget.LinearLayout.measureVertical(LinearLayout.java:681) at android.widget.LinearLayout.onMeasure(LinearLayout.java:574) at android.view.View.measure(View.java:15172) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4814) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310) at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2148) at android.view.View.measure(View.java:15172) at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1848) at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1100) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1273) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725) at android.view.Choreographer.doCallbacks(Choreographer.java:555) at android.view.Choreographer.doFrame(Choreographer.java:525) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStart.main(Native Method) Im seeing above stack trace. I'm unable to understand the issue. Please help me on tacking the issue. Thank you.

    Read the article

  • Weight doesn't work in a custom android component

    - by RCB
    I wanted to create a custom bottom button bar layout, I've created a xml file : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" style="@android:style/ButtonBar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:padding="0dp" > <Button android:id="@+id/media_menu_button" style="?android:attr/buttonStyleSmall" android:layout_width="0dp" android:layout_height="match_parent" android:layout_margin="0dp" android:layout_weight="1" android:text="@string/media_menu_button" /> <Button android:id="@+id/scenario_menu_button" style="?android:attr/buttonStyleSmall" android:layout_width="0dp" android:layout_height="match_parent" android:layout_margin="0dp" android:layout_weight="1" android:text="@string/scenario_menu_button" /> <Button android:id="@+id/rooms_menu_button" style="?android:attr/buttonStyleSmall" android:layout_width="0dp" android:layout_height="match_parent" android:layout_margin="0dp" android:layout_weight="1" android:text="@string/rooms_menu_button" /> <Button android:id="@+id/shortcut_menu_button" style="?android:attr/buttonStyleSmall" android:layout_width="0dp" android:layout_height="match_parent" android:layout_margin="0dp" android:layout_weight="1" android:text="@string/shortcut_menu_button" /> as you can see I've given all the buttons width 0dp and weight of 1. then, I've created a class that extends the linear layout class : public class BeLightBottomBar extends LinearLayout implements OnClickListener { private LayoutInflater mInflater; private Context contexnt; private Button mShortcutMenuButton; private Button mRoomsMenuButton; private Button mScenarioMenuButton; private Button mMediaMenuButton; public BeLightBottomBar(Context context, AttributeSet attrs) { super(context, attrs); //inflate the view this.contexnt = context; mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); LinearLayout barView = (LinearLayout) mInflater.inflate(R.layout.belight_bottombar, null); addView(barView); //get all the instances of the components of the bar mShortcutMenuButton = (Button) barView.findViewById(R.id.shortcut_menu_button); mRoomsMenuButton = (Button) barView.findViewById(R.id.rooms_menu_button); mScenarioMenuButton = (Button) barView.findViewById(R.id.scenario_menu_button); mMediaMenuButton = (Button) barView.findViewById(R.id.media_menu_button); //set this as a click listener mShortcutMenuButton.setOnClickListener(this); mRoomsMenuButton.setOnClickListener(this); mScenarioMenuButton.setOnClickListener(this); mMediaMenuButton.setOnClickListener(this); ... ... ... } the problem is when i add this class to the main activity xml <belight.homecontrol.components.BeLightBottomBar android:id="@+id/button_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_margin="0dp" android:padding="0dp" /> the weight stops working, all the buttons are different. and I don't know why !? if I just copy paste the bottom's bar xml code to the main xml file it works fine, the problem only occurs when using it as a whole. P.S. Is it a good practice to create a component this way? Or maybe I'm doing something wrong? Thanks, Dan

    Read the article

  • Connect ViewModel and View using Unity

    - by brainbox
    In this post i want to describe the approach of connecting View and ViewModel which I'm using in my last project.The main idea is to do it during resolve inside of unity container. It can be achived using InjectionFactory introduced in Unity 2.0 public static class MVVMUnityExtensions{    public static void RegisterView<TView, TViewModel>(this IUnityContainer container) where TView : FrameworkElement    {        container.RegisterView<TView, TView, TViewModel>();    }    public static void RegisterView<TViewFrom, TViewTo, TViewModel>(this IUnityContainer container)        where TViewTo : FrameworkElement, TViewFrom    {        container.RegisterType<TViewFrom>(new InjectionFactory(            c =>            {                var model = c.Resolve<TViewModel>();                var view = Activator.CreateInstance<TViewTo>();                view.DataContext = model;                return view;            }         ));    }}}And here is the sample how it could be used:var unityContainer = new UnityContainer();unityContainer.RegisterView<IFooView, FooView, FooViewModel>();IFooView view = unityContainer.Resolve<IFooView>(); // view with injected viewmodel in its datacontextPlease tell me your prefered way to connect viewmodel and view.

    Read the article

  • Drupal using views with CCK custom fields

    - by jackbot
    I've got a Drupal site which uses a custom field for a certain type of node (person_id) which corresponds to a particular user. I want to create a view so that when logged in, a user can see a list of nodes 'tagged' with their person_id. I've got the view working fine, with a url of my-library/username but replacing username with a different username shows a list of all nodes tagged with that user. What I want to do is stop users changing the URL and seeing other users' tagged nodes. How can I do this? Is there somewhere where I can dictate that the only valid argument for this page is the one that corresponds with the current logged in user's username?

    Read the article

  • iPhone: Proper use of View and View Controller

    - by Joel
    I've recently been doing a lot of Objective-C programming, and just got back into doing more iPhone development. I've done a lot of programming using MVC in other languages/frameworks, but I just want to make sure I'm using MVC properly in my iPhone Development. I created a new iPhone Utility Application, which creates two views: MainView and FlipsideView. Both have a controller (FlipsideViewController and MainViewController) and XIB file of their own. What I've been doing is putting the IBOutlet UIControl myControl variables in my MainView.h or FlipsideView.h files and then tying the controls in Interface Builder to those variables. Then I put any IBAction SomeAction myAction methods in the MainViewController.h and FlipsideViewController.h files and tying the events to those methods in Interface Builder. This seems to be conceptually correct, but seems to cause problems. Say I have a button that when clicked it changes a label's text. So the Controller doesn't have a clue of what the variable name of the label is in the OnTouchUp event handler for my button. So I make a @property for it. But since the MainViewController.view property isn't of type MyView, I get warnings or errors whenever I try to access those properties from the view controller. I am doing this correctly? Is there a better way to do this? If this is correct, how do I properly work with those variables without getting warnings or errors? Thanks

    Read the article

  • Update the model on HttpPost and render the changes in the View

    - by Etienne Giust
    With MVC3, I came over that problem where I was rendering a view with an updated model at the end of an HttpPost and the changes to the model were never applied to the rendered view :   NOT working as expected ! [HttpPost]         public ActionResult Edit(JobModel editedJobModel)         {             // Update some model property             editedJobModel.IsActive = true;                          // The view will NOT be updated as expected             return View(editedJobModel);         }   This is the standard behavior. In MVC3, POSTing the model does not render the Html helpers again. In my example, a HiddenFor bound to the IsActive value will not have its value set to true after the view is rendered.   Are you stuck, then ?   Well, for one, you’re not supposed to do that: in an ideal world you are supposed to apply the Post/Redirect/Get pattern. You would redirect to a new GET after your POST performed its actions. That’s what I usually do, but sometimes, when maintaining code and implementing slight changes to a pre-existing and tested logic, one prefers to keep structural changes to a minimum.   If you really have to (but my advice is to try to implement the PRG pattern whenever possible), here is a solution to alter values of the model on a POST and have the MVC engine render it correctly :   Solution [HttpPost] public ActionResult Edit(JobModel editedJobModel) {     // NOT WORKING : Update some model property     //editedJobModel.IsActive = true;     //Force ModelState value for IsActive property     ModelState["IsActive"].Value = new ValueProviderResult(true, "True", null);          // The view will be updated as expected     return View(editedJobModel); }   As you can see, it is a “dirty” solution, as the name (as a  string) of the updated property is used as a key of the ModelState dictionary. Also, the use of ValueProviderResult is not that straightforward.   But hey, it works.

    Read the article

  • SQLAuthority News – Download Whitepaper – Power View Infrastructure Configuration and Installation: Step-by-Step and Scripts

    - by pinaldave
    Power View, a feature of SQL Server 2012 Reporting Services Add-in for Microsoft SharePoint Server 2010 Enterprise Edition, is an interactive data exploration, visualization, and presentation experience. It provides intuitive ad-hoc reporting for business users such as data analysts, business decision makers, and information workers. Microsoft has recently released very interesting whitepaper which covers a sample scenario that validates the connectivity of the Power View reports to both PowerPivot workbooks and tabular models. This white paper talks about following important concepts about Power View: Understanding the hardware and software requirements and their download locations Installing and configuring the required infrastructure when Power View and its data models are on the same computer and on different computer Installing and configuring a computer used for client access to Power View reports, models, Sharepoint 2012 and Power View in a workgroup Configuring single sign-on access for double-hop scenarios with and without Kerberos You can download the whitepaper from here. This whitepaper talks about many interesting scenarios. It would be really interesting to know if you are using Power View in your production environment. If yes, would you please share your experience over here. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Business Intelligence, Data Warehousing, PostADay, SQL, SQL Authority, SQL Download, SQL Query, SQL Server, SQL Tips and Tricks, SQL White Papers, T SQL, Technology

    Read the article

  • ASP.NET MVC Custom Error Pages with Magical Unicorn

    - by FLClover
    my question is regarding Pure.Kromes answer to this post. I tried implementing my pages' custom error messages using his method, yet there are some problems I can't quite explain. a) When I provoke a 404 Error by entering in invalid URL such as localhost:3001/NonexistantPage, it defaults to the ServerError() Action of my error controller even though it should go to NotFound(). Here is my ErrorController: public class ErrorController : Controller { public ActionResult NotFound() { Response.TrySkipIisCustomErrors = true; Response.StatusCode = (int)HttpStatusCode.NotFound; var viewModel = new ErrorViewModel() { ServerException = Server.GetLastError(), HTTPStatusCode = Response.StatusCode }; return View(viewModel); } public ActionResult ServerError() { Response.TrySkipIisCustomErrors = true; Response.StatusCode = (int)HttpStatusCode.InternalServerError; var viewModel = new ErrorViewModel() { ServerException = Server.GetLastError(), HTTPStatusCode = Response.StatusCode }; return View(viewModel); } } My error routes in Global.asax.cs: routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" }); routes.MapRoute( name: "Error - 404", url: "NotFound", defaults: new { controller = "Error", action = "NotFound" } ); routes.MapRoute( name: "Error - 500", url: "ServerError", defaults: new { controller = "Error", action = "ServerError" } ); And my web.config settings: <system.web> <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="/ServerError"> <error statusCode="404" redirect="/NotFound" /> </customErrors> ... </system.web> <system.webServer> <httpErrors errorMode="Custom" existingResponse="Replace"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" path="/NotFound" responseMode="ExecuteURL" /> <remove statusCode="500" subStatusCode="-1" /> <error statusCode="500" path="/ServerError" responseMode="ExecuteURL" /> </httpErrors> ... The Error views are located in /Views/Error/ as NotFound.cshtml and ServerError.cshtml. b) One funny thing is, When a server error occurs, it does in fact display the Server Error view I defined, however it also outputs a default error message as well saying that the Error page could not be found. Here's how it looks like: Do you have any advice how I could fix these two problems? I really like Pure.Kromes approach to implementing these error messages, but if there are better ways of achieving this don't hestitate to tell me. Thanks! *EDIT : * I can directly navigate to my views through the ErrorController by accessing /Error/NotFound or Error/ServerError. The views themselves only contain some text, no markup or anything. As I said, it actually works in some way, just not the way I intended it to work. There seems to be an issue with the redirect in the web.config, but I haven't been able to figure it out.

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >