Questions tagged [presenter]

In MVP pattern the presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.

143 questions
1
vote
1 answer

GWTP. How to get access from one presenter to another- they are not connected by slots mechanism

I have one presenter for login screen purpose. And I have AppPresenter for the whole application. Each view (except login) is displayed inside AppView slots. In AppView I have logout button, which should be visible only when user is logged in, so…
masterdany88
  • 5,041
  • 11
  • 58
  • 132
1
vote
2 answers

Laravel Asgard CMS Menu with Custom Classes

I'm using Asgard CMS in one of my prjects. I'm trying to print a menu with custom classes. By defaut, {{ Menu::get('main') }} prints out the main menu with Bootstrap classes. But, I want to use different classes because of my theme. In their…
yenerunver
  • 416
  • 1
  • 5
  • 26
1
vote
1 answer

rails method from multiple methods

So I have this code in my Rails presenter(similar to Draper gem): def title h.link_to 'Favor', favor_path(@favor) + asked_or_published? + user_link end def asked_or_published? if asked_favor? h.content_tag(:p, "published by") …
fardin
  • 1,399
  • 4
  • 16
  • 27
1
vote
0 answers

Yielding blocks in Rails ActionView

I am trying to build my Rails app following the Presenter design pattern. A part of my page includes a few divs nested inside an anchor tag, which works fine using regular html, but does not work when I try to render it using ActionView helpers. My…
azrosen92
  • 8,357
  • 4
  • 26
  • 45
1
vote
1 answer

Is my implementation pattern for MVP valid?

I'm new to Android and MVP in-general, and I've been doing iOS programming for the last 1.5 years, so I find delegate patterns easy to digest. I've implemented MVP in such a way that the view conforms to a presenter's protocol, which lets the…
Carter Hudson
  • 1,176
  • 1
  • 11
  • 23
1
vote
2 answers

Protocol being called in two different classes at same time

I am a little new to iOS development, coming from a Java / Android background. My understanding is that your custom Protocols or Delegates are like Interfaces in Java land. If that is the case then I believe these Protocols are also Objects as…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
1
vote
1 answer

Combining Presenters and #includes in Rails query

Suppose I have the following setup in my Rails4 app: A Student has_many degrees, a Degree belongs_to a Student. I have a StudentPresenter and a DegreePresenter corresponding to both models as well. (Presenters as defined here) I want to query the…
XML Slayer
  • 1,530
  • 14
  • 31
1
vote
0 answers

Uninitialized constant error in my controller after adding a presenter

I added this to my controller: class HtmlreportController < ApplicationController def index @report = Report.new @report_presenter = ReportPresenter.new(@report_presenter) end end Then added this presenter to…
1
vote
2 answers

Rails rendering a collection of partials from a presenter method

i am busy watching the Rail cast on presenters and would like to refactor one of my presenters to include the page template. The screencast i was watching is 287-presenters-from-scratch I have initialized a presenter the way he suggested, and…
legendary_rob
  • 12,792
  • 11
  • 56
  • 102
1
vote
1 answer

How do i require a helper file in presenter - rails

I have a rails application. I need to use a helper within a presenter class. I used require 'number_helper' and used a method 'test' from 'number_helper'. It is giving me an error that 'undefined method 'test''. How do I require a helper file in a…
rajkumarts
  • 399
  • 1
  • 7
  • 20
1
vote
0 answers

GWTP Strange Error Messages (That are inaccurate)

So I really need some helpful hints with an issue I am having with my GWTP application, perhaps one of you have ran into this problem before. So I am using GWTP 1.1 with: com.gwtplatform.mvp.Mvp (Not w/ entry…
Ben Dol
  • 427
  • 6
  • 18
1
vote
2 answers

How to present list of names in Presenter?

I have my custom presenter class ShiftPresenter def initialize(shift, template) @shift = shift @template = template end def h @template end def users_list logs = ShiftLog.by_shift(@shift) names = logs.map do |log| …
tomekfranek
  • 6,852
  • 8
  • 45
  • 80
1
vote
4 answers

GWT: MVP Presenter Interface

I try to understand how the gwt example about activities and places works (https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces). I am wondering why they define an interface for the presenter. I know the view interface…
Maxii
  • 695
  • 2
  • 13
  • 26
0
votes
2 answers

How to set a Presenter in a composite widget in GWT

I have a GWT 2.4 app using MVP, clientFactory, activities, places, and uiBinder. I have a composite widget that I created as a standalone object with it's own ui.xml file. I reference that class and insert it into the main viewImpl.ui.xml file. …
James Drinkard
  • 15,342
  • 16
  • 114
  • 137
0
votes
1 answer

GWT with MVP: How to communicate between 2 views?

i use the MVP-Pattern in GWT. I have developed a GWT-TabPanel. Each Tab has his own Presenter and his own view. But now i want to use some Datas from ViewX in ViewY. Is there a simple way to realize it? Greetz
501 - not implemented
  • 2,638
  • 4
  • 39
  • 74