Hi i am using RAD Scheduler. The Problem is when i bind RAD Scheduler in Resource Grouping mode its not showing Appointments. If i remove resource grouping the scheduler is working fine.
I have two tables one for Projects (Appointments ) and other for Techs ( Resources.). Both table have FK relationship. I tried all possible way of binding ( In Memory DataTable with Custom fields required by Scheduler) and finally i m using Sql Data Sources for Projects ( Appointments) and Techs (Resources.) The FK relationship is defined.
And here is Resource defination
<ResourceTypes>
<telerik:ResourceType DataSourceID="sdsResources" ForeignKeyField="Assignedto"
KeyField="uID" Name="Tech" TextField="UserName" />
</ResourceTypes>
here are two DataSources.
"
SelectCommand="Select * From Techs" >
</asp:SqlDataSource>
<asp:SqlDataSource ID="sdsProjects" runat="server"
ConnectionString="<%$ ConnectionStrings:Mycon %>"
SelectCommand="sched_GetSchedule" SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:Parameter Name="schedDate" Type="DateTime" />
</SelectParameters>
</asp:SqlDataSource>
Any help will be greatly appreciated.
Thanks
Without seeing your scheduler markup there isn't a lot to go by, but I'll take a shot.
In your markup, you will need explicitely tell the scheduler how you want to show the grouping.
Between your <telerik:RadScheduler> and </telerik:RadScheduler> tags, include the following line:
<TimelineView UserSelectable="true" GroupBy="Tech" GroupingDirection="Vertical" />
You need to set the GroupBy property of your TimelineView tag equal to the Name property of the resource that you wish to group by. In your example, the value is "Tech".
That will allow your grid to visually display the relationship.
Related
I have odata coming from backend. I have two select controls on my SAPUI5 page. The first select displays a list of items received from the backend. The second select changes depending on what is selected from the first select control.
Right now I am constructing in the controller a new path for "planets" select. Is it possible to change the "planets" items path depending on the "stars" selected item just in the XML? Without using Javascript?
I would like to do something like this:
<Select id="stars"
items="{
path: '/Stars'
}">
<core:Item key="{StarID}" text="{StarName}" />
</Select>
<Select id="planets"
items="{
path: '("/Stars('" + StarID + "')/toPlanets"'
}">
<core:Item text="{PlanetName}" />
</Select>
Unfortunately, I do not believe that there is any existing functionality to do something like this naively in UI5. The only thing that is similar is binding replacement during XML preprocessing, but you cannot use that for your situation.
I have met this situation a lot of times in the past and have created a helper control for dealing with this (might not be the perfect solution, but it works). It only makes sense to use a similar approach if you have this kind of construct in multiple places (so you avoid having the same boilerplate code in your JS controllers).
You can find here an example implementation of such a control and here an example usage. Basically this allows you to have a reusable mechanism for doing such an "indirect binding" without resorting to event listeners.
I have created a simple UI5 application which consists of a Table.
The problem is that this table shows data only when I run the application on ABAP Server on other servers, ie. Tomcat or Web App Preview in eclipse it doesn't work. I also tried this application with other open oData services but the table shows no result.
Secondly the table show the data and after it continue to scroll down the data and there comes empty fields from above and data disappears to the down.
Does anyone have any ideas?
Most likely you will be helped with disabeling the same origin policy in google chrome. See:
Disable same origin policy in Chrome.
For a more extensive answer see:
http://scn.sap.com/community/developer-center/front-end/blog/2013/06/29/solving-same-origin-policy-issue-in-different-ways
That usually happened to me when I didn't map the correct field to the "Items" of the table.
You must check both the capitalization and the path of the item in your model.
Here is a short example :
<Table id="idMaterialsList2"
items="{SalesOrder>/Items/results}">
<columns>
<Column>
<Text text="{i18n>Order_product}" />
</Column>
</columns>
<items>
<ColumnListItem type="Navigation">
<ObjectIdentifier
title="{SalesOrder>Product}"
text="{SalesOrder>Description}"/>
</ColumnListItem>
</items>
</Table>
a) Check "items="{SalesOrder>/Items/results}"" the path
b) Check the names of the elements you want to show ""{SalesOrder>Product}""
If a is correct and b is wrong you will have an empty table with X lines where X = SalesOrder>/Items/results.length.
If a is wrong you will see nothing.
Try :)
I have page where I render some h:panelGroup panels. Those panels are realized as plugins registered in a plugin registry on startup.
Part of the plugins api is a custom jsf component where I get the registered plugins for extension point and include their facelet templates by path:
<c:forEach items="#{pluginRegistry.getPlugins(point)}" var="extension">
<ui:include src="#{extension.path}" />
</c:forEach>
The page where I include the panels looks like:
<h:panelGrid id="dashboard" columns="3">
<cmf:insertPageFragments point="dashboardExtensionPoint" />
</h:panelGrid>
For every panel there are facelet templates like the one below:
<rich:panel id="caseDetailsPanel" header="panel label">
<!-- panel content -->
</rich:panel>
Now, the problem is that the very first panel in the list returned by the pluginsRegistry is rendered in the page with the provided id like formId:caseDetailsPanel for example. The rest of them have generated ids like formId:j_idt223 !!! Obviously if I want to rerender some of the panels, I can't do that.
That happens when environment is jboss AS 7.1 with JSF 2.1, richfaces 4.2.3.Final.
When deployed on jboss-eap-6.1 everything looks fine but for now I can't use this jboss version.
Any suggestions on how to workaround this issue?
There can not be multiple JSF components with the same ID. Each JSF component must have an unique ID. When dynamically creating JSF components using JSTL, you need to manually assign and ensure an unique ID, otherwise JSF will discard the provided ID and autogenerate an unique ID.
There are several ways to achieve this, depending on the concrete functional requirement and the existing code.
Use use the iteration index of <c:forEach>.
<c:forEach ... varStatus="loop">
...
<rich:panel id="caseDetailsPanel_#{loop.index}" ...>
This will generate caseDetailsPanel_0, caseDetailsPanel_1, etc depending on the current iteration index.
Use the unique identifier of the currently iterated item. It isn't clear based on the information provided so far if you have any, so here's just a fictive example assuming that the class behind #{extension} has an id property representing the technical DB identifier.
<c:forEach ... var="extension">
...
<rich:panel id="caseDetailsPanel_#{extension.id}" ...>
Wrap #1 or #2 if necessary in a <f:subview> with an unique identifier, so that you don't need to modify the includes.
<c:forEach ... varStatus="loop">
<f:subview id="panel_#{loop.index}">
<ui:include ... />
The <f:subview> creates a new NamingContainer around it, so you end up getting formId:panel_0:caseDetailsPanel, formId:panel_1:caseDetailsPanel and so on.
A completely different alternative would be to use <ui:repeat> instead of <c:forEach>. The <ui:repeat> does not run during view build time, but during view render time. This way there's physically only one <rich:panel id="caseDetailsPanel"> component in the component tree which is reused multiple times during generating HTML whereby JSF will take care of generating the right IDs with the <ui:repeat> index like so formId:repeatId:0:caseDetailsPanel. However, this in turn may cause trouble with <ui:include> as it also runs during view build time and thus can't get the #{extension} at hands.
I have three models in my app: Athletes, Races, and Results. An Athlete has many results, a Race has many results, and a Result belongs to an Athlete and a Race. Each race has exactly 12 results.
As a beginning Rails developer, I'm having trouble understanding how to create the web form for entering the 12 race results. Should I maintain Results as a separate resource, or nest them under Races? In my controller, would I create 12 instances of a result object under the New action? How do I submit the appropriate race_id for each instance?
If you could help me clarify my thinking on this problem, and point me in the right direction, it would be greatly appreciated!
You don't need to nest your results if they have unique and auto-generated IDs, but you can if you think it makes you application easier to use or program.
Your web form should probably be based on the use case of entering 12 athletes as they ranked for a single race. That means you could use multiple HTML inputs for each of the results:
<input type="hidden" name="race[results_attributes][][rank]" value="1" />
<input type="text" name="race[results_attributes][][athlete_id]" />
<input type="hidden" name="race[results_attributes][][rank]" value="2" />
<input type="text" name="race[results_attributes][][athlete_id]" />
You could then modify your race model to accept inputs for results:
class Race
has_many :results
accepts_nested_attributes_for :results
end
And simply pass the attributes in an update statement:
Race.find(params[:id]).update_attributes params[:race]
I'm sure there are several ways to approach this. You certainly could nest Results under Races, but then it becomes a question of whether you're creating the Results at the same time as their Race or not (this is worth thinking about because you need to know how to tie your Results to your Race, e.g. does each Result form have a race_id as a hidden field? If so the Race probably needs to already exist). But in either case this would probably be 12 Result forms with Result.new as the object.
Background
I have this form that uses javascript exclusively to search through ~5k entries (suppliers) and populate a select dropdown from them (factories, ~10k entries). Right now, it's a javascript-required form. I'd like to make it so that javascript errors no longer render the form unusable, but the number of entries and the sequential nature of the entries leave me without a idiomatic way to provide just a basic html version.
The Issues
Sequential/hierarchical dropdowns
An example dropdown where sequence is important:
http://www.javascriptkit.com/javatutors/selectcontent2.shtml
So that shows "filtering" of sequential/hierarchical dropdown content, where the selections in the second City dropdown get filtered based on the selections in the first Country dropdown. But take away the javascript, and it could instantly become a mess. Madrid in the USA? Berlin in France? The sequence becomes corrupted.
Dropdowns that have huge numbers of options
If you have a select dropdown with 10k possible options, it's pretty easy to filter/search through them with javascript. Dealing with those options without javacript, on the other hand, is much more difficult.
How do you provide your users with all of the possibilities when just loading all the options them all would blow up their browser?
Possible Solutions
Sequential/Hierarchical Select boxes:
Server-side 2-part forms.
?Select option groups?
???
Selects with huge numbers of options:
Server-side 2-part search forms.
Server-side text search matching of entry names.
???
Simple links to resourceful solutions welcome.
The only solution that I can think of is to use a form submit each time you need to narrow down your results. You start off by showing a page to select a supplier's country. That submits, and returns a page that shows the selected country as text and now has a drop-down to select the next field, like cities. That way, the server can do the filtering at each level.
Here's a JSP example:
<c:choose>
<c:when test="${empty country}">
Country:
<form>
<select>
<option value="USA">America</option>
<option value="DEU">Germany</option>
<%-- ... --%>
</select>
</form>
</c:when>
<c:otherwise>
Country: ${country}
<c:choose>
<c:when test="${empty city}">
<input type="submit" value="Change" /> <%-- Button to change the previous value --%>
<%-- your form for choosing a supplier's city --%>
</c:when>
<c:otherwise>
<%-- continue filtering until you have all of the data --%>
</c:otherwise>
</c:choose>
</c:otherwise>
<c:choose>
When you select a country, the form submits. Your server processes the country, returns the same page with the country field value and a list of possible cities for your next drop-down. Doing it like this allows you to rely only on form submits (rather than JavaScript) to filter data sequentially. Your server would be responsible for keeping track of how far along the user is. The obvious downfall of this solution is that your JSP would be pretty messy, with all of the nested <c:choose> blocks.
You might also try a hybrid solution: when the page loads, find out if your JavaScript has loaded. If so, replace your submission forms with plain HTML that has AJAX behind it to populate the next set of options. That way, your page doesn't have to refresh a bunch of times when the JavaScript does load, but will still be functional if the JavaScript doesn't load. Just a thought.