Tryton: How can I Make One2Many field view using more space in view - tryton

I have my form view defined as follow in the tryton client
<form>
<group id="form">
<label name="capo_famiglia" />
<field name="capo_famiglia"/>
<label name="tipo_famiglia" />
<field name="tipo_famiglia"/>
<label name="data_inizio" />
<field name="data_inizio" widget="date"/>
<label name="data_fine" />
<field name="data_fine" widget="date"/>
<field name="componenti"
colspan="4"
view_ids="registry.family_date_view_tree,registry.family_date_view_form"/>
</group>
</form>
the field componenti is a One2Many fields.
the widget show me only 2 records in the form view, even if I put 3 or 4 records.
I try to make as done in sale_order,using notebook, and yexpand but without any result.
This is the view:
Click To View the image
any help is really appreciated

I guess your are using the web client. Because with the desktop client One2Many widget fill all the available vertical space. This behavior could not be mimicked on the web so the best solution found for now is a default min-height=100px and max-height=300px. Normally it is should be enough to show 8 rows.

Related

Accessibility with input DateTime type

I am attempting to check the accessibility of my web app. To do so, I added the ChromeVox extension to Chrome and turned it on. I see that ChromeVox can read out most of input controls when the user focuses on them. But, with these two <DateTimeInput> controls, ChromeVox only reads the place holder values, not the <label> for each. It's strange to me.
The following is the code for the <DateTimeInput> control portion of my web app:
<f:SimpleForm maxContainerCols="3" editable="true" labelSpanL="2" labelSpanM="2" layout="ResponsiveGridLayout">
<f:content>
<Label text="Start time" required="true" labelFor="startTimeFilter"></Label>
<DateTimeInput id="startTimeFilter" type="DateTime" />
<Label text="End Time" required="true" labelFor="endTimeFilter"></Label>
<DateTimeInput id="endTimeFilter" type="DateTime" />
</f:content>
</f:SimpleForm>
The UI looks like:
How can I change my code to make it such that ChromeVox, and other screen readers, read the <label> for each input when the input is focused?

Remove default value for a custom property in Advanced search

I'm using Alfresco Share and I have a property with a default value
<property name="my:Property1">
<title>Property1</title>
<type>d:text</type>
<multiple>true</multiple>
<default>0</default>
</property>
I have customised the advanced search
<form id="search">
<field-visibility>
<show id="my:Property1"/>
</field-visibility>
<appearance>
<field id="my:Property1" label-id="Property1">
</appearance>
</form>
In Advanced search this property is initially filled with a default value, in my case with 0. Is there any way to remove that value from a search field?
I guess in this case it's best to create a custom Share Form controller like the textfield.ftl.
In the default controller there is a freemarker entry {field.value}. Just remove this entry throughout the template and there won't be any default value shown.

spring webflow submit form on link

I have following problem.
I want to save the details entered by the user in the database using SpringWebflow. The requirement is that the user has to click Save as Draft link instead of a submit button.
I want to capture the details entered/selected by the user and send it as an object( i don't want to set request parameters because there are more than 20 fields throughout the flow).
Below is my code snippet. P.S, there are no errors. I can see the logs in the service being written.
step1.jsp
<form:form commandName="userEnteredCriteria" action="${flowExecutionUrl}" method="post">
<div class="submit-buttons submit-style">
<input type="submit" name="_eventId_next" value="next" class="submit-button product-submit"/>
</div>
<p class="return product-submit1">Save as Draft</p>
</form:form>
weblflow.xml
<view-state id="Step1">
<transition on="saveDraftStep1">
<evaluate expression="myAction.bindAndValidate" />
<evaluate expression="myFlowService.saveDraft(userEnteredCriteria externalContext.nativeRequest)" />
</transition>
</view-state>
Can someone please help me with how to submit the form on link click? I know i have to right some javascript( please correct me if i am wrong) but i don't know how to do it in javascirpt. we are using JQUERY for javascript. any sample code will hlp
Thanks a lot.
<input type="submit" id="saveDraftStep1" name="_eventId_saveDraftStep1" value="saveDraftStep1" style="display:none;"/>
<a href onclick="document.getElementById('saveDraftStep1').click();">Click here to save draft</a>

Logging in to my site opens a new tab?

I've been working on my personal website as of late, and even thought it's not a big problem because I'm the only one that sees it, it's annoying nonetheless.
Whenever I go to my login page, it all works fine. If I enter a bad username/password, it will just print a simple text message error(intended). But, if I login correctly, then instead of redirecting to the root of my website as I intend, it will instead create a new tab in firefox and from there it will be in / (which is correct). The problem is why does it create a new tab? I didn't even think forms were capable of such a thing:
My full login page is at http://lastyearswishes.com/login The gist of it is:
<form method="post" target="/login">
Username: <input type="text" name="username" /> <br />
Password: <input type="password" name="password" /> <br />
<input type="submit" name="Submit" />
</form>
And my server side code is also very simple:
if(RouteID=="login"){
if(AuthenticationModule.Login(Form["username"],Form["password"],false)){
//logged in correctly
Response.Redirect("/"); //just go to the root of my site
}else{
Write("You fail at life");
}
}
«target="/login"» means "open in window named «/login»". If it doesn't exist, a new one is opened. I think you meant to use
<form method="post" action="/login">
HTML Form Element

Asp.net + Google Charts - Attached html file won't open correctly

I have an Asp.Net page containing one grid and an image. The image is a google charts chart and its urls is around 1600 characters. I out together an .htm file containing the grid and the image. For the grid I use RenderControl to get its html code, and for the image, I just add an img html tag and assing the url to its src. I then send this .htm file as an email attachment.
My problem is that when you try to open the attached file, you see everything ok except the image (it doesn't show anything and when you look at the source code for the page, the img tag doesn't show any src whatsoever - it just shows < img > (without the spaces). If you open the file after you save it to disk, then it all works fine and you see the actual img src. Why???
Here's my html header:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>
And here's the image:
<img src="http://chart.apis.google.com/chart?chd=t:0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,420.95,0.00,2725.25,0.00,0.00,0.00,0.00,5036.96,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,47.82|0.0000,7.97,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,4.98,1.99,2.24,0.00,0.00,0.00,0.00,0.00,0.00,0.00,1.99,1.99|0.5100,34.04,0.00,0.00,0.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,36.77,18.01,18.26,0.00,0.00,0.00,0.00,0.00,8.99,0.00,20.06,14.01|0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,4.00|3.0000,0.00,0.00,0.00,0.00,0.00,0.00,0.00,46.98,0.00,257.91,113.25,0.00,0.00,0.00,1.00,24.99,29.99,0.00,0.00,0.00,0.00,0.00,0.00,0.00,60.00,123.92|0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,45.00,0.00,0.00,0.00,0.00,0.00,0.00,20.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,84.00|0,55.99,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,65.99&chdl=Type 1|Type 2|Type 3|Type 4|Type 5|Type 6|Type 7&chco=000000,CD7F32,A62A2A,0000FF,00FF00,FF6EC7,A8A8A8&chds=0,5037&chxl=0:|6/22|6/23|6/24|6/25|6/26|6/27|6/28|6/29|6/30|7/1|7/2|7/3|7/4|7/5|7/6|7/7|7/8|7/9|7/10|7/11|7/12|7/13|7/14|7/15|7/16|7/17|7/18|1:|0|503|1006|1509|2012|2515|3018|3521|4024|4527|5037|2:|Days|3:|Amount ($)&chls=3,1,0|3,1,0|3,1,0|3,1,0|3,1,0|3,1,0|3,1,0&chm=o,990066,0,-1,6.0|o,990066,1,-1,6.0|o,990066,2,-1,6.0|o,990066,3,-1,6.0|o,990066,4,-1,6.0|o,990066,5,-1,6.0|o,990066,6,-1,6.0&chg=3.85,0&cht=lc&chs=900x300&chxt=x,y,r,t"/>
If the problem is the size of the URL, what are my choices, short of building a pdf file and attaching it? It seems that an html file is all I need and I would like to keep it simple.
You could definitely be seeing a long URL problem. That happened to me when I was using Google Charts API (albeit in Rails rather than ASP.NET). I never could find the exact URL size that started to cause trouble, but some people reported troubles starting at 1024.
Google provides a couple of different encoding types you can use on the input data to shrink it, but using anything other than text encoding (what you are doing) will disable your ability to scale the data, if you care about that.
If you cannot scale the data, you may get some ugly graphs if the data stays at the maximum for long stretches or if you want to overlay two graphs with different scales.
See data formats from Google Chart API Docs
If the GET is too long you could use a POST instead you'll have a 16k limit which is more than enough. I've used the code below to generate your chart and it worked. So yes I guess you could use the post and attach that to the email. Perhaps the problem with using GET is an issue with the email client configured to not opening image files, have you tested it in other clients?
<form action='http://chart.apis.google.com/chart' method='POST' id='post_form'>
<input type="hidden" name="cht" value="lc" />
<input type="hidden" name="chtt" value="Demo chart" />
<input type="hidden" name="chg" value="3.85,0" />
<input type='hidden' name='chs' value='900x300' />
<input type="hidden" name="chxt" value="x,y,r,t" />
<input type="hidden" name="chds" value="0,5037" />
<input type="hidden" name="chxl" value="0:|6/22|6/23|6/24|6/25|6/26|6/27|6/28|6/29|6/30|7/1|7/2|7/3|7/4|7/5|7/6|7/7|7/8|7/9|7/10|7/11|7/12|7/13|7/14|7/15|7/16|7/17|7/18|1:|0|503|1006|1509|2012|2515|3018|3521|4024|4527|5037|2:|Days|3:|Amount ($)" />
<input type="hidden" name="chls" value="3,1,0|3,1,0|3,1,0|3,1,0|3,1,0|3,1,0|3,1,0" />
<input type="hidden" name="chm" value="o,990066,0,-1,6.0|o,990066,1,-1,6.0|o,990066,2,-1,6.0|o,990066,3,-1,6.0|o,990066,4,-1,6.0|o,990066,5,-1,6.0|o,990066,6,-1,6.0" />
<input type="hidden" name="chco" value="000000,CD7F32,A62A2A,0000FF,00FF00,FF6EC7,A8A8A8" />
<input type="hidden" name="chdl" value="Type 1|Type 2|Type 3|Type 4|Type 5|Type 6|Type 7" />
<input type='hidden' name='chd' value='t:0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,420.95,0.00,2725.25,0.00,0.00,0.00,0.00,5036.96,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,47.82|0.0000,7.97,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,4.98,1.99,2.24,0.00,0.00,0.00,0.00,0.00,0.00,0.00,1.99,1.99|0.5100,34.04,0.00,0.00,0.00,0.00,0.00,0.00,1.00,0.00,0.00,0.00,0.00,0.00,0.00,36.77,18.01,18.26,0.00,0.00,0.00,0.00,0.00,8.99,0.00,20.06,14.01|0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,2.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,4.00|3.0000,0.00,0.00,0.00,0.00,0.00,0.00,0.00,46.98,0.00,257.91,113.25,0.00,0.00,0.00,1.00,24.99,29.99,0.00,0.00,0.00,0.00,0.00,0.00,0.00,60.00,123.92|0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,45.00,0.00,0.00,0.00,0.00,0.00,0.00,20.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,84.00|0,55.99,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,65.99'/>
<input type="submit" />

Resources